Граф коммитов

883 Коммитов

Автор SHA1 Сообщение Дата
Meri Khamoyan 3f6d43c756
[iOS] HybridGlobalization set flag in SDK (#18498)
Add HybridGlobalization flag in SDK and load icudt_hybrid.dat file when
HybridGlobalization is on.

Contributes to https://github.com/dotnet/runtime/issues/80689
2023-06-28 10:25:24 +02:00
dotnet-maestro[bot] e83845e989
[net8.0] Update dependencies from dotnet/installer (#18489#pullrequestreview-1498967369)
This pull request updates the following dependencies

## Coherency Updates

The following updates ensure that dependencies with a *CoherentParentDependency*
attribute were produced in a build used as input to the parent dependency's build.
See [Dependency Description Format](https://github.com/dotnet/arcade/blob/master/Documentation/DependencyDescriptionFormat.md#dependency-description-overview)

- **Coherency Updates**:
  - **Microsoft.NET.ILLink.Tasks**: from 8.0.0-preview.6.23316.3 to 8.0.0-preview.7.23325.2 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.AspNetCore.App.Ref**: from 8.0.0-preview.6.23316.5 to 8.0.0-preview.7.23324.1 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.NETCore.App.Ref**: from 8.0.0-preview.6.23316.3 to 8.0.0-preview.7.23325.2 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport**: from 8.0.0-preview.6.23312.1 to 8.0.0-preview.7.23321.3 (parent: Microsoft.NETCore.App.Ref)
  - **Microsoft.NETCore.App.Ref**: from 8.0.0-preview.6.23316.3 to 8.0.0-preview.7.23325.2 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.DotNet.Cecil**: from 0.11.4-alpha.23312.1 to 0.11.4-alpha.23319.2 (parent: Microsoft.NETCore.App.Ref)

## From https://github.com/dotnet/installer

- **Subscription**: f9b68d84-9c90-4bd0-5499-08db4112d57e
- **Build**: 20230625.5
- **Date Produced**: June 26, 2023 6:19:18 AM UTC
- **Commit**: d2a244f560b9f89387a5e748c19adf3114153f89
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 8.0.100-preview.6.23320.7 to 8.0.100-preview.7.23325.5][14]
  - **Microsoft.NET.ILLink.Tasks**: [from 8.0.0-preview.6.23316.3 to 8.0.0-preview.7.23325.2][15]
  - **Microsoft.AspNetCore.App.Ref**: [from 8.0.0-preview.6.23316.5 to 8.0.0-preview.7.23324.1][16]
  - **Microsoft.NETCore.App.Ref**: [from 8.0.0-preview.6.23316.3 to 8.0.0-preview.7.23325.2][15]
  - **Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport**: [from 8.0.0-preview.6.23312.1 to 8.0.0-preview.7.23321.3][17]
  - **Microsoft.NETCore.App.Ref**: [from 8.0.0-preview.6.23316.3 to 8.0.0-preview.7.23325.2][15]
  - **Microsoft.DotNet.Cecil**: [from 0.11.4-alpha.23312.1 to 0.11.4-alpha.23319.2][18]

[14]: 7a0bb9fd74...d2a244f560
[15]: 76da696f3f...eaa9717d90
[16]: 974d15e3b0...213eb282fc
[17]: 1640faa87e...e004a85d84
[18]: ad66dcb8a0...f449dc9923
2023-06-26 18:44:18 +02:00
Rolf Bjarne Kvinge 9b72a75613
Add support for using NativeAOT. (#17374)
Add support for using NativeAOT on all our platforms.

This contains numerous changes in a lot of places to add support for
NativeAOT:

* build logic
* runtime
* managed code
* tests 

And it all pretty much consists of special-casing NativeAOT everywhere
we need to.

Note: NativeAOT doesn't work on macOS yet, because a dotnet/runtime fix
is required, and thus the corresponding test variations for
monotouch-test have been commented out.

This PR is best reviewed commit-by-commit.

This contributes towards https://github.com/xamarin/xamarin-macios/issues/17339.
2023-06-22 17:00:37 +02:00
Rolf Bjarne Kvinge b4e3361a10 [dotnet] Tell ILC about any satellite assemblies. 2023-06-22 08:44:47 +02:00
Rolf Bjarne Kvinge 3c912d7aea [dotnet] Treat the ICU data file as a resource instead of an assembly.
We can fix this better once this fix reaches us:

    https://github.com/dotnet/runtime/pull/87813

because then we can set the ICU data file at build time (to a relative path).
2023-06-22 08:44:47 +02:00
Rolf Bjarne Kvinge 42d6121e12 [dotnet] Set a flag to avoid a bug with the NativeAOT compiler 2023-06-22 08:44:47 +02:00
Rolf Bjarne Kvinge 264be7055e [dotnet] Disable SelfContained for the outer build of a universal app build when using NativeAOT. 2023-06-22 08:44:47 +02:00
Rolf Bjarne Kvinge 97b91f1600 [dotnet] Remove libSystem.Net.Security.Native from tvOS builds when using NativeAOT. 2023-06-22 08:44:47 +02:00
Rolf Bjarne Kvinge 7d65804e32 [dotnet/tests] Only use NativeAOT when publishing.
This matches how NativeAOT works for other platforms.
2023-06-22 08:44:47 +02:00
Rolf Bjarne Kvinge a1d707c013 [dotnet] Fix items in TrimmerRootAssembly to follow docs and what ILC supports. 2023-06-22 08:44:47 +02:00
Rolf Bjarne Kvinge 18eaeb24b2
[net8.0] [build] Require using EnablePreviewFeatures=true when using preview releases. Contributes towards #18343. (#18476)
Detect if we're using a non-stable Xcode, and in that case produce packages
that show an error if they're used and the EnablePreviewFeatures flag isn't
enabled.

Also add logic to set this flag for our own build, otherwise all our tests
would fail.

This is the same as Android does.

Contributes towards https://github.com/xamarin/xamarin-macios/issues/18343.
2023-06-22 08:16:50 +02:00
Rolf Bjarne Kvinge e3228d04ea [dotnet] Turn off some publishing behavior we don't need 2023-06-21 20:49:56 +02:00
Rolf Bjarne Kvinge 183c76af40 [dotnet] Use a different min OS version when building with NativeAOT.
This is because NativeAOT contains swift code, and we'd have to add code to
embed the Swift libraries in any apps that target early OS versions. We could
eventually implement this, but let's wait and see if there's a demand first.
2023-06-21 20:49:56 +02:00
Rolf Bjarne Kvinge d601e51698 [dotnet] Set PublishAotUsingRuntimePack=true when using NativeAOT to get the correct BCL libraries. 2023-06-21 20:49:56 +02:00
Rolf Bjarne Kvinge 617f64e52d [dotnet] Enforce that the linker must be enabled for all assemblies when using NativeAOT (and warn if someone asks otherwise). 2023-06-21 20:49:56 +02:00
Rolf Bjarne Kvinge 2ee532690a [dotnet] Collect all the native linker arguments ILC would have used and use them ourselves. 2023-06-21 20:49:55 +02:00
Rolf Bjarne Kvinge c48d583025 [dotnet] Link the output from ILC into the native executable 2023-06-21 20:49:55 +02:00
Rolf Bjarne Kvinge 79b76574c7 [dotnet] Ask ILC to only trim assemblies if trimming is explicitly enabled 2023-06-21 20:49:55 +02:00
Rolf Bjarne Kvinge 39774937ba [dotnet] Ask ILC to process all unmanaged callers only methods from all assemblies 2023-06-21 20:49:55 +02:00
Rolf Bjarne Kvinge 6bd8915d1a [dotnet] Rearrange items in item groups so that ILC gets the output from ILLink 2023-06-21 20:49:54 +02:00
Rolf Bjarne Kvinge 8cfee8b599 [dotnet] Ask ILC to treat all P/Invokes to __Internal as direct P/Invokes 2023-06-21 20:49:54 +02:00
Rolf Bjarne Kvinge 00b2865f0d [dotnet] Adjust ILC's build dependencies to cope with the fact that ILC doesn't support executing after ILLink.
Currently, NativeAOT is implemented as a replacement (of sorts) for ILLink. However,
we need to execute both, and in order to do that, we force our own logic to execute
to determine what ILC does.

This might be improved in the future. Ref: https://github.com/dotnet/runtime/issues/87187.
2023-06-21 20:49:54 +02:00
Rolf Bjarne Kvinge b36db05275 [dotnet] Call ILC, the NativeAOT compiler, before we link the native executable 2023-06-21 20:49:54 +02:00
Rolf Bjarne Kvinge 13fa76923f [dotnet] Disable our own IL stripping when using NativeAOT, because NativeAOT already does something equivalent 2023-06-21 20:49:54 +02:00
Rolf Bjarne Kvinge 595bcdb92f [dotnet] Don't call ComputeResolvedFilesToPublishList when using NativeAOT. 2023-06-21 20:49:53 +02:00
Rolf Bjarne Kvinge 0db2c5c53f [dotnet] Rework feature detection and notification a bit. 2023-06-21 20:49:53 +02:00
Rolf Bjarne Kvinge e0e4b77a55 [dotnet] Set AutoreleasePoolSupport earlier so that the linker doesn't set it first.
Might not be necessary: https://github.com/dotnet/runtime/pull/86753
2023-06-21 20:49:52 +02:00
Rolf Bjarne Kvinge b4a67c69c8 [src] Make the Runtime.IsNativeAOT property a constant in the linker. 2023-06-21 20:49:52 +02:00
Rolf Bjarne Kvinge 94c96ec263 [dotnet] Don't run Mono's AOT compiler if we're using NativeAOT. 2023-06-21 20:49:50 +02:00
Rolf Bjarne Kvinge 607cc78555 [dotnet] Use the correct package infix for NativeAOT 2023-06-21 20:49:50 +02:00
Rolf Bjarne Kvinge d584840c1c [dotnet] Force the managed static registrar when using NativeAot. 2023-06-21 20:49:50 +02:00
Rolf Bjarne Kvinge a76690198f [dotnet] Choose the correct runtime library depending on which runtime we're using. 2023-06-21 20:49:49 +02:00
Rolf Bjarne Kvinge a192eed02b [net8.0] Merge main into net8.0. 2023-06-19 23:23:04 +02:00
Rolf Bjarne Kvinge 2761123a6b
[dotnet] Add a property to opt-out of the _CopyLocalBindingResources logic easily. (#18443)
It seems this target has more problems than at first I thought, so make
it easier to opt-out of it by just setting a property in the csproj.

More investigation is needed, but I'm keeping the target on by default
for now, since it solves a real-world problem as well.

Ref: https://github.com/xamarin/xamarin-macios/issues/18445
2023-06-15 09:54:22 +02:00
Rolf Bjarne Kvinge 7df3eb1520
[dotnet] Add targets to compute mlaunch arguments for installing and launching mobile apps. Fixes #18359. (#18446)
Add public targets to compute the mlaunch command lines for installing
and launching mobile apps.

These new targets are:

* ComputeMlaunchInstallArguments
* ComputeMlaunchRunArguments

As part of this change, also create a few new public properties:

* MlaunchPath
* MlaunchRunArguments
* MlaunchInstallArguments
* MlaunchRunScript
* MlaunchInstallScript

If the *Script variables are set, the corresponding target will create a
script file with the path to mlaunch + the corresponding arguments.

Otherwise, it's also possible to get the arguments directly from the
build log.

Fixes https://github.com/xamarin/xamarin-macios/issues/18359.
2023-06-15 07:21:09 +02:00
Rolf Bjarne Kvinge 5d6a92eaf0 [net8.0] Merge main into net8.0. 2023-06-12 18:56:10 +02:00
Ivan Povazan e3088879a6
Reduce the size of `__LINKEDIT Export Info` section in stripped binaries (#18408)
# Description

This PR reduces the application's SOD (size on disk) by making
`__LINKEDIT Export Info` section smaller in the stripped Mach-O
binaries.

The feature is controlled by `_ExportSymbolsExplicitly` MSBuild property
and can be disabled by specifying: `-p:_ExportSymbolsExplicitly=true`

Fixes #18332 

# Initial problem

It has been noticed that during stripping, the strip tool does not
resize the export info section after it removes the symbols. Instead it
only zeroes out the entries (achieved by calling `prune_trie` function):

- https://github.com/apple-oss-distributions/cctools/blob/cctools-986/misc/strip.c
- https://github.com/apple-oss-distributions/ld64/blob/ld64-711/src/other/PruneTrie.cpp

Thanks @lambdageek for helping to track this down.

# Approach

As Xamarin build process already collects all the [required symbols][1] needed
for the application to run and preserves them during the strip phase, we can
use the same file to instruct clang toolchain to export only those symbols via
the command line options: `-exported_symbols_list <file>` ([source][2]).

This will make the export info section only include what is necessary for the
runtime - and at the same time eliminate the problem of the `strip` tool which
does not resize stripped symbols.

# Investigation setup

The issue is observable by building and inspecting the test application:
https://github.com/xamarin/xamarin-macios/blob/main/tests/dotnet/MySingleView/MySingleView.csproj
and targeting iOS platform in Release mode.

## Results:

| Measure      | MySingleView - main | MySingleView - this PR | Diff (%) | 
| :---         |                ---: |                   ---: |     ---: |
| SOD (bytes)  |            13668940 |               13458476 |    -1.5% |
| .ipa (bytes) |             4829368 |                4827928 |   -0.03% |

Even though zeroes are compressed well, the SOD is still affected and
unused section takes around 1.5% of the most simplistic app size.
Much bigger impact has been noted when trying out a MAUI iOS template
app with NativeAOT where the `__LINKEDIT Export Info` zeroes take up to
20MB of the SOD, but also with the regular macOS applications:
https://github.com/dotnet/runtime/issues/86707

### Repro current state of MySingleView.app with stripped binary

1. Build the app (you can ignore the need to run the sample, I just did it to
   make sure the changes do not break anything)

```bash
make run-device
``` 

2. Print the load commands - [load_cmds_strip.list][3]

```bash
otool -l bin/Release/net7.0-ios/ios-arm64/MySingleView.app/MySingleView > load_cmds_strip.list
```

- We are interested in the export info section:

```
cmd LC_DYLD_INFO_ONLY
...
export_off 5942960
export_size 207712
```

3. Create a hex dump of the export info section - [hex_dump_strip.list][4]

``` bash
xxd -s 5942960 -l 207712 bin/Release/net7.0-ios/ios-arm64/MySingleView.app/MySingleView > hex_dump_strip.list
```

- NOTE: Notice around ~200kb of zeroes from ~0x005ab490 to ~0x005dda00
    
4. Verify exported symbols are correct - [dyld_info_strip.list][5]

``` bash
dyld_info -exports bin/Release/net7.0-ios/ios-arm64/MySingleView.app/MySingleView > dyld_info_strip.list
```

### Repro current state of MySingleView.app with unstripped binary

1. Build the app (the make target preserves the symbols)

```bash
make run-device-no-strip
``` 

2. Print the load commands - [load_cmds_nostrip.list][6]

```bash
otool -l bin/Release/net7.0-ios/ios-arm64/MySingleView.app/MySingleView > load_cmds_nostrip.list
```

- We are interested in the export info section:

```
cmd LC_DYLD_INFO_ONLY
...
export_off 5942960
export_size 207712
```

3. Create a hex dump of the export info section - [hex_dump_nostrip.list][7]

``` bash
xxd -s 5942960 -l 207712 bin/Release/net7.0-ios/ios-arm64/MySingleView.app/MySingleView > hex_dump_nostrip.list
```

- Notice that the range: ~ 0x005ab490 to ~ 0x005dda00 now includes exported symbol entries
    
4. Verify exported symbols are correct - [dyld_info_nostrip.list][8]

``` bash
dyld_info -exports bin/Release/net7.0-ios/ios-arm64/MySingleView.app/MySingleView > dyld_info_nostrip.list
```

### Repro the new approach 

1. Build the app (the make target uses the new approach)

```bash
make run-device-export-syms
``` 

2. Print the load commands - [load_cmds_export.list][9]

```bash
otool -l bin/Release/net7.0-ios/ios-arm64/MySingleView.app/MySingleView > load_cmds_export.list
```

- We are interested in the export info section ***notice the reduced size of the section***:

```
cmd LC_DYLD_INFO_ONLY
...
export_off 5942432
export_size 1048
```

3. Create a hex dump of the export info section - [hex_dump_export.list][10]

``` bash
xxd -s 5942432 -l 1048 bin/Release/net7.0-ios/ios-arm64/MySingleView.app/MySingleView > hex_dump_export.list
```
    
4. Verify exported symbols are correct - [dyld_info_export.list][11]

``` bash
dyld_info -exports bin/Release/net7.0-ios/ios-arm64/MySingleView.app/MySingleView > dyld_info_export.list
```

---

## Additional benefits

With this approach we could also switch the way strip tool is invoked to
always strip all debug and local symbols via `strip -S -x` instead of passing
the file with symbols to preserve. This would remove the warning that we are
currently getting (which is being ignored):

```
/Applications/Xcode_14.3.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip: warning: removing global symbols from a final linked no longer supported.  Use -exported_symbols_list at link time when building...
```

## Other references:

- https://github.com/qyang-nj/llios/blob/main/exported_symbol/README.md

[1]: 11e7883da0/tools/dotnet-linker/Steps/GenerateReferencesStep.cs (L38-L44)
[2]: https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/DynamicLibraryDesignGuidelines.html
[3]: https://gist.github.com/ivanpovazan/d53f8d10be5e4ea9f39a41ea540aa7fa
[4]: https://gist.github.com/ivanpovazan/60637422f3ff8cb5f437ddd06a21d9c1
[5]: https://gist.github.com/ivanpovazan/352595ad15c2ac02f38dcb3bd4130642
[6]: https://gist.github.com/ivanpovazan/bf700161f2f3691d1d7381c98d4fa0be
[7]: https://gist.github.com/ivanpovazan/44269e4fff5ebd58a4d181451e5c106f
[8]: https://gist.github.com/ivanpovazan/38c5afe076502d514a77420af0e10b01
[9]: https://gist.github.com/ivanpovazan/3f663c3c630005f5a578605d48ba807e
[10]: https://gist.github.com/ivanpovazan/0bb84f64281d05ab20438aeaed64f13c
[11]: https://gist.github.com/ivanpovazan/78b3ba2288f53a2316b9bc46964e7e4f

---------

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2023-06-12 13:45:38 +02:00
Rolf Bjarne Kvinge 6f1c0ea534 [net8.0] Merge main into net8.0. 2023-06-08 13:32:48 +02:00
VS MobileTools Engineering Service 2 1527450920
[dotnet] Set _RequiresILLinkPack=true so that we always restore the ILLink package. (#18412)
This property will be required when building for a net7.0-* target framework
using .NET 8 (preview 6 - preview 5 does not need this fix)

Backport of #18411
2023-06-07 08:48:42 +02:00
Haritha Mohan 4bbd7df8f5
[dotnet] Enable runtime identifiers to be overriden at build time (#18396)
Fixes #17707
The error target for when there is a conflict of interest in defining
both the runtime identifier and runtime identifiers is called during the
multi-rid builds, but not sure if the placement is the most ideal..

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Alex Soto <alex@alexsoto.me>
2023-06-06 13:49:29 -07:00
Rolf Bjarne Kvinge e6e25497a0 [net8.0] Merge main into net8.0. 2023-06-05 10:54:13 +02:00
Rolf Bjarne Kvinge 3e13f66948
[dotnet] Add support for asking more of 'open' when launching desktop apps. (#18366)
* Add support for forwarding our debugging msbuild properties to their
  corresponding environment variables (the XamarinDebug* properties).
* Add support for passing --stdout/--stderr/--stdin to open to redirect
  to/from a file. This is particularly useful for debugging debugging.
* Add support for passing -a (to always create a new instance of the app).
  This is useful when debugging (when the developer would always want a new
  instance, instead of opening an existing instance).
* Also add support for any other argument using the 'OpenArguments' property.

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1825427.
2023-05-30 17:55:31 +02:00
Rolf Bjarne Kvinge d931a9f7ac Merge remote-tracking branch 'origin/main' into bump-main-in-net8.0-2023-05-26 2023-05-26 18:25:37 +02:00
Rolf Bjarne Kvinge 95f6c356d0
[msbuild] Make the GetFileSystemEntries task capable of copying files to the Mac. (#18324)
Make the GetFileSystemEntries task capable of copying files to the Mac, and
enable this new behavior when inspecting references for binding resources.

Otherwise the task might not find anything, if the files aren't copied to the
Mac (this happens if the files originate from NuGets instead of referenced
projects).

Ref:

* https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1808448 (third attempt)
* https://github.com/xamarin/xamarin-macios/issues/18308
* https://github.com/dotnet/maui/issues/15042
2023-05-25 16:34:04 +02:00
Rolf Bjarne Kvinge 22e510c063 [net8.0] Merge main into net8.0. 2023-05-25 07:54:38 +02:00
VS MobileTools Engineering Service 2 a054c52d54
Localized file check-in by OneLocBuild Task: Build definition ID 17751: Build ID 7800490 (#18306)
This is the pull request automatically created by the OneLocBuild task
in the build process to check-in localized files generated based upon
translation source files (.lcl files) handed-back from the downstream
localization pipeline. If there are issues in translations, visit
https://aka.ms/icxLocBug and log bugs for fixes. The OneLocBuild wiki is
https://aka.ms/onelocbuild and the localization process in general is
documented at https://aka.ms/AllAboutLoc.
2023-05-23 08:26:52 +02:00
Rolf Bjarne Kvinge ab73088c0b [net8.0] Merge main into net8.0. 2023-05-19 08:06:07 +02:00
Rolf Bjarne Kvinge b8baa07418
[net8.0] Merge main into net8.0. (#18296) 2023-05-19 07:44:07 +02:00
dotnet-maestro[bot] 99ffae1f0d
[net8.0] Update dependencies from dotnet/installer (#18271)
This pull request updates the following dependencies

## Coherency Updates

The following updates ensure that dependencies with a *CoherentParentDependency*
attribute were produced in a build used as input to the parent dependency's build.
See [Dependency Description Format](https://github.com/dotnet/arcade/blob/master/Documentation/DependencyDescriptionFormat.md#dependency-description-overview)

- **Coherency Updates**:
  - **Microsoft.NET.ILLink.Tasks**: from 8.0.0-preview.5.23252.13 to 8.0.0-preview.5.23260.3 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.AspNetCore.App.Ref**: from 8.0.0-preview.5.23252.26 to 8.0.0-preview.5.23262.1 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.NETCore.App.Ref**: from 8.0.0-preview.5.23252.13 to 8.0.0-preview.5.23260.3 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport**: from 8.0.0-preview.5.23225.2 to 8.0.0-preview.5.23252.1 (parent: Microsoft.NETCore.App.Ref)
  - **Microsoft.NETCore.App.Ref**: from 8.0.0-preview.5.23252.13 to 8.0.0-preview.5.23260.3 (parent: Microsoft.Dotnet.Sdk.Internal)

## From https://github.com/dotnet/installer
- **Subscription**: f9b68d84-9c90-4bd0-5499-08db4112d57e
- **Build**: 20230517.7
- **Date Produced**: May 17, 2023 9:29:46 PM UTC
- **Commit**: dda516cbd77ab9dc3c6048a1893b4321cdcda195
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 8.0.100-preview.5.23258.8 to 8.0.100-preview.5.23267.7][29]
  - **Microsoft.NET.ILLink.Tasks**: [from 8.0.0-preview.5.23252.13 to 8.0.0-preview.5.23260.3][30]
  - **Microsoft.AspNetCore.App.Ref**: [from 8.0.0-preview.5.23252.26 to 8.0.0-preview.5.23262.1][31]
  - **Microsoft.NETCore.App.Ref**: [from 8.0.0-preview.5.23252.13 to 8.0.0-preview.5.23260.3][30]
  - **Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport**: [from 8.0.0-preview.5.23225.2 to 8.0.0-preview.5.23252.1][32]
  - **Microsoft.NETCore.App.Ref**: [from 8.0.0-preview.5.23252.13 to 8.0.0-preview.5.23260.3][30]

[29]: 1ab664ce1c...dda516cbd7
[30]: bc9dad2351...888bac3044
[31]: 730dac21a5...059939bda4
[32]: 81590b9b84...ab09b0b8d6
2023-05-19 07:33:48 +02:00
Rolf Bjarne Kvinge 0bc12c8def
Add a managed static registrar. Fixes #17324. (#18268)
Add a new version of the static registrar (called the managed static
registrar), which most notably doesn't use metadata tokens (because NativeAOT
doesn't support metadata tokens). In addition, the new registrar also takes
advantage of new features in both C# and the runtime, in order to be more
performant.

I won't go into detail about everything here, because it would be rather long,
but I've added documentation for the new registrar (the first commit, so start
reviewing there).

Fixes https://github.com/xamarin/xamarin-macios/issues/17324.
2023-05-19 07:30:33 +02:00
Rolf Bjarne Kvinge edd0bc48f2
[msbuild] Fix calling the GetFileSystemEntries task on Windows when not connected to a Mac. (#18287)
Given the following truths:

* A task will (try to) connect to a Mac if its SessionId property isn't empty.
* The BuildSessionId property is always set on Windows when building from an IDE (even if not connected to a remote Mac).

It stands to reason that we can't use BuildSessionId to distinguish between
connected/not conected status on Windows. Instead introduce a new property,
BuildSessionIdIfConnected, which is only set if connected to a Mac (i.e. if
'IsMacEnabled=true').

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1808448 (second attempt).
2023-05-18 18:21:21 +02:00
Rolf Bjarne Kvinge a9c52baa28 [net8.0] Merge main into net8.0. 2023-05-18 17:26:48 +02:00
Rolf Bjarne Kvinge 65590ba8c0 Merge remote-tracking branch 'origin/main' into msr 2023-05-18 15:19:39 +02:00
Emanuel Fernandez Dell'Oca aec2af30ce
[dotnet] Stop looking for the AOT compiler if cached (#18286)
The AOT compiler does not exist on Windows, so this check was making the
cache never work there. We don't really need to check if the compiler
does still exist, since the cache can be deleted by rebuilding the
project if anything fails.
2023-05-17 14:06:10 +02:00
Rolf Bjarne Kvinge bf639a99d7 [dotnet-linker] Add the scaffolding for a ManagedRegistrarStep and a ManagedRegistrarLookupTablesStep. 2023-05-11 12:21:53 +02:00
Rolf Bjarne Kvinge 34264cd98f [dotnet] Add an 'IsManagedStaticRegistrar' feature to the linker.
This way we can ask the linker to inline the Runtime.IsManagedStaticRegistrar property, and remove any dead code paths.
2023-05-11 12:21:53 +02:00
Rolf Bjarne Kvinge b8c7dc7dc3 [net8.0] Merge main into net8.0. 2023-05-11 11:54:37 +02:00
TJ Lambert a54fefd836
[Localization] Revert change to non-breaking space (#18216)
This change didn't really get rid of the non-breaking space and caused
extra changes after we built xamarin-macios.

Co-authored-by: tj-devel709 <tjlambert@microsoft.com>
2023-05-04 21:59:37 -05:00
VS MobileTools Engineering Service 2 9b7b3360da
Localized file check-in by OneLocBuild Task: Build definition ID 17751: Build ID 7704520 (#18191)
This is the pull request automatically created by the OneLocBuild task
in the build process to check-in localized files generated based upon
translation source files (.lcl files) handed-back from the downstream
localization pipeline. If there are issues in translations, visit
https://aka.ms/icxLocBug and log bugs for fixes. The OneLocBuild wiki is
https://aka.ms/onelocbuild and the localization process in general is
documented at https://aka.ms/AllAboutLoc.
2023-05-03 12:32:16 -05:00
Filip Navara abd9883af6
Fix the name of the item function. (#18199)
The name is `HasMetadata`, not `HasMetadataValue`
(https://learn.microsoft.com/en-us/visualstudio/msbuild/item-functions?view=vs-2022).
2023-05-03 16:48:36 +02:00
Rolf Bjarne Kvinge a97b7d5355 [net8.0] Merge main into net8.0. 2023-05-03 15:31:25 +02:00
Rolf Bjarne Kvinge 6e7128b619
[msbuild/tests/dotnet] Add support for xcframeworks for Hot Restart and add tests. Fixes #16571. (#18103)
Rework Hot Restart builds to use as much as possible of the normal build
logic, because this is the easiest way to make sure the Hot Restart build is
as close as possible to normal builds (and we don't end up missing features).

This is done by executing selected parts of a normal build, and at the end we
have a new task that computes where each file goes in the various output
directories Hot Restart uses (HotRestartAppBundlePath, HotRestartContentDir,
HotRestartAppContentDir, etc.)

This PR also:

* Adds a test that runs on Windows and verifies that everything consumed in a
  build is placed in the correct location for a Hot Restart build (this is a
  variation of the BundleStructure test we already have).
* Removes tasks that aren't used anymore.
* Misc fixes to make sure existing code works on Windows.

---

This PR is best reviewed commit-by-commit.

Ref: https://github.com/xamarin/xamarin-macios/issues/13924

* Fixes https://github.com/xamarin/xamarin-macios/issues/16571
* Fixes https://github.com/xamarin/xamarin-macios/issues/16001
* Fixes https://github.com/xamarin/xamarin-macios/issues/10784
* Fixes https://github.com/xamarin/xamarin-macios/issues/17579
* Contributes towards https://github.com/xamarin/xamarin-macios/issues/13924.
2023-05-03 14:09:31 +02:00
Rolf Bjarne Kvinge f3b7673124 [net8.0] Merge main into net8.0. 2023-04-28 11:14:04 +02:00
Rolf Bjarne Kvinge 4a05d47f2e
[dotnet] Add a missing IsMacEnabled check before executing a task in the _ComputeLinkerArguments target. (#18145)
This fixes an issue where the build would fail on Windows if the Windows
machine wasn't connected to a remote Mac.

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1808448.
2023-04-26 15:23:29 +02:00
Rolf Bjarne Kvinge ce19b092c2 [net8.0] Merge main into net8.0. 2023-04-21 12:31:53 +02:00
Rolf Bjarne Kvinge fcbbd2992e [msbuild] Set/fix the PublishFolderType and RelativePath metadata in several places.
Set/fix the PublishFolderType and RelativePath metata for returned items in the ComputeBundleLocation
and ResolveNativeReferences task, so that the new ComputeHotRestartBundleContents
task has enough (and the correct) information to do the right thing with items that
are to be copied to the app bundle.
2023-04-20 18:21:17 +02:00
Rolf Bjarne Kvinge f17bc64d1b [msbuild/dotnet] Rework Hot Restart builds.
Rework Hot Restart builds to use as much as possible of the normal build logic, because
this is the easiest way to make sure the Hot Restart build is as close as possible
to normal builds (and we don't end up missing features).

This is done by executing selected parts of a normal build, and a the end we have
a new task that computes where each file goes in the various output directories Hot
Restart uses (HotRestartAppBundlePath, HotRestartContentDir, HotRestartAppContentDir,
etc.)
2023-04-20 18:21:17 +02:00
Rolf Bjarne Kvinge 9615de3334
[dotnet] Include the parsed runtimeconfig.bin into ResolvedFileToPublish. Contributes towards #17579. (#18087)
This makes it unnecessary to special-case this file for it to copied
correctly when building on Windows (once we've fixed the Windows build to use
ResolvedFileToPublish as the source of truth, like we do on macOS).

This is the first part of a fix for
https://github.com/xamarin/xamarin-macios/issues/17579.
2023-04-19 07:32:13 +02:00
Rolf Bjarne Kvinge 4dbd98b78f
[linker/trimmer] Add opt-in support for not marking NSObjects in user assemblies. Fixes #15723. (#17949)
We mark all types that derive from NSObject when we find them in user
assemblies, so that these types may be used in storyboards (where the linker
can't see them), without having to go through hoops to make sure the linker
doesn't remove these types (which would make the storyboard fail to load,
because it would reference types that were linked away).

However, not everybody uses storyboards, so in some cases it may make sense to
link away as much as possible, so make it opt-in to skip this custom marking.

This is an experimental feature, and will break at least some apps. It may
break most apps, but if someone wants to try it out, they're welcome!

It can be turned on by passing `--skip-marking-nsobjects-in-user-assemblies=true` to mtouch/mmp:

```xml
<PropertyGroup>
    <MtouchExtraArgs>--skip-marking-nsobjects-in-user-assemblies=true</MtouchExtraArgs>
</PropertyGroup>
```

Fixes #15723.
2023-04-13 16:38:04 +02:00
Rolf Bjarne Kvinge a09d0dc38a
[msbuild] Use our own Unzip task instead of Ditto when extracting compressed plugins. (#18015)
This way we can make the extraction work on Windows for Hot Restart, since ditto
doesn't exist on Windows.

This requires a few other changes:

* Move the Unzip task from the HotRestart tasks to be available everywhere.
* Change the Unzip task to use our existing decompression logic, which calls 'unzip'
  on non-Windows platforms in order to correctly support symlinks.
2023-04-13 16:36:24 +02:00
Rolf Bjarne Kvinge efc7551e3f
[runtime] Add support for passing on a connect timeout to sdb. (#18037)
The timeout can be given:

* By setting the __XAMARIN_DEBUG_CONNECT_TIMEOUT__ environment variable for the app when launching it.
* By passing the XamarinDebugConnectTimeout MSBuild property to 'dotnet run' or 'dotnet build /t:Run'.
* By setting the IOSDebugConnectTimeout MSBuild property at build time.

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1778177.
2023-04-13 16:34:52 +02:00
Rolf Bjarne Kvinge f2dc429f3c [net8.0] Merge main into net8.0. 2023-04-13 08:27:25 +02:00
Rolf Bjarne Kvinge 7973dcef1b
[localization] Fix BOMs. (#18027) 2023-04-12 14:01:18 +02:00
VS MobileTools Engineering Service 2 ada4d2cb31
Localized file check-in by OneLocBuild Task: Build definition ID 17751: Build ID 7603393 (#18005)
This is the pull request automatically created by the OneLocBuild task
in the build process to check-in localized files generated based upon
translation source files (.lcl files) handed-back from the downstream
localization pipeline. If there are issues in translations, visit
https://aka.ms/ceLocBug and log bugs for fixes. The OneLocBuild wiki is
https://aka.ms/onelocbuild and the localization process in general is
documented at https://aka.ms/AllAboutLoc.
2023-04-10 08:23:00 -05:00
Rolf Bjarne Kvinge 059aa7ad8f [net8.0] Merge main into net8.0. 2023-04-10 12:44:17 +02:00
Rolf Bjarne Kvinge 8c9ee8289f
[msbuild/dotnet] Rework how we collect and process native references. (#17554)
Previously, we'd do this:

* Collect all possible native references.
* Extract any compressed native references (*.framework.zip, *.xcframework.zip,
  *.resources.zip) to disk.
* Resolve the resulting native references.

This doesn't work very well on Windows (in non-connected/Hot Restart mode),
because some compressed files may contain symlinks (in particular compressed
xcframeworks). If those symlinks are for any other platform than the one we're
building for, they shouldn't matter, but if we extract the entire compressed
xcframework before figuring out what we need from it, we'd run into symlinks
and not knowing whether they should be ignored or not.

So rework the process to:

* Collect all possible native references.
* Resolve the resulting native references, peeking into zip files if need be.
* Extract any compressed native references, but only the parts of the zip we need.

This way we won't run into any symlinks unless we really need them, and it
should also improve build performance slightly, even on macOS, since we're not
extracting files we won't need (which can be significant for xcframeworks).

Additionally:

* Add support for unzipping on Windows by using System.IO.Compression.
* Show an error if attempting to extract a symlink in the last step in the
  reworked process on Windows.
* Some tests had to be updated (since they poked into internals of the
  ResolveNativeReferences task, and those internals have changed).
2023-04-10 11:27:41 +02:00
Alex Soto df5c2e2862 Merge remote-tracking branch 'xamarin/main' into net8.0-main-merge 2023-04-06 20:12:48 -04:00
Emanuel Fernandez Dell'Oca b7a486a887
[msbuild] Get RecursiveDir directory name only if it isn't empty (#17988)
If the `RecursiveDir` metadata is empty, the GetDirectoryName method
throws an error because it isn't a valid path. This can happen on VS
design time builds.
2023-04-06 17:21:26 -04:00
Alex Soto db0b1ff52f Merge remote-tracking branch 'xamarin/main' into net8.0-main-merge 2023-04-05 15:25:09 -04:00
Milos Kotlar 6d6cee815e
Enable deduplication of generics in Xamarin.iOS build (#17766)
This PR contributes to https://github.com/dotnet/runtime/issues/83193. It
creates a new target `_CreateAOTDedupAssembly`, and makes the `_AOTCompile`
depend on it. Also, it changes the `AOTCompile` task to pass `dedup-skip` and
`dedup-include` to the Mono AOT compiler.

The change was tested on `MySingleView` app and `Monotouch` tests. Both apps
are working, but some monotouch tests are failing due to
`Arg_NotlmplementedException`. Assumption is that calls between Obj-C and C#
could be problematic, as with the dedup improvement enabled, extra methods got
moved from origin assemblies to the dedup assembly, so native to managed
mapping could be corrupted.

Here are preliminary results comparing size on disk and build time between the
baseline (`net8.0` branch) and the target (this branch). Binlog details are
[attached](https://github.com/xamarin/xamarin-macios/files/10942772/binlog.zip).

| App                                      | Baseline size on disk .ipa (MB) | Target size on disk .ipa (MB) | Baseline size on disk .app (MB) | Target size on disk .app (MB) | Baseline build time (s) | Target build time (s) | .app diff (%) |
| ---------------------------------------- | ------------------------------- | ----------------------------- | ------------------------------- | ----------------------------- | ----------------------- | --------------------- | ------------- |
| MySingleView Release iOS                 | 5,40                            | 5,40                          | 29,2                            | 15,20                         | 29,18                   | 16,77                 | 47,94         |
| MySingleView Release  iOSSimulator-arm64 | N/A                             | N/A                           | 469,5                           | 341,80                        | 468,00                  | 330,00                | 27,20         |
| Monotouch Release llvm iOS               | 49,00                           | 38,80                         | 209,60                          | 157,40                        | 115,00                  | 130,00                | 24,90         |

Draft PR should get a full test run on the changes. The following tasks should
be resolved before making this PR ready for review.
2023-03-30 17:27:56 +02:00
Rolf Bjarne Kvinge 335f8c9d90
[dotnet/msbuild] Don't bundle *.xml files that match any assemblies. Fixes #14939 and fixes #15897. (#17908)
This fixes a warning when documentation is enabled for a project:

> The file '~/.nuget/packages/fsharp.core/6.0.0/contentFiles/any/netstandard2.1/FSharp.Core.xml' does not specify a 'PublishFolderType' metadata, and a default value could not be calculated. The file will not be copied to the app bundle.

This doesn't change any behavior (as the warning says, the file wasn't copied
to the app bundle before either), but it makes the behavior explicitly
documented and silences the warning.

Fixes https://github.com/xamarin/xamarin-macios/issues/14939.
Fixes https://github.com/xamarin/xamarin-macios/issues/15897.
2023-03-30 07:24:00 +02:00
Rolf Bjarne Kvinge 8deec35a20
[net8.0] Remove support for .NET 6. (#17901)
Context: https://dotnet.microsoft.com/platform/support/policy/maui

> A major version of .NET MAUI receives support for a minimum of 6
> months after a successor (the next major release) ships. For
> example, .NET MAUI 6.0 will be supported for 6 months after .NET
> MAUI 7.0 ships. Similarly, .NET MAUI 7.0 will receive support for 6
> months after .NET MAUI 8.0 ships.

By the time .NET 8 GA ships, .NET 6 MAUI projects will not be supported.

Remove .NET 6 support from our .NET 8 workloads.
2023-03-29 10:25:25 +02:00
Rolf Bjarne Kvinge 226a5f198f Merge remote-tracking branch 'origin/main' into bump-main-in-net8.0-2023-03-14 2023-03-27 19:53:33 +02:00
dustin-wojciechowski 60b0724b4d
[Templates] Add comments to help developers publish MacCatalyst apps on App Store (#17830)
Added some information to the MacCatalyst templates based on comments from the community
on how to publish MacCatalyst apps on the App Store.

Fixes #17591
2023-03-23 20:21:08 -07:00
Haritha Mohan 3dff232920
[dotnet] Enable generation of runtime configuration file (#17840)
Set the GenerateRuntimeConfigurationFiles (GRCF) property to true 
to avoid warnings at build time + add test for change.

Diving deeper into the fix...
- This warning only occurs with .NET apps which is why GRCF
is only updated in the dotnet directory and not msbuild (legacy)
- After examining the binlog (see issue), it was found that the GRCF 
was contingent upon the HasRuntimeOutput property, which is only 
defined for executable projects. And in this case, the user's project
output type is library thus both the RuntimeOutput and consequently 
GRCF properties were not enabled.
- By setting the GRCF to true we can address the original warning of 
concern while ensuring the rest of the projects's behavior is not
altered
in mysterious ways (i.e. by touching the RuntimeOutput property or the 
project output type instead, these changes could have extraneous
effects).

Fixes #17543

---------

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2023-03-23 08:10:04 -07:00
Rolf Bjarne Kvinge cfa2734a3a Merge remote-tracking branch 'origin/main' into bump-main-in-net8.0-2023-03-14 2023-03-23 15:33:43 +01:00
Rolf Bjarne Kvinge 4131267879 Merge remote-tracking branch 'origin/main' into bump-main-in-net8.0-2023-03-14 2023-03-23 08:36:21 +01:00
Peter Collins 432d27b171
[vs-workload] Update VS Component versions (#17883)
Context: https://github.com/xamarin/sdk-insertions/issues/56

Updates the VS component version for all workloads to use the NuGet
versions commit distance as the third version part.
2023-03-23 08:22:42 +01:00
Rolf Bjarne Kvinge 8ac36f126e
[dotnet] Add support for setting an MSBuild property to pass additional mlaunch arguments. (#17866)
This is helpful when doing a command-line -t:Run build, because it's not
possible to set an item group from the command line.
2023-03-22 16:19:49 +01:00
Rolf Bjarne Kvinge 7ea0044224
[dotnet/msbuild] Copy binding resource packages to output directories together with CopyLocal assemblies. Fixes #13910. (#17806)
With a project structure like this:

* Executable project references a library project.
* The library project references a binding project (or assembly).

The binding project's assembly will be copied to the library project's
output directory during the build. Unless we also make sure any binding
resource packages are copied as well, the executable project won't find those,
and the final app won't contain any native bits from the binding project.

The solution is to add any binding resource packages to the list of
files to be copied to the library's output directory.

Fixes https://github.com/xamarin/xamarin-macios/issues/13910.
2023-03-22 10:49:26 +01:00
Peter Collins 289ded90fe
[vs-workload] Remove @(MultiTargetPackNames) (#17838)
Context: https://github.com/xamarin/yaml-templates/pull/251

The VS manifest files generated during MSI conversion will now be split
up using the workload pack type rather than a substring match.
2023-03-20 15:36:44 -04:00
Rolf Bjarne Kvinge 69f5c42db4 [net8.0] Merge main into net8.0. 2023-03-08 23:48:50 +01:00
Rolf Bjarne Kvinge 256ef1ccd9
[dotnet] Change _IntermediateDecompressionDir to always have a trailing directory separator. (#17728)
Also don't hardcode the trailing directory separator as a forward slash,
because we might be executing on Windows (which is the real purpose behind
this change).
2023-03-07 18:58:25 +01:00
Rolf Bjarne Kvinge 07afcf9e97 [net8.0] Merge main into net8.0. 2023-03-07 18:12:02 +01:00
Rolf Bjarne Kvinge 765139e720
[dotnet] Add support for passing environment variables and custom arguments when launching apps with mlaunch. (#17730)
Environment variables can be specified using the MlaunchEnvironmentVariables
item group, and any other mlaunch argument can be specified using the
MlaunchAdditionalArguments item group.

Also add support for the XamarinDebugPort and XamarinDebugHosts properties to
make it easy to set the corresponding environment variable using the command
line (since setting item groups using the command line isn't trivial).

Fixes https://dev.azure.com/devdiv/DevDiv/_workitems/edit/1755574.
2023-03-07 18:11:45 +01:00
Rolf Bjarne Kvinge be031736be
[net8.0] [tests] Add a .NET 7 test app. (#17385) 2023-03-07 07:58:54 +01:00
Rolf Bjarne Kvinge 0c4be6ec9c Merge remote-tracking branch 'origin/main' into bump-main-in-net8.0-2023-03-03 2023-03-03 13:20:17 +01:00
Rolf Bjarne Kvinge e170ba56d8
[dotnet] Rework how we handle manifest version bands. (#17670)
* Use a separate variable for Mono's and Emscripten's manifest version band,
  so that they can diverge (this is a decision from the corresponding teams,
  we don't control it).
* Have a separate variable for our own manifest version band, so that it's
  easier to hard code it if we want to.
* Rename a few variables to make them clearer.
* Remove hardcoded rc.2 logic, we're not using any rc.2 versions right now, so
  that's dead code.
* A few other minor changes.
2023-03-03 13:17:55 +01:00
Rolf Bjarne Kvinge 7a866a5cc6 [net8.0] Merge main into net8.0. 2023-03-02 15:49:52 +01:00
Mauro Agnoletti 2178951527
[main] Updated Xamarin.Messaging to 1.9.59 (#17646)
Includes latest fixes like support for retry and reconnect, new telemetry, bug fixing, etc.

Also added Merq.Core.dll to dotnet/Workloads/SignList.xml because now it comes as part of Xamarin.Messaging
2023-03-01 08:20:59 +01:00
Rolf Bjarne Kvinge e0c92a03ce
[dotnet] Include the marshal-ilgen component. Fixes #16836. (#17606)
Fixes https://github.com/xamarin/xamarin-macios/issues/16836.
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1751368.
2023-02-24 20:01:43 +01:00
Rolf Bjarne Kvinge fec1e8a946 [net8.0] Merge main into net8.0. 2023-02-22 07:05:49 +01:00
Rolf Bjarne Kvinge ad4af52393
[dotnet] Improve error message when someone tries to disable trimming by setting PublishTrimmed=false. (#17568)
Make it more actionable, by telling users what they can do instead.
2023-02-21 14:54:44 +01:00
Rolf Bjarne Kvinge 7e05ea54bb Merge main into net8.0. 2023-02-17 14:58:12 +01:00
dotnet-maestro[bot] 6eb501be2b
[net8.0] Update dependencies from dotnet/installer (#17444)
This pull request updates the following dependencies

## Coherency Updates

The following updates ensure that dependencies with a *CoherentParentDependency*
attribute were produced in a build used as input to the parent dependency's build.
See [Dependency Description Format](https://github.com/dotnet/arcade/blob/master/Documentation/DependencyDescriptionFormat.md#dependency-description-overview)

- **Coherency Updates**:
  - **Microsoft.NET.ILLink.Tasks**: from 8.0.100-1.23067.1 to 8.0.0-preview.2.23101.2 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.AspNetCore.App.Ref**: from 8.0.0-alpha.1.23076.8 to 8.0.0-preview.2.23101.7 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.NET.Workload.Emscripten.net7.Manifest-8.0.100**: from 8.0.0-alpha.1.23073.2 to 8.0.0-alpha.1.23066.1 (parent: Microsoft.NETCore.App.Ref)
  - **Microsoft.NETCore.App.Ref**: from 8.0.0-alpha.1.23076.9 to 8.0.0-preview.2.23101.2 (parent: Microsoft.Dotnet.Sdk.Internal)

## From https://github.com/dotnet/installer
- **Subscription**: 9a2944cb-7dee-4bf2-a65c-08dabd10ae64
- **Build**: 20230202.11
- **Date Produced**: February 2, 2023 10:28:14 PM UTC
- **Commit**: 5c7737d740c861fe7cda4822a7137c22368000dc
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 8.0.100-alpha.1.23077.6 to 8.0.100-preview.2.23102.11][1]
  - **Microsoft.NET.ILLink.Tasks**: [from 8.0.100-1.23067.1 to 8.0.0-preview.2.23101.2][2]
  - **Microsoft.AspNetCore.App.Ref**: [from 8.0.0-alpha.1.23076.8 to 8.0.0-preview.2.23101.7][3]
  - **Microsoft.NET.Workload.Emscripten.net7.Manifest-8.0.100**: [from 8.0.0-alpha.1.23073.2 to 8.0.0-alpha.1.23066.1][4]
  - **Microsoft.NETCore.App.Ref**: [from 8.0.0-alpha.1.23076.9 to 8.0.0-preview.2.23101.2][5]

[1]: 1d88a6b...5c7737d
[2]: c790896...842ec4a
[3]: 4d75ee9...56cb24c
[4]: ff23620...5b46122
[5]: 007df05...842ec4a
2023-02-13 07:34:42 +01:00
Rolf Bjarne Kvinge bef4867281
[dotnet] Only include the Xamarin.Shared.Sdk.MultiTarget.targets file if it exists. Fixes #16400. (#17498)
Hopefully fixes https://github.com/xamarin/xamarin-macios/issues/16400.
2023-02-13 07:20:05 +01:00
Mauro Agnoletti 7f7942eae0
Imports the .user.env file if exists and the build is from VS (#17466)
This will allow the latest runtime identifier values to be evaluated in time during the MSBuild property evaluation phase.

Related and dependent of this PR: https://github.com/xamarin/XamarinVS/pull/13606
2023-02-08 09:37:39 +01:00
Rolf Bjarne Kvinge 735454f901 Bump min OS platform in template. 2023-02-07 11:47:48 +01:00
Rolf Bjarne Kvinge 9f55faeee0 Merge remote-tracking branch 'origin/net8.0' into bump-main-in-net8.0-2023-02-06 2023-02-07 07:18:23 +01:00
Rolf Bjarne Kvinge 003c656fea Bump new templates to .NET 8. 2023-02-06 14:59:58 +01:00
Rolf Bjarne Kvinge 61dd7b188b Merge main into net8.0. 2023-02-06 08:49:13 +01:00
Andoni Morales Alastruey 97ab14801f
[dotnet] Add support for .so files (#16887)
Autotools-based project using libtool's -module flag generate plugins
with the .so extension that needs to be treated like DynamicLibraries in
terms of deployment location and relocation, except they are not linked
to the app.

This PR adds support for such .so files: they're treated as .dylib files, except
that they're not linked to the app.
2023-02-03 09:16:40 +01:00
Rolf Bjarne Kvinge e6ef460f77 [dotnet] Bump min macOS version in XIB to 10.15. 2023-02-02 16:30:30 +01:00
Rolf Bjarne Kvinge d43c76363f [dotnet] Bump the default SupportedOSPlatformVersion in templates to a version we actually support. 2023-02-02 16:30:29 +01:00
Rolf Bjarne Kvinge 47a387f670
Add support for Visual Basic projects. (#17409)
* Add props and targets files for Visual Basic.
* Add templates for Visual Basic projects.
* Misc other related changes.

This contributes towards https://github.com/xamarin/xamarin-macios/issues/17321.
2023-02-01 21:20:14 +01:00
Rolf Bjarne Kvinge 7b352f5f26 [net8.0] Merge main into net8.0. 2023-01-31 14:52:18 +01:00
Rolf Bjarne Kvinge e0d64e8f61 [msbuild] Add props and targets files for Visual Basic.
These are just the C# versions changed just enough to use Visual Basic instead of C#.
2023-01-31 13:20:19 +01:00
Rolf Bjarne Kvinge bd74a1c266 [dotnet] Copy localizations from C# templates to the Visual Basic templates. 2023-01-31 13:04:41 +01:00
Rolf Bjarne Kvinge 52850559fb [dotnet] Add templates for Visual Basic projects.
Add a Visual Basic templates for:

* All our platforms (iOS, tvOS, macOS and Mac Catalyst).
* A simple project (the ios, tvos, macos and maccatalyst templates).
* A class library property (the ioslib, tvoslib, macoslib and maccatalystlib templates).
2023-01-31 13:12:48 +01:00
TJ Lambert ef8bdf2470
[Localization] Change the Line Endings (#17403)
Created a ticket asking the Localization team if they can control the
line endings before checking-in the code so that we will not have to
continue doing this:
https://ceapex.visualstudio.com/CEINTL/_workitems/edit/773212

---------

Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
2023-01-30 16:37:17 -05:00
VS MobileTools Engineering Service 2 9e4b699705
Localized file check-in by OneLocBuild Task: Build definition ID 17751: Build ID 7255787 (#17392)
This is the pull request automatically created by the OneLocBuild task
in the build process to check-in localized files generated based upon
translation source files (.lcl files) handed-back from the downstream
localization pipeline. If there are issues in translations, visit
https://aka.ms/ceLocBug and log bugs for fixes. The OneLocBuild wiki is
https://aka.ms/onelocbuild and the localization process in general is
documented at https://aka.ms/AllAboutLoc.
2023-01-30 10:34:09 -06:00
Rolf Bjarne Kvinge 1130e1c472 [dotnet] Move templates around a bit to make room for more language-specific project templates. 2023-01-30 17:21:22 +01:00
Rolf Bjarne Kvinge d27667f48a
[dotnet] Change the order of the linker steps. Fixes #17347. (#17360)
The bug manifests like this:

> Could not create an native instance of the type WindowsAzure.Messaging.SBNotificationHub: the native class hasn't been loaded.

which happens because the SBNotificationHub doesn't exist in the final
executable. We asked the linker to link with the static library containing
this type, but the linker didn't link with the library because it didn't need
any of the symbols in it.

We should have collected all the exported Objective-C types from this library
and asked the native linker to keep them, but that didn't happen because:

1. We collect bound Objective-C classes from binding libraries here (the
   ListExportedSymbolsStep): 608765e2c9/tools/linker/MonoTouch.Tuner/ListExportedSymbols.cs (L148-L157)

2. That only happens for attributes with a LinkWith attribute.
	* We compute if an assembly has a LinkWith attribute here:
	  608765e2c9/tools/common/Assembly.cs (L266)
	* Which is called from here:
	  608765e2c9/tools/common/Assembly.cs (L198)
	* Which is called from here (the ExtractBindingLibrariesStep):
	  608765e2c9/tools/dotnet-linker/Steps/ExtractBindingLibrariesStep.cs (L18)

Now, we must obviously compute if an assembly has a LinkWith attribute before
doing anything that depends on that value, but we weren't doing things in that
order.

Changing the custom linker steps to run the ListExportedSymbols step *after*
the ExtractBindingLibrariesStep fixes this logic problem.

Fixes https://github.com/xamarin/xamarin-macios/issues/17347.
2023-01-25 08:59:56 +01:00
Rolf Bjarne Kvinge 50b6eda7c1 Merge main into net8.0. 2023-01-24 15:03:03 +01:00
Rolf Bjarne Kvinge 10accc2cd7
[dotnet/msbuild] Only compile entitlements once for universal builds. Fixes #15632. (#17096)
Fixes https://github.com/xamarin/xamarin-macios/issues/15632.
2023-01-19 16:01:34 +01:00
Rolf Bjarne Kvinge 7d02fa6f4f
[dotnet] Ensure any trimmer components are restored properly. (#17227)
.NET 8 will load the ILLink component based on the target framework of the
project file - so if .NET 8 is building a net7.0-ios app, the build will
restore and use the ILLink component from .NET 7.

There is a problem however:

* The inclusion of the ILLink component is dpendent on the PublishTrimmed
  property - if PublishTrimmed is true, then the ILLink component is restored
  (which makes sense, why restore it if it's not going to be used?).
* We always PublishTrimmed, because the linker must always be executed for our
  projects. So far so good - we can just always enable PublishTrimmed, right?
* Nope, when building on Windows, we only enable PublishTrimmed when connected
  to a Mac, because that's where the ILLink target must be executed (and if
  we're not connected to a Mac, we can't run the ILLink target, and things
  fall apart - so just disable PublishTrimmed in that, since it won't work
  anyway).
* Early on in the build we have no idea if we're connected to a Mac or not,
  which means we can only enable PublishTrimmed in a target, and not as an
  early-on default value. This is *way* to late for the ILLink component,
  which needs PublishTrimmed set quite early in the build process.
* Fortunately, the ILLink inclusion is actually gated on a different variable
  (_IsTrimmingEnabled) - which is initialized from PublishTrimmed if it's not
  set. So the way out here is to set _IsTrimmingEnabled early enough, and now
  the ILLink component is included and restored.
* The additional hurdle is that we need to set _IsTrimmingEnabled in our .NET
  6 and .NET 7 workloads as well, it's not enough to set it in our .NET 8
  workload (which isn't even loaded when building an earlier TFM).
2023-01-16 08:21:09 +01:00
dotnet-maestro[bot] a361cc946a
[net8.0] Update dependencies from dotnet/installer (#16993)
This pull request updates the following dependencies

## Coherency Updates

The following updates ensure that dependencies with a *CoherentParentDependency*
attribute were produced in a build used as input to the parent dependency's build.
See [Dependency Description Format](https://github.com/dotnet/arcade/blob/master/Documentation/DependencyDescriptionFormat.md#dependency-description-overview)

- **Coherency Updates**:
  - **Microsoft.NET.ILLink.Tasks**: from 7.0.100-1.22564.1 to 8.0.100-1.23055.2 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.AspNetCore.App.Ref**: from 8.0.0-alpha.1.22558.5 to 8.0.0-alpha.1.23058.7 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.NETCore.App.Ref**: from 8.0.0-alpha.1.22559.2 to 8.0.0-alpha.1.23058.2 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.NET.Workload.Emscripten.net7.Manifest-8.0.100**: from 8.0.0-alpha.1.22554.1 to 8.0.0-alpha.1.22620.1 (parent: Microsoft.NETCore.App.Ref)

## From https://github.com/dotnet/installer
- **Subscription**: 9a2944cb-7dee-4bf2-a65c-08dabd10ae64
- **Build**: 20230113.2
- **Date Produced**: January 13, 2023 12:09:55 PM UTC
- **Commit**: e0284b3f3c72d8f21e4825ed1ac723d2e829d0a5
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 8.0.100-alpha.1.22605.6 to 8.0.100-alpha.1.23063.2][191]
  - **Microsoft.NET.ILLink.Tasks**: [from 7.0.100-1.22564.1 to 8.0.100-1.23055.2][192]
  - **Microsoft.AspNetCore.App.Ref**: [from 8.0.0-alpha.1.22558.5 to 8.0.0-alpha.1.23058.7][193]
  - **Microsoft.NETCore.App.Ref**: [from 8.0.0-alpha.1.22559.2 to 8.0.0-alpha.1.23058.2][194]
  - **Microsoft.NET.Workload.Emscripten.net7.Manifest-8.0.100**: [from 8.0.0-alpha.1.22554.1 to 8.0.0-alpha.1.22620.1][195]

[191]: cbc7313...e0284b3
[192]: 13b8d6d...4b3f78c
[193]: 1bee0af...cefc6cc
[194]: dd7fdb7...5da4a9e
[195]: b6656f5...66b9845

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2023-01-13 22:53:10 +01:00
Rolf Bjarne Kvinge a0c532afce Merge main into net8.0. 2023-01-10 21:19:12 +01:00
Rolf Bjarne Kvinge 74d7337dcc
[dotnet] Create an MSBuild property for the current min OS version. (#17034)
Create an MSBuild property for the minimum OS version
(`SupportedOSPlatformVersion`) we support for a given platform (named
`[platform]MinSupportedOSPlatformVersion`), and use it in most tests instead
of hardcoding the min OS version (which would otherwise have to be updated
every time we bump the min OS version).
2023-01-10 21:18:39 +01:00
TJ Lambert eae0930fcb
[Localization] Change the line endings to use LF instead of CRLF (#17155)
Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
2023-01-09 10:28:08 +01:00
VS MobileTools Engineering Service 2 a6c71fec74
Localized file check-in by OneLocBuild Task: Build definition ID 17751: Build ID 7141571 (#17131)
This is the pull request automatically created by the OneLocBuild task
in the build process to check-in localized files generated based upon
translation source files (.lcl files) handed-back from the downstream
localization pipeline. If there are issues in translations, visit
https://aka.ms/ceLocBug and log bugs for fixes. The OneLocBuild wiki is
https://aka.ms/onelocbuild and the localization process in general is
documented at https://aka.ms/AllAboutLoc.
2023-01-05 10:11:06 -06:00
Rolf Bjarne Kvinge 995ceaabc4 Merge main into net8.0. 2022-12-23 10:21:29 +01:00
Timothé Larivière 3b73bb658b
Add an additional F# template for Microsoft.iOS.iOSApp (#16823)
Closes #16822 

This PR adds an F# template to the basic Microsoft.iOS.iOSApp template.
This should allow being able to do either:

```
dotnet new ios -lang C# -n MyApp
dotnet new ios -lang F# -n MyApp
```

I had to move the C# template into a `csharp` folder.
Also added the `groupIdentity` `Microsoft.iOS.iOSApp` and set the identity for both C# and F# respectively to `Microsoft.iOS.iOSApp.CSharp` and `Microsoft.iOS.iOSApp.FSharp`

Co-authored-by: Timothé LARIVIERE <timothe.lariviere@fundourselves.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-12-22 12:04:36 +01:00
Andoni Morales Alastruey efad190de9
[msbuild] Validate OutputType property (#16871)
Fixes #16865

```
➜  test dotnet build  -bl:msbuild.binlog
MSBuild version 17.3.2+561848881 for .NET
/usr/local/share/dotnet/sdk/6.0.403/MSBuild.dll -bl:msbuild.binlog -consoleloggerparameters:Summary -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,/usr/local/share/dotnet/sdk/6.0.403/dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,/usr/local/share/dotnet/sdk/6.0.403/dotnet.dll -maxcpucount -restore -verbosity:m ./test.csproj
  Determining projects to restore...
  All projects are up-to-date for restore.
/usr/local/share/dotnet/packs/Microsoft.macOS.Sdk/12.3.471/targets/Xamarin.Shared.Sdk.targets(284,3): error : WinExe is not a valid output type for macOS [/Users/andoni/Downloads/test/test.csproj]

Build FAILED.

/usr/local/share/dotnet/packs/Microsoft.macOS.Sdk/12.3.471/targets/Xamarin.Shared.Sdk.targets(284,3): error : WinExe is not a valid output type for macOS [/Users/andoni/Downloads/test/test.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:01.14
```

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-12-22 07:36:04 +01:00
Rolf Bjarne Kvinge 1be62b286e Merge main into net8.0. 2022-12-20 16:11:10 +01:00
Rolf Bjarne Kvinge e06f49dd90
[dotnet] We no longer need to add the entry assembly as a root assembly for the linker. (#17026)
It's automatically done in the linker's MSBuild logic.

Not only is it no longer necessary (hasn't been for a while), it'll be wrong
in .NET 8 after https://github.com/dotnet/linker/pull/3124.
2022-12-19 18:36:54 +01:00
Rolf Bjarne Kvinge e2c9487027 Merge main into net8.0. 2022-12-16 18:08:15 +01:00
Andoni Morales Alastruey 4cfccff38e
Fix libs reidentification deployed in a subdirectory (#16706)
Dynamic libraries might be deployed in subdirectories such as libclrjit.dylib from the nuget package cefglue.common:
Contents/MonoBundle/CefGlueBrowserProcess/libclrjit.dylib

The library ID for that library should be: @executable_path/../MonoBundle/CefGlueBrowserProcess/libclrjit.dylib

Instead of: @executable_path/../MonoBundle/libclrjit.dylib

Beside the library ID being wrong, when it's combined with the nuget package microsoft.netcore.app.runtime.osx-x64 providing a library with the same name, both uses the same `ReidentifiedPath`, which can cause a failure in the InstallNameTool tasks that are run in parallel operating on the same temporary file.

The following patch uses the `RelativePath` for the tempory file used by `InstallNameTool` so that there are no clashes with other files with the same name deployed in other directories. It also uses the `RelativePath` to create the correct library id: @executable_path/../../Contents/MonoBundle/CefGlueBrowserProcess/libclrjit.dylib

Partially fixes https://github.com/xamarin/xamarin-macios/issues/15173 for this scenario
2022-12-16 09:17:01 +01:00
Rolf Bjarne Kvinge aee3f88ae8
[msbuild/dotnet] Use a more unique property name than _AOTCompiler. (#17049)
Use a more unique property name than _AOTCompiler (use _XamarinAOTCompiler
instead) to try to prevent any problems if somebody else tries to use
'_AOTCompiler' somewhere.

Ref: https://github.com/xamarin/xamarin-macios/pull/17033#discussion_r1047823981
2022-12-16 07:22:51 +01:00
Rolf Bjarne Kvinge 07702485c0 Merge main into net8.0. 2022-12-15 08:49:18 +01:00
Rolf Bjarne Kvinge 7fd33cce1b
[dotnet] Cache the AOT compiler path. Fixes #16774. (#17033)
Cache the AOT compiler path, to avoid an expensive recomputation on every
build. This is even more expensive when building remotely from Windows, so
store the cached value on Windows.

Fixes https://github.com/xamarin/xamarin-macios/issues/16774.
2022-12-14 18:23:43 +01:00
Rolf Bjarne Kvinge 9cdb2042ce Merge main into net8.0. 2022-12-12 18:01:02 +01:00
Rolf Bjarne Kvinge 85b4b791a2
[dotnet] Fix line endings in template localizations. (#16981)
The automatic translation apparently runs on windows, creates files with crlf,
and will check in the corresponding files as such. During the local build
these files will be read and written out again, but now with lf endings,
leaving all these files modified.

So set the 'text' git attribute for these files, so that they're stored as
'lf' and converted to 'crlf' on Windows.
2022-12-12 17:12:35 +01:00
Rolf Bjarne Kvinge 294314a518
[autoformat] Add the rest of the repository. (#16974) 2022-12-07 09:13:36 +01:00
Rolf Bjarne Kvinge 90c4972db1 Merge main into net8.0. 2022-12-07 08:07:44 +01:00
Jeffrey Stedfast 1075c66d95
Fix typo in iOS Storyboard template (#16966)
Partial fix for https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1694105

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-12-06 13:00:28 +01:00
Rolf Bjarne Kvinge 684c664740
[dotnet] Fix the TargetFramework version in a few templates. (#16938) 2022-12-06 08:58:52 +01:00
VS MobileTools Engineering Service 2 a201c4b3af
Localized file check-in by OneLocBuild Task: Build definition ID 17751: Build ID 7046351 (#16955)
This is the pull request automatically created by the OneLocBuild task
in the build process to check-in localized files generated based upon
translation source files (.lcl files) handed-back from the downstream
localization pipeline. If there are issues in translations, visit
https://aka.ms/ceLocBug and log bugs for fixes. The OneLocBuild wiki is
https://aka.ms/onelocbuild and the localization process in general is
documented at https://aka.ms/AllAboutLoc.
2022-12-05 09:10:55 -06:00
Jonathan Peppers b7170fb735
[build] Add support for Visual Studio on win-arm64 (#16935)
Context: https://github.com/xamarin/yaml-templates/pull/204
Context: https://github.com/xamarin/xamarin-android/pull/7471

Updates the VSMAN files generated for our .NET workload to support Visual Studio on windows-arm64.
2022-12-02 09:08:56 +01:00
Rolf Bjarne Kvinge 62a4038187 Merge main into net8.0. 2022-12-01 17:23:19 +01:00