Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upTracking issue for build plan generation (--build-plan) #5579
Comments
This comment has been minimized.
This comment has been minimized.
|
A perhaps non-obvious use case of this: I was able to reimplement the compile-fail test functionality provided by compiletest-rs using the build plan to figure out how to compile an integration test: https://github.com/jonas-schievink/compile-fail The benefit of this approach is that asking Cargo how to build a test is much more robust than building the rustc command line manually (essentially guessing how dependencies should be linked). This should fix practically every bug where compiletest-rs would break with an error like "multiple matching crates found". |
This comment has been minimized.
This comment has been minimized.
saleemrashid
commented
Jun 26, 2018
|
One complication is that the downstream build system needs to know how to use build scripts. Otherwise, the build plan will execute the build script, without passing the |
This comment has been minimized.
This comment has been minimized.
saleemrashid
commented
Jun 26, 2018
|
Also, including the path to the dep-info file would be useful, as it is not as simple as changing the file extension to |
matklad
added
the
C-tracking-issue
label
Jun 26, 2018
This comment has been minimized.
This comment has been minimized.
|
I don't know if there's a useful way to associate issues with a tracking issue in GitHub, but I filed: #5719 |
LukasKalbertodt
referenced this issue
Jul 22, 2018
Merged
Add compile-fail and compile-pass tests #17
Mark-Simulacrum
added
the
A-build-plan
label
Aug 2, 2018
jonas-schievink
referenced this issue
Nov 9, 2018
Open
Suggestion: Add a flag to clean all currently unused build artifacts #2
This comment has been minimized.
This comment has been minimized.
hobofan
commented
Nov 13, 2018
|
I just learned about the One thing that was really surprising to me, that there hasn't been any discussions about the implications of build.rs output altering the build plan as far as I can tell. I feel like that if that factor is ignored it would give either give consumers of the build plan a false sense of security that the produced build plan is static and always acurate, or leave a significant feature with many crates using it up for reeimplementation by the build-plan consumers. To me it seems like that is something at least worth discussing before this feature will be stabilized. |
This comment has been minimized.
This comment has been minimized.
denzp
commented
Nov 13, 2018
|
@hobofan Indeed, it's impossible to predict what build script will do. It can create some files, alter the rustc environment, or add link flags. For my use case (experiments with advanced Docker building and caching), I've made a small binary that handles build script output with cargo's Probably |
jonas-schievink commentedMay 27, 2018
Implemented in #5301, Cargo gained the ability to produce a JSON build plan containing a list of commands that need to be executed to build a target.
The feature is currently unstable and requires a nightly Cargo release as well as the
-Zunstable-optionscommand line argument. This issue tracks its eventual stabilization.This feature was originally requested in #3815 to facilitate Cargo's integration into other build systems.