-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[New custom build] Implement the new custom build command #763
Conversation
} | ||
|
||
/// Consumes this job by running it, returning the result of the | ||
/// computation. | ||
pub fn run(self, fresh: Freshness) -> CargoResult<()> { | ||
pub fn run(self, fresh: Freshness, sender: Sender<String>) -> CargoResult<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/sender/tx/
Ok, I've looked this over and added some comments here and there, thanks @tomaka! Could you also add some tests along these lines:
The list of things you plan on adding after this gets merged looks great, I hope to merge this soon! Some specific comments:
This is currently mainly used for feeding information into
Could you elaborate a little more on this? |
Ah, and one other recommendation for tests: Could you pass |
I re-read Cargo's source code, and apparently I was mistaken. When I modified |
Ok, sounds good to me! |
3223825
to
c1ed49c
Compare
For the record, here's what remains to be done before merging:
|
Closing in favor of #792 |
This series of commits (based on #763) is an implementation of the recent [Cargo RFC](https://github.com/rust-lang/rfcs/blob/master/text/0403-cargo-build-command.md). This should implement all portions of the RFC, but there's a lot so an extra set of eyes would be nice! I haven't added documentation for it all yet, but I would like to do so before landing (starting with #749). Otherwise I've been migrating all of the existing cargo dependencies away from the build command to a build script, and the progress can be seen with these repositories: * https://github.com/alexcrichton/gcc-rs * https://github.com/alexcrichton/pkg-config-rs * https://github.com/alexcrichton/git2-rs/tree/build-cmd * https://github.com/alexcrichton/openssl-sys * https://github.com/alexcrichton/flate2-rs/tree/build-cmd * https://github.com/alexcrichton/libz-sys * https://github.com/alexcrichton/ssh2-rs/tree/build-cmd I haven't quite gotten around to curl just yet, but it's next on my list!
Does include:
target/build/$pkg
, its output is written in the same directory in theoutput
file, and it hastarget/build/$pkg/out
available to write temporary filesoutput
files are later loaded by each rustc invocation and other custom build command, in order to retreive the rustc-flags orDEP_
variables.plugin
tofor_host
Does not include:
links
, I plan to add this after this PR is mergedDEP_<links>_<key>
: You just need to uncomment a block of code, but this can't be implemented without support forlinks
rustc-flags
are correctly passed to rustc, because rustc doesn't support the-l
flag yet. I'll add this to the PR once rust supports it (or maybe even before if I compile the fork of rustc that has it).The test supposed to check whether a custom build script failure triggers a compilation failure for the whole project is commented out, because I didn't find a way to get the name of the package to match the exact error message. This will need to be fixed before merging.Compilation
structThebuild
directory is not used when determining the fingerprint, something that was apparently done for thenative
directoryI recommend reviewing commit by commit. I implemented each feature one by one (tests should pass for each individual commit).
cc #610