Skip to content
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

"x.py doc --stage 0" fails with compiler-docs enabled #74976

Closed
tshepang opened this issue Jul 31, 2020 · 20 comments
Closed

"x.py doc --stage 0" fails with compiler-docs enabled #74976

tshepang opened this issue Jul 31, 2020 · 20 comments
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@tshepang
Copy link
Member

tshepang commented Jul 31, 2020

Just bumped onto this with ./x.py doc, even after ./x.py clean:

error[E0460]: found possibly newer version of crate `std` which `synstructure` depends on                                                    
 --> src/librustc_macros/src/lib.rs:4:5                                                                                                      
  |                                                                                                                                          
4 | use synstructure::decl_derive;                                                                                                           
  |     ^^^^^^^^^^^^                                                                                                                         
  |                                                                                                                                                                                                                                                                                       
  = note: perhaps that crate needs to be recompiled?                                                                                                                                                                                                                                      
  = note: the following crate versions were found:                                                                                                                                                                                                                                        
          crate `std`: /home/tshepang/rust/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-95e90a1be2e66993.rlib                                                                                                                            
          crate `std`: /home/tshepang/rust/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-95e90a1be2e66993.so                                                                            
          crate `synstructure`: /home/tshepang/rust/build/x86_64-unknown-linux-gnu/stage0-rustc/release/deps/libsynstructure-7a0d29a374b01f60.rmeta

Here is my config.toml

[build]
compiler-docs = true
extended = true
tools = [ "clippy", "rustfmt", "rust-analyzer" ]
target = [ "wasm32-unknown-unknown" ]

[rust]
incremental = true

Originally posted by @tshepang in #59105 (comment)

@tshepang tshepang changed the title Just bumped onto this with ./x.py doc, even after ./x.py clean: "x.py doc" fails Jul 31, 2020
@jonas-schievink jonas-schievink added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) C-bug Category: This is a bug. labels Jul 31, 2020
@jyn514
Copy link
Member

jyn514 commented Jul 31, 2020

If you pass --stage 1 does it work? The default was recently changed to 0 so that might have uncovered a latent bug.

@tshepang
Copy link
Member Author

@jyn514 that worked

@ehuss
Copy link
Contributor

ehuss commented Jul 31, 2020

Fixing this properly looks like it will be quite tricky. Some of the complexity stems from the fact that the rustc wrapper does not set the sysroot without a --target flag, which is what happens when running cargo doc (see here). However, the rustdoc wrapper always sets the sysroot here. This means that dependencies that are built with rustc (for .rmeta) use the beta sysroot (stage0), and rustdoc is using the stage0-sysroot folder with the newly built std.

As an aside, if this is fixed to support stage0, this line will probably need to be changed to Std, not Rustc. There's no need to build Rustc to document itself.

@ehuss ehuss changed the title "x.py doc" fails "x.py doc" fails with compiler-docs enabled Jul 31, 2020
@Mark-Simulacrum
Copy link
Member

I suspect that rustdoc always setting the sysroot might in fact be a bug, or at least unintentional - it seems like the two should be the same probably?

@jyn514 jyn514 changed the title "x.py doc" fails with compiler-docs enabled "x.py doc --stage 0" fails with compiler-docs enabled Jul 31, 2020
@tshepang
Copy link
Member Author

tshepang commented Aug 19, 2020

x.py doc --stage 1 does not work anymore

...
 Documenting std v0.0.0 (/home/tshepang/rust/library/std)          
error: unresolved link to `crate::os::unix::ffi::OsStrExt`                                                                                   
   --> library/std/src/ffi/mod.rs:134:22
    |                                                                                                                                        
134 | //! [unix.OsStrExt]: crate::os::unix::ffi::OsStrExt                                                                                    
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unresolved link
    |                                                                                                                                        
    = note: `-D broken-intra-doc-links` implied by `-D warnings`      
    = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
...

@jyn514
Copy link
Member

jyn514 commented Aug 19, 2020

What platform are you on? There might be some weird cfgs going on that weren't caught by CI for #75501. Feel free to make a PR reverting the links to ext, if you don't get around to it today I'll try to make a PR by the end of the week.

@tshepang
Copy link
Member Author

I am on x86_64-unknown-linux-gnu, Debian unstable.

@jyn514
Copy link
Member

jyn514 commented Aug 19, 2020

