Emscripten tries to write to /nix

I would like to use a nix shell environment to compile a project that needs emscripten. I have added the emscripten package to it.
I am trying to execute em++ but it fails to build a cache in the /nix directory.
Read-only file system: '/nix/store/<hash>-emscripten-2.0.27/share/emscripten/cache/ports

Is this a bug in the package itself? I guess it should be build in a way that would make it write that cache somewhere else.
Or am I doing something wrong?

1 Like

It seems like it is intended behavior of the package itself, especially when it is being used in building other packages. However the current behavior does not work for interactive shell usage.
See the attached issue for more info and a workaround for development usage:

1 Like

Thank you, I was also trying to use emscripten from the command line nix-shell -p emscripten

  • I got the same error OSError: [Errno 30] Read-only file system: for the emscripten cache
  • your quick fix still works for emscripten 3.1.45