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

Validate installed emsdk version #2256

Merged
merged 4 commits into from
Jun 15, 2023
Merged

Conversation

tomjakubowski
Copy link
Contributor

@tomjakubowski tomjakubowski commented Jun 13, 2023

Feature

It's easy to forget to upgrade Emscripten when perspective updates, and your penalty if you forget is you might see weird build errors. Update run_emsdk.js to additionally check the version with emsdk activate

  • Breaking feature
  • Non-breaking feature

Changelog

  • Add a new script with_emsdk.sh, call it from run_emsdk.js

Testing

  • Try changing emscripten version in package.json, then run: scripts/run_emsdk.js echo hello world

Copy link
Member

@texodus texodus left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! This is a good idea. The CI build failed with a curious error which needs to be fixed first.

Historically, Perspective does not use .sh scripts because we supported building on Windows. We don't currently test this anywhere that requires emsdk, but maybe worth just moving this logic into JavaScript section as it is currently the solo .sh in the repo, since it doesn't work on CI anyway :)

This ensures that the version installed on a developer's clone
matches what's in package.json

may want to catch the error + add some instructions to fix the
problem
The build error you get when emsdk has drifted out of date looks like:

    error: error: tool is not installed and therefore cannot be activated: 'releases-adedc0750c4a89b65bee866edab24298cb8d6677-64bit'
    Command failed: cd /Users/tom/perspective/perspective/.emsdk && . ./emsdk_env.sh >/dev/null 2>&1 && emsdk activate 3.1.36 >/dev/null && cd /Users/tom/perspective/perspective/cpp/perspective && node ./build.js

The resolution to this now is to run `node scripts/install_emsdk.js`.
Previously it wouldn't install the current emsdk version unless the
developer first rm-rfed .emsdk

It's also still cheap to run the script when the current version is
already installed.
Copy link
Member

@texodus texodus left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Looks good!

One potential issue I have not tested:

  1. User has old emsdk installed.
  2. Upgrades Perspective repo to a version that needs a newer emsdk.
  3. activate doesn't work because upgraded version is not installed yet.

... though the emsdk error on trying to activate this version should be descriptive enough.

@texodus texodus merged commit 0dd3111 into finos:master Jun 15, 2023
@texodus texodus added the internal Internal refactoring and code quality improvement label Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Internal refactoring and code quality improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants