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

8441 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 7cf88c4fbf
Bump GuiUnit. (#8920)
New commits in mono/guiunit:

* mono/guiunit@40ed270 Print the full test name when showing labels. (#19)
* mono/guiunit@b05141d Print errors at the end. (#20)
* mono/guiunit@29faffa Merge pull request #18 from mono/update-gitignore
* mono/guiunit@22c0fdf Just ignore obj directories in general

Diff: 9affe48139..40ed270ba7
2020-06-23 08:47:33 +02:00
Rolf Bjarne Kvinge cd265f852c
[configure] Add an option to enable/disable install-source. (#8904)
Disable by default, but automatically enable for CI builds.

This makes running 'make install' with a fully built tree take ~8s instead of
20+s.
2020-06-22 10:26:21 +02:00
Rolf Bjarne Kvinge 36a1ec4fc1
[xharness] Set the working directory to the project directory when building projects. (#8910)
This is particularly important when we have global.json and NuGet.config in
the project directory, because those are looked up starting with the current
directory, so those two need to match.
2020-06-22 10:25:19 +02:00
Manuel de la Pena 3cf2fc1316
[DevOps] Do not fail the tests is xamarin-storage cannot be reached. (#8912)
Try to create the folder in xamarin-storage, if that fails, rather than
stop with an error, execute the tests and st an env var.

Once the tests are complete, when adding the summaries, check if we did
fail to reach xamarin-storage and notify it.

This will make sure that tests won't fail if:

* xamarin-storage dies.
* bots are not in the vpn and could not reach xamarin-storage.
2020-06-19 20:18:35 -04:00
Chris Hamons 1150156e06
[AVFoundation] Remove unnecessary Equals/GetHashCode that caused crash (#8907)
- Found in https://github.com/xamarin/xamarin-macios/issues/8882
- It turns out that https://github.com/xamarin/xamarin-macios/pull/8091 changed behavior so this:
	return (obj == null);
- Would call another equals which would call the original equals and it would repeat until stack overflow
- Missing manual tests tracked in https://github.com/xamarin/xamarin-macios/issues/8905
2020-06-19 15:17:21 -05:00
Manuel de la Pena 670d68c86c
[DevOps] Improve the comments added in GitHub. (#8898)
Comments were ugly. Clean a little the markdown.
2020-06-19 11:45:21 -04:00
Rolf Bjarne Kvinge 53c285c097
Merge pull request #8887 from rolfbjarne/dotnet-linker-generate-main
[dotnet] Generate a main function, and use it to compile the main executable.
2020-06-19 17:45:05 +02:00
Manuel de la Pena 6bc4dc4649
[Bump] Bump maccore to use the new yaml pipelines. (#8897)
Commits:

* [DevOps] Update the pipeline ids to point to the new yaml based ones. (#2241)

Complete diff: 8b437d6ae3...8eee91b69c
2020-06-19 11:43:06 -04:00
Rolf Bjarne Kvinge c181d26ae4 Improve diagnostic output. 2020-06-19 17:41:04 +02:00
Rolf Bjarne Kvinge b39bd0e420
[msbuild] Make sure all the Base/Core tasks are abstract. (#8888)
Also add a cecil test ensure our leaf MSBuild tasks don't have code.
2020-06-19 17:40:18 +02:00
Sebastien Pouliot 76a61f1290
[runtime] Remove internal memcpy p/invoke (#8890)
* Replace `memcpy` with `Buffer.MemoryCopy`
* Add cecil-based test to make sure we're not p/invoke into it again (nor any other MS banned API)
* Remove `memcpy` from xtro ignore file
2020-06-19 09:41:54 -04:00
Sebastien Pouliot 4a23951829
[runtime] Fix warning in launcher.m (#8891)
```
launcher.m:136:9: warning: unused variable 'size' [-Wunused-variable]
        size_t size;
               ^
1 warning generated.
```

missed in https://github.com/xamarin/xamarin-macios/pull/8853
2020-06-19 09:40:01 -04:00
Sebastien Pouliot 96eb54dcb2
[runtime] Use `strnlen` instead of `strlen` (#8893)
`strlen` is part of the list of C API banned by Microsoft.

Also rename a local variable in `Runtime.cs` so grepping the source
files won't show `strlen` outside the `tests` subdirectories.
2020-06-19 09:36:02 -04:00
Manuel de la Pena 34362be245
[Harness] Add an extra index that will use full uris. (#8889)
Vsdrops does not support serving a static html. Therefore we need to use
full uris that will be used to download the logs. To make things less
dangerous, we leave the xamarin-storage report as it was and create a
new one for vsdrops.

This means that:

1. xamarin-storage index.html is left as is.
2. vsdrops_index.html contains full uris to download (the env var will
   have to be set in the step) and js and css are in the header.
3. because we use and env var, jenkins won't generate the
   vsdrops_index.html only device pipelines will.

For this to take effect needs updates in the device pipelines. The
solution is not yet optimal since we need to add some workaround to
rather than make the monitoring person open a text file, we should
display it in the browser.

Co-authored-by: Chris Hamons <chris.hamons@xamarin.com>
2020-06-18 19:51:14 -04:00
Manuel de la Pena 78730b8ceb
[DevOps] Update contexts to be more clear. (#8896)
The contexts are the ones that link a status with a device run. Update
them so that we do know the labe used (and remove a typo where we used
TvOS).
2020-06-18 17:10:01 -04:00
Manuel de la Pena 1b6b5dec20
[Devops] Use correct variables template on ddfun tvos pipeline. (#8895) 2020-06-18 15:28:47 -04:00
Manuel de la Pena 96e14746b3
[Devops] Fix typo in beta device pipeline. (#8894) 2020-06-18 15:15:37 -04:00
Manuel de la Pena ed8a00152e
[Devops] Add support for yaml pipelines in the old device pipelines. (#8862)
This commit moves all the different pipelines we have to fully use yaml.
That includes the old ddfun pipeline that was using a mix between using
yaml and the UI interface to configure it.

The new pipelines are found under the tools/devops/device-tests
directory. All of the use a very similar structure and therefore we use
a template. The README.md inside the directory should explain most of
the logic and the devices-tests.yml contains comments for each of the
steps.

Most of the bash scripts have been moved to use pwsh which is inside the
scripts directory and contains tests. Tests can be ran via:

```bash
make -C tools/devops/device-tests/scripts run-tests
```

This commit will only affect the ddfun pipeline that will need to be
updated to use the new yml path. All the other pipelines are not
affected and they will be to be updated manually.

The pipelines support two different storages for the html report.

* xamarin-storage: Old school.
* vsdrops: New age.

Unfortunatly we yet do not know how to workaround the fact that vsdrops
does not serve the files, therefore we use the xamarin-storage in all
pipelines but those in the ddfun lab because they do not have the right
access.

This later can be easily changed editing the
tools/devops/device-tests/tempaltes/cambridge-variables.yml which will
update all the pipelines in the cambridge lab.

PS: Sorry for the size.
2020-06-18 14:15:59 -04:00
Sebastien Pouliot a58f5ec82b
[modelio] Remove internal `Runtime.memcpy` usage from MDLAnimatedValueTypes (#8885)
Refactor code to have a single method checks alignment, allocates (if
alignment is needed) and, optionally, copy the existing data

note: we already had tests for those manually bound API
2020-06-18 11:56:37 -04:00
Rolf Bjarne Kvinge 6ad1cba473
[monotouch-test] Lower indirect command buffer availability. (#8886)
Apple's charts say indirect command buffers are available with MTLGpuFamilyCommon2.

That's not quite so, devices that support MTLGpuFamilyCommon2 may crash when
MTLDevice.CreateIndirectCommandBuffer is called.

So make the conditions for calling CreateIndirectCommandBuffer an intersection
of the previous condition for macOS (MTLFeatureSet.macOS_GPUFamily2_v1) + the
new condition (MTLGpuFamily.Common2) + Xcode 11+ (just to make things
simpler).

I've tested this on all our macOS bots, and it worked on all of them.

If it fails anywhere else (iOS devices), the next patch will remove the entire
test.
2020-06-18 17:55:20 +02:00
Rolf Bjarne Kvinge a6d9678260 [dotnet] Add a LinkNativeCode task and link the output from the CompileNativeCode task into a main executable. 2020-06-18 15:57:02 +02:00
Rolf Bjarne Kvinge 8594af3b2c [dotnet] Add a CompileNativeCode task and compile the generated main code into object files. 2020-06-18 15:57:01 +02:00
Rolf Bjarne Kvinge 72bbee78c0 [dotnet] Load the output from the GenerateMain step into the MSBuild targets.
The GenerateMain step needs to return the generated filename to the MSBuild targets, and it does so by writing out MSBuild xml which is then loaded into the MSBuild logic.
2020-06-18 15:57:01 +02:00
Rolf Bjarne Kvinge 1401624e09 [dotnet-linker] Add a GenerateMain step.
This generates a very basic Main method that doesn't do anything at all.
2020-06-18 15:57:01 +02:00
Rolf Bjarne Kvinge c6abc2fea1 [dotnet-linker] Add CacheDirectory and ItemsDirectory to the linker configuration. 2020-06-18 15:57:01 +02:00
Rolf Bjarne Kvinge da1db99954 [dotnet-linker] Pass TargetArchitectures to the linker. 2020-06-18 15:52:16 +02:00
Rolf Bjarne Kvinge a3b638bea3 [dotnet] Compute ComputedPlatform based on the architecture. 2020-06-18 15:52:16 +02:00
Rolf Bjarne Kvinge 9f98c8fdfd [dotnet] Deduce the architecture from the runtime identifier. 2020-06-18 15:52:16 +02:00
Rolf Bjarne Kvinge 197026622e [dotnet-linker] Add the MachO.cs file to get the Abi enum.
This also requires adding support for the ErrorHandler machinery, which the
MachO.cs file needs.

I considered extracting the Abi enum from the MachO.cs file, but it's used in
several places (including externally, such as binding-tools-for-swift), which
means this would be a rather disruptive change.

I also considered modifying MachO.cs to make it possible to build without the
ErrorHandler machinery, but since we'll need it all anyway eventually, I
decided against this option as well.
2020-06-18 15:52:16 +02:00
Rolf Bjarne Kvinge 6bc03419fa
[msbuild] Unify the CompileAppManifest target. (#8875)
Also rework the class hierarchy a little bit, so that Xamarin.iOS and
Xamarin.Mac are identical:

    CompileAppManifestTaskBase
    └─── iOS/CompileAppManifestTaskCore
    │    └─── iOS/CompileAppManifest
    └─── Mac/CompileAppManifestTaskCore
        │    └─── Mac/CompileAppManifest
2020-06-18 15:46:45 +02:00
Rolf Bjarne Kvinge d8cd95d4e1
[msbuild] Split out min version argument calculation from MetalTask. (#8876) 2020-06-18 15:17:33 +02:00
Sebastien Pouliot 577af10467
[runtime] Remove strlen and memcpy usage from runtime/xamarin-support.m (#8879)
* NSString can give us the length of the string
* NSData can copy memory into a supplied buffer

The later is already covered by tests in `tests/linker/ios/link all/InternalsTest.cs`
2020-06-18 08:06:59 -04:00
Sebastien Pouliot ce45a0267b
[runtime] Remove memcpy usage from Runtime.CloneMemory (#8880)
instead use `Buffer.MemoryCopy`.

Currently only used from `CGDataProvider`. Added unit tests for the
public/indirect, usage of the API (we had none).
2020-06-18 08:01:16 -04:00
Rolf Bjarne Kvinge c3bcfac582
Unify code for executing processes. (#8848)
* Create a simple Xamarin.Utils.Execution class that can handle all our
  process execution needs:
    * Captures or streams stdout/stderr (in UTF8).
    * Supports async
    * Supports a timeout
    * Does not depend on any other source file we have, only uses BCL API.
* Have the execution helper classes from mtouch/mmp
  (Xamarin.BundlerDriver.RunCommand) and the tests
  (Xamarin.Tests.ExecutionHelper) use this new class.
* Some simplifications were made:
    * All API that took a string array for the environment now takes a
      Dictionary<string, string>.
    * The Driver.RunCommand methods were split out to a separate file. This
      file also contains a Verbosity field, which is conditioned on not being
      in mtouch nor mmp, which makes including this file from other projects
      simpler (such as bgen - in particular bgen was modified to use this
      Verbosity field instead of its own).
2020-06-18 12:34:07 +02:00
Rolf Bjarne Kvinge ac7056ccb9
Bump maccore. (#8866)
* Bump maccore.

New commits in xamarin/maccore:

* xamarin/maccore@f1526568f4 [tests] Run the correct sample tests when launched from CI (#2234)

Diff: ed6d146822..f1526568f4

* Bump maccore to get additional fix.

New commits in xamarin/maccore:

* xamarin/maccore@8b437d6ae3 [tests] Fix parameters to launch sample tests in CI. (#2238)

Diff: f1526568f4..8b437d6ae3
2020-06-18 12:05:59 +02:00
Rolf Bjarne Kvinge 7a97cc9f31
[AppKit] NSTextView allows passing nil to PasteAsPlainText and PasteAsRichText. (#8873)
* [AppKit] NSTextView allows passing nil to PasteAsPlainText and PasteAsRichText.

This is documented in Apple's documentation, their headers, and even proved
experimentally.

* Update xtro.
2020-06-18 10:57:23 +02:00
Rolf Bjarne Kvinge 1d269a12d0
[monotouch-test] Check for Metal compatibility for all platforms before creating indirect command buffers. Fixes #xamarin/maccore@2235. (#8863)
This fixes an iOS assertion (crash) when running on iPhone 6 with iOS 12+:

    2020-06-15 13:52:35.138 monotouchtest[6887:5713672] failed assertion 0 at line 54 in NopIndirectCommandBuffer

    =================================================================
    	Native Crash Reporting
    =================================================================
    Got a abrt while executing native code. This usually indicates
    a fatal error in the mono runtime or one of the native libraries
    used by your application.
    =================================================================

    =================================================================
    	Native stacktrace:
    =================================================================
    	0x1060b23fc - /private/var/containers/Bundle/Application/B3C2F137-4C0F-48EF-A50A-8972FF268069/monotouchtest.app/libmonosgen-2.0.dylib : mono_dump_native_crash_info
    	0x1060a8674 - /private/var/containers/Bundle/Application/B3C2F137-4C0F-48EF-A50A-8972FF268069/monotouchtest.app/libmonosgen-2.0.dylib : mono_handle_native_crash
    	0x1060b1948 - /private/var/containers/Bundle/Application/B3C2F137-4C0F-48EF-A50A-8972FF268069/monotouchtest.app/libmonosgen-2.0.dylib : sigabrt_signal_handler
    	0x20049e9fc - /usr/lib/system/libsystem_platform.dylib : <redacted>
    	0x2004a4094 - /usr/lib/system/libsystem_pthread.dylib : <redacted>
    	0x200383ea8 - /usr/lib/system/libsystem_c.dylib : abort
    	0x2029c5dac - /System/Library/Frameworks/Metal.framework/Metal : MTLGetWarningMode
    	0x2210cff78 - /System/Library/Extensions/AGXMetalA8.bundle/AGXMetalA8 :
    	0x20299fb80 - /System/Library/Frameworks/Metal.framework/Metal : <redacted>
    	0x103143c58 - /private/var/containers/Bundle/Application/B3C2F137-4C0F-48EF-A50A-8972FF268069/monotouchtest.app/libXamarin.iOS.dll.dylib : wrapper_managed_to_native_ObjCRuntime_Messaging_IntPtr_objc_msgSend_IntPtr_nuint_UInt64_intptr_intptr_intptr_System_nuint_ulong
    	0x102f4cbdc - /private/var/containers/Bundle/Application/B3C2F137-4C0F-48EF-A50A-8972FF268069/monotouchtest.app/libXamarin.iOS.dll.dylib : Metal_MTLDevice_Extensions_CreateIndirectCommandBuffer_Metal_IMTLDevice_Metal_MTLIndirectCommandBufferDescriptor_System_nuint_Metal_MTLResourceOptions
    	0x101a8bd58 - /private/var/containers/Bundle/Application/B3C2F137-4C0F-48EF-A50A-8972FF268069/monotouchtest.app/libmonotouchtest.exe.dylib : MonoTouchFixtures_Metal_MTLDeviceTests_ReturnReleaseTest
    	[...]

Fixes https://github.com/xamarin/maccore/issues/2235.
2020-06-18 08:59:35 +02:00
Manuel de la Pena 1d5557c328
[DevOps] Move away from a testing branch and use main. (#8874) 2020-06-17 12:59:44 -04:00
Manuel de la Pena a20f8ddcbe
[Devtools] Do not try to install tools via brew if present.] (#8872) 2020-06-17 11:27:26 -04:00
Sebastien Pouliot 44d3e1b7ba
[runtime] Simplify string code inside launcher by using ObjC (#8859)
This avoids the use of `strcpy`, `memcpy` and `strlen` which can be
misused. We're already using ObjC code inside the file so we can
leverage higher-level API that makes review the code easier.
2020-06-17 10:03:35 -04:00
Manuel de la Pena 9ddb35720b
[Harness] Add a more general IHarness interface. (#8868)
In order to be able to test the TestSelectro in PR
https://github.com/xamarin/xamarin-macios/pull/8768 we need a more
general interface to mock and ensure that the correct properties are set
by the TestSelector.
2020-06-16 16:04:38 -04:00
Sebastien Pouliot f9aa25cefa
[runtime] Replace custom string concatenation inside `mono-runtime.m.t4` (#8865)
by simpler, at least to review, ObjC code.
2020-06-16 13:26:58 -04:00
Rolf Bjarne Kvinge 6ced972a68
[msbuild] Add a GetMinimumOSVersion target that reads the app manifest and outputs the MinimumOSVersion. (#8858)
This makes it possible for several other tasks to take the MinimumOSVersion as
direct input, instead of the app manifest's path. Previously the app manifest
(Info.plist) was loaded and parsed in each task, slightly differently in each
place, and in addition there are differences between macOS and other
platforms, which made it even worse. This code refactoring also made it
possible to remove an error code which wasn't necessary anymore.

This task also computes the default MinimumOSVersion if none is specified in
the app manifest.

There is one breaking change: a library project could previously specify an
inexistent Info.plist, and it would build fine. This will now result in a
"Error loading 'Info.plist': File not found" error. This is trivial to fix:
just remove the Info.plist from the project file (or an alternative solution
could be to condition the inclusion of the Info.plist in the project file on
the existence of the Info.plist).

New commits in xamarin/Xamarin.MacDev:

* xamarin/Xamarin.MacDev@a1bc6f3 [Xamarin.MacDev] Split IAppleSdkVersion.TryParse in two methods. (#73)

Diff: 45c5a680e2..a1bc6f39b3
2020-06-16 17:40:04 +02:00
Rolf Bjarne Kvinge fbdd1b8e3f
[msbuild] Share the DeviceSpecificIntermediateOutputPath property. (#8854)
* [msbuild] Share the DeviceSpecificIntermediateOutputPath property.

We don't technically need this value for Xamarin.Mac, but many of the targets
that can be shared need to use this for Xamarin.iOS, so set this value for
Xamarin.Mac as well. It will always be the default IntermediateOutputPath for
Xamarin.Mac, while for Xamarin.iOS it might be changed in
_ComputeTargetArchitectures.

* [msbuild] Remove usage in Xamarin.Mac of a variable that was always empty in the past.
2020-06-16 17:39:47 +02:00
Rolf Bjarne Kvinge 24719920dc
[xharness] Make ConsoleLog thread-safe. Fixes #8569. (#8864)
Fixes https://github.com/xamarin/xamarin-macios/issues/8569.
2020-06-16 17:39:06 +02:00
Rolf Bjarne Kvinge 95e42b9266
Rename master to main. (#8851)
* Fix links that point to master to point to main instead.
* Implement support in the sample tester for specifying the default branch for
  each sample repo.
* Fix various text / documentation to say 'main' instead of 'master.'
* Push to 'main' instead of 'master' in xamarin-macios-data.
* Fix xharness to make 'main' the special branch with regards to documentation tests as opposed to 'master'.
* Fix various CI to use 'main' instead of 'master'.
* Bump maccore

    New commits in xamarin/maccore:

    * xamarin/maccore@ed6d146822 Rename 'master' to 'main'. (#2233)

    Diff: 424fa26148..ed6d146822
2020-06-16 15:51:44 +02:00
Rolf Bjarne Kvinge f236e2fc94
[xharness] Don't ignore a failure to restore nugets. (#8852) 2020-06-16 08:07:37 +02:00
Rolf Bjarne Kvinge 4e71aa43b9
[tests] Use Cache.CreateTemporaryDirectory to create temporary directories for the msbuild-mac tests. (#8856)
This makes it easier to diagnose failures, because the temporary directory stay on disk after
the test has finished executing (until the next time the test is run).
2020-06-16 08:07:23 +02:00
Chris Hamons 78dcb51fe3
Remove notice from generated iOS Apps (#8857)
- The notice points to an out of date page, currently dead (will be redirected soon)
- https://github.com/xamarin/xamarin-macios/issues/8849 is the new home
2020-06-15 15:52:08 -05:00
Sebastien Pouliot 0187a45359
[runtime] Have launcher use https-based URL if mono is missing (#8855) 2020-06-15 14:21:15 -04:00