Skip to content

Commit

Permalink
🐛 Fix Rust cross-compilation
Browse files Browse the repository at this point in the history
This is done by using our own fork of the Rust overlay.
Issue reported here: oxalica/rust-overlay#59
  • Loading branch information
abbec authored and sakarias88 committed Nov 24, 2021
1 parent 80ddbb5 commit c975fe8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions languages/rust/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ let
safeAttrs = builtins.removeAttrs attrs [ "extraChecks" "testFeatures" "buildFeatures" "srcExclude" "shellInputs" "docs" ];

# cross compiling
ccForBuild = "${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}cc";
cxxForBuild = "${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}c++";
ccForBuild = "${buildPackages.stdenv.cc.targetPrefix}cc";
cxxForBuild = "${buildPackages.stdenv.cc.targetPrefix}c++";
linkerForBuild = ccForBuild;

ccForHost = "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc";
cxxForHost = "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++";
ccForHost = "${stdenv.cc.targetPrefix}cc";
cxxForHost = "${stdenv.cc.targetPrefix}c++";
# after https://github.com/rust-lang/rust/commit/6615ee89be2290c96aa7d4ab24dc94e23a8c7080
# `--as-needed` is wrongfully added to wasm-ld even though it isn't a GNU linker
# workaround it by removing the argument before passing along
Expand Down
10 changes: 5 additions & 5 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"rust": {
"branch": "master",
"branch": "temp-fix-issue-59",
"description": "Pure and reproducible nix overlay for binary distributed rust toolchains",
"homepage": "",
"owner": "oxalica",
"owner": "goodbyekansas",
"repo": "rust-overlay",
"rev": "85733f85cd860760e3ed536b6e8a6ed0cd1ebde4",
"sha256": "04z8a1jhly6sfjn7hxsylvjlb73pslsd36bg0spzhnjdkw97268b",
"rev": "6d7d67b9a5417651a3835d0d6a39c3512ac3b008",
"sha256": "1sjkqc8qa13w2172w1gv7hyz61fjm893p8agfm0i0b9npycpq34p",
"type": "tarball",
"url": "https://github.com/oxalica/rust-overlay/archive/85733f85cd860760e3ed536b6e8a6ed0cd1ebde4.tar.gz",
"url": "https://github.com/goodbyekansas/rust-overlay/archive/6d7d67b9a5417651a3835d0d6a39c3512ac3b008.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
}

0 comments on commit c975fe8

Please sign in to comment.