We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Apparently cargo recently gained the ability to build Rust's standard library: https://doc.rust-lang.org/cargo/reference/unstable.html#build-std this command replaces xargo.
I just tried this locally, it's just a matter of updating rustc and cargo:
diff --git a/nix/default.nix b/nix/default.nix index 7588024a..4f33d260 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -41,7 +41,7 @@ let # Rust nightly (self: super: let moz_overlay = import self.sources.nixpkgs-mozilla self super; - rust-channel = moz_overlay.rustChannelOf { date = "2020-07-22"; channel = "nightly"; }; + rust-channel = moz_overlay.rustChannelOf { date = "2020-12-29"; channel = "nightly"; }; in rec { rustc-nightly = rust-channel.rust.override { targets = [ "wasm32-unknown-unknown" "wasm32-unknown-emscripten" ];
and updating the Makefile:
diff --git a/rts/Makefile b/rts/Makefile index c23f3fdf..7d980bbd 100644 --- a/rts/Makefile +++ b/rts/Makefile @@ -164,7 +164,7 @@ _build/wasm/libmotoko_rts.a: | _build/wasm # NB. codegen-units=1 is to make debugging easier, not strictly # necessary cd motoko-rts && \ - xargo -v rustc --target=wasm32-unknown-emscripten --release -- \ + cargo -v rustc -Zbuild-std=core --target=wasm32-unknown-emscripten --release -- \ -Crelocation-model=pic -Ccodegen-units=1 cp motoko-rts/target/wasm32-unknown-emscripten/release/libmotoko_rts.a $@
However I couldn't make this work in nix-shell and nix-build. There's always some dependency issue, and other errors that I don't understand.
When I try locally outside of nix-shell I can build the release RTS and link it, but the final linker command fails when producing debug RTS:
wasm-ld -o mo-rts-debug.wasm \ --import-memory --shared --no-entry --gc-sections \ --export=__wasm_call_ctors \ --export=memcpy \ --export=memcmp \ --whole-archive \ _build/wasm/libmotoko_rts_debug.a _build/wasm/rts_debug.o ... wasm-ld: error: motoko_rts-a73c3d27a1126524.3lq75tfopvybv06x.rcgu.o: Bad relocation type: make: *** [Makefile:200: mo-rts-debug.wasm] Error 1
I don't know if this is a cargo/rustc bug or me using the command incorrectly.
The text was updated successfully, but these errors were encountered:
This is implemented with #2761, closing.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Apparently cargo recently gained the ability to build Rust's standard library: https://doc.rust-lang.org/cargo/reference/unstable.html#build-std this command replaces xargo.
I just tried this locally, it's just a matter of updating rustc and cargo:
and updating the Makefile:
However I couldn't make this work in nix-shell and nix-build. There's always some dependency issue, and other errors that I don't understand.
When I try locally outside of nix-shell I can build the release RTS and link it, but the final linker command fails when producing debug RTS:
I don't know if this is a cargo/rustc bug or me using the command incorrectly.
The text was updated successfully, but these errors were encountered: