Age | Commit message (Collapse) | Author |
|
Fixes #51236
|
|
Previously, we have had four iOS RIDs:
iOS-arm
iOS-arm64
iOS-x86
iOS-x64
Apple has never shipped an iOS device with an x86 or x64 processor. Instead, the x86/x64 RIDs have meant "iOS simulator with these arches" as opposed to "iOS with these arches". Amongst other things, that means building against a DIFFERENT SDK, iPhoneSimulator.platform vs iPhoneOS.platform
In the Apple Silicon future, the iOS simulator is now an ARM64 binary - so we need:
iOS-arm
iOS-arm64
iOS-arm64, but built against the simulator SDK not the device SDK
iOS-x86
iOS-x64
Clearly, there's a problem.
The solution is to move the simulators to a different RID, to avoid the overloading issue:
iOS-arm
iOS-arm64
iOSSimulator-arm64
iOSSimulator-x86
iOSSimulator-x64
This PR introduces the new entries in the RID graph, moves our existing iOS-x{86,64} to iOS-sim-x{86,64}, adds a new iOS-arm64.
The above also applies for tvOS, with a smaller set of OSes:
tvOS-arm64
tvOSSimulator-arm64
tvOSSimulator-x64
Ref: #48216
|
|
|
|
* [wasm] Disable the linkonce linking of wrappers for now, the aot metadata about wrappers is not dedup-ed, so a separate dedup pass still saves more space.
* [wasm] Add dedup support to the build to avoid generating generic instances etc. multiple times.
This works as follows:
* Controlled by a new public 'WasmDedup' property, defaults to true.
* All assemblies are AOT compiled with the 'dedup-skip' option, which causes
the AOT compiler to avoid generating generic instances, certain wrappers etc.
* A new internal assembly called aot-instances.dll is added to the build.
* When aot-instances.dll is AOTed, all the other assemblies are AOTed together,
but only the generic instances/wrappers are emitted into its AOT image.
|
|
* [wasm] reduce visibility of `[AOT] /foo/bar.dll` messages
* [wasm] Quote assembly path when invoking mono-aot-cross
* [wasm] WasmApp.*: Use the msbuild equivalent of `Path.Combine` in
.. the targets/props .
* [wasm] WasmApp.targets: Simplify emcc invocations a bit
* [wasm] WasmApp.targets: quote paths correctly
* [wasm] Add `%(WasmAssembliesToBundle._InternalForceInterpret)`
.. to allow skipping AOT, per assembly.
* [wasm] don't copy dotnet.* to appbundle unnecessarily
This was added earlier to support blazor workload which only uses AOT.
But that has since been fixed to correctly use
`WasmBuildApp`+`@(WasmNativeAsset)`, so this can be removed.
* [wasm] Add new `$(WasmNativeDebugSymbols)` that to get symbols with
.. dotnet.wasm . It defaults to `true`.
* [wasm] Check that EMSDK_PATH is set when building native files
* [wasm] Rename `@(_WasmAssemblies)` -> `@(_WasmAssembliesInternal)`
* [wasm] Fix sample build
* [wasm] Fix tests on helix - typo
* Address review feedback
* fix a missing quote
Co-authored-by: Larry Ewing <lewing@microsoft.com>
|
|
.. precompile.
|
|
|
|
* [wasm] pack: Let the workload configure the runtime pack path
* [wasm] update webassembly pack description
* [wasm] Makefile: fix being able to `make build`
* [wasm] Fix AOT compilation to work before publish
Instead of using runtime pack, and other assemblies from the
publish folder, we are now using them directly from the source
location. This means that `System.Private.CoreLib` can be in a different
directory, than the assembly being precompiled.
So, we need to set `MONO_PATH` to the relevant paths that will have the assemblies.
This manifests during blazor workload based builds.
* [wasm][aot] Don't strip the source assemblies in place
Currently we run `mono-cil-strip` on assemblies, in the AOT case, but we
do that in-place.
This is problematic because the assemblies from the runtime pack will
get modified in their original location (nuget/etc), since we don't use
them from the publish folder anymore.
- This would mean that a subsequent attempt to build with AOT would fail
because now the original assemblies are already stripped!
- this also becomes apparent if you have the runtime pack installed in a
system dotnet folder, eg. as a pack - `/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Runtime.browser-wasm/`,
because a regular user wouldn't have permissions to modify that.
Solution: Write the stripped assemblies into the obj dir
* [wasm] Make the final list of wasm assemblies as an item
- Blazor skips the generation of the app bundle when running
`WasmBuildApp` target.
- Because of the previous commit, the locations for the final assemblies
could be different (when aot+stripping), which needs to be surfaced
for blazor. So, generate a `@(WasmAssembliesFinal)` item for that.
* [wasm] Allow enabling assert messages with $(MonoEnableAssertMessages)
* [wasm][aot] WasmApp.targets: check that we have .bc file for each assembly
Just a sanity check to ensure that due to some build authoring error, we
are not building dotnet.js/wasm with no .bc files! That just shows up as
an assert:
`* Assertion at /Users/radical/dev/r3/src/mono/mono/mini/aot-runtime.c:2651, condition `<disabled>' not met`
.. which is:
`g_assert (info->version == MONO_AOT_FILE_VERSION);`
.. `0 != MONO_AOT_FILE_VERSION`
* [wasm] remove UsingTask for non-exitant WasmAOT
* MonoCrossAot pkg: use mono-aot-cross.exe on windows
* [wasm] Fix up emscripten command invocations for windows
* [wasm] WasmApp.targets: move some property inits closer to their use
* [wasm] fix build for browser-profile sample
* [wasm] fix emcc invocation for getting the version
* [wasm] Add new RunWithEmSdkEnv task
* [wasm] Use `RunWithEmSdkEnv` to run `emcc` commands
* [wasm] AotCompiler: use platform specific path separator
* [wasm] RunWithEmSdkEnv: quote path on windows
* [wasm] Use new ReadEmccVersion to get the versions
This simplifies the target too, and works on windows.
* Update src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.MonoCrossAOT.Sdk.props
Co-authored-by: Pranav K <prkrishn@hotmail.com>
* fix messageimportance for debug msg
* Fix emcc invocation on windows, thanks to @pranavkm
* Don't strip assemblies with mono-cil-strip for aotinterp mode
* [wasm] Remove ReadEmccVersion task, and use msbuild to get the version
.. string instead. We do this by looking for the line with `'emcc'` in
it, since the other lines are the license text. Hopefully, this isn't
too brittle, since we are invoking `emcc --version`.
* Fix emcc version extraction to not depend on a specific string
Co-authored-by: Pranav K <prkrishn@hotmail.com>
|
|
(#48021)
|
|
runtime build (#47555)
* [wasm] Add $( WasmBuildAppAfterThisTarget) to control which target
.. triggers WasmAppBuild. Defaults to `Publish`.
* [wasm] emcc, mono-aot-cross doesn't like relative output paths
eg. `-o foo/bar.js`
.. so convert that to absolute paths.
* [wasm] Check for WasmMainJSPath close to it's use
* [wasm] Add new $(WasmGenerateAppBundle) to allow skipping app bundle
.. generation. This is useful when you want to do all the other steps
for wasm, but handle the packaging/bundle generation yourself. Eg.
Blazor
* [wasm] Ensure that generated dotnet.{js,wasm} get copied to the app dir
This is usually done as part of the bundle generation (NativeAssets).
But in cases when that step is being skipped, we still want to copy over
generated dotnet.{js,wasm} (eg. in case of AOT) to the app dir. This is
the case that blazor uses.
* [wasm] Allow skipping mono-cil-strip step
In some cases, eg. blazor (till we fix it), `mono-cil-strip` can break
the app, because of bugs, or linker issues etc.
Also, do this only in the AOT case.
* [wasm] Add support for building wasm projects outside the tree
.. using local runtime builds.
* [wasm] fix up the support for local build dir
* [wasm] add comments for new properties
* [wasm] LocalBuild.*: add more comments, validation
* [wasm] sample: Use BeforeTargets for Prepare target, as a psuedo test for that
|
|
(#47253)
We want to use a separate directory for intermediate build outputs, that aren't needed
in the app bundle, and reduce unclear internal dependencies during a build.
# TL;DR
## Changes:
1. `$(WasmBuildDir)` removed
2. Reasonable defaults set for most properties
3. To generate a wasm app for a project, the minimum you need to set:
a. `$(WasmMainJS)`,
b. and `@(WasmAssembliesToBundle)`
# Details:
Though it is a bit tricky, because the current targets assume:
- that they are being run after `Publish`
- that the publish directory has:
- some required files copied over from the runtime pack (eg. `libmono*`),
- and includes the assemblies
- that the targets emit all the intermediate output files like `driver.o`, or the bitcode files, into the same
directory
- And there are assumptions about where to pick which files from (eg. whether to take `dotnet.wasm`
from the runtime pack, or from the publish dir), based on unclear rules.
## What does this PR change?
- All the assets meant to be from the runtime pack (like `libmono*`, `icudt.dat`) are always taken
only from the runtime pack
- and this logic is moved out of the tasks, to the targets
- `$(WasmBuildDir)` is removed completely. Instead, we use an intermediate path based on `$(IntermediateOutputPath)`
- and emit all the intermediate bits there, like the bitcode files
- Add reasonable defaults for various properties, like `$(WasmAppDir)`
Effectively:
1. To generate a wasm app for a project, the minimum you need to set:
a. `$(WasmMainJS)`,
b. and `@(WasmAssembliesToBundle)`
2. The targets don't depend on publish dir at all
(in a future PR, we could remove triggering based on `Publish` target also)
* [wasm] WasmAppBuilder - move the list of native assets, and logic out
.. to the targets.
- New property: `NativeAssets`, populated by `@(WasmNativeAsset)`
- Remove property `MicrosoftNetCoreAppRuntimePackRidDir`
- Also, add the `icudt.dat` file from the targets
* [wasm] Simplify handling of dotnet.{js,wasm}
WasmAppBuilder has (non-obvious) logic to:
1. if AOT'ing, then use the *generated* dotnet.{js,wasm};
2. else use the one from the runtime pack
This depends on Publish having copied those files from the runtime pack
to the publish directory, and then comparing paths in the builder to
decide which one to use.
Instead, make this the intention obvious, and clear.
----
Commits:
* [wasm] Always get the native libs from the runtime pack (eg.libmono*)
We were getting these from the publish directory, instead we can get
them directly from the runtime pack.
This includes icudt.dt, and dotnet.timezones.blat .
* [wasm] MonoAOTCompiler: add `OutputDir` property
.. where we can emit the generated native files. Since these files are
meant only for generating the final `dotnet.wasm`, we don't want them to
put them in the bin directory.
* [wasm] Use existing list of assemblies - @(_WasmAssemblies)
.. instead of trying to find them in the build dir. This build directory
will become a directory for intermediate build output in upcoming
commits.
* [wasm] Replace $(WasmMainAssemblyPath) with $(WasmMainAssemblyFileName)
- Instead of having a special $(WasmMainAssemblyPath), and then adding
it to the wasm assemblies ourselves
- let the user project add all the relevant assemblies to
`@(WasmAssembliesToBundle)`, which is usually as simple as
`$(OutDir)\*.dll`.
- This helps to simplify lot of things.
- And we just need the main assembly filename for generating the
run-v8.sh script.
* [wasm] Rename WasmBuildDir -> _WasmIntermediateOutputPath
Based on the changes in previous commits, we can now remove
`$(WasmBuildDir)`, and replace that with an internal
`$(_WasmIntermediateOutputPath)`. This path will have all the build
artifacts generated that aren't required in the app bundle.
Earlier, we were using the publish directory for that, which resulted in
it being littered with unncessary files, and files getting copied to the
app bundle from unclear sources, and for non-obvious reasons.
* [wasm] add default value for $(WasmAppDir)
* [wasm] WasmApp.targets - misc cleanup
* [wasm] WasmAppBuilder: validate Assemblies property
* [wasm] WasmTestRunner - rename TestAssembly->TestAssemblyFileName, to correctly reflect the value
* [wasm] Fix make clean, for samples
* [wasm] WasmApp.targets: Add new $(MonoAotCrossCompilerPath)
* [wasm] update comments/docs
* Address review feedback from @mdh1418
|
|
* [wasm] samples: makefile cleanup
* [wasm] Mark FileWrites as Output
* [wasm] Move driver-gen.c generation for and profile, !aot case to separate target
* [wasm] Add $(WasmProfilers) for aot compiler
* [wasm] update public properties/items list in WasmApp.targets
* wasmapp.targets - some more cleanup - differentiate internal properties
* [wasm] fix MonoAOTCompiler build error
* [wasm] WasmApp.targets - Add `WasmExtraConfig`, to add to `mono-config.js`
`WasmAppBuilder.EnableProfiler` was added to add a special entry to
`mono-config.js` (`config.enable_profiler=true`), for the
`browser-profile` sample. Instead of doing that, add a general way to
add extra json elements to the config file.
This can be done through `WasmAppBuilder.ExtraConfig` set via
`@(WasmExtraConfig)`. Examples:
```xml
<WasmExtraConfig Include="enable_profiler" Value="true" />
<!-- Value attribute can have a number, bool, quoted string, or json string -->
<WasmExtraConfig Include="json" Value="{ "abc": 4 }" />
<WasmExtraConfig Include="string_val" Value=""abc"" />
<WasmExtraConfig Include="string_with_json" Value=""{ "abc": 4 }"" />
```
This would add the following to the config file:
```json
"enable_profiler": true,
"json": {
"abc": 4
},
"string_val": "abc",
"string_with_json": "{ \"abc\": 4 }"
```
* [wasm] Remove BuildAOTProfiled, and instead use AOTProfilePath only
* [wasm] Fix typo
* [wasm] MonoAOTCompiler: fix NRE
* [wasm] WasmAppBuilder.ExtraConfig: add comments
* [wasm] WasmAppBuilder - fix json escaping
|
|
(#45910)
* Enable AOT Profiler
* Add a `browser-profile` sample
* Clean up Makefile add AotInterp mode to MonoAotMode
* move the shared make logic to wasm.mk
Co-authored-by: Steve Pfister <steveisok@users.noreply.github.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
|
|
* Test workload
* Remove hardcoded path to MonoAOTCompiler
Remove changes related to testing the MonoAOTCompiler NuPkg
Remove changes to deprecated files that led to file additions
* Inline pkg descriptions for MonoAOTCompiler Task and workload packs
* Remove Workload AOT additions
* Replace _ILLinkTasksDirectoryRoot with _AOTTasksDirectoryRoot
* Add TargetsMobile condition
* Remove temporary variables
* Reword MonoAOTCompiler NuPkg description
* Remove NuPkg import of MonoAOTCompiler UsingTask
* Add MonoAOTCompilerTaskAssemblyPath property
* Cleanup Microsoft.NET.Runtime.MonoAOTCompiler.Tasks.props
* Add README.md with example of using the NuPkg
* Specify the package files for the aot task, in the project itself
* Add comment for GetFilesToPackage target
* Update README.md
Co-authored-by: Ankit Jain <radical@gmail.com>
Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
|
|
AOT can now be triggered through the libraries tests as well as the wasm samples.
Passing /p:RunAOTCompilation=true is all that is needed for the libraries test run. The property will be false (for now) by default.
|
|
|
|
Fixes mono_aot_register_module not being found when AOT'ing.
|
|
* Move tools-local\tasks to src\tasks
* Delete dead task code
* nit installer.tasks.csproj changes
* Remove mobile.tasks intermediate folder
|