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

Error: expand-default-features test (among others) fail on stable toolchain #855

Open
luketpeterson opened this issue Jul 11, 2023 · 3 comments

Comments

@luketpeterson
Copy link

Pulled current cbindgen master (although the problem can be reproduced quite a ways back)
Ran: cargo run -- --config ./tests/rust/expand_default_features/cbindgen.toml ./tests/rust/expand_default_features

Output:

   Compiling cbindgen v0.25.0 (/Users/admin/rustProjects/cbindgen_debug/cbindgen)
    Finished dev [unoptimized + debuginfo] target(s) in 4.42s
     Running `target/debug/cbindgen --config ./tests/rust/expand_default_features/cbindgen.toml ./tests/rust/expand_default_features`
ERROR: Parsing crate `expand-default-features`: couldn't run `cargo rustc -Zunpretty=expanded`: Compile("    Checking expand-default-features v0.1.0 (/Users/admin/rustProjects/cbindgen_debug/cbindgen/tests/rust/expand_default_features)\n     Running `rustc --crate-name expand src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --crate-type dylib --emit=dep-info,metadata -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -Zunpretty=expanded --cfg 'feature=\"default\"' --cfg 'feature=\"extra_headers\"' -C metadata=f3d0676702499c9a -C extra-filename=-f3d0676702499c9a --out-dir /Users/admin/rustProjects/cbindgen_debug/cbindgen/target/debug/build/cbindgen-ebaa33047086c38a/out/expanded/debug/deps -C incremental=/Users/admin/rustProjects/cbindgen_debug/cbindgen/target/debug/build/cbindgen-ebaa33047086c38a/out/expanded/debug/incremental -L dependency=/Users/admin/rustProjects/cbindgen_debug/cbindgen/target/debug/build/cbindgen-ebaa33047086c38a/out/expanded/debug/deps`\nerror: the option `Z` is only accepted on the nightly compiler\n\nerror: could not compile `expand-default-features` (lib)\n\nCaused by:\n  process didn't exit successfully: `rustc --crate-name expand src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --crate-type dylib --emit=dep-info,metadata -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -Zunpretty=expanded --cfg 'feature=\"default\"' --cfg 'feature=\"extra_headers\"' -C metadata=f3d0676702499c9a -C extra-filename=-f3d0676702499c9a --out-dir /Users/admin/rustProjects/cbindgen_debug/cbindgen/target/debug/build/cbindgen-ebaa33047086c38a/out/expanded/debug/deps -C incremental=/Users/admin/rustProjects/cbindgen_debug/cbindgen/target/debug/build/cbindgen-ebaa33047086c38a/out/expanded/debug/incremental -L dependency=/Users/admin/rustProjects/cbindgen_debug/cbindgen/target/debug/build/cbindgen-ebaa33047086c38a/out/expanded/debug/deps` (exit status: 1)\n")
ERROR: Couldn't generate bindings for ./tests/rust/expand_default_features.

Configuration:
Current cbindgen master (commit 0b43f0b)
Rust toolchain: stable-x86_64-apple-darwin unchanged - rustc 1.70.0 (90c541806 2023-05-31)
cargo-expand version: cargo-expand-expand 1.0.59 + prettyplease 0.2.10

@luketpeterson luketpeterson changed the title Error in expand-default-features test (among others) fails on stable toolchain Error: expand-default-features test (among others) fail on stable toolchain Jul 11, 2023
@Pro-Ly
Copy link

Pro-Ly commented Sep 25, 2023

hello, I'm confused. Has this issue been solved already? I can't use expand macro in stable channel still.

@luketpeterson
Copy link
Author

I just checked master top. The failure is now different from when this issue was filed.

The test now outputs:

#include <cstdarg>
#include <cstdint>
#include <cstdlib>
#include <ostream>
#include <new>

struct Foo {

};

extern "C" {

WARN: Missing `[defines]` entry for `feature = "extra_headers"` in cbindgen config.
void extra_debug_fn();

void root(Foo a);

} // extern "C"

This may be simply an issue in the test, however. I haven't debugged it further yet.

@Pro-Ly
Copy link

Pro-Ly commented Sep 25, 2023

But in rust-toolchain.toml,channel is still "nightly". If you change to "1.70.0", it will fail to compile.

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