-
-
Notifications
You must be signed in to change notification settings - Fork 15k
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
rustc: enable bpfe library targets #382166
base: staging
Are you sure you want to change the base?
Conversation
|
# For rustc only targetting no_std, this was circumvented by passing the | ||
# `--disable-docs` flag, but when we mix no_std and std targets, we still | ||
# want docs to be built for just the std targets. | ||
rustcPatches = [ ./skip-no-std-docs.patch ]; |
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.
Has this patch been proposed upstream? This is the kind of patch we could easily end up having to keep around forever, and that might break again in more complicated ways due to upstream not being responsible for it, making it difficult to maintain rustc in Nixpkgs (which is already hard enough).
This is an upstream bug, and the fix should be upstream too. Working around it in Nixpkgs should be an absolute last resort.
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.
maybe we can pull request to upstream instead of patching to source.
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.
Yup, I'm definitely planning to upstream this, but that will likely take a long while until it reaches nixpkgs, so to unblock eBPF crates I didn't want one PR to depend on the other.
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.
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.
Yup, I'm definitely planning to upstream this, but that will likely take a long while until it reaches nixpkgs, so to unblock eBPF crates I didn't want one PR to depend on the other.
I do. I don't want to be committed to keeping a custom behaviour around we don't know that upstream will be okay with.
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.
Yeah, let's wait for the response to rust-lang/rust#137073 :)
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.
it merged; we can backport now. @niklaskorz @alyssais
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.
Yes! Change this to a fetchpatch of the upstream commit and this is good to go.
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.
Will do in a sec :)
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.
Done
c5b41ad
to
10cadc3
Compare
…-no-std, r=clubby789 boostrap: skip no_std targets in Std doc step This fixes a bug that currently prevents us from adding no_std library targets to rustc in nixpkgs (NixOS/nixpkgs#382166). When running `./x.py doc`, the `Std` doc step generally fails for no_std targets, logs: https://gist.github.com/niklaskorz/fb83f9503ce19b75e8b1af02cdebd592 Skipping no_std targets in this step will allow using no_std targets such as `bpfel-unknown-none` together with other targets in the same config without blocking the doc generator for them, e.g. ``` ./configure --release-channel=stable --tools=rustc,rustdoc,rust-analyzer-proc-macro-srv --build=aarch64-apple-darwin --host=aarch64-apple-darwin --target=aarch64-apple-darwin,bpfel-unknown-none ./x.py doc ``` Logs with this fix applied: https://gist.github.com/niklaskorz/cdd50aaea33ede579f737434286d800b
Rollup merge of rust-lang#137073 - niklaskorz:bootstrap-doc-fix-empty-no-std, r=clubby789 boostrap: skip no_std targets in Std doc step This fixes a bug that currently prevents us from adding no_std library targets to rustc in nixpkgs (NixOS/nixpkgs#382166). When running `./x.py doc`, the `Std` doc step generally fails for no_std targets, logs: https://gist.github.com/niklaskorz/fb83f9503ce19b75e8b1af02cdebd592 Skipping no_std targets in this step will allow using no_std targets such as `bpfel-unknown-none` together with other targets in the same config without blocking the doc generator for them, e.g. ``` ./configure --release-channel=stable --tools=rustc,rustdoc,rust-analyzer-proc-macro-srv --build=aarch64-apple-darwin --host=aarch64-apple-darwin --target=aarch64-apple-darwin,bpfel-unknown-none ./x.py doc ``` Logs with this fix applied: https://gist.github.com/niklaskorz/cdd50aaea33ede579f737434286d800b
10cadc3
to
3f9baa3
Compare
|
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.
works for mitmproxy-linux 🎉
and I could finally build the mitmproxy update!!!! Thanks people!
Includes the bpfe targets in libraries to be built by default, see #373425 (comment) and #381669.
The docs stage of Rust's bootstrapping is broken for
no_std
targets, as for these, it determines an empty set of libraries to build the docs for, which in turn results in an attempt to build docs for all libraries. For rustc only targettingno_std
, this was circumvented by passing the--disable-docs
flag, but when we mix no_std and std targets, we still want docs to be built for just thestd
targets.This is fixed by skipping any targets for which an empty set of crates to built docs for is returned.
I also included two minor refactoring commits (indented string literal, obsolete darwin frameworks) which can be excluded from this PR if preferred.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.