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

Use older github runners for better compatibilities #273

Closed
wants to merge 2 commits into from

Conversation

yamt
Copy link
Contributor

@yamt yamt commented Dec 24, 2022

See the commit messages for relevant errors.

yamt added 2 commits January 6, 2023 18:06
Recently github switched ubuntu-latest to ubuntu 22.04.
https://github.blog/changelog/2022-11-09-github-actions-ubuntu-latest-workflows-will-use-ubuntu-22-04/

as a consequence, wasi-sdk-17.0 binary doesn't work on ubuntu 20.04:

```
5d4353ee0338# ./.wasi-sdk-17.0/bin/clang
./.wasi-sdk-17.0/bin/clang: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./.wasi-sdk-17.0/bin/clang)
./.wasi-sdk-17.0/bin/clang: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./.wasi-sdk-17.0/bin/clang)
./.wasi-sdk-17.0/bin/clang: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by ./.wasi-sdk-17.0/bin/clang)
5d4353ee0338#
```

This commit switches it back to ubuntu 20.04 for now.
According to the following github document,
macos-latest is either macos-11 or macos-12 at this point.

https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources

It's better for us to use a consistent version to build.

This might explain the following error i've seen with wasi-sdk-17.0
release binary on macos-11.0:

```
    Run Build Command(s):/usr/bin/make -f Makefile cmTC_254ef/fast && /Applications/Xcode_13.2.1.app/Contents/Developer/usr/bin/make  -f CMakeFiles/cmTC_254ef.dir/build.make CMakeFiles/cmTC_254ef.dir/build
    Building C object CMakeFiles/cmTC_254ef.dir/testCCompiler.c.obj
    /Users/runner/work/toywasm/toywasm/.wasi-sdk-17.0/bin/clang    -o CMakeFiles/cmTC_254ef.dir/testCCompiler.c.obj -c /Users/runner/work/toywasm/toywasm/build.wasm/CMakeFiles/CMakeScratch/TryCompile-aWXHXM/testCCompiler.c
    dyld: Symbol not found: __ZTTNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE
      Referenced from: /Users/runner/work/toywasm/toywasm/.wasi-sdk-17.0/bin/clang (which was built for Mac OS X 12.0)
      Expected in: /usr/lib/libc++.1.dylib
     in /Users/runner/work/toywasm/toywasm/.wasi-sdk-17.0/bin/clang
    make[1]: *** [CMakeFiles/cmTC_254ef.dir/testCCompiler.c.obj] Abort trap: 6
    make: *** [cmTC_254ef/fast] Error 2
```
@TerrorJack
Copy link
Contributor

For linux: to maximize compatability with older glibc versions, we already have a docker build job that performs the build in an ubuntu bionic container, that artifact should be used when the glibc version error pops up.

For macos: I recommend sticking to macos-latest and explicitly adding -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 to the Makefile when building LLVM. This ensures we can benefit from future system/toolchain updates while retaining some degree of compatability with older versions of macos.

@yamt
Copy link
Contributor Author

yamt commented Jan 10, 2023

For linux: to maximize compatability with older glibc versions, we already have a docker build job that performs the build in an ubuntu bionic container, that artifact should be used when the glibc version error pops up.

will it be a part of assets for the next release?
i'm not entirely sure about the release process.

For macos: I recommend sticking to macos-latest and explicitly adding -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 to the Makefile when building LLVM. This ensures we can benefit from future system/toolchain updates while retaining some degree of compatability with older versions of macos.

while it's reasonable to specify the target version, i feel it's simpler to use a fixed version on the ci.

@yamt
Copy link
Contributor Author

yamt commented Jan 10, 2023

For linux: to maximize compatability with older glibc versions, we already have a docker build job that performs the build in an ubuntu bionic container, that artifact should be used when the glibc version error pops up.

will it be a part of assets for the next release? i'm not entirely sure about the release process.

#284

@TerrorJack
Copy link
Contributor

while it's reasonable to specify the target version, i feel it's simpler to use a fixed version on the ci.

-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 is literally just one line of change, and it doesn't impact other platforms. Staying with macos-latest allows us to benefit from host toolchain updates.

@yamt
Copy link
Contributor Author

yamt commented Jan 10, 2023

Staying with macos-latest allows us to benefit from host toolchain updates.

only when github happens to choose 12.
if you want to use the latest, it's better to use macos-12 than macos-latest.

@TerrorJack
Copy link
Contributor

if you want to use the latest, it's better to use macos-12 than macos-latest.

macos-latest will default to macos-12 per actions/runner-images#6384. The point is not pinning to a fixed version, but latest will be future proof and do not require manual intervention for future updates.

@yamt
Copy link
Contributor Author

yamt commented Jan 10, 2023

if you want to use the latest, it's better to use macos-12 than macos-latest.

macos-latest will default to macos-12 per actions/runner-images#6384. The point is not pinning to a fixed version, but latest will be future proof and do not require manual intervention for future updates.

ok. i understand your point. i don't agree it's a good idea though.

@sbc100
Copy link
Member

sbc100 commented Jan 10, 2023

I think the -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 solution make sense. The purpose of that option is to produce backwards compatible binaries which is exactly what we are wanting to do here.

I don't feel strongly about (also) pinning the version of macos used to do the build, but I don't think we should conflate that with the version we are targeting (that is what MAKE_OSX_DEPLOYMENT_TARGET is for).

@yamt
Copy link
Contributor Author

yamt commented Jan 24, 2023

while i still think it's better to use fixed versions of runners, i'm not too unhappy with the current solutions. (CMAKE_OSX_DEPLOYMENT_TARGET and docker)
let's close this.

@yamt yamt closed this Jan 24, 2023
yamt added a commit to yamt/wasi-sdk that referenced this pull request Mar 15, 2023
Exclude dist-ubuntu-latest to prefer dist-ubuntu-bionic, which is
compatible with wider distributions.
cf.
WebAssembly#273 (comment)
WebAssembly#303
abrown pushed a commit that referenced this pull request Mar 17, 2023
Exclude dist-ubuntu-latest to prefer dist-ubuntu-bionic, which is
compatible with wider distributions.
cf.
#273 (comment)
#303
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.

3 participants