-
Notifications
You must be signed in to change notification settings - Fork 338
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
Add rust targets #900
Add rust targets #900
Conversation
Usage example together with Godot https://github.com/ulrikstrid/dodge-the-creeps-nix-rust |
src/modules/languages/rust.nix
Outdated
(rustPackages.combine | ||
( | ||
(map (c: config.languages.rust.toolchain.${c}) cfg.components) ++ | ||
(map (t: rustPackages.targets.${t}.latest.rust-std) cfg.targets) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Would you always want the nightly channel here? Should this use the channel specified in the config instead?
- Is the standard library the only component you would ever want to include for a given target?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- You are correct, we probably want whatever is supplied by the user.
- I'm still new to rust, but as I understand it std is what you compile against and the other things in the toolchain should run on your own computer and should therefore be your arch.
Please correct me if I'm wrong.
We'd want to not commit |
The whole second commit can and probably should be dropped |
Would be great to have tests for #866 |
@ulrikstrid do you plan to finish this one? |
61a8af4
to
3690ef1
Compare
@domenkozar I have some time right now so I'll try to get it in shape today |
3690ef1
to
0b1eb28
Compare
examples/rust/devenv.yaml
Outdated
@@ -4,3 +4,5 @@ inputs: | |||
inputs: | |||
nixpkgs: | |||
follows: nixpkgs | |||
devenv: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs to be removed, you can use devenv-run-tests
and it will automatically do the overriding
examples/rust/devenv.nix
Outdated
@@ -14,7 +16,9 @@ | |||
# clippy.enable = true; | |||
#}; | |||
|
|||
packages = lib.optionals pkgs.stdenv.isDarwin (with pkgs.darwin.apple_sdk; [ | |||
packages = [ | |||
pkgs.wasm-pack |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we include that only of wasm32-
target is set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm actually moving the example to rust-wasm-cross
currently
examples/rust/.test.sh
Outdated
@@ -13,4 +13,5 @@ fi | |||
echo "$PATH" | grep -- "$CARGO_INSTALL_ROOT/bin" | |||
|
|||
cd app | |||
cargo run | |||
# cargo run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to uncomment?
4890da9
to
ecb9b22
Compare
|
eaeac1b
to
40f434d
Compare
Interesting, my macOS machine refuses to build the wasm example unless Error log
|
Looks like rust-lang/rust#122333 |
Adds
targets
as a list of strings of additional targets, as an example you can now easily addwasm32-unknown-unknown
to build for wasm.