mirror of
https://github.com/roc-lang/roc.git
synced 2024-09-17 13:47:26 +03:00
Merge pull request #6314 from roc-lang/nix-rev-update
update nix revision
This commit is contained in:
commit
4569770c82
@ -9,7 +9,7 @@
|
|||||||
# We use this two-step process because Netlify times out if we try to build the Web REPL there.
|
# We use this two-step process because Netlify times out if we try to build the Web REPL there.
|
||||||
|
|
||||||
# https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/
|
# https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/
|
||||||
set -euxo pipefail
|
set -exo pipefail
|
||||||
|
|
||||||
if ! which wasm-pack
|
if ! which wasm-pack
|
||||||
then
|
then
|
||||||
@ -23,9 +23,22 @@ cd $SCRIPT_RELATIVE_DIR
|
|||||||
mkdir -p build
|
mkdir -p build
|
||||||
rm -rf build/*
|
rm -rf build/*
|
||||||
|
|
||||||
# We want a release build, but with debug info (to get stack traces for Wasm backend panics)
|
# c++abi is not needed for wasm-pack and causes an error, see #6303 for more info
|
||||||
# This configuration is called `--profiling`
|
REMOVE_STR="-C link-arg=-lc++abi"
|
||||||
wasm-pack build --profiling --target web -- --features console_error_panic_hook
|
|
||||||
|
( # start subshell to limit scope of export RUSTFLAGS
|
||||||
|
# Check if RUSTFLAGS contains the string to be removed
|
||||||
|
if [[ $RUSTFLAGS == *"$REMOVE_STR"* ]]; then
|
||||||
|
# Remove the string
|
||||||
|
RUSTFLAGS=$(echo "$RUSTFLAGS" | sed "s/$REMOVE_STR//g")
|
||||||
|
|
||||||
|
export RUSTFLAGS
|
||||||
|
fi
|
||||||
|
|
||||||
|
# We want a release build, but with debug info (to get stack traces for Wasm backend panics)
|
||||||
|
# This configuration is called `--profiling`
|
||||||
|
wasm-pack build --profiling --target web -- --features console_error_panic_hook
|
||||||
|
)
|
||||||
cp -v pkg/roc_repl_wasm.js build
|
cp -v pkg/roc_repl_wasm.js build
|
||||||
|
|
||||||
# To disable optimizations while debugging, do `export REPL_DEBUG=1` before running the script
|
# To disable optimizations while debugging, do `export REPL_DEBUG=1` before running the script
|
||||||
|
@ -59,17 +59,17 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1693140250,
|
"lastModified": 1702900294,
|
||||||
"narHash": "sha256-URyIDETtu1bbxcSl83xp7irEV04dPEgj7O3LjHcD1Sk=",
|
"narHash": "sha256-pt7sSoJYNw3n8YtXw0Z/Nnr6/PfY2YrjDvqboErXnRM=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "676fe5e01b9a41fa14aaa48d87685677664104b1",
|
"rev": "886c9aee6ca9324e127f9c2c4e6f68c2641c8256",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "676fe5e01b9a41fa14aaa48d87685677664104b1",
|
"rev": "886c9aee6ca9324e127f9c2c4e6f68c2641c8256",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
description = "Roc flake";
|
description = "Roc flake";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs?rev=676fe5e01b9a41fa14aaa48d87685677664104b1";
|
nixpkgs.url = "github:nixos/nixpkgs?rev=886c9aee6ca9324e127f9c2c4e6f68c2641c8256";
|
||||||
|
|
||||||
# rust from nixpkgs has some libc problems, this is patched in the rust-overlay
|
# rust from nixpkgs has some libc problems, this is patched in the rust-overlay
|
||||||
rust-overlay = {
|
rust-overlay = {
|
||||||
@ -134,7 +134,9 @@
|
|||||||
shellHook = ''
|
shellHook = ''
|
||||||
export LLVM_SYS_${llvmMajorMinorStr}_PREFIX="${llvmPkgs.llvm.dev}"
|
export LLVM_SYS_${llvmMajorMinorStr}_PREFIX="${llvmPkgs.llvm.dev}"
|
||||||
${aliases}
|
${aliases}
|
||||||
'';
|
'' + pkgs.lib.optionalString (system == "aarch64-darwin") ''
|
||||||
|
export RUSTFLAGS="-C link-arg=-lc++abi"
|
||||||
|
''; # lc++abi as workaround for github.com/NixOS/nixpkgs/issues/166205, see also github.com/roc-lang/roc/issues/6303
|
||||||
};
|
};
|
||||||
|
|
||||||
formatter = pkgs.nixpkgs-fmt;
|
formatter = pkgs.nixpkgs-fmt;
|
||||||
|
Loading…
Reference in New Issue
Block a user