Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emsdk activate breaks things #1380

Open
mmertama opened this issue May 8, 2024 · 1 comment
Open

emsdk activate breaks things #1380

mmertama opened this issue May 8, 2024 · 1 comment

Comments

@mmertama
Copy link

mmertama commented May 8, 2024

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

@sbc100
Copy link
Collaborator

sbc100 commented May 8, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants