mirror of
https://github.com/roc-lang/roc.git
synced 2024-09-11 10:55:31 +03:00
fixed BUILTINS_HOST_OBJ_PATH not found
This commit is contained in:
parent
0b5b3a8652
commit
d6b62add36
@ -230,7 +230,7 @@ pub fn build_zig_host_native(
|
||||
"build-exe",
|
||||
"-fPIE",
|
||||
shared_lib_path.to_str().unwrap(),
|
||||
bitcode::BUILTINS_HOST_OBJ_PATH,
|
||||
&bitcode::get_builtins_host_obj_path(),
|
||||
]);
|
||||
} else {
|
||||
command.args(&["build-obj", "-fPIC"]);
|
||||
|
@ -187,7 +187,7 @@ pub fn helper(
|
||||
// With the current method all methods are kept and it adds about 100k to all outputs.
|
||||
&[
|
||||
app_o_file.to_str().unwrap(),
|
||||
bitcode::BUILTINS_HOST_OBJ_PATH,
|
||||
&bitcode::get_builtins_host_obj_path(),
|
||||
],
|
||||
LinkType::Dylib,
|
||||
)
|
||||
|
10
default.nix
10
default.nix
@ -9,6 +9,8 @@ let
|
||||
pkgs = import nixpkgs { };
|
||||
rustPlatform = pkgs.rustPlatform;
|
||||
llvmPkgs = pkgs.llvmPackages_13;
|
||||
# nix does not store libs in /usr/lib or /lib
|
||||
nixGlibcPath = if pkgs.stdenv.isLinux then "${pkgs.glibc.out}/lib" else "";
|
||||
in
|
||||
rustPlatform.buildRustPackage {
|
||||
pname = "roc";
|
||||
@ -16,14 +18,12 @@ rustPlatform.buildRustPackage {
|
||||
|
||||
src = pkgs.nix-gitignore.gitignoreSource [] ./.;
|
||||
|
||||
cargoSha256 = "sha256-ZT3lH2P0OnK8XwI89csINXIK+/AhhKVmXDqNGYMy/vk=";
|
||||
cargoSha256 = "sha256-cFzOcU982kANsZjx4YoLQOZSOYN3loj+5zowhWoBWM8=";
|
||||
|
||||
LLVM_SYS_130_PREFIX = "${llvmPkgs.llvm.dev}";
|
||||
|
||||
# required for zig
|
||||
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;
|
||||
|
||||
@ -77,12 +77,10 @@ rustPlatform.buildRustPackage {
|
||||
Security
|
||||
]);
|
||||
|
||||
# mkdir -p $out/lib
|
||||
|
||||
# cp: to copy str.zig,list.zig...
|
||||
# wrapProgram pkgs.stdenv.cc: to make ld available for compiler/build/src/link.rs
|
||||
postInstall = ''
|
||||
cp -r target/x86_64-unknown-linux-gnu/release/lib/. $out/lib
|
||||
wrapProgram $out/bin/roc --prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.stdenv.cc ]}
|
||||
wrapProgram $out/bin/roc --set NIX_GLIBC_PATH ${nixGlibcPath} --prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.stdenv.cc ]}
|
||||
'';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user