You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add documentation on how to use local emscripten #1291
I tried to instead just cd upstream/emscripten as emscripten/main dir doesn't exist, but that didn't work either, because that will instead switch the remote of the emsdk local git repo as whole. My hack so far has been to rm -rf emscripten && ln -s ../../emscripten (this surprisingly works in git-bash on windows!), which has my outer clone of emscripten.
There is an issue that I don't know how to install emsdk and activate it, with my fork and branch, without getting
error: BINARYEN_ROOT is set to empty value C:\Users\user\git\emsdk\upstream\emscripten\.emscripten
I don't know what is the right approach but I guess there is a process everyone here uses - it's just everyone is so used they forgot to document! 😆
I guess the docs that are here are supposed to mysteriously explain this in some other way, but find . -iname ".emscripten" comes up empty in the emsdk directory after clone or after ./emsdk install tot do all it's things... I have no idea what this file is or how it's supposed to work. The environment variable thing also doesn't work as it's apparently supposed to point to a dir that contains this mysterious file.
The .emscripten file in the emsdk directory is created by ./emsdk activate tot (which should be done after ./emsdk install tot). Once you have don't that setting EM_CONFIG=/path/to/emsdk/.emscripten should work.
I don't understand this yet, I don't want to pass a "path/to/emsdk", I want to pass a path to emscripten! My local emscripten doesn't have that dot emscripten file, no matter what I do.
(but like, it's Sunday, I am ok getting a better answer during the week :p)
I don't understand this yet, I don't want to pass a "path/to/emsdk", I want to pass a path to emscripten! My local emscripten doesn't have that dot emscripten file, no matter what I do.
(but like, it's Sunday, I am ok getting a better answer during the week :p)
The .emscripten file in emsdk is the one you want. You don't need to have in your emscripten checkout.
To use your emscripten just make sure it comes first in the PATH. Then you run emcc it will find your local checkout in the PATH.. and then EM_CONFIG will tell your checkout of emscripten where to find other things like llvm and binaryen.
In other words the .emscripten file in the emsdk works for any/all versions of emscripten. It doesn't say where emscripten lives.. only where the dependencies live.
I had this question as well. I want to figure out why DWARF was not correctly generated. So I want to git clone the emscripten-core repository and debug. Briefly, I want:
Use myown fork of emscripten-core, of some version(3.1.43)
Keep other dependencies(those prebuilt binaries) by default, once they're suitable for 3.1.43.
What I tried:
emsdk install tot. This install all things as latest. Not what I want.
emsdk install sdk-main-64bit. This install all things as source, such as LLVM source. Also not what I want. I don't have to compile LLVM.
emsdk install 3.1.43 install all for me, but it keeps <emsdk>/upstream/emscripten an unzipped stuff, not git.
Here is my final solution:
emsdk install 3.1.43 then emsdk activate 3.1.43
This install and activate the prebuilt dependencies.
./emsdk_env
This makes the dependencies available.
Set environment variable EMSCRIPTEN = <path-to-my-emscripten-fork>.
This might be optional. My project use this env var to locate emscripten CMake toolchain.
Set environment variable EM_CONFIG = <path-to-emsdk>/.emscripten.
I don't know why this is required, but I have to do this.
Activity
ericoporto commentedon Oct 21, 2023
I guess the docs that are here are supposed to mysteriously explain this in some other way, but
find . -iname ".emscripten"comes up empty in the emsdk directory after clone or after./emsdk install totdo all it's things... I have no idea what this file is or how it's supposed to work. The environment variable thing also doesn't work as it's apparently supposed to point to a dir that contains this mysterious file.sbc100 commentedon Oct 22, 2023
The
.emscriptenfile in the emsdk directory is created by./emsdk activate tot(which should be done after./emsdk install tot). Once you have don't that settingEM_CONFIG=/path/to/emsdk/.emscriptenshould work.As for the docs at https://github.com/emscripten-core/emsdk#how-do-i-use-my-own-emscripten-github-fork-with-the-sdk, I agree they are perhpas out-of-date or confusing. They are referring to how using a custom branch in the "build-from-source" scenario which is different way to use emsdk. Most folks don't use that method so we should probably either remove or update the question.
ericoporto commentedon Oct 22, 2023
I don't understand this yet, I don't want to pass a "
path/to/emsdk", I want to pass a path to emscripten! My local emscripten doesn't have that dot emscripten file, no matter what I do.(but like, it's Sunday, I am ok getting a better answer during the week :p)
sbc100 commentedon Oct 23, 2023
The
.emscriptenfile in emsdk is the one you want. You don't need to have in your emscripten checkout.To use your emscripten just make sure it comes first in the PATH. Then you run
emccit will find your local checkout in the PATH.. and thenEM_CONFIGwill tell your checkout of emscripten where to find other things like llvm and binaryen.sbc100 commentedon Oct 23, 2023
In other words the
.emscriptenfile in theemsdkworks for any/all versions of emscripten. It doesn't say where emscripten lives.. only where the dependencies live.ericoporto commentedon Oct 23, 2023
Sorry, what are supposed the contents of this file? I think it's not being created. I am on Windows. I would like to create it by hand.
sbc100 commentedon Oct 23, 2023
The
.emscriptenfile in the emsdk directory is created for you by theemsdk activatecommand, for exampleemsdk activate latest.If you don't want to use emsdk and you want to build your own dependencies for some reason you can create a
.emscriptenfile in your emscripten checkout. You can use./emcc --generate-configto have emscripten create a dummy config file for you. See https://emscripten.org/docs/building_from_source/configuring_emscripten_settings.html#configuring-emscripten-settings-when-manually-building-from-source for more on that.However, I would strongly recommend using emsdk since that avoids build the dependencies yourself.
shrinktofit commentedon Dec 23, 2023
I had this question as well. I want to figure out why DWARF was not correctly generated. So I want to git clone the emscripten-core repository and debug. Briefly, I want:
Use myown fork of emscripten-core, of some version(
3.1.43)Keep other dependencies(those prebuilt binaries) by default, once they're suitable for
3.1.43.What I tried:
emsdk install tot. This install all things as latest. Not what I want.emsdk install sdk-main-64bit. This install all things as source, such as LLVM source. Also not what I want. I don't have to compile LLVM.emsdk install 3.1.43install all for me, but it keeps<emsdk>/upstream/emscriptenan unzipped stuff, not git.Here is my final solution:
emsdk install 3.1.43thenemsdk activate 3.1.43This install and activate the prebuilt dependencies.
./emsdk_envThis makes the dependencies available.
EMSCRIPTEN = <path-to-my-emscripten-fork>.This might be optional. My project use this env var to locate emscripten CMake toolchain.
EM_CONFIG = <path-to-emsdk>/.emscripten.I don't know why this is required, but I have to do this.
sbc100 commentedon Jan 2, 2024
Your solution looks good. The
EM_CONFIGenvironment is most important thing which tells emcc where to find its dependencies.The
EMSCRIPTENenvironment variable is not used by emscripten itself these days.