-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Fix most ports not being overrideable with EMCC_LOCAL_PORTS #20042
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
base: main
Are you sure you want to change the base?
Conversation
|
Huh, this actually doesn't seem to work for some reason. Attempting to use multiple ports gives me an error about the cache being locked: |
|
Yes this is not a well documented or tested, or used feature. I wonder if we need to re-think it or remove it? |
|
Can you show the command that generated that error? |
|
Sure. The reason I need this patch is because I'm attempting to package an application with Nix, which does not allow internet access in builds. This seems to be related to dealing with dependencies in local ports, since my other ports seem to build fine and Vorbis immediately fails (which is the only one I'm using that also pulls dependencies as far as I can tell). The entire build log is here: https://gist.github.com/SkyLeite/4da587b439ef13f379fe3f553282e1ed If there's a different way to point Emscripten to vendored ports I'd be happy to pivot to that as well |
|
Fwiw simply removing the |
It should be possible to avoid downloading anything at compile time. Are you using emsd, or some other distribution of emscripten that comes with prebuilt ports? Can you share the command line that you are running than triggers the internet access?
Sadly no there is no way other way today. |
|
Ah yes, it seems that emsdk ships with pre-built system libraries but not with any pre-built ports. One option would be to popular that ports tree ahead of time using |
Not really, unfortunately. Ideally I would leave downloading and managing these dependencies to Nix, as it gives me guarantees that are outside of Emscripten's scope. The current implementation of EMCC_LOCAL_PORTS does seem to work besides the cache locking issue, fortunately, which is more than good enough imo :) |
|
If you are pre-downloading these archive anyway I think you can just place in them in the cache/ports directory and emscripten will not download them (assuming the hashes match). For example: It get access the specific archives with the right hashes you can use embuilder. e.g. |
|
It worked! I took a look at the code and it seems to check for a file export EM_CACHE=$(pwd)/.emscriptencache
mkdir -p $EM_CACHE/ports
OGG_URL="https://github.com/emscripten-ports/ogg/archive/version_1.zip"
mkdir ogg
pushd ogg
echo $OGG_URL > .emscripten_url
wget $OGG_URL
unar $(basename $OGG_URL .zip)
popd |
Fixes #8466