Skip to content

Copy Dispatch and Clang from upstream toolchain #719

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

Merged
merged 7 commits into from
May 7, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions utils/webassembly/build-toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ cd $TMP_DIR/$TOOLCHAIN_NAME

# Merge wasi-sdk and toolchain
cp -r $WASI_SDK_PATH/lib/clang usr/lib
cp $WASI_SDK_PATH/bin/* usr/bin
cp -a $SOURCE_PATH/build/Ninja-ReleaseAssert/llvm-*/bin/clang* usr/bin
cp -a $WASI_SDK_PATH/bin/*ld usr/bin
cp -r $WASI_SDK_PATH/share/wasi-sysroot usr/share

# Build SwiftPM and install it into toolchain
Expand All @@ -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

else
cp -r $NIGHTLY_TOOLCHAIN/usr/lib/swift/macosx $TMP_DIR/$TOOLCHAIN_NAME/usr/lib/swift
fi
Expand Down