-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
HELP error: unknown --json
option future-incompat
#1097
Comments
Which rustc and cargo version are you using? You can see this with |
$ rustc -V --verbose
rustc 1.61.0-nightly (63b8f01bb 2022-03-24)
binary: rustc
commit-hash: 63b8f01bb5ca277e7df8d7efe094ed4244c1790c
commit-date: 2022-03-24
host: x86_64-apple-darwin
release: 1.61.0-nightly
LLVM version: 14.0.0
$ cargo -V --verbose
cargo 1.61.0-nightly (109bfbd05 2022-03-17)
release: 1.61.0-nightly
commit-hash: 109bfbd055325ef87a6e7f63d67da7e838f8300b
commit-date: 2022-03-17
host: x86_64-apple-darwin
libgit2: 1.4.2 (sys:0.14.2 vendored)
libcurl: 7.77.0 (sys:0.4.51+curl-7.80.0 system ssl:(SecureTransport) LibreSSL/2.8.3)
os: Mac OS 12.2.1 [64-bit]
$ rustup -V
rustup 1.24.3 (ce5817a94 2021-05-31)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.61.0-nightly (63b8f01bb 2022-03-24)`
|
What is the exact command you are using to build it? |
just follow the tutorial, use |
$ cargo build --target x86_64-blog_os.json
Compiling compiler_builtins v0.1.70
Compiling core v0.0.0 (/Users/xunjunjie/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core)
error: unknown `--json` option `future-incompat`
error: unknown `--json` option `future-incompat`
error: could not compile `compiler_builtins`
warning: build failed, waiting for other jobs to finish...
error: build failed
|
|
$ cat target/.rustc_info.json
{
"rustc_fingerprint":10704764349668684348,
"outputs":{
"931469667778813386":{
"success":true,
"status":"",
"code":0,
"stdout":"___\nlib___.rlib\nlib___.dylib\nlib___.dylib\nlib___.a\nlib___.dylib\n/Users/xunjunjie/.rustup/toolchains/nightly-x86_64-apple-darwin\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_family=\"unix\"\ntarget_feature=\"cmpxchg16b\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"llvm14-builtins-abi\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_feature=\"sse3\"\ntarget_feature=\"ssse3\"\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store=\"128\"\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"macos\"\ntarget_pointer_width=\"64\"\ntarget_thread_local\ntarget_vendor=\"apple\"\nunix\n",
"stderr":""
},
"1412545348552125361":{
"success":false,
"status":"exit status: 1",
"code":1,
"stdout":"",
"stderr":"error: `-Csplit-debuginfo` is unstable on this platform\n\n"
},
"1825251703565484386":{
"success":true,
"status":"",
"code":0,
"stdout":"___\nlib___.rlib\nlib___.a\n/Users/xunjunjie/.rustup/toolchains/nightly-x86_64-apple-darwin\ndebug_assertions\npanic=\"abort\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_feature=\"llvm14-builtins-abi\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"none\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\n",
"stderr":"warning: dropping unsupported crate type `dylib` for target `x86_64-blog_os-14647065019002254224`\n\nwarning: dropping unsupported crate type `cdylib` for target `x86_64-blog_os-14647065019002254224`\n\nwarning: dropping unsupported crate type `proc-macro` for target `x86_64-blog_os-14647065019002254224`\n\nwarning: 3 warnings emitted\n\n"
},
"17598535894874457435":{
"success":true,
"status":"",
"code":0,
"stdout":"rustc 1.61.0-nightly (63b8f01bb 2022-03-24)\nbinary: rustc\ncommit-hash: 63b8f01bb5ca277e7df8d7efe094ed4244c1790c\ncommit-date: 2022-03-24\nhost: x86_64-apple-darwin\nrelease: 1.61.0-nightly\nLLVM version: 14.0.0\n",
"stderr":""
},
"2797684049618456168":{
"success":true,
"status":"",
"code":0,
"stdout":"___\nlib___.rlib\nlib___.dylib\nlib___.dylib\nlib___.a\nlib___.dylib\n",
"stderr":""
}
},
"successes":{
}
}
|
😕 |
How's that...Please help |
I have no clue what the issue is unfortunately. |
It's a regrettable, but still thank you for your REPLY! |
I just try to use the origin repo post-02 and follow the $ rustup update nightly --force
info: syncing channel updates for 'nightly-x86_64-apple-darwin'
nightly-x86_64-apple-darwin unchanged - rustc 1.61.0-nightly (d53246fed 2022-03-25)
info: checking for self-updates
$ cargo build
Compiling compiler_builtins v0.1.53
Compiling core v0.0.0 (/Users/xunjunjie/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core)
error: unknown `--json` option `future-incompat`
error: unknown `--json` option `future-incompat`
error: could not compile `compiler_builtins`
warning: build failed, waiting for other jobs to finish...
error: build failed
$ cargo install bootimage
Updating `ustc` index
error: failed to update replaced source registry `crates-io`
Caused by:
failed to fetch `git://mirrors.ustc.edu.cn/crates.io-index`
Caused by:
process didn't exit successfully: `git fetch --force --update-head-ok 'git://mirrors.ustc.edu.cn/crates.io-index' '+HEAD:refs/remotes/origin/HEAD'` (exit status: 128)
--- stderr
fatal: read error: Connection reset by peer
$ cargo bootimage
WARNING: `CARGO_MANIFEST_DIR` env variable not set
Building kernel
Compiling compiler_builtins v0.1.53
Compiling core v0.0.0 (/Users/xunjunjie/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core)
error: unknown `--json` option `future-incompat`
error: unknown `--json` option `future-incompat`
error: could not compile `core`
warning: build failed, waiting for other jobs to finish...
error: build failed
Error: Kernel build failed.
Stderr:
I felt like I was going to surrender It's too much of a blow to self-confidence The point is that the code from yesterday's second lesson still ran successfully |
@kaixinbaba Could you try running |
@phil-opp Thank you for REPLY! $ cargo b -vv
Compiling compiler_builtins v0.1.70
Compiling core v0.0.0 (/Users/xunjunjie/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core)
Running `CARGO=/usr/local/bin/cargo CARGO_CRATE_NAME=build_script_build
CARGO_MANIFEST_DIR=/Users/xunjunjie/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/compiler_builtins-0.1.70
CARGO_PKG_AUTHORS='Jorge Aparicio <japaricious@gmail.com>'
CARGO_PKG_DESCRIPTION='Compiler intrinsics used by the Rust compiler. Also available for other targets
if necessary'\!'
'
CARGO_PKG_HOMEPAGE='https://github.com/rust-lang/compiler-builtins'
CARGO_PKG_LICENSE=MIT/Apache-2.0 CARGO_PKG_LICENSE_FILE=''
CARGO_PKG_NAME=compiler_builtins
CARGO_PKG_REPOSITORY='https://github.com/rust-lang/compiler-builtins'
CARGO_PKG_VERSION=0.1.70
CARGO_PKG_VERSION_MAJOR=0
CARGO_PKG_VERSION_MINOR=1
CARGO_PKG_VERSION_PATCH=70
CARGO_PKG_VERSION_PRE=''
DYLD_FALLBACK_LIBRARY_PATH='/Users/xunjunjie/IdeaProjects/RustHome/blog_os/target/debug/deps:/Users/xunjunjie/.rustup/toolchains/nightly-x86_64-apple-darwin/lib:/Users/xunjunjie/lib:/usr/local/lib:/usr/lib'
RUSTC_BOOTSTRAP=1 rustc --crate-name build_script_build /Users/xunjunjie/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/compiler_builtins-0.1.70/build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 --cfg 'feature="compiler-builtins"' --cfg 'feature="core"' --cfg 'feature="default"' --cfg 'feature="mem"' --cfg 'feature="rustc-dep-of-std"' -C metadata=c7a24f5a423a70c0 -C extra-filename=-c7a24f5a423a70c0 --out-dir /Users/xunjunjie/IdeaProjects/RustHome/blog_os/target/debug/build/compiler_builtins-c7a24f5a423a70c0 -Z force-unstable-if-unmarked -L dependency=/Users/xunjunjie/IdeaProjects/RustHome/blog_os/target/debug/deps --cap-lints warn`
Running `CARGO=/usr/local/bin/cargo
CARGO_CRATE_NAME=core
CARGO_MANIFEST_DIR=/Users/xunjunjie/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core
CARGO_PKG_AUTHORS='' CARGO_PKG_DESCRIPTION='The Rust Core Library'
CARGO_PKG_HOMEPAGE=''
CARGO_PKG_LICENSE='MIT OR Apache-2.0'
CARGO_PKG_LICENSE_FILE=''
CARGO_PKG_NAME=core
CARGO_PKG_REPOSITORY='https://github.com/rust-lang/rust.git'
CARGO_PKG_VERSION=0.0.0
CARGO_PKG_VERSION_MAJOR=0
CARGO_PKG_VERSION_MINOR=0
CARGO_PKG_VERSION_PATCH=0
CARGO_PKG_VERSION_PRE=''
DYLD_FALLBACK_LIBRARY_PATH='/Users/xunjunjie/IdeaProjects/RustHome/blog_os/target/debug/deps:/Users/xunjunjie/.rustup/toolchains/nightly-x86_64-apple-darwin/lib:/Users/xunjunjie/lib:/usr/local/lib:/usr/lib'
RUSTC_BOOTSTRAP=1 rustc --crate-name core --edition=2021 /Users/xunjunjie/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=dea57f7448780fea -C extra-filename=-dea57f7448780fea --out-dir /Users/xunjunjie/IdeaProjects/RustHome/blog_os/target/x86_64-blog_os/debug/deps --target /Users/xunjunjie/IdeaProjects/RustHome/blog_os/x86_64-blog_os.json -Z force-unstable-if-unmarked -L dependency=/Users/xunjunjie/IdeaProjects/RustHome/blog_os/target/x86_64-blog_os/debug/deps -L dependency=/Users/xunjunjie/IdeaProjects/RustHome/blog_os/target/debug/deps --cap-lints warn`
error: unknown `--json` option `future-incompat`
error: unknown `--json` option `future-incompat`
error: could not compile `core`
Caused by:
process didn't exit successfully: `CARGO=/usr/local/bin/cargo
CARGO_CRATE_NAME=core
CARGO_MANIFEST_DIR=/Users/xunjunjie/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core CARGO_PKG_AUTHORS=''
CARGO_PKG_DESCRIPTION='The Rust Core Library'
CARGO_PKG_HOMEPAGE=''
CARGO_PKG_LICENSE='MIT OR Apache-2.0'
CARGO_PKG_LICENSE_FILE=''
CARGO_PKG_NAME=core
CARGO_PKG_REPOSITORY='https://github.com/rust-lang/rust.git'
CARGO_PKG_VERSION=0.0.0
CARGO_PKG_VERSION_MAJOR=0
CARGO_PKG_VERSION_MINOR=0
CARGO_PKG_VERSION_PATCH=0
CARGO_PKG_VERSION_PRE=''
DYLD_FALLBACK_LIBRARY_PATH='/Users/xunjunjie/IdeaProjects/RustHome/blog_os/target/debug/deps:/Users/xunjunjie/.rustup/toolchains/nightly-x86_64-apple-darwin/lib:/Users/xunjunjie/lib:/usr/local/lib:/usr/lib' RUSTC_BOOTSTRAP=1 rustc --crate-name core --edition=2021 /Users/xunjunjie/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=dea57f7448780fea -C extra-filename=-dea57f7448780fea --out-dir /Users/xunjunjie/IdeaProjects/RustHome/blog_os/target/x86_64-blog_os/debug/deps --target /Users/xunjunjie/IdeaProjects/RustHome/blog_os/x86_64-blog_os.json -Z force-unstable-if-unmarked -L dependency=/Users/xunjunjie/IdeaProjects/RustHome/blog_os/target/x86_64-blog_os/debug/deps -L dependency=/Users/xunjunjie/IdeaProjects/RustHome/blog_os/target/debug/deps --cap-lints warn` (exit status: 1)
warning: build failed, waiting for other jobs to finish...
error: build failed
|
Thanks! Could you try running the first rustc --crate-name core --edition=2021 /Users/xunjunjie/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=dea57f7448780fea -C extra-filename=-dea57f7448780fea --out-dir /Users/xunjunjie/IdeaProjects/RustHome/blog_os/target/x86_64-blog_os/debug/deps --target /Users/xunjunjie/IdeaProjects/RustHome/blog_os/x86_64-blog_os.json -Z force-unstable-if-unmarked -L dependency=/Users/xunjunjie/IdeaProjects/RustHome/blog_os/target/x86_64-blog_os/debug/deps -L dependency=/Users/xunjunjie/IdeaProjects/RustHome/blog_os/target/debug/deps --cap-lints warn If it still throws the "unknown --json option" error, then try running |
It return {"artifact":"/Users/xunjunjie/IdeaProjects/RustHome/blog_os/target/x86_64-blog_os/debug/deps/core-dea57f7448780fea.d","emit":"dep-info"}
{"artifact":"/Users/xunjunjie/IdeaProjects/RustHome/blog_os/target/x86_64-blog_os/debug/deps/libcore-dea57f7448780fea.rmeta","emit":"metadata"}
{"artifact":"/Users/xunjunjie/IdeaProjects/RustHome/blog_os/target/x86_64-blog_os/debug/deps/libcore-dea57f7448780fea.rlib","emit":"link"}
|
And I try another rustc --crate-name build_script_build /Users/xunjunjie/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/compiler_builtins-0.1.70/build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 --cfg 'feature="compiler-builtins"' --cfg 'feature="core"' --cfg 'feature="default"' --cfg 'feature="mem"' --cfg 'feature="rustc-dep-of-std"' -C metadata=c7a24f5a423a70c0 -C extra-filename=-c7a24f5a423a70c0 --out-dir /Users/xunjunjie/IdeaProjects/RustHome/blog_os/target/debug/build/compiler_builtins-c7a24f5a423a70c0 -Z force-unstable-if-unmarked -L dependency=/Users/xunjunjie/IdeaProjects/RustHome/blog_os/target/debug/deps --cap-lints warn and it return {"artifact":"/Users/xunjunjie/IdeaProjects/RustHome/blog_os/target/debug/build/compiler_builtins-c7a24f5a423a70c0/build_script_build-c7a24f5a423a70c0.d","emit":"dep-info"}
{"artifact":"/Users/xunjunjie/IdeaProjects/RustHome/blog_os/target/debug/build/compiler_builtins-c7a24f5a423a70c0/build_script_build-c7a24f5a423a70c0","emit":"link"} What's these two mean? Ask for guidance |
The output shows that the Could you try running |
The output is RUSTFLAGS="--version --verbose" cargo build
error: output of --print=file-names has changed in the compiler, cannot parse
command was: `rustc - --crate-name ___ --print=file-names --version --verbose --target /Users/xunjunjie/IdeaProjects/RustHome/blog_os/x86_64-blog_os.json --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg`
--- stdout
rustc 1.61.0-nightly (d53246fed 2022-03-25)
binary: rustc
commit-hash: d53246fedde4c193eae8a003546a8f0f9f85d223
commit-date: 2022-03-25
host: x86_64-apple-darwin
release: 1.61.0-nightly
LLVM version: 14.0.0 |
I'm not familiar with the way Rustup works on MacOS. On Linux and Windows, it would usually install binaries in your home directory (in ~/.cargo). From the output above, however, it seems like cargo is being invoked from /usr/local/bin. Do you have any other versions of Rust installed, e.g. through Homebrew? Maybe that's causing the weird behavior. |
$ whereis cargo
# there is noting output
$ which cargo
/usr/local/bin/cargo
$ cargo -V
cargo 1.61.0-nightly (109bfbd05 2022-03-17)
$ cargo build
Compiling compiler_builtins v0.1.70
Compiling core v0.0.0 (/Users/xunjunjie/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core)
error: unknown `--json` option `future-incompat`
error: unknown `--json` option `future-incompat` Then I try to use $HOME/.cargo/bin/cargo $ ~/.cargo/bin/cargo build
Compiling compiler_builtins v0.1.70
Compiling core v0.0.0 (/Users/xunjunjie/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core)
Compiling bootloader v0.9.21
Compiling rustc-std-workspace-core v1.99.0 (/Users/xunjunjie/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/rustc-std-workspace-core)
Compiling blog_os v0.1.0 (/Users/xunjunjie/IdeaProjects/RustHome/blog_os)
Finished dev [unoptimized + debuginfo] target(s) in 14.90s AMAZING! $ cargo build
Compiling compiler_builtins v0.1.70
Compiling core v0.0.0 (/Users/xunjunjie/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core)
Compiling bootloader v0.9.21
Compiling rustc-std-workspace-core v1.99.0 (/Users/xunjunjie/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/rustc-std-workspace-core)
Compiling blog_os v0.1.0 (/Users/xunjunjie/IdeaProjects/RustHome/blog_os)
Finished dev [unoptimized + debuginfo] target(s) in 15.15s I think this issue resolved! THANK YOU! |
When I start study
VGA Text Mode
and add dependency forvolatile
, My project start got error like thisEven if I delete the
volatile
dependency, or even delete the entire project and start all over again, it will not return to normal, and my project can successfully print characters inpemu
before thevolatile
event follows the tutorialPlease HELP~
My
.cargo/config.toml
in projectMy
main.rs
My Cargo.toml
my json
What confuse me the most was the
error: unknown '--json' option 'future-incompat'
this error, which I had never seen before and did not get much help from searchingMy computer is Macbook Pro
Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_X86_64
macOS Monterey 12.21
By the way,
A Freestanding Rust Binary
This chapter is consistent with the tutorial and the correct outputThe text was updated successfully, but these errors were encountered: