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

9934 Коммитов

Автор SHA1 Сообщение Дата
Sebastien Pouliot 0709c8882f
[msbuild] Always codesign the framework directory, not what's inside (#10309)
**Example #1.** Signing a framework binary is the **same** thing as
signing the framework directory.

```
$ codesign -v --force --timestamp=none --sign - bin/iPhone/Release/xcf_ios.app//Frameworks/lame.framework/lame
bin/iPhone/Release/xcf_ios.app//Frameworks/lame.framework/lame: replacing existing signature
bin/iPhone/Release/xcf_ios.app//Frameworks/lame.framework/lame: signed bundle with Mach-O thin (arm64) [io.sourceforge.lame]

$ codesign -v --force --timestamp=none --sign - bin/iPhone/Release/xcf_ios.app//Frameworks/lame.framework
bin/iPhone/Release/xcf_ios.app//Frameworks/lame.framework: replacing existing signature
bin/iPhone/Release/xcf_ios.app//Frameworks/lame.framework: signed bundle with Mach-O thin (arm64) [io.sourceforge.lame]
```

Nice right ? Pretty much until...

**Example #2.** Signing a framework binary is **NOT** the **same** thing
as signing the framework directory.

```
$ codesign -v --force --timestamp=none --sign - bin/iPhone/Release/xcf_ios.app//Frameworks/flac.framework/flac
bin/iPhone/Release/xcf_ios.app//Frameworks/flac.framework/flac: replacing existing signature
bin/iPhone/Release/xcf_ios.app//Frameworks/flac.framework/flac: signed Mach-O thin (arm64) [flac-55554944583d2f02282c33d8bfed082daa857e30]

$ codesign -v --force --timestamp=none --sign - bin/iPhone/Release/xcf_ios.app//Frameworks/flac.framework
bin/iPhone/Release/xcf_ios.app//Frameworks/flac.framework: replacing existing signature
bin/iPhone/Release/xcf_ios.app//Frameworks/flac.framework: signed bundle with Mach-O thin (arm64) [org.xiph.flac]
```

In this case signing the binary `flac` does not produce the
`_CodeSignature` directory and fails our msbuild Codesign task

