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

Add support for rebuilding the wasm executable in non-aot mode. #45072

Merged
merged 4 commits into from
Jan 4, 2021

Conversation

vargaz
Copy link
Contributor

@vargaz vargaz commented Nov 22, 2020

No description provided.

@vargaz vargaz changed the title Add support for rebuilding the wasm executable in non-aot mode by setting the 'BuildWasm' property to 'true'. Also run the pinvoke table generator. Add support for rebuilding the wasm executable in non-aot mode. Dec 18, 2020
@vargaz vargaz requested review from steveisok and removed request for marek-safar, steveisok, EgorBo and akoeplinger December 18, 2020 08:15
* Run the pinvoke generator as well.
* Strip the final executable.
* Document some of the public msbuild properties.
Comment on lines +175 to +179
<Exec Command="$(_WasmEmcc) $(EmccCFlags) $(_WasmSrcDir)/driver.c -c -o driver.o" IgnoreStandardErrorWarningFormat="true" WorkingDirectory="$(WasmBuildDir)" StandardOutputImportance="Low" />
<Exec Command="$(_WasmEmcc) $(EmccCFlags) $(_WasmSrcDir)/corebindings.c -c -o corebindings.o" IgnoreStandardErrorWarningFormat="true" WorkingDirectory="$(WasmBuildDir)" StandardOutputImportance="Low" />
<Exec Command="$(_WasmEmcc) $(EmccCFlags) $(_WasmSrcDir)/pinvoke.c -c -o pinvoke.o" IgnoreStandardErrorWarningFormat="true" WorkingDirectory="$(WasmBuildDir)" StandardOutputImportance="Low" />
<Exec Command="$(_WasmEmcc) $(EmccLDFlags) --js-library $(_WasmSrcDir)/library_mono.js --js-library $(_WasmSrcDir)/binding_support.js --js-library $(_WasmSrcDir)/dotnet_support.js --js-library $(_WasmSrcDir)/pal_random.js @(_WasmAssemblies->'%(LlvmBitcodeFile)', ' ') @(_WasmObjects, ' ') -o dotnet.js" IgnoreStandardErrorWarningFormat="true" WorkingDirectory="$(WasmBuildDir)" StandardOutputImportance="Low" />
<Exec Condition="'$(WasmNativeStrip)' == 'true'" Command="$(EMSDK_PATH)/upstream/bin/wasm-opt --strip-dwarf dotnet.wasm -o dotnet.wasm" IgnoreStandardErrorWarningFormat="true" WorkingDirectory="$(WasmBuildDir)" />
Copy link
Member

Choose a reason for hiding this comment

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

Maybe something like:

Suggested change
<Exec Command="$(_WasmEmcc) $(EmccCFlags) $(_WasmSrcDir)/driver.c -c -o driver.o" IgnoreStandardErrorWarningFormat="true" WorkingDirectory="$(WasmBuildDir)" StandardOutputImportance="Low" />
<Exec Command="$(_WasmEmcc) $(EmccCFlags) $(_WasmSrcDir)/corebindings.c -c -o corebindings.o" IgnoreStandardErrorWarningFormat="true" WorkingDirectory="$(WasmBuildDir)" StandardOutputImportance="Low" />
<Exec Command="$(_WasmEmcc) $(EmccCFlags) $(_WasmSrcDir)/pinvoke.c -c -o pinvoke.o" IgnoreStandardErrorWarningFormat="true" WorkingDirectory="$(WasmBuildDir)" StandardOutputImportance="Low" />
<Exec Command="$(_WasmEmcc) $(EmccLDFlags) --js-library $(_WasmSrcDir)/library_mono.js --js-library $(_WasmSrcDir)/binding_support.js --js-library $(_WasmSrcDir)/dotnet_support.js --js-library $(_WasmSrcDir)/pal_random.js @(_WasmAssemblies->'%(LlvmBitcodeFile)', ' ') @(_WasmObjects, ' ') -o dotnet.js" IgnoreStandardErrorWarningFormat="true" WorkingDirectory="$(WasmBuildDir)" StandardOutputImportance="Low" />
<Exec Condition="'$(WasmNativeStrip)' == 'true'" Command="$(EMSDK_PATH)/upstream/bin/wasm-opt --strip-dwarf dotnet.wasm -o dotnet.wasm" IgnoreStandardErrorWarningFormat="true" WorkingDirectory="$(WasmBuildDir)" />
<ItemGroup>
<_WasmJSLibrary Include="$(_WasmSrcDir)/library_mono.js" />
<_WasmJSLibrary Include="$(_WasmSrcDir)/binding_support.js" />
<_WasmJSLibrary Include="$(_WasmSrcDir)/dotnet_support.js" />
<_WasmJSLibrary Include="$(_WasmSrcDir)/pal_random.js" />
<_EmccOutputFile Include="driver.o" BuildArgs="$(EmccCFlags) $(_WasmSrcDir)/driver.c -c" />
<_EmccOutputFile Include="corebindings.o" BuildArgs="$(EmccCFlags) $(_WasmSrcDir)/corebindings.c -c" />
<_EmccOutputFile Include="pinvoke.o" BuildArgs="$(EmccCFlags) $(_WasmSrcDir)/pinvoke.c -c" />
<_EmccOutputFile Include="dotnet.js" BuildArgs="$(EmccLDFlags) @(_WasmJSLibrary->'--js-library %(Identity)', ' ') @(_WasmAssemblies->'%(LlvmBitcodeFile)', ' ') @(_WasmObjects, ' ')"/>
</ItemGroup>
<Exec Command="$(_WasmEmcc) %(_EmccOutputFile.BuildArgs) -o %(_EmccOutputFile.Identity)"
WorkingDirectory="$(WasmBuildDir)" IgnoreStandardErrorWarningFormat="true" StandardOutputImportance="Low" StandardErrorImportance="Low" />
<Exec Condition="'$(WasmNativeStrip)' == 'true'"
Command="$(EMSDK_PATH)/upstream/bin/wasm-opt --strip-dwarf dotnet.wasm -o dotnet.wasm"
WorkingDirectory="$(WasmBuildDir)" IgnoreStandardErrorWarningFormat="true" StandardOutputImportance="Low" />

@vargaz vargaz merged commit a98a943 into dotnet:master Jan 4, 2021
@vargaz vargaz deleted the rebuild-wasm branch January 4, 2021 17:40
@ghost ghost locked as resolved and limited conversation to collaborators Feb 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants