rustc: enable bpfe library targets #382166
Conversation
|
There was a problem hiding this comment.
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.
maybe we can pull request to upstream instead of patching to source.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Yeah, let's wait for the response to rust-lang/rust#137073 :)
There was a problem hiding this comment.
it merged; we can backport now. @niklaskorz @alyssais
There was a problem hiding this comment.
Yes! Change this to a fetchpatch of the upstream commit and this is good to go.
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
|
…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
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_stdtargets, 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-docsflag, but when we mix no_std and std targets, we still want docs to be built for just thestdtargets.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 = relaxedsandbox = truenix-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.