Hmm, I can't reproduce locally and I have the same link in library/std. Not sure what's going on, I'm on x86_64-unknown-linux-gnu as well.

@jyn514
Copy link
Member

jyn514 commented Aug 19, 2020

This makes it seem like it should be independent of the platform:

if #[cfg(doc)] {
// When documenting libstd we want to show unix/windows/linux modules as
// these are the "main modules" that are used across platforms. This
// should help show platform-specific functionality in a hopefully
// cross-platform way in the documentation
#[stable(feature = "rust1", since = "1.0.0")]
pub use crate::sys::unix_ext as unix;
#[stable(feature = "rust1", since = "1.0.0")]
pub use crate::sys::windows_ext as windows;
#[doc(cfg(target_os = "linux"))]
pub mod linux;
} else {

#[cfg(doc)]
cfg_if::cfg_if! {
if #[cfg(unix)] {
// On unix we'll document what's already available
#[stable(feature = "rust1", since = "1.0.0")]
pub use self::ext as unix_ext;
} else if #[cfg(any(target_os = "cloudabi",
target_os = "hermit",
target_arch = "wasm32",
all(target_vendor = "fortanix", target_env = "sgx")))] {
// On CloudABI and wasm right now the module below doesn't compile
// (missing things in `libc` which is empty) so just omit everything
// with an empty module
#[unstable(issue = "none", feature = "std_internals")]
#[allow(missing_docs)]
pub mod unix_ext {}
} else {
// On other platforms like Windows document the bare bones of unix
use crate::os::linux as platform;
#[path = "unix/ext/mod.rs"]
pub mod unix_ext;
}
}

@tshepang
Copy link
Member Author

Here is my config.toml, just in case that makes a difference

[build]
compiler-docs = true
extended = true
tools = [ "clippy", "rustfmt", "rust-analyzer" ]
target = [ "wasm32-unknown-unknown" ]

[rust]
incremental = true
lld = true

@jyn514
Copy link
Member

jyn514 commented Aug 19, 2020

Ah ok, this is because you're targeting wasm - if you look at

target_arch = "wasm32",
it doesn't have unix_ext at all for that target.

The different from before is that the links would fail silently; now they are failing noisily. I'm not sure the best way to fix this ... from the comments it seems like adding unix_ext for that target is not trivial. Maybe you could export RUSTFLAGS="-A broken_intra_doc_links"? Or set warnings not to be errors?

@tshepang
Copy link
Member Author

Is there a way of specifying which target to build docs for in x.py?

@jyn514
Copy link
Member

jyn514 commented Aug 19, 2020

x.py doc --stage 1 --target x86_64-unknown-linux-gnu

@tshepang
Copy link
Member Author

Note also that I no longer experience the initial issue... no need to specify --stage 1 anymore.

@o01eg
Copy link
Contributor

o01eg commented Sep 9, 2020

I caught this bug.

My config.toml:

[llvm]
optimize = true
release-debuginfo = false
assertions = false
ninja = true
targets = "X86;Mips;NVPTX;RISCV;BPF;AArch64;WebAssembly"
experimental-targets = ""
link-shared = true
[build]
build = "x86_64-unknown-linux-gnu"
host = ["x86_64-unknown-linux-gnu"]
target = ["i686-unknown-linux-gnu","x86_64-unknown-linux-gnu","wasm32-unknown-unknown"]
docs = true
compiler-docs = true
submodules = false
python = "python3.7"
locked-deps = true
vendor = false
extended = true
tools = ["rust-analyzer","rustfmt","rls","miri","clippy","cargo",]
verbose = 2
sanitizers = false
profiler = false
cargo-native-static = false
[install]
prefix = "/usr"
libdir = "lib64/rust-9999"
docdir = "share/doc/rust-9999"
mandir = "share/rust-9999/man"
[rust]
optimize = true
debug = false
debug-assertions = false
debuginfo-level-rustc = 0
backtrace = true
incremental = false
default-linker = "x86_64-pc-linux-gnu-gcc"
parallel-compiler = false
rpath = false
verbose-tests = true
optimize-tests = true
codegen-tests = true
dist-src = false
ignore-git = false
lld = false
backtrace-on-ice = true
jemalloc = false
[dist]
src-tarball = false
[target.i686-unknown-linux-gnu]
cc = "x86_64-pc-linux-gnu-gcc"
cxx = "x86_64-pc-linux-gnu-g++"
linker = "x86_64-pc-linux-gnu-gcc"
ar = "x86_64-pc-linux-gnu-ar"
llvm-config = "/usr/lib/llvm/10/bin/llvm-config"
[target.x86_64-unknown-linux-gnu]
cc = "x86_64-pc-linux-gnu-gcc"
cxx = "x86_64-pc-linux-gnu-g++"
linker = "x86_64-pc-linux-gnu-gcc"
ar = "x86_64-pc-linux-gnu-ar"
llvm-config = "/usr/lib/llvm/10/bin/llvm-config"
[target.wasm32-unknown-unknown]
linker = "lld"

