-
Notifications
You must be signed in to change notification settings - Fork 232
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
Add repository rules for fetching prebuilt build tools (cmake
, ninja
, etc...)
#497
Comments
It is true that compiling these from source, while seems like a good idea, can take forever. Not to mention the rabbit hole it produces: compiling I could give this a try, but we first need to find out if these tools provide binaries for the major platforms. (I don't want to be in the business of having to maintain a binary release…) |
My thought for this change was to write a basic shells script that generates a bzl file with repository definitions for a predefined set of cmake and ninja versions. Then update the interface for def rules_foreign_cc_dependencies(
native_tools_toolchains = [],
register_default_tools = True,
cmake_version = "3.18.0",
ninja_version = "1.10.2",
additional_shell_toolchain_mappings = [],
additional_shell_toolchain_package = None): Where users can pick from our built in set of supported releases that will be downloaded from cmake/github/google with all the appropriate Specifically, something like @rules_rust//util:fetch_shas.sh Though I'm not sure what you mean with
That said though, I haven't had the time to work on this but think it'd help immensely in making builds more hermetic. If you wanted to work on this I'd greatly appreciate it! 😄 |
What I meant there is that this would work as long as cmake/ninja/etc. provide binaries somewhere, on GitHub or some place else. I.e. we don't need to build and release binaries. |
Ah, 100% agree. If this were not the case, I'd say the "preinstalled" and compiled toolchains are as good as it's going to get. |
As mentioned in #506, CMake is no longer installed on MacOS test runners for CI. This change would solve for this issue. I feel this is higher priority now since other users may run into this issue. That PR has a work-around but hopefully one of us can find time to implement this feature. |
It also seems that |
I think what we have for now, with the fetched pre-built binaries, works nicely. For those cyclic dependencies, they tend to include some bootstrap script or similar, i.e. building a bare-bones |
Currently users can either use there's a set of tools toolchains that either rely on a pre-installed build tool or compile one from source. In general, it's not always convenient to expect one of these tools to be installed on the host and it can be very time consuming to have to compile these tools. In addition to the following
rules_foreign_cc/tools/build_defs/native_tools/BUILD
Lines 7 to 62 in 14520d2
A new rule should be added that will download cmake and ninja for the current platform and make it available for users to register. A similar example of what I'm hoping for can be seen in @rules_rust//rust:repositories.bzl
The text was updated successfully, but these errors were encountered: