Skip to content

Avoid exporting EM_CONFIG for modern SDK versions #1110

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

Merged
merged 1 commit into from
Oct 6, 2022
Merged

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Sep 20, 2022

Newer versions of emscipten, starting all the way back in 1.39.13, can automatically locate the .emscripten config file that emsdk creates so there is no need for the explicit EM_CONFIG environment variable. Its redundant and adds unnessary noisce/complexity.

Really, adding emcc to the PATH is all the is needed these days.

One nice thing about this change is that it allows folks to run whichever emcc they want to and have it just work, even if they have
configured emsdk. Without this change, if I activate emsdk and I run
some/other/emcc then emsdk's EM_CONFIG will still be present and
override the configuration embedded in some/other/emcc.

e.g. in the same shell, with emsdk activated, I can run both these commands and have them both just work as expected.

$ emcc --version
$ /path/to/my/emcc --version

Without this change the second command gets confused because it tries to use the emsdk's EM_CONFIG.

@sbc100 sbc100 requested review from kripken, juj and dschuff September 20, 2022 17:59
@dschuff
Copy link
Member

dschuff commented Sep 20, 2022

It looks like emsdk leaves .emscripten in the top-level emsdk dir (i.e. above upstream/emscripten) but I thought emcc looks for .emscripten in the emscripten/ directory next to emcc itself. Does it automatically just look in the directories above emscripten/ too?

@sbc100
Copy link
Collaborator Author

sbc100 commented Sep 20, 2022

It looks like emsdk leaves .emscripten in the top-level emsdk dir (i.e. above upstream/emscripten) but I thought emcc looks for .emscripten in the emscripten/ directory next to emcc itself. Does it automatically just look in the directories above emscripten/ too?

Yes, thats what emscripten-core/emscripten#10935 does. This PR is the ultimate followup to the old PR.

@dschuff
Copy link
Member

dschuff commented Sep 20, 2022

Ah yeah if embedded has been the default for 2 years then this makes sense, I think it's definitely a nicer model for most use cases.

@dschuff
Copy link
Member

dschuff commented Sep 20, 2022

with this mode, there's really no longer any need for emsdk_env anymore is there? Since all the paths go in the config file, and the config file is located relative to emcc?

@sbc100
Copy link
Collaborator Author

sbc100 commented Sep 20, 2022

with this mode, there's really no longer any need for emsdk_env anymore is there? Since all the paths go in the config file, and the config file is located relative to emcc?

The think the main job of emcc_env is really to put a working compiler (emcc) on the PATH, so I think we will always need it to do that.. and that is almost all it does after this change.

Newer versions of emscipten, starting all the way back in 1.39.13, can
automatically locate the `.emscripten` config file that emsdk creates so
there is no need for the explicit EM_CONFIG environment variable.  Its
redundant and adds unnessary noisce/complexity.

Really, adding emcc to the PATH is all the is needed these days.

One nice thing about this change is that it allows folks to run
whichever emcc they want to and have it just work, even if they have
configured emsdk.   Without this change, if I activate emsdk and I run
`some/other/emcc` then emsdk's `EM_CONFIG` will still be present and
override the configuration embedded in `some/other/emcc`.

e.g. in the same shell, with emsdk activated, I can run both these
commands and have them both just work as expected.

```
$ emcc --version
$ /path/to/my/emcc --version
```
@sbc100
Copy link
Collaborator Author

sbc100 commented Oct 6, 2022

Can I get an LGTM on this?

@sbc100 sbc100 merged commit 3d87d5e into main Oct 6, 2022
@sbc100 sbc100 deleted the remove_em_config branch October 6, 2022 21:13
sbc100 added a commit to emscripten-core/emscripten that referenced this pull request Oct 7, 2022
Since emscripten-core/emsdk#1110 landed emsdk
no longer set `EM_CONFIG` so we need to do that (in order to make our
local version of emscripten use the config from emsdk).
sbc100 added a commit to emscripten-core/emscripten that referenced this pull request Oct 7, 2022
Since emscripten-core/emsdk#1110 landed emsdk
no longer set `EM_CONFIG` so we need to do that (in order to make our
local version of emscripten use the config from emsdk).
sbc100 added a commit to emscripten-core/emscripten that referenced this pull request Oct 7, 2022
Since emscripten-core/emsdk#1110 landed emsdk
no longer set `EM_CONFIG` so we need to do that (in order to make our
local version of emscripten use the config from emsdk).
sbc100 added a commit to emscripten-core/emscripten that referenced this pull request Oct 7, 2022
Since emscripten-core/emsdk#1110 landed emsdk
no longer set `EM_CONFIG` so we need to do that (in order to make our
local version of emscripten use the config from emsdk).
sbc100 added a commit to emscripten-core/emscripten that referenced this pull request Oct 7, 2022
Since emscripten-core/emsdk#1110 landed emsdk
no longer set `EM_CONFIG` so we need to do that (in order to make our
local version of emscripten use the config from emsdk).
sbc100 added a commit to emscripten-core/emscripten that referenced this pull request Oct 7, 2022
Since emscripten-core/emsdk#1110 landed emsdk
no longer set `EM_CONFIG` so we need to do that (in order to make our
local version of emscripten use the config from emsdk).
lewing referenced this pull request in dotnet/emsdk Feb 7, 2023
* [bazel] Set CLOSURE_COMPILER to workaround RBE+symlinks issue (#1037)

* [bazel] Set CLOSURE_COMPILER to workaround RBE+symlinks issue

* space

* specify node_js

* 3.1.10 (#1046)

* Optimize sandbox performance (#1045)

* Optimize sandbox performance

Link just the files needed to compile, link, or archive, rather than the entire directory tree. This drastically improves build times on macOS, where the sandbox is known to be slow (bazelbuild/bazel#8230).

* Linux wants clang to link

* all_files not needed?

* Linux wants llc

* And llvm-ar

* Templated build_file_content

* include node modules glob with linker files. also some minor formatting fixes. (#1052)

* Using bazelisk on macOS CI (#1049)

* Explicit outputs for wasm_cc_binary (#1047)

* Explicit outputs for wasm_cc_binary

* Backwards compatibility

* data_runfiles restore

* restore test_bazel.sh

* Using wrong path on accident

* two separate rules for legacy support

* Added name attribute to wasm_cc_binary rule

* 3.1.11 (#1053)

* 3.1.12 (#1054)

* 3.1.13 (#1055)

* [bazel] Add additional files necessary for building with closure and on RBE (#1057)

* 3.1.14 (#1061)

* 3.1.15 (#1066)

* Pin `latest` to a specific version for arm64-linux (#1065)

Fixes: #1040

* 3.1.16 (#1071)

* 3.1.17 (#1076)

* Exclude msys from path fix function. (#1078)

Fixes: #911

* 3.1.18 (#1081)

* 3.1.18

* Update LLVM include path in Bazel files

* Version 3.1.18-2 (#1083)

3.1.18 had a bad release binary on ARM64 Mac so push an updated version of the release.

* 3.1.19 (#1090)

* Add EMSDK_QUIET to make emsdk_env less chatting (#1091)

Without this the recommended way to silence emsdk_env was to pipe its
stderr to /dev/null.. but then you also loose potentially useful error
message.

Fixes: #946

* 3.1.20 (#1095)

* Add double-quotes to allow spaces in path (#1097)

* 3.1.21 (#1101)

* Update latest-arm64-linux to 3.1.21 (#1102)

* Update XCode version on CircleCI (#1103)

12.2 is being deprecated

* 3.1.22 (#1107)

* 3.1.23 (#1111)

* Avoid exporting EM_CONFIG for modern SDK versions (#1110)

Newer versions of emscipten, starting all the way back in 1.39.13, can
automatically locate the `.emscripten` config file that emsdk creates so
there is no need for the explicit EM_CONFIG environment variable.  Its
redundant and adds unnessary noisce/complexity.

Really, adding emcc to the PATH is all the is needed these days.

One nice thing about this change is that it allows folks to run
whichever emcc they want to and have it just work, even if they have
configured emsdk.   Without this change, if I activate emsdk and I run
`some/other/emcc` then emsdk's `EM_CONFIG` will still be present and
override the configuration embedded in `some/other/emcc`.

e.g. in the same shell, with emsdk activated, I can run both these
commands and have them both just work as expected.

```
$ emcc --version
$ /path/to/my/emcc --version
```

* Use x64 version for Windows on Arm (#1115)

* 3.1.24 (#1122)

* 3.1.25 (#1130)

* [bazel] Switch to platforms-based toolchain resolution (#1036)

* remove "name" attribute from bazel rules (#1131)

* 3.1.26 (#1134)

* Update remote_docker version in CircleCI config (#1117)

20.10.17 is the current default.

* docker image: Change base to Ubuntu 22.04 LTS (jammy) (#1135)

Done to upgrade from CMake 3.16.3 to 3.22.1. CMake 3.21 or newer is needed to build the Qt 6.4.1 sources with emscripten.

Also update to libidn12 to resolve an "Unable to locate package libidn11" error.

* 3.1.27 (#1139)

* Use constants for fixed paths. NFC (#1140)

* Add standalone_wasm feature to bazel emscripten_toolchain (#1145)

* 3.1.28 (#1149)

* Upgrade to rules_nodejs 5.8.0 (#1150)

Fixes emscripten-core#1020

* 3.1.29 (#1160)

* Pin Windows CI to Bazel 5.4.0 (#1163)

* Remove reference to fastcomp-latest. NFC (#1164)

fastcomp can only be install using explicit versions names so this name
doesn't work.

* Remove fastcomp SDK and fastcomp build rules. NFC (#1165)

Folks that want to work with fastcomp will now need to use an older
checkout of emsdk.

* 3.1.30 (#1167)

* Bump emscripten to 3.1.30

* Bump clang version

* Do not include test directory

* Update eng/emsdk.proj

Co-authored-by: Alexander Köplinger <[email protected]>

---------

Co-authored-by: Kevin Lubick <[email protected]>
Co-authored-by: Sam Clegg <[email protected]>
Co-authored-by: John Firebaugh <[email protected]>
Co-authored-by: walkingeyerobot <[email protected]>
Co-authored-by: Ezekiel Warren <[email protected]>
Co-authored-by: Heejin Ahn <[email protected]>
Co-authored-by: Tim Ebbeke <[email protected]>
Co-authored-by: Derek Schuff <[email protected]>
Co-authored-by: Joel Van Eenwyk <[email protected]>
Co-authored-by: Pierrick Bouvier <[email protected]>
Co-authored-by: Trevor Hickey <[email protected]>
Co-authored-by: Fredrik Orderud <[email protected]>
Co-authored-by: Robbert van Ginkel <[email protected]>
Co-authored-by: Alexander Köplinger <[email protected]>
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

Successfully merging this pull request may close these issues.

2 participants