Failed command:

error: Could not document `std`.

Caused by:
  process didn't exit successfully: `/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/bootstrap/debug/rustdoc --edition=2018 --crate-type dylib --crate-type rlib --crate-name std library/std/src/lib.rs --target wasm32-unknown-unknown -o /tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/doc --cfg 'feature="addr2line"' --cfg 'feature="backtrace"' --cfg 'feature="gimli-symbolize"' --cfg 'feature="miniz_oxide"' --cfg 'feature="object"' --cfg 'feature="panic_unwind"' --cfg 'feature="std_detect_dlsym_getauxval"' --cfg 'feature="std_detect_file_io"' --error-format=json --json=diagnostic-rendered-ansi --markdown-css rust.css --markdown-no-toc -Z unstable-options --resource-suffix 1.48.0 --index-page /tmp/portage/dev-lang/rust-9999/work/rust-git-src/src/doc/index.md -L dependency=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps -L dependency=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/release/deps --extern addr2line=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/libaddr2line-9c90916959ed47dc.rmeta --extern alloc=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/liballoc-f10d36e19a6b4a6c.rmeta --extern cfg_if=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/libcfg_if-30857b79c73f7fff.rmeta --extern compiler_builtins=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/libcompiler_builtins-1b00cc16184366d5.rmeta --extern core=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/libcore-1c0d17d595f10ad8.rmeta --extern dlmalloc=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/libdlmalloc-d3a093304a3f5ed3.rmeta --extern hashbrown=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/libhashbrown-8e4f0f970969b8bf.rmeta --extern libc=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/liblibc-e07644d41b7e931f.rmeta --extern miniz_oxide=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/libminiz_oxide-5d75d119f5f9ea26.rmeta --extern object=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/libobject-1b2bee7d52f5d55c.rmeta --extern panic_abort=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/libpanic_abort-37cc5afa0a6b8ae3.rmeta --extern panic_unwind=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/libpanic_unwind-4cac7c7e34360602.rmeta --extern rustc_demangle=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/librustc_demangle-a4be1769e9ac3e0f.rmeta --extern unwind=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/libunwind-efdde7ebbb0e90a3.rmeta -Lnative=/usr/lib/llvm/10/lib64 -Dwarnings -Winvalid_codeblock_attributes --crate-version '1.48.0-dev
  (683d1bcd4
  2020-09-09)' --cfg backtrace_in_libstd` (exit code: 1)


command did not execute successfully: "/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "rustdoc" "--target" "wasm32-unknown-unknown" "-Zbinary-dep-depinfo" "-j" "7" "-v" "--release" "--locked" "--features" "panic-unwind backtrace" "--manifest-path" "/tmp/portage/dev-lang/rust-9999/work/rust-git-src/library/test/Cargo.toml" "-p" "std" "--" "--markdown-css" "rust.css" "--markdown-no-toc" "-Z" "unstable-options" "--resource-suffix" "1.48.0" "--index-page" "/tmp/portage/dev-lang/rust-9999/work/rust-git-src/src/doc/index.md"
expected success, got: exit code: 101

Commit: 683d1bc

@jyn514
Copy link
Member

jyn514 commented Sep 9, 2020

@o01eg that's not enough info to be sure it's the same bug - can you post the output about 5 lines up that says why it failed to document?

@o01eg
Copy link
Contributor

o01eg commented Sep 9, 2020

@jyn514 Part of log with error:

      c Rustdoc { compiler: Compiler { stage: 2, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } }
      c Sysroot { compiler: Compiler { stage: 2, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } }
      c Sysroot { compiler: Compiler { stage: 2, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } }
      c Sysroot { compiler: Compiler { stage: 2, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } }
      c Rustdoc { compiler: Compiler { stage: 2, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } }
      c Sysroot { compiler: Compiler { stage: 2, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } }
