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

Copy Dispatch and Clang from upstream toolchain #719

Merged
merged 7 commits into from
May 7, 2020

Conversation

MaxDesiatov
Copy link

@MaxDesiatov MaxDesiatov commented Apr 19, 2020

Resolve #713. This should copy modulemaps and headers and shouldn't overwrite any wasm libraries. clang binaries are now longer copied from the upstream snapshot instead of wasi-sdk, as the latter can't builf for host architectures (at least on Linux).

@MaxDesiatov MaxDesiatov changed the title Copy Dispatch from the upstream toolchain Copy libraries from the upstream toolchain Apr 27, 2020
@MaxDesiatov MaxDesiatov changed the title Copy libraries from the upstream toolchain Copy libraries from the upstream toolchain for Linux Apr 27, 2020
@MaxDesiatov MaxDesiatov marked this pull request as ready for review April 27, 2020 20:36
@MaxDesiatov MaxDesiatov requested review from kateinoigakukun and removed request for kateinoigakukun April 27, 2020 20:37
@MaxDesiatov MaxDesiatov marked this pull request as draft April 28, 2020 13:23
@MaxDesiatov MaxDesiatov changed the title Copy libraries from the upstream toolchain for Linux Copy libraries, fix clang from wasi-sdk on Linux Apr 28, 2020
@MaxDesiatov MaxDesiatov changed the title Copy libraries, fix clang from wasi-sdk on Linux Copy Dispatch and Clang from upstream toolchain May 3, 2020
@MaxDesiatov
Copy link
Author

It finally works! 🎉 I've got the last artifact package in the swiftwasm-action Docker image, which now allows us to get working SwiftWasm GitHub Actions!

@MaxDesiatov MaxDesiatov marked this pull request as ready for review May 6, 2020 11:21
@@ -73,7 +74,7 @@ sed -i -e "s@\".*/include@\"../../../../share/wasi-sysroot/include@g" $TMP_DIR/$
# Copy nightly-toolchain's host environment stdlib into toolchain

if [[ "$(uname)" == "Linux" ]]; then
cp -r $NIGHTLY_TOOLCHAIN/usr/lib/swift/linux $TMP_DIR/$TOOLCHAIN_NAME/usr/lib/swift
cp -a $NIGHTLY_TOOLCHAIN/usr/lib/* $TMP_DIR/$TOOLCHAIN_NAME/usr/lib || true
Copy link
Member

@kateinoigakukun kateinoigakukun May 6, 2020

Choose a reason for hiding this comment

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

I'm not sure why need || true 🤔 Could you explain more?

Copy link
Author

Choose a reason for hiding this comment

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

There's a single file that fails to get copied, related to clang I think. It doesn't cause problems as far as I understand, and it's a pain to test and to exclude just a single file. I can add a comment about that in the script. Not sure I'll be able to get the exact file name quickly, seems like GitHub erased logs for the previous actions in this PR (maybe because of the force push?), and I don't have access to powerful hardware to re-run builds quickly from scratch.

Copy link
Member

@kateinoigakukun kateinoigakukun May 6, 2020

Choose a reason for hiding this comment

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

OK, I'll try it on my local linux machine 👍

Copy link
Member

Choose a reason for hiding this comment

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

I got the error. It seems that our toolchain's lib/swift/clang is a directory but nightly toolchain's one is a symlink.

cp: cannot overwrite directory '/tmp/tmp.wtHPlnPXwh/swift-wasm-DEVELOPMENT-SNAPSHOT-2020-05-06-a/usr/lib/swift/clang' with non-directory

So I added clang-resource-dir-symlink component to install to create that symlink

utils/webassembly/build-toolchain.sh Outdated Show resolved Hide resolved
@kateinoigakukun
Copy link
Member

@MaxDesiatov Could you check the latest toolchain with my commit work well on the docker image?

@MaxDesiatov
Copy link
Author

Will do, thanks for the updates!

@MaxDesiatov MaxDesiatov merged commit bad3e04 into swiftwasm May 7, 2020
@MaxDesiatov MaxDesiatov deleted the maxd/upstream-dispatch branch May 7, 2020 09:35
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.

SwiftPM doesn't work in the Linux build
2 participants