Skip to content

Separate installing and building self-hosted compiler #12722

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
BratishkaErik opened this issue Sep 2, 2022 · 0 comments · Fixed by #13036
Closed

Separate installing and building self-hosted compiler #12722

BratishkaErik opened this issue Sep 2, 2022 · 0 comments · Fixed by #13036
Labels
regression It worked in a previous version of Zig, but stopped working.
Milestone

Comments

@BratishkaErik
Copy link
Contributor

BratishkaErik commented Sep 2, 2022

Regressed since e69973b, this can be a problem for package maintainers, for example https://bugs.gentoo.org/867592:

dev-lang/zig-9999: sandbox violation (tries to create /usr/lib/zig)

and https://aur.archlinux.org/packages/zig-git#comment-880012:

With the latest changes to the Zig build process the PKGBUILD no longer works. Problem is that the "cmake --build build" attempts to write directly to /usr/lib. The last part of the build uses zig (stage2) and wants to use -DCMAKE_INSTALL_PREFIX=/usr as written when building stage3. This is the second version of this PKGBUILD.

zig/CMakeLists.txt

Lines 1046 to 1065 in f7784a0

set(ZIG_INSTALL_ARGS "build"
--zig-lib-dir "${CMAKE_SOURCE_DIR}/lib"
--prefix "${CMAKE_INSTALL_PREFIX}"
"-Dconfig_h=${ZIG_CONFIG_H_OUT}"
"-Denable-llvm"
"-Denable-stage1"
${ZIG_RELEASE_ARG}
${ZIG_STATIC_ARG}
${ZIG_SKIP_INSTALL_LIB_FILES_ARG}
${ZIG_SINGLE_THREADED_ARG}
"-Dtarget=${ZIG_TARGET_TRIPLE}"
"-Dcpu=${ZIG_TARGET_MCPU}"
)
add_custom_target(stage3 ALL
COMMAND zig2 ${ZIG_INSTALL_ARGS}
DEPENDS zig2
COMMENT STATUS "Building stage3"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
)

@andrewrk andrewrk added this to the 0.10.0 milestone Oct 15, 2022
@andrewrk andrewrk added the regression It worked in a previous version of Zig, but stopped working. label Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression It worked in a previous version of Zig, but stopped working.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants