Open ericoporto opened 10 months ago
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.
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.
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.
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.
The .emscripten
file in the emsdk directory is created for you by the emsdk activate
command, for example emsdk 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 .emscripten
file in your emscripten checkout. You can use ./emcc --generate-config
to 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.
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.
Your solution looks good. The EM_CONFIG
environment is most important thing which tells emcc where to find its dependencies.
The EMSCRIPTEN
environment variable is not used by emscripten itself these days.
Hi,
I think the documentation here in the readme has unfortunately aged: https://github.com/emscripten-core/emsdk#how-do-i-use-my-own-emscripten-github-fork-with-the-sdk
I tried to instead just cd
upstream/emscripten
asemscripten/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 torm -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
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! 😆