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

can't compile Rust standard library with cc v1.0.80+ #859

Closed
kadiwa4 opened this issue Aug 20, 2023 · 7 comments
Closed

can't compile Rust standard library with cc v1.0.80+ #859

kadiwa4 opened this issue Aug 20, 2023 · 7 comments

Comments

@kadiwa4
Copy link
Contributor

kadiwa4 commented Aug 20, 2023

Edit: now tracked in #913

In the Rust repo, if you update cc to the latest version and try to compile the standard library

RUSTC_BOOTSTRAP=1 ./build/host/stage0/bin/cargo update -p cc
./x check std

You will get this error:

Error
error: unexpected `cfg` condition name
  --> library/core/src/num/mod.rs:29:11
   |
29 | #[cfg(not(no_fp_fmt_parse))]
   |           ^^^^^^^^^^^^^^^
   |
   = note: `-D unexpected-cfgs` implied by `-D warnings`

error: unexpected `cfg` condition name
  --> library/core/src/num/mod.rs:31:11
   |
31 | #[cfg(not(no_fp_fmt_parse))]
   |           ^^^^^^^^^^^^^^^

error: unexpected `cfg` condition name
  --> library/core/src/num/mod.rs:33:11
   |
33 | #[cfg(not(no_fp_fmt_parse))]
   |           ^^^^^^^^^^^^^^^

error: unexpected `cfg` condition name
  --> library/core/src/num/mod.rs:35:11
   |
35 | #[cfg(not(no_fp_fmt_parse))]
   |           ^^^^^^^^^^^^^^^

error: unexpected `cfg` condition name
  --> library/core/src/num/mod.rs:57:11
   |
57 | #[cfg(not(no_fp_fmt_parse))]
   |           ^^^^^^^^^^^^^^^

error: unexpected `cfg` condition value
   --> library/core/src/mem/mod.rs:735:19
    |
735 |     #[cfg(not(any(target_arch = "spirv")))]
    |                   ^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `target_arch` are: `aarch64`, `arm`, `avr`, `bpf`, `hexagon`, `loongarch64`, `m68k`, `mips`, `mips64`, `msp430`, `nvptx64`, `powerpc`, `powerpc64`, `riscv32`, `riscv64`, `s390x`, `sparc`, `sparc64`, `wasm32`, `wasm64`, `x86`, `x86_64`

error: unexpected `cfg` condition value
   --> library/core/src/ffi/mod.rs:244:5
    |
244 |     target_arch = "asmjs",
    |     ^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `target_arch` are: `aarch64`, `arm`, `avr`, `bpf`, `hexagon`, `loongarch64`, `m68k`, `mips`, `mips64`, `msp430`, `nvptx64`, `powerpc`, `powerpc64`, `riscv32`, `riscv64`, `s390x`, `sparc`, `sparc64`, `wasm32`, `wasm64`, `x86`, `x86_64`

error: unexpected `cfg` condition value
   --> library/core/src/ffi/mod.rs:273:5
    |
273 |     target_arch = "asmjs",
    |     ^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `target_arch` are: `aarch64`, `arm`, `avr`, `bpf`, `hexagon`, `loongarch64`, `m68k`, `mips`, `mips64`, `msp430`, `nvptx64`, `powerpc`, `powerpc64`, `riscv32`, `riscv64`, `s390x`, `sparc`, `sparc64`, `wasm32`, `wasm64`, `x86`, `x86_64`

error: unexpected `cfg` condition value
   --> library/core/src/ffi/mod.rs:434:5
    |
434 |     target_arch = "asmjs",
    |     ^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `target_arch` are: `aarch64`, `arm`, `avr`, `bpf`, `hexagon`, `loongarch64`, `m68k`, `mips`, `mips64`, `msp430`, `nvptx64`, `powerpc`, `powerpc64`, `riscv32`, `riscv64`, `s390x`, `sparc`, `sparc64`, `wasm32`, `wasm64`, `x86`, `x86_64`

error: unexpected `cfg` condition value
   --> library/core/src/ffi/mod.rs:464:9
    |
464 |     not(target_arch = "asmjs"),
    |         ^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `target_arch` are: `aarch64`, `arm`, `avr`, `bpf`, `hexagon`, `loongarch64`, `m68k`, `mips`, `mips64`, `msp430`, `nvptx64`, `powerpc`, `powerpc64`, `riscv32`, `riscv64`, `s390x`, `sparc`, `sparc64`, `wasm32`, `wasm64`, `x86`, `x86_64`

error: unexpected `cfg` condition value
   --> library/core/src/ffi/mod.rs:398:9
    |
