mirror of
https://github.com/roc-lang/roc.git
synced 2024-08-16 06:10:44 +03:00
nix-build works
This commit is contained in:
parent
b791729046
commit
11fd062a86
@ -351,6 +351,11 @@ pub fn root_dir() -> PathBuf {
|
||||
path.pop();
|
||||
path.pop();
|
||||
|
||||
// running cargo with --target will put us in the target dir
|
||||
if path.ends_with("target") {
|
||||
path.pop();
|
||||
}
|
||||
|
||||
path
|
||||
}
|
||||
|
||||
|
10
default.nix
10
default.nix
@ -16,7 +16,7 @@ rustPlatform.buildRustPackage {
|
||||
|
||||
src = pkgs.nix-gitignore.gitignoreSource [] ./.;
|
||||
|
||||
cargoSha256 = "sha256-oSi9UIom3YowgfR1U4c6her3SsfeV//t6Dy3eOQaW9o=";
|
||||
cargoSha256 = "sha256-ey1zHqiFhGNgjQLC6ATEH6i7RcuXJGcijGMcv9amn0w=";
|
||||
|
||||
LLVM_SYS_130_PREFIX = "${llvmPkgs.llvm.dev}";
|
||||
|
||||
@ -37,12 +37,18 @@ rustPlatform.buildRustPackage {
|
||||
'';
|
||||
|
||||
# required for zig
|
||||
XDG_CACHE_HOME = "/build/xdgcache";
|
||||
XDG_CACHE_HOME = "xdg_cache"; # prevents zig AccessDenied error github.com/ziglang/zig/issues/6810
|
||||
# nix does not store libs in /usr/lib or /lib
|
||||
NIX_GLIBC_PATH = if pkgs.stdenv.isLinux then "${pkgs.glibc.out}/lib" else "";
|
||||
# want to see backtrace in case of failure
|
||||
RUST_BACKTRACE = 1;
|
||||
|
||||
# skip running rust tests, problems:
|
||||
# building of example platforms requires network: Could not resolve host
|
||||
# zig AccessDenied error github.com/ziglang/zig/issues/6810
|
||||
# Once instance has previously been poisoned ??
|
||||
doCheck = false;
|
||||
|
||||
nativeBuildInputs = (with pkgs; [
|
||||
cmake
|
||||
git
|
||||
|
@ -5,3 +5,4 @@ components = [
|
||||
# for usages of rust-analyzer or similar tools inside `nix develop`
|
||||
"rust-src"
|
||||
]
|
||||
targets = [ "x86_64-unknown-linux-gnu" ]
|
Loading…
Reference in New Issue
Block a user