-
Notifications
You must be signed in to change notification settings - Fork 24
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
Added wasi-sdk flow #307
Added wasi-sdk flow #307
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! Have you been able to use it yet in the wasi runtime build?
not yet. Once this will be merged I will do changes in wasi runtime build |
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.
the changes which are also in patch need to be removed from the PR, right ?
I checked with other patches and they were applied to the code that is why I didn't remove from PR. Also if I remove these changes , I didn't find code which will apply the patch before running on CI. Maybe @directhex or @akoeplinger will know? |
eng/azure-pipelines.yml
Outdated
inputs: | ||
targetPath: 'artifacts/bin' | ||
artifactName: Artifacts_Wasi_Threading | ||
condition: and(succeeded(), ne(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) |
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.
condition: and(succeeded(), ne(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) | |
condition: and(succeeded(), ne(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) |
eng/icu.proj
Outdated
</ReadLinesFromFile> | ||
|
||
<PropertyGroup> | ||
<WASI_SDK_PATH>$(RepoRoot)\artifacts</WASI_SDK_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.
Is this needed here? What is using it?
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.
Removed, was not used.
eng/icu.proj
Outdated
<WASI_SDK_PATH>$(RepoRoot)\artifacts</WASI_SDK_PATH> | ||
<WasiLocalPath>$(RepoRoot)\artifacts</WasiLocalPath> | ||
<WasiSdkVersion>%(_VersionLines.Identity)</WasiSdkVersion> | ||
<WasiSdkUrl>https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-$(WasiSdkVersion)/wasi-sdk-$(WasiSdkVersion).0-linux.tar.gz</WasiSdkUrl> |
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.
Condition for OS here too. And we can use <Error
if the url is not set, eg. on windows.
eng/icu.proj
Outdated
<WasiLocalPath>$(RepoRoot)\artifacts</WasiLocalPath> | ||
<WasiSdkVersion>%(_VersionLines.Identity)</WasiSdkVersion> | ||
<WasiSdkUrl>https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-$(WasiSdkVersion)/wasi-sdk-$(WasiSdkVersion).0-linux.tar.gz</WasiSdkUrl> |
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.
These properties are only for private use, so prepend _
to the names like _WasiLocalPath
.
eng/icu.proj
Outdated
<WasiSdkUrl Condition="$([MSBuild]::IsOSPlatform('OSX'))" >https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-$(WasiSdkVersion)/wasi-sdk-$(WasiSdkVersion).0-macos.tar.gz</WasiSdkUrl> | ||
</PropertyGroup> | ||
|
||
<Exec Command="rm -rf wasi-sdk-*/ wasi-sdk/ && curl -L -o- $(WasiSdkUrl) | tar -xvz && mv wasi-sdk-$(WasiSdkVersion).*/ wasi-sdk/" |
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.
This won't show any errors with downloading the tarball. Add --fail -S
to the curl
command.
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.
I guess we could do the same improvements on runtime repo
eng/icu.wasi.mk
Outdated
CFLAGS="-Oz -fno-exceptions -Wno-sign-compare $(THREADS_FLAG) $(ICU_DEFINES)" \ | ||
CXXFLAGS="-Oz -fno-exceptions -Wno-sign-compare $(THREADS_FLAG) $(ICU_DEFINES)" \ | ||
CC="$(WASI_SDK_PATH)/bin/clang --sysroot=$(WASI_SDK_PATH)/share/wasi-sysroot" \ | ||
CXX="$(WASI_SDK_PATH)/bin/clang++ --sysroot=$(WASI_SDK_PATH)/share/wasi-sysroot" \ | ||
--host=$(HOST_PLATFORM) --build=wasm32 |
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.
spaces -> tabs for make file.
CFLAGS="-Oz -fno-exceptions -Wno-sign-compare $(THREADS_FLAG) $(ICU_DEFINES)" \ | |
CXXFLAGS="-Oz -fno-exceptions -Wno-sign-compare $(THREADS_FLAG) $(ICU_DEFINES)" \ | |
CC="$(WASI_SDK_PATH)/bin/clang --sysroot=$(WASI_SDK_PATH)/share/wasi-sysroot" \ | |
CXX="$(WASI_SDK_PATH)/bin/clang++ --sysroot=$(WASI_SDK_PATH)/share/wasi-sysroot" \ | |
--host=$(HOST_PLATFORM) --build=wasm32 | |
CFLAGS="-Oz -fno-exceptions -Wno-sign-compare $(THREADS_FLAG) $(ICU_DEFINES)" \ | |
CXXFLAGS="-Oz -fno-exceptions -Wno-sign-compare $(THREADS_FLAG) $(ICU_DEFINES)" \ | |
CC="$(WASI_SDK_PATH)/bin/clang --sysroot=$(WASI_SDK_PATH)/share/wasi-sysroot" \ | |
CXX="$(WASI_SDK_PATH)/bin/clang++ --sysroot=$(WASI_SDK_PATH)/share/wasi-sysroot" \ | |
--host=$(HOST_PLATFORM) --build=wasm32 |
eng/icu.wasi.mk
Outdated
--host=$(HOST_PLATFORM) --build=wasm32 | ||
|
||
check-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.
space -> tab
: | |
: |
@@ -188,6 +235,14 @@ stages: | |||
inputs: | |||
artifact: Artifacts_Browser_Threading | |||
path: 'artifacts/bin/browser-threading' | |||
- task: DownloadPipelineArtifact@2 |
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.
For a future PR: This Publish Packages
job should run for PRs too, and generate the packages, but skip the publishing part itself. This would ensure that the PR doesn't break packaging.
Does anyone know why we have both the patch files and the changes in files ? |
The patch files in |
eng/icu.proj
Outdated
@@ -37,4 +39,18 @@ | |||
Lines="@(_ItemsFromEmscriptenVersionFile->Replace('"', ''))" | |||
Overwrite="true" /> | |||
</Target> | |||
<Target Name="PatchWasiSdk" Condition="'$(TargetOS)' == 'Wasi'"> |
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.
Please rename to DownloadWasiSdk
. Also I'm not clear if this is necessary when running on docker image with wasi SDK already in place.
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.
Updated, now it will download wasi sdk only when needed.
Contributes to dotnet/runtime#65895
Allows to build icu for wasm using wasi-sdk.