The fix is to detect if we're signing a framework like `A.framework/A`
and change this to sign `A.framework` as this will always work.
2021-01-11 16:05:35 -05:00
Rolf Bjarne Kvinge 28791b6e2a
[builds] Create the cache directory if needed. (#10372) 2021-01-11 16:25:56 +01:00
Rolf Bjarne Kvinge 0132667419
[Security] Fix the underlying integral type for SslCipherSuite for Mac Catalyst. (#10321)
This difference manifested as a memory corruption (because we were passing an array
of the enum to native code, and the array was half the size it should be, so native
code write into random memory).
2021-01-11 16:11:38 +01:00
Rolf Bjarne Kvinge 4730ef30b8
[msbuild] Unify the EmbedProvisionProfile and EmbedMobileProvision tasks between iOS and macOS. (#10322)
These two tasks did essentially the same thing, so we can just merge them. I
kept the "EmbedProvisionProfile" name, because that sounded like the most
applicable to all platforms.
2021-01-11 14:34:19 +01:00
Sebastien Pouliot 6d143763c3
[msbuild] Use the existing user framework dSYM when available (#10304)
User frameworks comes in different "shapes"

* You can roll your own (like ours are) and they are likely to be similar
  to dynamic libraries. Of interest is the fact that the native binary
  will include debugging symbols. On which our tools will, at a later
  point, run `dsymutil` to create a `dSYM` and `strip` the binary.

* You can create them with a tool, like Xcode, and the build's output
  will give you a `dSYM` and a stripped (no debug information) binary.

Now we can't process the later like the former. Because if we execute
`dsymutil` on the **stripped** framework we'll get an _empty_ (no symbol)
`.dSYM`. The tool will issue a warning like:

> warning: no debug symbols in executable (-arch arm64)

which is easy to miss since it's informational (now promoted to a proper
msbuild warning).

The result is that the archive will have our new, but _empty_ .dSYM,
which won't be of any help to symbolicate crashes later.

It's also quite inefficient since
* we run `dsymutil` way too often (to produce nothing useful)
* we run `strip` on the, already stripped, framework binary

The solution is to check if the user framework comes with a `.dSYM`.
If it does then this is the one we should bundle in the archive and we
can skip the `dsymutil` and `strip` steps.

If it does not have one (dSYM) then the current logic is the best we can
do, i.e. assume there might be debug information inside the binary,
extract it (`dsymutil`) and remove it (`strip`) from shipping code.
2021-01-11 08:32:56 -05:00
Sebastien Pouliot a6866b4864
[msbuild] Remove the old `--rsrc` argument when using `ditto` (#10303)
`--rsrc` has been the default since macOS 10.4
2021-01-11 08:23:35 -05:00
Rolf Bjarne Kvinge 22d65a560d
[tests] Add xtro support for Mac Catalyst. Fixes #10214. (#10289)
* [xtro] Add support for Mac Catalyst. Fixes #10214.

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

* Update xtro.

* Bump Objective-Sharpie.

* Delete .todo files for frameworks we don't support.

* And another one bites the dust.

* [xtro] Update.
2021-01-11 11:56:58 +01:00
Rolf Bjarne Kvinge fa65fc4bcf
[versions-check.csharp] Improve this script a bit (#10323)
* Pass -s to csharp to tell it the rest of the arguments are the script and its arguments.

    Fixes these warnings printed to the terminal:

        warning CS2002: Source file `7.0' specified multiple times
        warning CS2002: Source file `10.15' specified multiple times

* Add an exception handler and return 1 if there are any exceptions.
2021-01-11 10:47:57 +01:00
Manuel de la Pena 031e14f1a3
[Actions] Add the user to all branches. Remove monojenkins. (#10368) 2021-01-08 16:21:41 -05:00
Přemek Vysoký 1c34588487
[xharness] Bump the shared library version
This is mainly to bring in this fix: dotnet/xharness@841114a
(two parameters were swapped and BundleIdentifier was set to AppPath)

Other changes contained:

We don't log the full XML when listing devices anymore, just the file size
SimulatorLoader has a new method that accepts retryCount
2021-01-08 15:47:56 -05:00
Manuel de la Pena e2db8536f4
[CI][VSTS] Add trigger for xcode branches. (#10349)
fixes: https://github.com/xamarin/maccore/issues/2355
2021-01-07 17:30:50 -05:00
Manuel de la Pena f218681d7b
[Actions] Ensure the new bot is considered. (#10352)
@monojenkins is no more.
2021-01-07 15:41:00 -05:00
Sebastien Pouliot 89482b5d5b
[macos] Handle symlinks in user frameworks (#10281)
User frameworks for macOS often uses symlinks (as Xcode creates them
this way).

This cause problem cause the symlink is on the binary and we expected
the `_CodeSignature` directory to by side-by-side with the binary. This
was missing and cause exceptions when codesigning such frameworks.

A second problem happened because `mmp` use `lipo -thin` to remove
non-required architectures. However when a framework has symlinks, like:

```
├── Frameworks
│   └── Universal.framework
│       ├── Resources -> Versions/Current/Resources
│       ├── Universal -> Versions/Current/Universal
│       └── Versions
│           ├── A
│           │   ├── Resources
│           │   │   └── Info.plist
│           │   ├── Universal
│           │   └── _CodeSignature
│           │       └── CodeResources
│           └── Current -> A
```

then this actually replaced the (very small) symlink with a thin version
of the framework. Which means the original one was still _fat_ and the
whole app was now larger than the original version.

Sample used: https://github.com/spouliot/xcframework/tree/main/xamarin/xcf-mac
2021-01-07 11:20:31 -05:00
Manuel de la Pena 4396368851
[CI][VSTS] Add comments to PR not only to commits. (#10350)
The GitHup url to be used to create comments in PRs is diff to the one
for comments. Use the build reason AND the changeID to identify if we
are building due to a PR and use the correct url.

fixes: https://github.com/xamarin/maccore/issues/2356

Co-authored-by: Alex Soto <alex@alexsoto.me>
2021-01-07 10:57:49 -05:00
Manuel de la Pena 6de4e717e7
[CI][VSTS] Add the donet 6 pkg as a dependency. (#10348)
Ensure that the new dotnet 6 is installed so that we do build with the
support for it.

fixes: https://github.com/xamarin/maccore/issues/2354
2021-01-06 18:21:46 -05:00
Manuel de la Pena 7a06a22be4
[CI][VSTS] Add the correct mac pkg file name. (#10347)
The wrong variable was used and therefore the dir path was used instead
of the mac pkg name.

fixes: https://github.com/xamarin/maccore/issues/2353
2021-01-06 18:18:24 -05:00
Manuel de la Pena 30f0010184
[CI][VSTS] Ensure that xharness creates an index with the correct uris. (#10345)
The prefix of the location of the logs depends on the platform where it
was executed (else we step on them) but that was not added in the env
var use by xharness.

fixes: https://github.com/xamarin/maccore/issues/2349
2021-01-06 15:33:57 -05:00
Manuel de la Pena 1e78a9de6a
[VSTS] Move away from Jenkins to VSTS pipelines for xamarin-macios. (#10302)
Initial implementation of the projects CI in yaml to be uses with VSTS. The port is not complete as there are some small issues to address, the following are the known issues:

* https://github.com/xamarin/maccore/issues/2349 
* https://github.com/xamarin/maccore/issues/2350
* https://github.com/xamarin/xamarin-macios/issues/10299
* https://github.com/xamarin/xamarin-macios/issues/10298
* https://github.com/xamarin/xamarin-macios/issues/10300
* https://github.com/xamarin/maccore/issues/2351

Nevertheless the CI already compiles the project, creates the pkgs and nugets and publishes them so that we can create insertions.


Co-authored-by: Mike Bond <mjbond-msft@outlook.com>
Co-authored-by: cadsit <connor.adsit@gmail.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-01-06 10:48:54 -05:00
Rolf Bjarne Kvinge 734c120bb0
[tests] Add a Xamarin.Forms test project using Mac Catalyst. (#10319) 2020-12-18 22:16:51 +01:00
Rolf Bjarne Kvinge eb09e593b1
[src] Any type forwarders in iOS' Xamarin.iOS.dll must appear in the Mac Catalyst facade as well. (#10317)
This shows up in a Xamarin.Forms app, which has a reference to
System.Drawing.RectangleF in Xamarin.iOS.dll, which is a type forwarder to
System.Drawing.Common.dll. That type forwarder must also exist in the
Xamarin.iOS.dll Facadate that Mac Catalyst uses.
2020-12-18 16:50:02 +01:00
Rolf Bjarne Kvinge 61bd40e39c
[mtouch] Allow referencing Xamarin.iOS.dll in a Mac Catalyst app. (#10318) 2020-12-18 16:47:08 +01:00
Rolf Bjarne Kvinge 93bbfe7a86
[tests] Merge apitest into xammac_tests. (#10276)
* [apitest] Sanitize files by adding missing eols.

* [apitest] Add #if __MACOS__ to all test files.

In preparation for the move into monotouchtest.

* [apitest] Move test files into monotouchtest.

* [tests] Remove the apitest project.

* [monotouch-test] Remove MessagingMac.cs, it's not needed.

* [xammac-tests] Add file PlatformInfo.cs to the build.

* [xammac-tests] Move files into monotouch-test.

* [monotouch-test] Rename test class to not clash with another test class of the same (Objective-C) name.

* [tests] How did this ever work?

Answer: it never did.

* [monotouch-test] Remove duplicated test code.

* [xammac-tests] Define DYNAMIC_REGISTRAR when we're using the dynamic registrar.

* [monotouch-test] Adjust the BundleTest.TestGetBundleId test to cope with having multiple apps for the same bundle id.

* [monotouch-test] Ignore a test that doesn't work with the static registrar (due to a bug in the static registrar).
2020-12-18 11:45:06 +01:00
Alex Soto 1b530b6872
[main] Update API diff to the xcode12.3 release (#10313) 2020-12-17 18:07:49 -05:00
Alex Soto 04461cd5c8
Merge pull request #10306 from dalexsoto/main-xcode12.3
[main] Merge xcode12.3 into main
2020-12-17 15:20:24 -05:00
Rolf Bjarne Kvinge 1582bf47cc
Add support for binding projects in Mac Catalyst. Fixes #10286. (#10295)
* [tests] Build test-libraries for Mac Catalyst.

* [msbuild] Add support for Mac Catalyst binding projects.

* [mtouch] Allow frameworks for Mac Catalyst apps.

* [mtouch] Put frameworks in the expected location for Mac Catalyst apps.

* [msbuild] Create the Resources directory before trying to put files in it.
2020-12-17 18:53:16 +01:00
Rolf Bjarne Kvinge c98b51feb7
[bgen] Avoid a NullReferenceException when reporting multiple attributes on a type. Fixes #10310. (#10311)
Fixes https://github.com/xamarin/xamarin-macios/issues/10310.
2020-12-17 15:12:32 +01:00
Rolf Bjarne Kvinge ef0763bbac
[tests] Use the FSharp.Core NuGet for Mac Catalyst. (#10307)
We're not shipping F# assemblies for Mac Catalyst, so just use the ones from
NuGet instead.

This is a partial fix for https://github.com/xamarin/xamarin-macios/issues/10217.
2020-12-17 15:01:20 +01:00
Alex Soto 4645ed29ed [src] Add AdServices to Mac Catalyst frameworks 2020-12-16 10:17:52 -05:00
Alex Soto 6dbd74c12d [versions] Add back the MACCATALYST_NUGET_VERSION var 2020-12-16 08:21:49 -05:00
Alex Soto bd16f26f88 Merge remote-tracking branch 'xamarin/xcode12.3' into main 2020-12-15 23:50:18 -05:00
Rolf Bjarne Kvinge bf847323a0
Replace manually maintained code about frameworks with generated code. (#10218)
* [src] Generate the string constants for each framework from our list of frameworks.

This makes it less error prone to add new frameworks (one less place to add
them), and easier to add new platforms (only one place to make sure the list
of frameworks is correct).

This also revelead a few issues in our list of frameworks (missing frameworks,
frameworks that have been moved, etc.), which have been fixed.

* [mmp] Generate the library path -> namespace map for the linker to optimize away dlopen statements.

* Fix indentation to be just as broken as the surrounding indentation.

* Remove unused Cecil reference.

* Fix c&p oversight.

* Adjust more Mac Catalyst API.

* CFNetwork is its own top-level framework.
2020-12-15 18:44:05 +01:00
Sebastien Pouliot d7684319cd
[xtro] Fix nullability checks on parameters (#10279)
and fix most (append for AppKit) additional missing/extra null that this
fix detected in the bindings
2020-12-15 08:24:10 -05:00
Manuel de la Pena 896479e1bd
[VSTS] Remove all the device pipelines. (#10280)
With the migration away from Jenkins, we do not longer ping them.
2020-12-14 16:43:06 -05:00
Rolf Bjarne Kvinge ddb890f140
[Foundation] Fix nullability for the 'resourceValues' parameter for NSUrl.CreateBookmarkData. Fixes #10261. (#10272)
Fixes https://github.com/xamarin/xamarin-macios/issues/10261.
2020-12-14 14:18:14 -05:00
Sebastien Pouliot 50e91deda7
[spritekit] Add nullability to (generated and manual) bindings (#10262)
See [HOWTO](https://github.com/xamarin/xamarin-macios/wiki/Nullability)
2020-12-14 08:32:17 -05:00
Manuel de la Pena f059a7ec8b
[Actions] Add a rebase action. (#10259)
As part of the effort to move away from jenkins, the @monojenkins bot will be retired. This adds an action to be used that does the same job.

The new action can be executed via '@vs-mobiletools-engineering-service2 rebase'
2020-12-12 16:38:01 -05:00
Manuel de la Pena 6c6d8e32b7
[Actions] Add the backport action (#10258)
* [Actions] Add the backport action

As part of the effort to move away from jenkins, the @monojenkins bot will be retired. This adds an action to be used that does the same job.

New action can be executed via '/sudo backport $TARGET_BRANCH'
2020-12-12 16:36:16 -05:00
Rolf Bjarne Kvinge 9a20a26694
[compare-commits] Rework logic to build xamarin-macios again from a separate clone. (#10264)
Rework the code to generate an API comparison and a generator comparison: we
now clone xamarin-macios into a different directory, checks out the hash we
want to compare against, build the whole thing, and then compare the results.

This is somewhat slower than the previous implementation (which would checkout
the previous hash and build that on top of the existing build), but since we
don't have to build mono, it shouldn't make too much of a difference (the
biggest chunk of our build is building src/, and we had to do that anyway with
the previous implementation as well).

The upside is that it should be much more reliable.

Fixes https://github.com/xamarin/maccore/issues/2034.
Fixes https://github.com/xamarin/maccore/issues/1467.
Fixes https://github.com/xamarin/maccore/issues/1059.
Maybe https://github.com/xamarin/maccore/issues/1173 too.
2020-12-12 16:27:16 -05:00
Rolf Bjarne Kvinge 6e71956f3e
[Foundation] Fix typo in NSFileCoordinator.CoordinateBatc[h]. Fixes #10260. (#10263)
Fixes https://github.com/xamarin/xamarin-macios/issues/10260.
2020-12-11 14:43:52 +01:00
Alex Soto 7d385cf705
Merge pull request #10257 from dalexsoto/main-mono-bump
[main][mono] Bump mono to match Android
2020-12-10 20:50:41 -05:00
Alex Soto c51fabee8a
Merge pull request #10256 from dalexsoto/xcode12.3-mono-bump
[xcode12.3][mono] Bump mono to get watchsim64 fix
2020-12-10 20:30:58 -05:00
Alex Soto d5b500ff58 Revert "[tests] Ignore bcl-tests that causes a SIGFPE (#10235)"
This reverts commit 318ee8a3f5.
2020-12-10 14:31:18 -05:00
Sebastien Pouliot db77ed51a1
[msbuild] Fix xcframework support when used directly as native references (#10219)
instead _indirectly_ thru a binding project.

It got broken when I fixed the msbuild tests (to avoid re-building
needlessly the project).

Test case: https://github.com/spouliot/xcframework

Also don't resolve when building binding projects - since it's not useful (as we already package the whole .xcframework)
2020-12-10 12:45:58 -05:00
Alex Soto 051ffe51ad Revert "[tests] Ignore bcl-tests that causes a SIGFPE"
This reverts commit 2c3f8a69d2.
2020-12-10 09:59:42 -05:00
Alex Soto 2417bd4d40 [mono] Bump mono to match Android
New commits in mono/mono:

* mono/mono@5e9cb6d1c1 Use explicit arithmetic checks in the amd64 watchOS simulator. (#20647)
* mono/mono@4fdfb5b1fd Bump bockbuild for gtk+ patch
* mono/mono@6f6c3286b6 [runtime] Avoid checking for hardened runtime on ios, its not needed, and it causes alerts because of PROT_WRITE|PROT_EXEC. (#20623)
* mono/mono@124f115714 Fix iOS sdks build on Xcode 12 (#20574)

Diff: dfbfe5eed1..5e9cb6d1c1
2020-12-10 09:52:03 -05:00
Alex Soto 82dce5ff46 [mono] Bump mono to get watchsim64 fix
New commits in mono/mono:

* mono/mono@5e9cb6d1c1 Use explicit arithmetic checks in the amd64 watchOS simulator. (#20647)
* mono/mono@4fdfb5b1fd Bump bockbuild for gtk+ patch
* mono/mono@6f6c3286b6 [runtime] Avoid checking for hardened runtime on ios, its not needed, and it causes alerts because of PROT_WRITE|PROT_EXEC. (#20623)
* mono/mono@124f115714 Fix iOS sdks build on Xcode 12 (#20574)
* mono/mono@dfbfe5eed1 [2020-02] Build makefile to support Mac Catalyst (#20566)

Diff: ac596375c7..5e9cb6d1c1
2020-12-10 09:43:44 -05:00
Rolf Bjarne Kvinge 26803f791d
[dotnet] Set default runtime feature switches. (#10250)
Set all current feature switches, except for InvariantGlobalization, to
defaults which trim the features.

Ref: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md
Ref: https://github.com/xamarin/xamarin-android/pull/5337

This drops the hello world app size from 28.6 MB to 23.5 MB. Full report:
https://gist.github.com/rolfbjarne/71cc18b49446862f1d42aa29526b0ac6
2020-12-10 15:19:40 +01:00
Rolf Bjarne Kvinge 38531bdcab
[CallKit] Add to macOS. (#10244) 2020-12-10 11:37:15 +01:00
Rolf Bjarne Kvinge 2a2c7f8087
[src] Fix dependencies of the maccatalyst-defines.rsp files for .NET assemblies. (#10248) 2020-12-09 16:31:32 -05:00
Alex Soto 7a2ee467c6
[xcode12.3] Bump to Xcode 12.3 RC (#10240)
* [xcode12.3] Bump to Xcode 12.3 RC

* Remove the odds to make it even
2020-12-09 12:24:02 -05:00