398 |         target_arch = "asmjs",
    |         ^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `target_arch` are: `aarch64`, `arm`, `avr`, `bpf`, `hexagon`, `loongarch64`, `m68k`, `mips`, `mips64`, `msp430`, `nvptx64`, `powerpc`, `powerpc64`, `riscv32`, `riscv64`, `s390x`, `sparc`, `sparc64`, `wasm32`, `wasm64`, `x86`, `x86_64`

error: unexpected `cfg` condition value
   --> library/core/src/ffi/mod.rs:416:13
    |
416 |         not(target_arch = "asmjs"),
    |             ^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `target_arch` are: `aarch64`, `arm`, `avr`, `bpf`, `hexagon`, `loongarch64`, `m68k`, `mips`, `mips64`, `msp430`, `nvptx64`, `powerpc`, `powerpc64`, `riscv32`, `riscv64`, `s390x`, `sparc`, `sparc64`, `wasm32`, `wasm64`, `x86`, `x86_64`

error: unexpected `cfg` condition value
   --> library/core/src/ffi/mod.rs:114:21
    |
114 |                     target_arch = "csky"
    |                     ^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `target_arch` are: `aarch64`, `arm`, `avr`, `bpf`, `hexagon`, `loongarch64`, `m68k`, `mips`, `mips64`, `msp430`, `nvptx64`, `powerpc`, `powerpc64`, `riscv32`, `riscv64`, `s390x`, `sparc`, `sparc64`, `wasm32`, `wasm64`, `x86`, `x86_64`

error: unexpected `cfg` condition name
  --> library/core/src/fmt/mod.rs:16:11
   |
16 | #[cfg(not(no_fp_fmt_parse))]
   |           ^^^^^^^^^^^^^^^

error: unexpected `cfg` condition name
  --> library/core/src/fmt/mod.rs:18:7
   |
18 | #[cfg(no_fp_fmt_parse)]
   |       ^^^^^^^^^^^^^^^

error: unexpected `cfg` condition name
   --> library/core/src/../../stdarch/crates/core_arch/src/x86/mod.rs:782:11
    |
782 | #[cfg(not(stdarch_intel_sde))]
    |           ^^^^^^^^^^^^^^^^^

error: unexpected `cfg` condition name
   --> library/core/src/../../stdarch/crates/core_arch/src/x86/mod.rs:784:11
    |
784 | #[cfg(not(stdarch_intel_sde))]
    |           ^^^^^^^^^^^^^^^^^

error: unexpected `cfg` condition name
   --> library/core/src/../../stdarch/crates/core_arch/src/x86/mod.rs:787:11
    |
787 | #[cfg(not(stdarch_intel_sde))]
    |           ^^^^^^^^^^^^^^^^^

error: unexpected `cfg` condition name
   --> library/core/src/../../stdarch/crates/core_arch/src/x86/mod.rs:789:11
    |
789 | #[cfg(not(stdarch_intel_sde))]
    |           ^^^^^^^^^^^^^^^^^

error: could not compile `core` (lib) due to 19 previous errors

Preventing rust-lang/rust#112865 from passing CI. The problem was introduced in #780. Maybe it's because it introduced a new dependency (os_pipe edit: libc, because os_pipe was removed again).

Feel free to move the issue if it belongs to rust-lang/rust.

@thomcc
Copy link
Member

thomcc commented Aug 20, 2023

We removed the dependencies in subsequent PRs, prior to the release. None of the errors in blob you linked look like errors you'd get if it were cc's fault -- they all look like the errors you get when using a wrong rustc to build libcore, maybe.

Note that neither libstd nor libcore depend on cc (including transitively), so I'm really unsure how cc is responsible here, there's definitely not enough info for this to be actionable.

@thomcc
Copy link
Member

thomcc commented Aug 20, 2023

Anyway how did you come to the conclusion that this is cc? I don't see any evidence of this at all.

@thomcc
Copy link
Member

thomcc commented Aug 20, 2023

I'm going to close this as there's no real evidence this is cc. The errors are all from libcore which doesn't depend on cc (or anything else). If you reopen, please provide more information.

@thomcc thomcc closed this as not planned Won't fix, can't repro, duplicate, stale Aug 20, 2023
@kadiwa4
Copy link
Contributor Author

kadiwa4 commented Aug 20, 2023

Maybe you can move it to rust instead of closing? It's still an issue there

@thomcc
Copy link
Member

thomcc commented Aug 20, 2023

I don't know how to move an issue across repositories. I'm not sure that's a thing. I also don't see evidence that an issue besides rust-lang/rust#112865 is needed.

@kadiwa4
Copy link
Contributor Author

kadiwa4 commented Aug 20, 2023

Ok. Sadly, I don't know much about how the standard library is compiled, so I don't think I'll be able to come up with a good explanation or fix :/

edit: Actually, nevermind. I think I understand it now.

@thomcc
Copy link
Member

thomcc commented Aug 20, 2023

For future note: This probably was a real issue, which was addressed by #860 (in 1.0.83).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants