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

505 Коммитов

Автор SHA1 Сообщение Дата
Manuel de la Pena 4c4b906bc4 [Xcode14] Merge main into xcode14. 2022-07-26 11:15:34 -04:00
Rolf Bjarne Kvinge 9fdae5443d
[dotnet] Use the correct manifest version band. (#15499)
We must use the sdk manifest band when computing the path into sdk-manifests
to install workloads, otherwise they won't be found after installation.

This is a problem when building with .NET 6.0.301, because we want to install
into the sdk-manifests/6.0.300 directory, not sdk-manifests/6.0.301 directory.
2022-07-15 10:26:38 +02:00
Rolf Bjarne Kvinge 786303bb29
[dotnet] Add support for 'make dotnet-install-system'. (#15498) 2022-07-15 09:58:03 +02:00
Rolf Bjarne Kvinge f8ff530796 Merge remote-tracking branch 'origin/main' into xcode14-merge-main-2022-07-12 2022-07-12 14:52:32 +02:00
Rolf Bjarne Kvinge 77a16fcc58
[dotnet] Stop hardcoding the TargetFrameworkVersion in the default items template. (#15386)
This prepares us for net7.0 and beyond; no need to update any of this code anymore.

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-07-12 10:34:15 +02:00
Rolf Bjarne Kvinge 3c7c4e7130
[dotnet] Generate the AutoImport.props file for each platform. (#15387)
This reduces some code duplication.

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-07-12 10:00:35 +02:00
Rolf Bjarne Kvinge f7772d4705
[dotnet] Accept invalid runtime identifiers for Restore. (#15357) 2022-07-12 09:37:01 +02:00
Rolf Bjarne Kvinge 620a4ebbd9
[dotnet] Generate Microsoft.<platform>.Sdk.ImplicitNamespaceImports.props. (#15385)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-07-12 09:34:55 +02:00
Rolf Bjarne Kvinge abbd6ef466
[msbuild/tools] Fix path issues in the FilterStaticFrameworks task and ExtractBindingLibraries step. Fixes #15289. (#15321)
In the FilterStaticFrameworks task:

* Convert Windows-style paths to Mac-style paths.
* Give a better error if a framework can't be found.
* Don't try to copy frameworks that don't exist on Windows to the Mac.

In the ExtractBindingLibrariesStep:

* Return a relative path to frameworks we've extracted to make things easier for
  remote builds.

* In the _ComputeFrameworkFilesToPublish target, don't compute the source
  directory for frameworks using RootDir + Directory, because some frameworks
  may only exist on the mac, and RootDir + Directory will be a Windows path
  when building remotely. Instead use 'Identity', which is a relative path and
  will work on both Windows and Mac.

Fixes https://github.com/xamarin/xamarin-macios/issues/15289.
2022-07-11 10:39:54 +02:00
Rolf Bjarne Kvinge 1ecd84353f
[dotnet] Fix hang after packing .NET NuGets. Fixes #13355. (#15407)
This has been bothering me for a while... the symptom is that the build just
hangs at the end. Curiously it's never happend on the bots, only locally.

1. It only happens when using parallel make. When using parallel make, make is
   in a jobserver mode, where sub-makes are controlled using a pair of file
   descriptors inherited by the sub-makes. A consequence of this algorithm is
   that the controlling make process will wait until all inherited file
   descriptors have been closed before it will realize that all its sub-makes
   have finished.
2. 'dotnet pack' will build the corresponding project, and that might start a
   background compiler server.
3. This background compiler server does not seem to close any file descriptors
   it inherits.
4. The background compiler server does not necessarily exit by the time `make`
   is done.
5. The result is that `make` things there are still sub-makes doing stuff,
   because there are inherited file descriptors still open.
6. Killing the compiler server (in another terminal for instance) will make
   make realize it's done (and the hang is resolved).

So I'm applying the last point: shutting down the compiler server after
packing all the .NET NuGets.

Fixes https://github.com/xamarin/xamarin-macios/issues/13355.
2022-07-08 16:50:20 +02:00
Rolf Bjarne Kvinge a9bee06e72
[xcode14] Initial bump. (#15212)
* Use Xcode 14 beta 1
* Bump versions
* Fix numerous issues.

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-06-30 17:29:04 +02:00
Manuel de la Pena 9a8d74b880
[Build] Allow to skip the build of Hotrestart. (#15380) 2022-06-30 09:18:42 -04:00
Manuel de la Pena 8bf0ed7bd1
Merge branch 'xcode14' into xcode14-initial-pr 2022-06-24 12:53:29 -04:00
Peter Collins e39e8e3655
[post-build] Fix Maestro asset publishing (#15339)
Attempts to push build asset information to Maestro started failing
recently:

    D:\a\1\s\xamarin-macios\packages\microsoft.dotnet.arcade.sdk\6.0.0-beta.21212.6\tools\SdkTasks\PublishBuildAssets.proj(43,5): error MSB4062: The "PushMetadataToBuildAssetRegistry" task could not be loaded from the assembly C:\Users\VssAdministrator\.nuget\packages\microsoft.dotnet.maestro.tasks\1.1.0-beta.20570.1\tools\netcoreapp3.1\Microsoft.DotNet.Maestro.Tasks.dll. Could not load file or assembly 'C:\Users\VssAdministrator\.nuget\packages\microsoft.dotnet.maestro.tasks\1.1.0-beta.20570.1\tools\netcoreapp3.1\Microsoft.DotNet.Maestro.Tasks.dll'. The system cannot find the path specified.

Commit a1d0b6eb looks like it may have broken this, as it changed the
`globalPackagesFolder` used for NuGet packages across the repo.

Looking at [PublishBuildAssets.proj][0] we should be able to set the
`$(NuGetPackageRoot)` property to the new `globalPackagesFolder` value,
fixing attempts to load `Microsoft.DotNet.Maestro.Tasks.dll`.

[0]: b8007eed82/src/Microsoft.DotNet.Arcade.Sdk/tools/SdkTasks/PublishBuildAssets.proj (L32)
2022-06-23 16:31:17 -04:00
Rolf Bjarne Kvinge baf9f82c9e Merge remote-tracking branch 'origin/xcode14' into xcode14-initial-pr 2022-06-22 23:51:52 +02:00
Rolf Bjarne Kvinge 3be1d9d760
Use unix-style line endings in project files. (#15303)
This also removes the BOM in a few project files.

This is a whitespace-only change, as can be seen here: https://github.com/xamarin/xamarin-macios/pull/15303/files?w=1
2022-06-21 17:22:58 +02:00
Rolf Bjarne Kvinge 3e10f01a8d [dotnet] Adjust condition for _ComputeLinkNativeExecutableInputs to ignore the entire target unless connected to a Mac.
Fixes:

> Xamarin.Shared.Sdk.targets(1151,14): error MSB4184: The expression "[MSBuild]::VersionGreaterThanOrEquals('', 14.0)" cannot be evaluated. Version string was not in a correct format.
2022-06-15 16:20:09 +02:00
Rolf Bjarne Kvinge 22f7ad1deb Fix typo. 2022-06-13 12:20:48 +02:00
Rolf Bjarne Kvinge c05e774612 [dotnet/tools] Disable compact unwind on Xcode 14 to fix linker warnings.
Ref: https://codereview.chromium.org/2784253003
Ref: https://github.com/grain-lang/binaryen.ml/pull/136
Ref: https://github.com/ocaml/ocaml/issues/9026
Ref: https://gitlab.haskell.org/ghc/ghc/-/issues/11829
2022-06-13 10:56:02 +02:00
David Ortinau 5532f148d8
[Templates] Updated app icons for net6 templates (#15237)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-06-10 22:39:56 +02:00
Rolf Bjarne Kvinge a1d0b6eba9
Make our local .NET the default .NET for the build. (#15086)
Make our local .NET the default .NET (in the root's global.json), and then if
a directory wants to use the system .NET, then that directory would have to
opt-in (using its own global.json).

This way we don't have to copy global.json/NuGet.config files around to run
tests with the correct .NET setup.
2022-06-07 10:11:02 +02:00
Rolf Bjarne Kvinge 5039634a5c
[dotnet] Condition default inclusion on the target framework version. (#15196) 2022-06-07 09:45:16 +02:00
Rolf Bjarne Kvinge 0e5b2c32c1
[dotnet] Remove some dead build logic. (#15180)
The _BTouchCompileCommand property is never used, so we can just delete it.
2022-06-03 10:41:09 +02:00
Rolf Bjarne Kvinge b062f2be6c
[dotnet] Change condition when to include the System.Runtime.InteropServices.NFloat.Internal package reference. (#15183)
'BundledNETCorePlatformsPackageVersion' will be 7.0 when building with .NET 7
and using the 'net6.0-*' TFM, but we still need the package reference in that
case. So change the condition to go off TargetFrameworkVersion instead.
2022-06-03 10:40:07 +02:00
Rolf Bjarne Kvinge da7dd02dfd
[dotnet] Make sure to not run the linker when we're on a disconnected Windows build. (#15076)
This also means that we shouldn't load the linker's output. Note that we need
to check _LoadLinkerOutput even if we've already disabled the linker, because
there may be linker output from a previous (connected) build, and we don't
want to load that.

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1542438.
2022-05-23 16:33:09 +02:00
Rolf Bjarne Kvinge 4c2ddcf349
[dotnet-linker] Bump default trampoline count when using the interpreter on x64 in .NET. Fixes #14887. (#15025)
Fixes https://github.com/xamarin/xamarin-macios/issues/14887.
2022-05-18 11:27:28 +02:00
Rolf Bjarne Kvinge 8b9cd60dc6
[dotnet] Update localized json files. (#15024)
This is just changing line endings, ignoring whitespace shows no changes.
2022-05-13 20:49:51 +02:00
VS MobileTools Engineering Service 2 7d9dad24fc
Localized file check-in by OneLocBuild Task: Build definition ID 14411: Build ID 6124703 (#14931)
Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
2022-05-12 12:25:41 -05:00
Rolf Bjarne Kvinge 92eda7f353
[dotnet] Add support for selecting whether to create P/Invoke wrappers or not. Fixes #4940. (#14961)
* This is a potential mitigation for slower transition to native code when
  exception marshalling is enabled (#14812).
* A minor modification was required in the linker, to make sure any modified
  assemblies are saved.

Fixes https://github.com/xamarin/xamarin-macios/issues/4940.
2022-05-11 16:42:01 +02:00
Rolf Bjarne Kvinge f2bcedd441
[msbuild/dotnet] Add support for passing --aot arguments to the AOT compiler. (#14936)
Pick up --aot arguments in MtouchExtraArgs and pass them to the AOT compiler
when building a .NET project. This makes it possible to work around #14887 by
manually increasing the number of trampolines.

Ref: https://github.com/xamarin/xamarin-macios/issues/14887
2022-05-10 16:25:19 +02:00
Rolf Bjarne Kvinge d1b7606181
Adjust versioning scheme for .NET to make the third field the commit distance. (#14923)
Adjust our versioning scheme so that the NuGet version is
`Major.Minor.CommitDistance`. The previous scheme ("Major.Minor.<fixed-ish
version>") causes problems on branches producing stable builds, because each
new commit would end up with the same NuGet version, and we wouldn't be able
to push those to a NuGet feed because there might already be an existing
version there.

By using the commit distance in the NuGet version we ensure that every commit
has a different version.
2022-05-10 09:28:39 +02:00
Rolf Bjarne Kvinge 01c3127c8c
[dotnet] Don't set '_RunAotCompiler' on macOS if 'MtouchInterpreter' is set. (#14874)
There's no AOT compiler for macOS, so setting _RunAotCompiler causes problems
because if it's set, we try to find the AOT compiler, and because there is
none, the build fails.

So don't set '_RunAotCompiler' if 'MtouchInterpreter' is set (which also
indirectly means if 'UseInterpreter' is set) to avoid the problem altogether.
2022-05-05 16:16:40 +02:00
Rolf Bjarne Kvinge 2684b1de5e
[dotnet] Update generated files after template changes. (#14851) 2022-05-03 10:06:27 +02:00
Peter Collins e1073eb630
[dotnet/Templates] Remove preview language (#14842)
Removes the "(Preview)" string from the title of the .NET templates.
2022-04-29 09:56:56 +02:00
Eric Sink b84b80902c
Build fixes (-dotnet) for app extensions (#14685)
Resolves #14285 

1.  Make sure `libextension-dotnet.a` gets built, and with the `-DEXTENSION` flag.
2.  Make sure `libextension-dotnet.a` gets included in the package alongside `libxamarin-dotnet.a`
3. At build time, make sure to link with the correct lib[tv]extension-dotnet.a library depending when we need to.
4. Add some tests.

Co-authored-by: Eric Sink <eric@Erics-MacBook-Pro.local>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-04-25 16:56:52 +02:00
Rolf Bjarne Kvinge a9a638553f
[msbuild/dotnet] Fix building binding projects on Windows in .NET (#14704)
When building a binding project, we need to execute bgen (and csc) on the mac. Figuring
out where these files are on the Mac is rather complicated from a remotely executed
task, so instead we execute a sub-build that computes these properties.

In legacy Xamarin this was accomplished by building the 'Xamarin.iOS.ObjCBinding.Common.props'
file using msbuild, and invoking a custom target that prints the property we're looking
for (the 'targetGetPropertyValue_*' targets).

For multiple reasons this approach doesn't work in .NET anymore (in particular it
seems that the 'Xamarin.iOS.ObjCBinding.Common.After.targets' file with the custom
'targetGetPropertyValue_*' targets is nowhere to be found, but logic has also moved
around in the .targets/.props files which makes just building the 'Xamarin.iOS.ObjCBinding.Common.props'
not work correctly since the properties we need wouldn't be set).

So I'm adding a new task that does a sub-build, using either msbuild or dotnet as
appropriate, to compute the properties we need. Instead of building the 'Xamarin.iOS.ObjCBinding.Common.props'
file, the task creates an actual binding project (an empty one), and executes the
new '_WriteRemoteGeneratorProperties' target in this binding project.

An additional advantage in this new task is that it will only execute one sub-build
where all the properties are computed (the previous approach executed one sub-msbuild
per property).

In order to keep code as similar as possible between legacy Xamarin and .NET, the
new task is being used for legacy Xamarin as well (and the old approach deleted).

This fixes building binding projects on Windows in .NET.
2022-04-22 16:17:03 +02:00
Manuel de la Pena 45650ee23a
[Dotnet] Fix the template on iOS and Catalyst to use the system background color. (#14766) 2022-04-20 07:54:49 -04:00
Rolf Bjarne Kvinge e886e954af
[dotnet] Update localized json files. (#14770)
These files are updated during the build, and the working copy is left dirty,
so commit these files.
2022-04-19 16:26:24 +02:00
VS MobileTools Engineering Service 2 001920f754
Localized file check-in by OneLocBuild Task: Build definition ID 14411: Build ID 6035860 (#14756) 2022-04-18 18:10:04 -04:00
Rolf Bjarne Kvinge 9c185e1fff
[msbuild] Ask ditto to thin native libraries according to the architectures we're targetting. Fixes #13081. (#14403)
Ask ditto to thin native libraries and frameworks when copying them to the app
bundle to remove slices for architectures we're not building for.

Also add tests.

Fixes https://github.com/xamarin/xamarin-macios/issues/13081.

Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
2022-04-07 08:17:01 +02:00
Rolf Bjarne Kvinge 7a0c7428b8
[dotnet] Don't list OS versions we don't support. (#14665)
Our min OS target versions are different between legacy Xamarin and .NET
(former supports earlier versions). The list of versions in the Versions.plist
contain all the versions supported by legacy Xamarin, but that's not correct
for .NET, so don't list any version in Version.plist that's lower than the
minimum OS version we support for a given platform.
2022-04-06 17:53:06 +02:00
Emanuel Fernandez Dell'Oca 3af92421f9
[dotnet] Adds platform specific RID options (#14643)
This enables Visual Studio to set a specific `RuntimeIdentifier` for each platform when building all target frameworks in a MAUI project.

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-04-06 09:39:33 +02:00
Rolf Bjarne Kvinge 6e348f0e65
[dotnet] Port the iOS tabbed app template to .NET. (#14592)
Ref: https://github.com/xamarin/xamarin-macios/issues/10747
2022-04-04 10:05:08 +02:00
Rolf Bjarne Kvinge c4879f5142
[dotnet] Adjust template descriptions to not say .NET 6, just plain .NET instead. (#14607) 2022-04-04 09:52:02 +02:00
Chris Hamons 11a7c84d52
[dotnet] Update macos template to visible at launch (#14581)
Fixes https://github.com/xamarin/xamarin-macios/issues/14420

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-04-01 10:20:28 -05:00
Rolf Bjarne Kvinge 6fa6b75f19
[dotnet] Don't include @(Compile) and @(EmbeddedResource) items in @(BundleResource) items by default. Fixes #14442. (#14571)
Fixes https://github.com/xamarin/xamarin-macios/issues/14442.
2022-03-31 08:17:53 +02:00
Alexander Köplinger b8c493c3e1
Set IsImplicitlyDefined="true" on the System.Runtime.InteropServices.NFloat.Internal PackageReference (#14532)
* Set IsImplicitlyDefined="true" on the System.Runtime.InteropServices.NFloat.Internal

This unbreaks Central Package Management via https://github.com/microsoft/MSBuildSdks/tree/main/src/CentralPackageVersions which is being worked on for NuGet, see https://github.com/NuGet/Home/issues/6764

* Add test case

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-03-30 10:13:39 +02:00
Rolf Bjarne Kvinge 43f87ec4c1
[msbuild] Only conditionally copy the entire input directory from Windows in the Ditto task. (#14495)
Sometimes we want to copy the entire input directory from Windows to the Mac
when executing the Ditto task remotely, and sometimes we don't.

In particular we do not want to copy the input directory when the directory on
Windows is an incomplete mirror of what's on the Mac - one scenario being when
copying the app bundle to prepare for IPA creation. The .app directory on
Windows is not complete - all the files are there (maybe? not quite sure, but
that's beside the point here), but some may be empty, because when we only
care about the timestamp for a file, we'll create an empty file on Windows to
mirror the actual file on Mac. Copying this incomplete directory to the Mac,
overwriting the correct files there, will break things badly.

However, sometimes we're not mirroring a directory on Windows, but instead we
have directories as actual build input (for instances frameworks from NuGets),
and in that case we want to copy everything to the Mac.

So this PR adds a parameter to the Ditto task to optionally copy the directory
from Windows for remote builds, and we enable this behavior when we want it -
specifically when copying frameworks.

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1506009 while not
regressing https://dev.azure.com/devdiv/DevDiv/_workitems/edit/1492635.

Ref: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1506009
Ref: https://dev.azure.com/devdiv/DevDiv/_workitems/edit/1492635
Ref: https://github.com/xamarin/xamarin-macios/pull/14375
2022-03-25 14:08:05 +01:00
Rolf Bjarne Kvinge a1a4771448
[dotnet] Update doc about breaking nfloat changes and when we generate a global using directive. (#14487) 2022-03-25 07:40:23 +01:00
Rolf Bjarne Kvinge d95f2d15ad
[dotnet] Use a variable for 'net6.0' instead of hardcoding it. (#14481)
This makes it easier to bump to 'net7.0' when that time comes.
2022-03-24 16:41:29 +01:00