Skip to content

Commit d84315d

Browse files
author
fidgetingbits
committed
fix EM_CACHE problem in the flake instead
1 parent 64bd743 commit d84315d

File tree

2 files changed

+14
-29
lines changed

2 files changed

+14
-29
lines changed

Diff for: README.md

-24
Original file line numberDiff line numberDiff line change
@@ -63,35 +63,11 @@ When working with WSL, the host vscode instance connects to a vscode server on t
6363

6464
There is a `.envrc` file included to trigger the flake usage.
6565

66-
As of 2023-09 emscripten seems to have some issues related to caching folder on
67-
Nix. After running the `yarn` command you will see something like this:
68-
69-
```
70-
$ yarn add -D tree-sitter-nix
71-
[SNIPPED]
72-
OSError: [Errno 30] Read-only file system: '/nix/store/ykh9rm7z5mr248hsc408zr1csh6ss0vz-emscripten-3.1.42/share/emscripten/cache/symbol_lists.lock'
73-
make: *** [Makefile:63: vendor/web-tree-sitter/0.20.4/README.md] Error 1
74-
error Command failed with exit code 2.
75-
```
76-
77-
In order to work around that error you will have to run the commands included below. Note the `/nix/store/` path comes from the error above.
78-
79-
```bash
80-
$ cp -R /nix/store/ykh9rm7z5mr248hsc408zr1csh6ss0vz-emscripten-3.1.42/share/emscripten/cache/ ~/.emscripten_cache
81-
$ chmod u+rwX -R ~/.emscripten_cache
82-
$ export EM_CACHE=~/.emscripten_cache
83-
$ yarn add -D ...
84-
```
85-
86-
See https://github.com/NixOS/nixpkgs/issues/139943 for background on this
87-
issue.
88-
8966
In order to run `yarn compile` it will attempt to run `npx tree-sitter` which
9067
will fail. You can use `steam-run` instead:
9168

9269
`steam-run yarn compile`
9370

94-
9571
### Updating `web-tree-sitter`
9672

9773
We build a custom version of `web-tree-sitter` to ensure that we can always use the latest version and fix any problems as they come up.

Diff for: flake.nix

+14-5
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,19 @@
1818
});
1919
in
2020
{
21-
devShells = forEachSupportedSystem ({ pkgs }: {
22-
default = pkgs.mkShell {
23-
packages = with pkgs; [ node2nix nodejs pnpm yarn emscripten python310 steam-run];
24-
};
25-
});
21+
devShells = forEachSupportedSystem
22+
({ pkgs }: {
23+
default = pkgs.mkShell
24+
{
25+
packages = with pkgs; [ node2nix nodejs pnpm yarn emscripten python310 steam-run ];
26+
# shellHook = ''
27+
# if [ ! -d $(pwd)/.emscripten_cache ]; then
28+
# cp -R ${pkgs.emscripten}/share/emscripten/cache/ $(pwd)/.emscripten_cache
29+
# chmod u+rwX -R $(pwd)/.emscripten_cache
30+
# export EM_CACHE=$(pwd)/.emscripten_cache
31+
# fi
32+
# '';
33+
};
34+
});
2635
};
2736
}

0 commit comments

Comments
 (0)