feat: support toolchains building zig from source#646
Open
cerisier wants to merge 7 commits intoaherrmann:mainfrom
Open
feat: support toolchains building zig from source#646cerisier wants to merge 7 commits intoaherrmann:mainfrom
cerisier wants to merge 7 commits intoaherrmann:mainfrom
Conversation
* zig_asm
* Simplify zig_toolchain
Require labels as cfg exec
Symlinking Zig exe and libs for zig local toolchain
Stop forwarding exe paths and use file everywhere
Explicit dependency on zig.h
Use dirname of zig.h file for lib paths
* source directory
* do not use .path for zig_lib
* zig_exe_file -> zig_exe
* no _single_file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As explained in #644
This PR makes it possible to build zig from source as part of the toolchain.
The way it works is by allowing end users to define their own:
and passing a new build flat
--@rules_zig//zig/settings:bootstrapped=True.This setting is used in a rule transition for
zig_toolchain, settingbootstrapped=Falseso that all dependencies ofzig_toolchainif they are zig targets, do not resolve the samezig_from_sourcetoolchain but the prebuilt toolchain which doesn't have the bootstrappedtarget_settings.However, this PR currently breaks compatibility with path-based non hermetic zig installations.
Supporting local installation is very easy with this setup if we use new_local_repository with symlinks but I remember your objections wrt windows.
I wonder if there is a way to somehow split the logic entirely so that we don't end up with 1 toolchain API bent to support 2 conflicting use case.
Another argument to keep passing
Filearound in the nominal case is to support path mapping which prohibits passing.pathto actions.