running: "/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "rustdoc" "--target" "wasm32-unknown-unknown" "-Zbinary-dep-depinfo" "-j" "7" "-v" "--release" "--locked" "--features" "panic-unwind backtrace" "--manifest-path" "/tmp/portage/dev-lang/rust-9999/work/rust-git-src/library/test/Cargo.toml" "-p" "std" "--" "--markdown-css" "rust.css" "--markdown-no-toc" "-Z" "unstable-options" "--resource-suffix" "1.47.0" "--index-page" "/tmp/portage/dev-lang/rust-9999/work/rust-git-src/src/doc/index.md"
...
 Documenting std v0.0.0 (/tmp/portage/dev-lang/rust-9999/work/rust-git-src/library/std)
     Running `/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/bootstrap/debug/rustdoc --edition=2018 --crate-type dylib --crate-type rlib --crate-name std library/std/src/lib.rs --target wasm32-unknown-unknown -o /tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/doc --cfg 'feature="addr2line"' --cfg 'feature="backtrace"' --cfg 'feature="gimli-symbolize"' --cfg 'feature="miniz_oxide"' --cfg 'feature="object"' --cfg 'feature="panic_unwind"' --cfg 'feature="std_detect_dlsym_getauxval"' --cfg 'feature="std_detect_file_io"' --error-format=json --json=diagnostic-rendered-ansi --markdown-css rust.css --markdown-no-toc -Z unstable-options --resource-suffix 1.47.0 --index-page /tmp/portage/dev-lang/rust-9999/work/rust-git-src/src/doc/index.md -L dependency=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps -L dependency=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/release/deps --extern addr2line=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/libaddr2line-8229f5c2a688b6e3.rmeta --extern alloc=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/liballoc-74f910f193e7b336.rmeta --extern cfg_if=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/libcfg_if-fd0d852fc79171d8.rmeta --extern compiler_builtins=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/libcompiler_builtins-db2ee1dfa27e3e7f.rmeta --extern core=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/libcore-5a47466fe4fc98f4.rmeta --extern dlmalloc=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/libdlmalloc-b7e449ca03644816.rmeta --extern hashbrown=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/libhashbrown-7583e9f834c306b7.rmeta --extern libc=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/liblibc-cf6ced52b7f0305e.rmeta --extern miniz_oxide=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/libminiz_oxide-393b4807a077fca1.rmeta --extern object=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/libobject-9e197139924657b6.rmeta --extern panic_abort=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/libpanic_abort-ac1891acc12bd958.rmeta --extern panic_unwind=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/libpanic_unwind-ab0162dc30186b39.rmeta --extern rustc_demangle=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/librustc_demangle-f73103bf135d5d64.rmeta --extern unwind=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/libunwind-8d9aa4ec2b106ff0.rmeta -Lnative=/usr/lib/llvm/10/lib64 -Dwarnings -Winvalid_codeblock_attributes --crate-version '1.47.0-dev
(49d39e559
2020-08-17)' --cfg backtrace_in_libstd`
rustdoc command: "LD_LIBRARY_PATH"="/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2/lib64/rust-9999:/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/release/deps:/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage0/lib" "/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" "--edition=2018" "--crate-type" "dylib" "--crate-type" "rlib" "--crate-name" "std" "library/std/src/lib.rs" "--target" "wasm32-unknown-unknown" "-o" "/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/doc" "--cfg" "feature=\"addr2line\"" "--cfg" "feature=\"backtrace\"" "--cfg" "feature=\"gimli-symbolize\"" "--cfg" "feature=\"miniz_oxide\"" "--cfg" "feature=\"object\"" "--cfg" "feature=\"panic_unwind\"" "--cfg" "feature=\"std_detect_dlsym_getauxval\"" "--cfg" "feature=\"std_detect_file_io\"" "--error-format=json" "--json=diagnostic-rendered-ansi" "--markdown-css" "rust.css" "--markdown-no-toc" "-Z" "unstable-options" "--resource-suffix" "1.47.0" "--index-page" "/tmp/portage/dev-lang/rust-9999/work/rust-git-src/src/doc/index.md" "-L" "dependency=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps" "-L" "dependency=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/release/deps" "--extern" "addr2line=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/libaddr2line-8229f5c2a688b6e3.rmeta" "--extern" "alloc=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/liballoc-74f910f193e7b336.rmeta" "--extern" "cfg_if=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/libcfg_if-fd0d852fc79171d8.rmeta" "--extern" "compiler_builtins=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/libcompiler_builtins-db2ee1dfa27e3e7f.rmeta" "--extern" "core=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/libcore-5a47466fe4fc98f4.rmeta" "--extern" "dlmalloc=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/libdlmalloc-b7e449ca03644816.rmeta" "--extern" "hashbrown=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/libhashbrown-7583e9f834c306b7.rmeta" "--extern" "libc=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/liblibc-cf6ced52b7f0305e.rmeta" "--extern" "miniz_oxide=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/libminiz_oxide-393b4807a077fca1.rmeta" "--extern" "object=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/libobject-9e197139924657b6.rmeta" "--extern" "panic_abort=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/libpanic_abort-ac1891acc12bd958.rmeta" "--extern" "panic_unwind=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/libpanic_unwind-ab0162dc30186b39.rmeta" "--extern" "rustc_demangle=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/librustc_demangle-f73103bf135d5d64.rmeta" "--extern" "unwind=/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2-std/wasm32-unknown-unknown/release/deps/libunwind-8d9aa4ec2b106ff0.rmeta" "-Lnative=/usr/lib/llvm/10/lib64" "-Dwarnings" "-Winvalid_codeblock_attributes" "--crate-version" "1.47.0-dev\n(49d39e559\n2020-08-17)" "--cfg" "backtrace_in_libstd" "--cfg" "stage2" "--cfg" "dox" "--sysroot" "/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2" "-Z" "force-unstable-if-unmarked"
sysroot: "/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2"
libdir: "/tmp/portage/dev-lang/rust-9999/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage2/lib64/rust-9999"
error: unresolved link to `crate::os::unix::ffi::OsStrExt`
   --> library/std/src/ffi/mod.rs:134:22
    |
