Skip to content

[NativeAOT-LLVM] Upgrade emscripten and workaround cache lock problem #1702

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 5 commits into from
Nov 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions eng/native/gen-buildsys.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ if not "%__ConfigureOnly%" == "1" (
)

if /i "%__UseEmcmake%" == "1" (
REM workaround for https://github.com/emscripten-core/emscripten/issues/15440 - emscripten cache lock problems
REM build the ports for ICU and ZLIB upfront
embuilder build icu zlib

REM Add call in front of emcmake as for some not understood reason, perhaps to do with scopes, by calling emcmake (or any batch script),
REM delayed expansion is getting turned off. TODO: remove this and see if CI is ok and hence its just my machine.
call emcmake "%CMakePath%" %__ExtraCmakeParams% --no-warn-unused-cli -G "%__CmakeGenerator%" -B %__IntermediatesDir% -S %__SourceDir%
Expand Down
6 changes: 3 additions & 3 deletions eng/pipelines/runtimelab/install-emscripten.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ git clone https://github.com/emscripten-core/emsdk.git

cd emsdk
rem Checkout a known good version to avoid a random break when emscripten changes the top of tree.
git checkout 5ad9d72
git checkout 044d620

powershell -NoProfile -NoLogo -ExecutionPolicy ByPass -command "& """%~dp0update-machine-certs.ps1""" %*"

call python emsdk.py install 2.0.12
call python emsdk.py install 2.0.33
if %errorlevel% NEQ 0 goto fail
call emsdk activate 2.0.12
call emsdk activate 2.0.33
if %errorlevel% NEQ 0 goto fail

rem We key off of this variable in the common/build.ps1 script.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ if(CLR_CMAKE_TARGET_UNIX)
message("including ICU")
# add ICU support to emscripten and workaround https://github.com/emscripten-core/emscripten/issues/9302
# ucol_setVariableTop is deprecated so disable warnings
add_compile_options(-s USE_ICU=1 -I$ENV{EMSDK}/upstream/emscripten/cache/ports/icu/icu/source/i18n -Wno-deprecated-declarations)
# emscripten ICU source has __xxxx variables so suppress reserved identifiers.
# TODO-LLVM: remove these suppresession when https://github.com/dotnet/runtime/commit/2265a61565e20fc26ca8ec0632eb14268b99158e is merged
# and when emscripten ICU is updated.
add_compile_options(-s USE_ICU=1 -I$ENV{EMSDK}/upstream/emscripten/cache/ports/icu/icu/source/i18n -Wno-deprecated-declarations -Wno-reserved-identifier -Wno-unused-but-set-variable)
elseif (NOT CLR_CMAKE_TARGET_ANDROID)
if (CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_MACCATALYST)
execute_process(COMMAND brew --prefix OUTPUT_VARIABLE brew_prefix OUTPUT_STRIP_TRAILING_WHITESPACE)
Expand Down
5 changes: 5 additions & 0 deletions src/libraries/Native/Unix/System.Native/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ if (CLR_CMAKE_TARGET_OSX)
add_definitions(-D_DARWIN_C_SOURCE)
endif ()

# TODO-LLVM: remove when https://github.com/dotnet/runtime/commit/2265a61565e20fc26ca8ec0632eb14268b99158e is merged
if (CLR_CMAKE_TARGET_UNIX_WASM)
add_compile_options(-Wno-unused-but-set-variable)
endif ()

include_directories("${CLR_SRC_NATIVE_DIR}/common")

set(NATIVE_SOURCES
Expand Down