-
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
Changes from 16 commits
ad1ca5e
426b8ff
2525da0
a0cb465
17beb4d
3f2da6c
f38f521
915bc84
90c071d
b1ed769
d5fd0ef
a4b8734
a536b93
bf0e0aa
a443d2c
3f15161
2b441a6
a8e96b4
32e532b
f244f8b
4ab7653
d717f61
2955160
24885c9
1f7ff41
a7d2c77
40a1e89
605ef11
1163a29
1b926d9
ea55666
17e2613
30a53d9
3036bc2
ca26058
e435609
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
if [[ "$__TargetOS" == Browser ]]; then | ||
EMSDK_PATH=$PWD/artifacts/emsdk | ||
rm -rf $EMSDK_PATH | ||
git clone https://github.com/emscripten-core/emsdk.git $EMSDK_PATH | ||
EMSCRIPTEN_VERSION="`cat ./.devcontainer/emscripten-version.txt 2>&1`" | ||
cd $EMSDK_PATH && ./emsdk install $EMSCRIPTEN_VERSION | ||
cd $EMSDK_PATH && ./emsdk activate $EMSCRIPTEN_VERSION | ||
# ready to build, e.g.: | ||
# ./build.sh /p:TargetOS=Browser /p:TargetArchitecture=wasm /p:IcuTracing=true | ||
# ./build.sh /p:TargetOS=Browser /p:TargetArchitecture=wasm /p:IcuTracing=true | ||
elif [[ "$__TargetOS" == Wasi ]]; then | ||
WASI_SDK_PATH=$PWD/artifacts/wasi-sdk | ||
rm -rf $WASI_SDK_PATH | ||
git clone https://github.com/WebAssembly/wasi-sdk.git $WASI_SDK_PATH | ||
# ready to build, e.g.: | ||
# ./build.sh /p:TargetOS=Wasi /p:TargetArchitecture=wasm /p:IcuTracing=true | ||
fi |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
16 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,6 +77,51 @@ stages: | |
artifactName: Artifacts_Browser_Threading | ||
condition: and(succeeded(), ne(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) | ||
|
||
############ WASI BUILD ############ | ||
- job: Build_Wasi | ||
displayName: Wasi | ||
timeoutInMinutes: 360 | ||
pool: | ||
${{ if eq(variables['System.TeamProject'], 'public') }}: | ||
vmImage: ubuntu-20.04 | ||
${{ if eq(variables['System.TeamProject'], 'internal') }}: | ||
name: NetCore1ESPool-Internal | ||
demands: ImageOverride -equals Build.Ubuntu.1804.Amd64 | ||
container: | ||
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-20.04-webassembly | ||
steps: | ||
- bash: | | ||
./build.sh --ci --restore --build --configuration $(_BuildConfig) /p:TargetOS=Wasi /p:TargetArchitecture=wasm $(_InternalBuildArgs) | ||
displayName: Build | ||
- task: PublishPipelineArtifact@1 | ||
displayName: Upload artifacts | ||
inputs: | ||
targetPath: 'artifacts/bin' | ||
artifactName: Artifacts_Wasi | ||
condition: and(succeeded(), ne(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) | ||
|
||
- job: Build_Wasi_Threading | ||
displayName: Wasi_Threading | ||
timeoutInMinutes: 360 | ||
pool: | ||
${{ if eq(variables['System.TeamProject'], 'public') }}: | ||
vmImage: ubuntu-20.04 | ||
${{ if eq(variables['System.TeamProject'], 'internal') }}: | ||
name: NetCore1ESPool-Internal | ||
demands: ImageOverride -equals Build.Ubuntu.1804.Amd64 | ||
container: | ||
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-20.04-webassembly | ||
steps: | ||
- bash: | | ||
./build.sh --ci --restore --build --configuration $(_BuildConfig) /p:TargetOS=Wasi /p:TargetArchitecture=wasm /p:WasmEnableThreads=true $(_InternalBuildArgs) | ||
displayName: Build | ||
- task: PublishPipelineArtifact@1 | ||
displayName: Upload artifacts | ||
inputs: | ||
targetPath: 'artifacts/bin' | ||
artifactName: Artifacts_Wasi_Threading | ||
condition: and(succeeded(), ne(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) | ||
|
||
############ iOS BUILD ############ | ||
- job: Build_iOS | ||
displayName: iOS | ||
|
@@ -168,6 +213,8 @@ stages: | |
dependsOn: | ||
- Build_Browser | ||
- Build_Browser_Threading | ||
- Build_Wasi | ||
- Build_Wasi_Threading | ||
- Build_iOS | ||
- Build_MacCatalyst | ||
- Build_tvOS | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. For a future PR: This |
||
inputs: | ||
artifact: Artifacts_Wasi | ||
path: 'artifacts/bin' | ||
- task: DownloadPipelineArtifact@2 | ||
inputs: | ||
artifact: Artifacts_Wasi_Threading | ||
path: 'artifacts/bin/wasi-threading' | ||
- task: DownloadPipelineArtifact@2 | ||
inputs: | ||
artifact: Artifacts_iOS | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<Project> | ||
<Target Name="Build" Condition="'$(PackOnly)' != 'true'" DependsOnTargets="PatchEmscripten;CopyEmscriptenVersion"> | ||
<Target Name="Build" Condition="'$(PackOnly)' != 'true'" DependsOnTargets="PatchEmscripten;CopyEmscriptenVersion;PatchWasiSdk"> | ||
<Error Condition="'$(TargetOS)' == ''" Text="TargetOS needs to be specified!" /> | ||
<Error Condition="'$(TargetArchitecture)' == ''" Text="TargetArchitecture needs to be specified!" /> | ||
|
||
|
@@ -37,4 +37,28 @@ | |
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 commentThe reason will be displayed to describe this comment to others. Learn more. Please rename to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated, now it will download wasi sdk only when needed. |
||
<ReadLinesFromFile File="../.devcontainer/wasi-sdk-version.txt"> | ||
radical marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<Output TaskParameter="Lines" ItemName="_VersionLines" /> | ||
</ReadLinesFromFile> | ||
|
||
<PropertyGroup> | ||
<WASI_SDK_PATH>$(RepoRoot)\artifacts</WASI_SDK_PATH> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Removed, was not used. |
||
<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 commentThe reason will be displayed to describe this comment to others. Learn more. Condition for OS here too. And we can use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These properties are only for private use, so prepend |
||
<WasiSdkUrl Condition="'$(HostOS)' == 'osx'" >https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-$(WasiSdkVersion)/wasi-sdk-$(WasiSdkVersion).0-macos.tar.gz</WasiSdkUrl> | ||
<WasiSdkUrl Condition="'$(HostOS)' == 'windows'" >https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-$(WasiSdkVersion)/wasi-sdk-$(WasiSdkVersion).0-mingw.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 commentThe reason will be displayed to describe this comment to others. Learn more. This won't show any errors with downloading the tarball. Add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess we could do the same improvements on runtime repo |
||
Condition="'$(HostOS)' != 'windows'" | ||
WorkingDirectory="$(WasiLocalPath)" | ||
IgnoreStandardErrorWarningFormat="true" /> | ||
|
||
<Exec Command="powershell -NonInteractive -command "& .\provision.ps1 -WasiSdkUrl $(WasiSdkUrl) -WasiSdkVersion $(WasiSdkVersion) ; Exit $LastExitCode "" | ||
Condition="'$(HostOS)' == 'windows'" | ||
WorkingDirectory="$(WasiLocalPath)" | ||
IgnoreStandardErrorWarningFormat="true" /> | ||
</Target> | ||
</Project> |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,10 @@ | ||||||
ifeq ($(WASM_ENABLE_THREADS),true) | ||||||
pavelsavara marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
THREADS_FLAG="-pthread" | ||||||
endif | ||||||
|
||||||
CONFIGURE_COMPILER_FLAGS += \ | ||||||
CFLAGS="-Oz -fno-exceptions -Wno-sign-compare $(THREADS_FLAG) $(ICU_DEFINES)" \ | ||||||
CXXFLAGS="-Oz -fno-exceptions -Wno-sign-compare $(THREADS_FLAG) $(ICU_DEFINES)" | ||||||
|
||||||
check-env: | ||||||
: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. space -> tab
Suggested change
|
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.