134 | //! [unix.OsStrExt]: crate::os::unix::ffi::OsStrExt
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unresolved link
    |
    = note: `-D broken-intra-doc-links` implied by `-D warnings`
    = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`

error: unresolved link to `crate::os::unix::ffi::OsStrExt::from_bytes`
   --> library/std/src/ffi/mod.rs:135:21
    |
135 | //! [`from_bytes`]: crate::os::unix::ffi::OsStrExt::from_bytes
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unresolved link
    |
    = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`

@jyn514
Copy link
Member

jyn514 commented Sep 9, 2020

Same issue as #74976 (comment), don't pass --target wasm32.

@o01eg
Copy link
Contributor

o01eg commented Sep 9, 2020

It's a part of x.py install I cannot disable it.

@jyn514
Copy link
Member

jyn514 commented Sep 9, 2020

Set deny-warnings = false, then: https://github.com/rust-lang/rust/blob/master/config.toml.example#L442. If you want to fix the root issue please open a separate bug for that, it's not trivial to fix and is not related to the issue you're commenting on.

gentoo-bot pushed a commit to gentoo/gentoo that referenced this issue Apr 27, 2021
This should unbreak USE="doc wasm" build and allow to aunmask doc
useflag, which has been masked for quite some time.

rust-lang/rust#74976
rust-lang/rust#76526

Package-Manager: Portage-3.0.18, Repoman-3.0.3
Signed-off-by: Georgy Yakovlev <[email protected]>
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Apr 5, 2022
Fix `x doc --stage 0 compiler`

Eric figured out the fix to this almost 2 years ago, I just didn't read his comment carefully enough at the timme.
The issue was that fake rustc and fake rustdoc were inconsistent about when they passed `--sysroot` to the real compiler.
Change them to consistently only pass it when `--target` is present.

cc rust-lang#74976 (comment)
Fixes rust-lang#79980

r? `@ehuss`
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Apr 5, 2022
Fix `x doc --stage 0 compiler`

Eric figured out the fix to this almost 2 years ago, I just didn't read his comment carefully enough at the timme.
The issue was that fake rustc and fake rustdoc were inconsistent about when they passed `--sysroot` to the real compiler.
Change them to consistently only pass it when `--target` is present.

cc rust-lang#74976 (comment)
Fixes rust-lang#79980

r? ``@ehuss``
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

6 participants