emscripten-core/emsdk

emsdk activate breaks things

mmertama opened this issue · 1 comments

emsdk.py clears EM_CONFIG

and therefore it is tried written to into emsdk folder
$ export EM_CONFIG=~/.emscripten
$ emsdk activate latest
Resolving SDK alias 'latest' to '3.1.59'
Resolving SDK version '3.1.59' to 'sdk-releases-e20ee09a8a740544c4bc6de5d4ba5f81f74b74d6-64bit'
Setting the following tools as active:
node-16.20.0-64bit
releases-e20ee09a8a740544c4bc6de5d4ba5f81f74b74d6-64bit

Traceback (most recent call last):
File "/opt/src/emsdk/emsdk.py", line 3114, in
sys.exit(main(sys.argv[1:]))
File "/opt/src/emsdk/emsdk.py", line 3048, in main
active_tools = set_active_tools(tools_to_activate, permanently_activate=arg_permanent, system=arg_system)
File "/opt/src/emsdk/emsdk.py", line 2412, in set_active_tools
generate_em_config(tools_to_activate, permanently_activate, system)
File "/opt/src/emsdk/emsdk.py", line 1540, in generate_em_config
with open(EM_CONFIG_PATH, "w") as text_file:
PermissionError: [Errno 13] Permission denied: '/opt/src/emsdk/.emscripten'
markusmertama@37c7131e029c:~$

Whaat! I have to grant write access to whole emsdk folder due this design flaw

emsdk activate does indeed write a config file to the emsdk directory. That is by design. Indeed, the whole point of emsdk it to download stuff and write it to the emsdk directory. emsdk install, for example, writes many many files to the emsdk directory.

emsdk does not support running in a mode where the emsdk directory itself is read only. It absolutely expects to be able to write to its own directory.