-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[wasm] Add support for using custom native libraries #55797
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Native libraries can be referenced via `@(NativeReference)` item, eg: `<NativeReference Include="NativeLib.o" />` - JS files can be added via `@(Content)`, with a `Kind` metadata, eg: `<Content Include="foo.js" Kind="pre-js" />`
Tagging subscribers to 'arch-wasm': @lewing Issue DetailsNative libraries can be referenced via
|
failure is
|
radical
force-pushed
the
wasm-native-libs
branch
from
July 16, 2021 21:31
30f7ae6
to
1ebae57
Compare
.. and update the tests to use that.
radical
force-pushed
the
wasm-native-libs
branch
from
July 16, 2021 21:53
1ebae57
to
0ea5099
Compare
/azp run runtime,runtime-staging |
Azure Pipelines successfully started running 2 pipeline(s). |
lewing
approved these changes
Jul 19, 2021
radical
added a commit
to radical/runtime
that referenced
this pull request
Jul 22, 2021
(cherry picked from commit d574b03)
mmitche
pushed a commit
that referenced
this pull request
Jul 26, 2021
…raries (#56013) * [wasm] Add support for using custom native libraries (#55797) (cherry picked from commit d574b03) * [wasm] Use compile rsp instead of link, for compiling native files (#55848) .. and fix logging that broke recently. `tasks/Common/Utils.cs`: TaskLoggingHelper Utils.Logger is a static field, which must be set by task else any methods in Utils, eg. RunProcess, silently fail to log any messages. Also, this would be a problem when building multiple projects in parallel, since the logger is a task-specific one. Instead, we pass logger as an arg to all the methods. (cherry picked from commit 3301e9d) * Link with EmccCompileOptimizationFlag==-Oz by default in release (#55939) (cherry picked from commit 04072ff) * [wasm] Fix regression in compiling .bc -> .o files (#56063) * [wasm] Add back --emit-llvm that got removed mistakenly, in an earlier commit .. found thanks to Jerome Laban. * [wasm] Set EmccCompile's messages to MessageImportance.Low by default. .. and to MessageImportance.Normal if `$(EmccVerbose)==true`. * [wasm] Quote filenames passed to emcc compile command line * Add more blazorwasm tests - for debug/release, aot/relinking * Bump sdk for workload testing to 6.0.100-rc.1.21370.2 * [wasm] Fix regression in compiling bitcode -> .o The `-emit-llvm` arg has been incorrectly added, and removed from the args used for compiling .bc->.o . This commit fixes it, and adds a crude test for it, so we don't regress again. * Fix build (cherry picked from commit 1d8ad03) * [wasm] Bump sdk for workload testing to 6.0.100-preview.7.21372.19 Co-authored-by: Larry Ewing <lewing@microsoft.com>
github-actions bot
pushed a commit
that referenced
this pull request
Jul 27, 2021
TL;dr `publish` fails on any blazorwasm project with VS17 A recent commit[1] moved initializing `$(_WasmIntermediateOutputPath)` from a target, to project level `PropertyGroup`. It is set as: `<_WasmIntermediateOutputPath>$([MSBuild]::NormalizeDirectory($(IntermediateOutputPath), 'wasm'))</_WasmIntermediateOutputPath>` The `NormalizeDirectory` call converts this to a full path, presumably using the current directory. Because we are setting `$(_WasmIntermediateOutputPath)` at the project level, it gets evaluated during the evaluation phase. And the current directory doesn't seem to be set to the project directory at that point in VS. So, `$(_WasmIntermediateOutputPath)` gets a wrong path like: `C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\obj\Release\net6.0\wasm`. And then when actually publishing, it fails to create this directory with: `Unable to create directory "C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\obj\Release\net6.0\wasm\". Access to the path 'C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\obj\Release\net6.0\wasm\' is denied.` Fix: Set the property in `_InitializeCommonProperties` *target*, at which point the current directory is correctly set. Note: - This doesn't seem to be reproducible outside VS - It happens only on `publish`, because that's when the wasm targets come into play. -- 1. ``` commit d574b03 Author: Ankit Jain <radical@gmail.com> Date: Mon Jul 19 01:02:01 2021 -0400 [wasm] Add support for using custom native libraries (#55797) ```
mmitche
pushed a commit
that referenced
this pull request
Jul 28, 2021
TL;dr `publish` fails on any blazorwasm project with VS17 A recent commit[1] moved initializing `$(_WasmIntermediateOutputPath)` from a target, to project level `PropertyGroup`. It is set as: `<_WasmIntermediateOutputPath>$([MSBuild]::NormalizeDirectory($(IntermediateOutputPath), 'wasm'))</_WasmIntermediateOutputPath>` The `NormalizeDirectory` call converts this to a full path, presumably using the current directory. Because we are setting `$(_WasmIntermediateOutputPath)` at the project level, it gets evaluated during the evaluation phase. And the current directory doesn't seem to be set to the project directory at that point in VS. So, `$(_WasmIntermediateOutputPath)` gets a wrong path like: `C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\obj\Release\net6.0\wasm`. And then when actually publishing, it fails to create this directory with: `Unable to create directory "C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\obj\Release\net6.0\wasm\". Access to the path 'C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\obj\Release\net6.0\wasm\' is denied.` Fix: Set the property in `_InitializeCommonProperties` *target*, at which point the current directory is correctly set. Note: - This doesn't seem to be reproducible outside VS - It happens only on `publish`, because that's when the wasm targets come into play. -- 1. ``` commit d574b03 Author: Ankit Jain <radical@gmail.com> Date: Mon Jul 19 01:02:01 2021 -0400 [wasm] Add support for using custom native libraries (#55797) ``` Co-authored-by: Ankit Jain <radical@gmail.com>
radical
added a commit
to radical/runtime
that referenced
this pull request
Jul 28, 2021
TL;dr `publish` fails on any blazorwasm project with VS17 A recent commit[1] moved initializing `$(_WasmIntermediateOutputPath)` from a target, to project level `PropertyGroup`. It is set as: `<_WasmIntermediateOutputPath>$([MSBuild]::NormalizeDirectory($(IntermediateOutputPath), 'wasm'))</_WasmIntermediateOutputPath>` The `NormalizeDirectory` call converts this to a full path, presumably using the current directory. Because we are setting `$(_WasmIntermediateOutputPath)` at the project level, it gets evaluated during the evaluation phase. And the current directory doesn't seem to be set to the project directory at that point in VS. So, `$(_WasmIntermediateOutputPath)` gets a wrong path like: `C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\obj\Release\net6.0\wasm`. And then when actually publishing, it fails to create this directory with: `Unable to create directory "C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\obj\Release\net6.0\wasm\". Access to the path 'C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\obj\Release\net6.0\wasm\' is denied.` Fix: Set the property in `_InitializeCommonProperties` *target*, at which point the current directory is correctly set. Note: - This doesn't seem to be reproducible outside VS - It happens only on `publish`, because that's when the wasm targets come into play. -- 1. ``` commit d574b03 Author: Ankit Jain <radical@gmail.com> Date: Mon Jul 19 01:02:01 2021 -0400 [wasm] Add support for using custom native libraries (dotnet#55797) ```
radical
added a commit
that referenced
this pull request
Jul 28, 2021
TL;dr `publish` fails on any blazorwasm project with VS17 A recent commit[1] moved initializing `$(_WasmIntermediateOutputPath)` from a target, to project level `PropertyGroup`. It is set as: `<_WasmIntermediateOutputPath>$([MSBuild]::NormalizeDirectory($(IntermediateOutputPath), 'wasm'))</_WasmIntermediateOutputPath>` The `NormalizeDirectory` call converts this to a full path, presumably using the current directory. Because we are setting `$(_WasmIntermediateOutputPath)` at the project level, it gets evaluated during the evaluation phase. And the current directory doesn't seem to be set to the project directory at that point in VS. So, `$(_WasmIntermediateOutputPath)` gets a wrong path like: `C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\obj\Release\net6.0\wasm`. And then when actually publishing, it fails to create this directory with: `Unable to create directory "C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\obj\Release\net6.0\wasm\". Access to the path 'C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\obj\Release\net6.0\wasm\' is denied.` Fix: Set the property in `_InitializeCommonProperties` *target*, at which point the current directory is correctly set. Note: - This doesn't seem to be reproducible outside VS - It happens only on `publish`, because that's when the wasm targets come into play. -- 1. ``` commit d574b03 Author: Ankit Jain <radical@gmail.com> Date: Mon Jul 19 01:02:01 2021 -0400 [wasm] Add support for using custom native libraries (#55797) ```
ghost
locked as resolved and limited conversation to collaborators
Aug 18, 2021
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Native libraries can be referenced via
@(NativeReference)
item, eg:<NativeFileReference Include="NativeLib.o" />
@(Content)
, with aKind
metadata, eg:<Content Include="foo.js" Kind="pre-js" />