Skip to content
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

Skip installing optional npm deps, but manually install Closure Compiler native package #630

Merged
merged 2 commits into from
Oct 6, 2020

Conversation

curiousdannii
Copy link
Contributor

@sbc100
Copy link
Collaborator

sbc100 commented Oct 5, 2020

Having this much logic in the post-install phase of emsdk makes me a little sad. But at the same time it does save a significant amount of space so we need to fix it somehow.

cwd=directory, stderr=subprocess.STDOUT, env=env,
universal_newlines=True)
except subprocess.CalledProcessError as e:
print('Error running %s:\n%s' % (e.cmd, e.output))
return False

# Manually install the appropriate native Closure Compiler package
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you leave a longer comment here about what this is needed?

Can you mention the upstream closure bug that bloats the native package: google/closure-compiler-npm#186

And also mention that its only need because we use npm ci (which seems to install all optional dependencies) as opposed to npm install which does the right thing and installs just the current platform one :(

I'm hoping we might be able to revert this if they fix either or both of these issues.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How's this look?

Add detailed comment, referring to npm/cli#558 and google/closure-compiler-npm#186
@sbc100 sbc100 merged commit 47b7f85 into emscripten-core:master Oct 6, 2020
@curiousdannii curiousdannii deleted the patch-1 branch October 6, 2020 03:17
@ebeasant-arm
Copy link

ebeasant-arm commented Oct 6, 2020

Unfortunately, google-closure-compiler-linux is a platform specific package, for x86: this change breaks any from-source built platform that isn't x86:

emsdk build:
Installing SDK 'sdk-upstream-master-64bit'..
Installing tool 'llvm-git-master-64bit'..
Fetching latest changes to the branch 'master' for '/usr/local/emsdk/llvm/git/src'...
Successfully updated and checked out branch 'master' on repository '/usr/local/emsdk/llvm/git/src'
Current repository version: "Tue, 6 Oct 2020 03:41:19 -0700 315970de1d7140fa689dbbe7482620f134e5d021"
Running CMake: ['cmake', '-G', 'Unix Makefiles', '-DCMAKE_BUILD_TYPE=Release', '-DPYTHON_EXECUTABLE=/usr/bin/python3', '-DLLVM_TARGETS_TO_BUILD=WebAssembly;AArch64', '-DLLVM_INCLUDE_EXAMPLES=OFF', '-DCLANG_INCLUDE_EXAMPLES=OFF', '-DLLVM_INCLUDE_TESTS=OFF', '-DCLANG_INCLUDE_TESTS=OFF', '-DLLVM_ENABLE_ASSERTIONS=OFF', '-DLLVM_ENABLE_PROJECTS="clang;clang;lld;lld"', '/usr/local/emsdk/llvm/git/src/llvm']
Performing a parallel build with 31 cores.
Running build: ['cmake', '--build', '.', '--', '-j31']
Done installing tool 'llvm-git-master-64bit'.
Skipped installing node-12.18.1-64bit, already installed.
Installing tool 'emscripten-master-64bit'..
Fetching latest changes to the branch 'master' for '/usr/local/emsdk/emscripten/master'...
Successfully updated and checked out branch 'master' on repository '/usr/local/emsdk/emscripten/master'
Current repository version: "Mon, 5 Oct 2020 19:25:05 -0700 a1cbde2"
Running post-install step: npm ci ...
Running post-install step: npm install google-closure-compiler-linux
Error running ['/usr/local/emsdk/node/12.18.1_64bit/bin/npm', 'install', 'google-closure-compiler-linux']:
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for google-closure-compiler-linux@20200927.0.0: wanted {"os":"linux","arch":"x64,x86"} (current: {"os":"linux","arch":"arm64"})
npm ERR! notsup Valid OS: linux
npm ERR! notsup Valid Arch: x64,x86
npm ERR! notsup Actual OS: linux
npm ERR! notsup Actual Arch: arm64

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-10-06T11_47_21_672Z-debug.log

Installation failed!

Package Test:
npm -g install google-closure-compiler-linux
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for google-closure-compiler-linux@20200927.0.0: wanted {"os":"linux","arch":"x64,x86"} (current: {"os":"linux","arch":"arm64"})
npm ERR! notsup Valid OS: linux
npm ERR! notsup Valid Arch: x64,x86
npm ERR! notsup Actual OS: linux
npm ERR! notsup Actual Arch: arm64

npm ERR! A complete log of this run can be found in:
npm ERR! /home/edwbea01/.npm/_logs/2020-10-06T13_25_50_266Z-debug.log

kripken added a commit that referenced this pull request Oct 6, 2020
…re Compiler native package (#630)"

This reverts commit 47b7f85.
kripken added a commit that referenced this pull request Oct 6, 2020
…re Compiler native package (#630)" (#633)

This reverts commit 47b7f85.

Fixes #632
curiousdannii added a commit to curiousdannii/emsdk that referenced this pull request Oct 8, 2020
sbc100 pushed a commit that referenced this pull request Oct 9, 2020
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.

Don't install optional npm dependencies?
3 participants