Fix default setting of EXECUTABLE overriding the value set in phase_linker_setup() for autoconfiguring.#26822
Conversation
…inker_setup() for autoconfiguring.
|
So how does autoconf run the program if the resulting program has no #! line? |
| # linker setup phase may have initialized the EXECUTABLE setting already, so only init default here | ||
| # if not yet set. | ||
| if not settings.EXECUTABLE: | ||
| default_setting('EXECUTABLE', 1) |
There was a problem hiding this comment.
I wonder if we should instead move the EMMAKEN_JUST_CONFIGURE block ~100 lines down so it comes after this?
If not maybe at least make this in to single if statement.
| # making the resulting file exectuable. | ||
| if settings.ENVIRONMENT_MAY_BE_NODE and options.oformat == OFormat.JS and final_suffix in {'', '.out'}: | ||
| default_setting('EXECUTABLE', 1) | ||
| # linker setup phase may have initialized the EXECUTABLE setting already, so only init default here |
There was a problem hiding this comment.
This code is still part of phase_linker_setup (i know, its huge).
How about autoconf handling above may have initialized the EXECUTABLE ..
|
It is not a case of the resulting program not having a #! line, but it is a case of the program having a line When autoconfiguring, the code did first force EXECUTABLE to an absolute path to node, but that logic gets overridden by the later |
Fix default setting of EXECUTABLE overriding the value set in phase_linker_setup() for autoconfiguring.
This line has no effect:
emscripten/tools/link.py
Lines 829 to 830 in 2a8234f
since it was being overridden by
default_setting('EXECUTABLE', 1), which looks only inuser_settings, and not if the setting has already been initialized.The result is that all autoconfigures would get the default shebang
emscripten/tools/link.py
Lines 460 to 462 in 2a8234f
and attempt to run Node from PATH.
On my CI, I don't have a Node in PATH (exactly for the purposes of guarding against accidental 'wrong node' accesses like this). Fixes
test_bullet_autoconfwithout Node in PATH: http://clbri.com:8010/api/v2/logs/406907/raw_inline