Skip to content

zig 0.12.0 ignores DESTDIR (cmake) on NetBSD (fails to install in chrooted builds) #19756

Description

@nikkicoon

Zig Version

0.12.0

Steps to Reproduce and Observed Behavior

Building zig 0.12.0 on NetBSD 10.99.10 (GENERIC) amd64 inside a pbulk build chroot ignore DESTDIR. (build receipe on pkgsrc: http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/lang/zig/Makefile?rev=1.32&content-type=text/x-cvsweb-markup)

snippet from the build logs:

=> Bootstrap dependency digest>=20211023: found digest-20220214
===> Skipping vulnerability checks.
WARNING: No /usr/pkg/pkgdb/pkg-vulnerabilities file found.
WARNING: To fix run: `/usr/sbin/pkg_admin -K /usr/pkg/pkgdb fetch-pkg-vulnerabilities'.
===> Building for zig-0.12.0
[  5%] Building C object CMakeFiles/zig-wasm2c.dir/stage1/wasm2c.c.o
[ 10%] Building CXX object CMakeFiles/zigcpp.dir/src/zig_llvm-ar.cpp.o
[ 15%] Building CXX object CMakeFiles/zigcpp.dir/src/zig_llvm.cpp.o
[ 21%] Building CXX object CMakeFiles/zigcpp.dir/src/zig_clang.cpp.o
[ 26%] Linking C executable zig-wasm2c
[ 26%] Built target zig-wasm2c
[ 31%] Building CXX object CMakeFiles/zigcpp.dir/src/zig_clang_driver.cpp.o
[ 36%] Converting /tmp/work/zig-0.12.0/stage1/zig1.wasm to /tmp/work/zig-0.12.0/cmake-pkgsrc-build/zig1.c
[ 42%] Building C object CMakeFiles/zig1.dir/stage1/wasi.c.o
[ 47%] Building C object CMakeFiles/zig1.dir/zig1.c.o
[ 52%] Building CXX object CMakeFiles/zigcpp.dir/src/zig_clang_cc1_main.cpp.o
[ 57%] Building CXX object CMakeFiles/zigcpp.dir/src/zig_clang_cc1as_main.cpp.o
[ 63%] Linking CXX static library zigcpp/libzigcpp.a
[ 63%] Built target zigcpp
[ 68%] Linking C executable zig1
[ 68%] Built target zig1
[ 78%] Running zig1.wasm to produce /tmp/work/zig-0.12.0/cmake-pkgsrc-build/compiler_rt.c
[ 78%] Running zig1.wasm to produce /tmp/work/zig-0.12.0/cmake-pkgsrc-build/zig2.c
[ 89%] Building C object CMakeFiles/zig2.dir/compiler_rt.c.o
[ 89%] Building C object CMakeFiles/zig2.dir/zig2.c.o
[ 94%] Linking CXX executable zig2
[ 94%] Built target zig2
[100%] Building stage3
[100%] Built target stage3
=> Bootstrap dependency digest>=20211023: found digest-20220214
=> Checksum BLAKE2s OK for zig-0.12.0.tar.xz
=> Checksum SHA512 OK for zig-0.12.0.tar.xz
=> Bootstrap dependency digest>=20211023: found digest-20220214
=> Checksum BLAKE2s OK for zig-0.12.0.tar.xz
=> Checksum SHA512 OK for zig-0.12.0.tar.xz
===> Installing dependencies for zig-0.12.0
==========================================================================
The following variables will affect the build process of this package,
zig-0.12.0.  Their current value is shown below:

        * TERMINFO_DEFAULT = terminfo

Based on these variables, the following variables have been set:

        * TERMINFO_TYPE = terminfo

You may want to abort the process now with CTRL-C and change the value
of variables in the first group before continuing.  Be sure to run
`/usr/bin/make clean' after the changes.
==========================================================================
=> Tool dependency cmake>=0: found cmake-3.29.2
=> Tool dependency mktools-[0-9]*: found mktools-20220614
=> Tool dependency cwrappers>=20150314: found cwrappers-20220403
=> Tool dependency checkperms>=1.1: found checkperms-1.12
=> Full dependency bash-[0-9]*: found bash-5.2.26nb1
=> Full dependency lld>=17.0.0<18: found lld-17.0.6
=> Full dependency llvm>=17.0.0<18: found llvm-17.0.6
=> Full dependency clang>=17.0.0<18: found clang-17.0.6
===> Skipping vulnerability checks.
WARNING: No /usr/pkg/pkgdb/pkg-vulnerabilities file found.
WARNING: To fix run: `/usr/sbin/pkg_admin -K /usr/pkg/pkgdb fetch-pkg-vulnerabilities'.
===> Overriding tools for zig-0.12.0
===> Extracting for zig-0.12.0
===> Patching for zig-0.12.0
===> Creating toolchain wrappers for zig-0.12.0
===> Configuring for zig-0.12.0
=> Checking for portability problems in extracted files
-- The C compiler identification is GNU 10.5.0
-- The CXX compiler identification is GNU 10.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /tmp/work/.cwrapper/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /tmp/work/.cwrapper/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring zig version 0.12.0
-- Found llvm: /usr/pkg/lib/libLLVM-17.so;-lrt;-lexecinfo;-lpthread;-lm;-lz;-lzstd;-lterminfo;-lxml2 (Required is at least version "17")
-- Found clang: /usr/pkg/lib/libclang-cpp.so.17 (Required is at least version "17")
-- Found lld: /usr/pkg/lib/liblldMinGW.a;/usr/pkg/lib/liblldELF.a;/usr/pkg/lib/liblldCOFF.a;/usr/pkg/lib/liblldWasm.a;/usr/pkg/lib/liblldMachO.a;/usr/pkg/lib/liblldCommon.a (Required is at least version "17")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Configuring done (1.0s)
-- Generating done (0.0s)
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_INSTALL_LIBDIR
    CMAKE_INSTALL_MANDIR
    DESTDIR

===> Installing for zig-0.12.0
=> Generating pre-install file lists
[ 36%] Built target zigcpp
[ 47%] Built target zig-wasm2c
[ 68%] Built target zig1
[ 94%] Built target zig2
[100%] Built target stage3
Install the project...
-- Install configuration: "Release"
error: AccessDenied
::
:: ERROR: 1
:: (execute_process)
::
:: argv: /tmp/work/zig-0.12.0/cmake-pkgsrc-build/zig2 build --zig-lib-dir /tmp/work/zig-0.12.0/lib -Dconfig_h=/tmp/work/zig-0.12.0/cmake-pkgsrc-build/config.h -Denable-llvm -Doptimize=ReleaseFast -Dstrip -Dno-langref -Dtarget=native -Dcpu=baseline -Dversion-string=0.12.0 --prefix /usr/pkg
::
:: argv[0]: /tmp/work/zig-0.12.0/cmake-pkgsrc-build/zig2
:: argv[1]: build
:: argv[2]: --zig-lib-dir
:: argv[3]: /tmp/work/zig-0.12.0/lib
:: argv[4]: -Dconfig_h=/tmp/work/zig-0.12.0/cmake-pkgsrc-build/config.h
:: argv[5]: -Denable-llvm
:: argv[6]: -Doptimize=ReleaseFast
:: argv[7]: -Dstrip
:: argv[8]: -Dno-langref
:: argv[9]: -Dtarget=native
:: argv[10]: -Dcpu=baseline
:: argv[11]: -Dversion-string=0.12.0
:: argv[12]: --prefix
:: argv[13]: /usr/pkg
::
CMake Error at /tmp/work/zig-0.12.0/cmake/install.cmake:26 (message):
Call Stack (most recent call first):
  cmake_install.cmake:57 (include)


*** Error code 1

Stop.
make[2]: stopped in /tmp/work/zig-0.12.0/cmake-pkgsrc-build
*** Error code 1

Stop.
make: stopped in /usr/pkgsrc/lang/zig

Expected Behavior

zig should install.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behavioros-netbsdNetBSD

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions