Open nikkicoon opened 4 months ago
since nothing substantial changed in the cmake parts for 2 years, I guess you no longer use cmake for install but build.zig and something changed between 0.11 and 0.12 in the code which handles the installation.
using CMAKE_CONFIGURE_ARGS+= -DCMAKE_INSTALL_PREFIX=${DESTDIR}${PREFIX}
doesn't change a thing in the outcome.
I'd appreciate pointers in how/where to make zig install in our chroot build environment again.
using
CMAKE_CONFIGURE_ARGS+= -DCMAKE_INSTALL_PREFIX=${DESTDIR}${PREFIX}
doesn't change a thing in the outcome.I'd appreciate pointers in how/where to make zig install in our chroot build environment again.
The CMAKE_INSTALL_PREFIX
used as follows works for me.
cmake -G Ninja -S . -B _build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/opt/zig-0.12.0-30-6fd09f8d2d -DCMAKE_PREFIX_PATH=/opt/llvm-netbsd10.0-amd64-17.0.6-release -DCMAKE_C_FLAGS=-fdiagnostics-color -DCMAKE_CXX_FLAGS=-fdiagnostics-color -DZIG_STATIC=OFF -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DZIG_PIE=OFF
followed by
ninja -C _build -j8
ninja -C _build -j8 install
I have to add: it works outside of a chroot without issues. I can safely build and install zig when I run it from pkgsrc as a user (make clean; make package). What you replied didn't look like a build in a pbulk pkgsrc chroot.
The issue for this ticket is:
When the build runs in a pbulk chroot build, it fails to install.
this looks sus:
:: argv[12]: --prefix
:: argv[13]: /usr/pkg
::
is it possible something stripped the original --prefix
placement which usually would go at argv[2]
and appended the hard coded value?
We've changed nothing which would touch this (to my knowledge), that's why we're asking you what changed between 0.11 and 0.12 that we'd encounter this suddenly.
so in this case, is --prefix /usr/pkg
correct and the chroot user pbulk
? has write access?
pbulk (or anything building) doesn't have write access to /usr/pkg. The builds of pkgsrc happen in ${WRKSRC}, which by default is ${WRKDIR}/${DISTNAME}. We write something like a binary named "zig" to (for example) /usr/work/lang/zig/work/.destdir/usr/pkg/bin, where /usr/pkg is ${PREFIX} and iirc the whole thing before that is the destdir. this is writable in the build environment. Upon package creation, it gets transformed to strip away all that and actual install happens to the real prefix, /usr/pkg for example
are you perhaps on discord or zig's irc?
I am on irc, but I don't have enough time today. Tomorrow I'm available.
feel free to ping me. I'm on as freshcoffee in libera #zig
thanks, will do!
Not really a fix, but what if I packaged the zig-bootstrap, used that to build zig and see if we run into the same issue?
zig build
and builds+installs of the zig package in general seem to work for non-root, non-chroot'ed users...
Any idea what's going on here, further blockers?
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:
Expected Behavior
zig should install.