-
Notifications
You must be signed in to change notification settings - Fork 581
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
Use setup-emsdk instead of emscripten dockerfile in samples.yml. #18422
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@@ -61,7 +61,6 @@ jobs: | |||
|
|||
web: | |||
runs-on: ubuntu-20.04 | |||
container: gcr.io/iree-oss/emscripten@sha256:2dd4c52f1bb499ab365aad0111fe5538b685d88af38636b409b0cf6a576ab214 | |||
env: | |||
VENV_DIR: ${{ github.workspace }}/.venv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be cleaner to add env variables here in future btw
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trueee... I could simplify the various places this is done, like
iree/.github/workflows/pkgci_test_android.yml
Lines 64 to 69 in 3bdd909
- name: Install build dependencies | |
run: | | |
sudo apt update | |
sudo apt install -y ninja-build | |
echo "CC=clang" >> $GITHUB_ENV | |
echo "CXX=clang++" >> $GITHUB_ENV |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we prefer one over the other? Most workflows I've looked in seem to follow https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#defining-environment-variables-for-a-single-workflow and not https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#setting-an-environment-variable but I don't know what we should prefer.
# Emscripten writes into its cache location (outside of the CMake build | ||
# directory). | ||
# We can either | ||
# (A) Grant broad write permissions to the cache directory to be able to run | ||
# our scripts under different users. | ||
# (B) Mount a user home directory when using the image. | ||
# Since (A) requires less configuration, we'll do that. If multiple tools would | ||
# want a user directory (like Bazel), we should switch to (B). | ||
# See https://github.com/emscripten-core/emsdk/issues/535 | ||
RUN mkdir -p "${EM_CACHE}" && chmod -R 777 "${EM_CACHE}" | ||
|
||
# Normally we'd run `source emsdk_env.sh`, but that doesn't integrate with | ||
# Docker's environment properties model. Instead, we directly extend the path | ||
# to include the directories suggested by `emsdk activate`. | ||
ENV PATH="${EMSDK}:${EMSDK}/upstream/emscripten:$PATH" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good riddance to these hacks 🥳
Follow-up to #18422 (comment) and #18421 (comment). This style is more compact, but it does remove some context that could be useful - that the CC/CXX environment variables are for the build toolchain and are related to CMake and Ninja. The 'runtime' workflow is cross platform and also sets this conditionally: https://github.com/iree-org/iree/blob/1124be8025995b64804e9f02b62a0354b25dfb2b/.github/workflows/ci.yml#L112-L124 See https://github.com/iree-org/iree-template-runtime-cmake/blob/main/.github/workflows/build-and-test.yml for a more comprehensive example where we also branch on gcc and clang in the same matrix.
…e-org#18422) Also delete the now unused `emscripten.Dockerfile` (it's technically still referenced in a commented out `cross_compile_and_test` build, but that can be added back as needed using this same technique). Progress on iree-org#15332 - one less Dockerfile to maintain. Tested here: https://github.com/ScottTodd/iree/actions/runs/10691087132/job/29636852886 (this samples.yml workflow runs on a nightly schedule). skip-ci: no impact on other workflows
…org#18425) Follow-up to iree-org#18422 (comment) and iree-org#18421 (comment). This style is more compact, but it does remove some context that could be useful - that the CC/CXX environment variables are for the build toolchain and are related to CMake and Ninja. The 'runtime' workflow is cross platform and also sets this conditionally: https://github.com/iree-org/iree/blob/1124be8025995b64804e9f02b62a0354b25dfb2b/.github/workflows/ci.yml#L112-L124 See https://github.com/iree-org/iree-template-runtime-cmake/blob/main/.github/workflows/build-and-test.yml for a more comprehensive example where we also branch on gcc and clang in the same matrix.
…e-org#18422) Also delete the now unused `emscripten.Dockerfile` (it's technically still referenced in a commented out `cross_compile_and_test` build, but that can be added back as needed using this same technique). Progress on iree-org#15332 - one less Dockerfile to maintain. Tested here: https://github.com/ScottTodd/iree/actions/runs/10691087132/job/29636852886 (this samples.yml workflow runs on a nightly schedule). skip-ci: no impact on other workflows
…org#18425) Follow-up to iree-org#18422 (comment) and iree-org#18421 (comment). This style is more compact, but it does remove some context that could be useful - that the CC/CXX environment variables are for the build toolchain and are related to CMake and Ninja. The 'runtime' workflow is cross platform and also sets this conditionally: https://github.com/iree-org/iree/blob/1124be8025995b64804e9f02b62a0354b25dfb2b/.github/workflows/ci.yml#L112-L124 See https://github.com/iree-org/iree-template-runtime-cmake/blob/main/.github/workflows/build-and-test.yml for a more comprehensive example where we also branch on gcc and clang in the same matrix.
Also delete the now unused
emscripten.Dockerfile
(it's technically still referenced in a commented outcross_compile_and_test
build, but that can be added back as needed using this same technique).Progress on #15332 - one less Dockerfile to maintain.
Tested here: https://github.com/ScottTodd/iree/actions/runs/10691087132/job/29636852886 (this samples.yml workflow runs on a nightly schedule).
skip-ci: no impact on other workflows