Put the shell code for resetting README dependencies in a shell script instead
of embedded in the Makefile so that it's easier to write, read and debug.
Also add support for switching between different remotes for README
dependencies (this means that `make reset-X` will now work fine if `X`'s
remote changed).
A side effect is that all README dependencies will now end up with a 'xamarin'
remote in addition to the 'origin' remote, but this should have no other
effect.
The MSBuild tasks will codesign an executable if the executable's timestamp is
later than `_CodeSignature/CodeResources`'s timestamp (or if
`_CodeSignature/CodeResources` doesn't exist).
Unfortunately, the codesign executable modifies both of those files, and the
executable last. This means that even just after running codesign, the
executable's timestamp might be later than `_CodeSignature/CodeResources`'s
timestamp (due to HFS+'s one-second timestamp resolution, this might happen
all within the same second, which means that this is a random issue: the
problem only occurs if the executable was modified at least a second later
than `_CodeSignature/CodeResources`.)
So make sure to touch `_CodeSignature/CodeResources` after running codesign,
so that the next time a build occurs (with no modifications), we don't resign
needlessly.
Fixes this (random) test failure when running the MSBuild tests:
1) Test Failure : Xamarin.iOS.Tasks.TargetTests.RebuildExecutable_NoModifications
#1: ../MySingleView/bin/iPhoneSimulator/Debug/MySingleView.app/MySingleView
Expected: 2017-11-30 10:04:20.000
But was: 2017-11-30 10:04:22.000
Fixes https://github.com/xamarin/maccore/issues/592.
Complete the earlier stubs (committed to avoid tests failures) and add
`[Mac (10,14, onlyOn64: true)]` attributes on them.
This solves two XM failures when running on Mojave
```
3) ApiCoreImageFiltersTest.CheckManagedFilters (Introspection.MacCoreImageFiltersTest.ApiCoreImageFiltersTest.CheckManagedFilters)
Managed filters not found for CIAreaMinMax, CIDither, CIGuidedFilter, CIMeshGenerator, CIMix, CISampleNearest
Expected: 0
But was: 6
at Introspection.ApiCoreImageFiltersTest.CheckManagedFilters () [0x0019e] in /Users/poupou/git/xcode10/xamarin-macios/tests/introspection/ApiCoreImageFiltersTest.cs:146
at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in /Users/poupou/git/xcode10/xamarin-macios/external/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:305
4) ApiCoreImageFiltersTest.CheckNativeFilters (Introspection.MacCoreImageFiltersTest.ApiCoreImageFiltersTest.CheckNativeFilters)
6 native filters missing: CIAreaMinMax, CIDither, CIGuidedFilter, CIMeshGenerator, CIMix, CISampleNearest
Expected: 0
But was: 6
```
Also introduce a new base type `CIReductionFilter` as found by tests
```
[WARN] CIAreaMaximum.SuperClass == CIReductionFilter (native) and CIFilter managed
[WARN] CIAreaMaximumAlpha.SuperClass == CIReductionFilter (native) and CIFilter managed
[WARN] CIAreaMinimum.SuperClass == CIReductionFilter (native) and CIFilter managed
[WARN] CIAreaMinimumAlpha.SuperClass == CIAreaMaximumAlpha (native) and CIFilter managed
```
Finally `CIMeshGenerator` is incomplete because the generator does not
support (never had to before) `NSArray` in filters, so we cannot express
`CIVector[]`. Filed as https://github.com/xamarin/xamarin-macios/issues/4226
* [Jenkins] Create artifacts.json and set a GH status as 'Jenkins: Artifacts'.
* [jenkins] Include the url in artifacts.json
* [jenkins] Add sha256 checksum to artifacts.json as well.
* [Jenkins] Enable xamarin before provisioning so that we auto-provision Xcode.
* [jenkins] Fix passing flags to configure.
Quoting empty CONFIGURE_FLAGS ends up doing this:
./configure "" --disable-ios-device
and since configure parses arguments until it finds an empty argument, it
would stop parsing at the first argument, effectively not disabling the device
build.
So don't quote CONFIGURE_FLAGS when invoking configure. shellcheck doesn't
quite like this, but the better code is much more complex, and not really
needed, so just add an exception.
Add support for building on internal Jenkins.
Jenkins has been configured to build every branch on xamarin/xamarin-macios that contains a `jenkins/Jenkinsfile`, which means it will start working as soon as this PR is merged.
Results will be posted as statuses on each commit, which can be viewed using the url `https://github.com/xamarin/xamarin-macios/commits/<branch>`:
![screenshot 2018-06-01 11 12 57](https://user-images.githubusercontent.com/249268/40832932-c3b05eb0-658c-11e8-9670-8de5fcc23407.png)
* The `continuous-integration/jenkins/branch` status links to the jenkins job.
* The other two are XI and XM packages (the `Jenkins-` prefix will be removed once we officially switch from Wrench to Jenkins).
More detailed information will be added as a comment to each commit, which can be seen by clicking on the commit and scrolling to the bottom (url of the format `https://github.com/xamarin/xamarin-macios/commit/<sha1>`)
![screenshot 2018-06-01 11 14 33](https://user-images.githubusercontent.com/249268/40833014-fd8772f4-658c-11e8-8a35-5df46bfb16c7.png)
Unfortunately GitHub does not display the commit statuses when viewing a single commit, so to view those statuses you'll have to view the list of commits (the `/commits/` url). Tip: it's possible to use `<sha1>` instead of `<branch>` (and vice versa for that matter) if you're interested in the statuses of a particular commit.
Pull requests will also be built (only from contributors with write access), but by default nothing will be done (the job will exit immediately, although a green check mark will still show up). Jenkins will **not** add a comment in the pull request in this case.
However, if the label `build-package` [1] is set for a pull request, the internal jenkins job will run (it will do everything except the local xharness test run: this includes creating and publishing packages, creating various diffs, run tests on older macOS versions, test docs, etc). A detailed comment will also be added to the pull request (see below for multiple examples), which means that there will be two Jenkins comments: one for the public Jenkins which builds every PR, and one for the internal Jenkins [2].
[1] I don't quite like the name of the label, because it doesn't get even close to explain all that will actually happen, but `run-on-internal-jenkins-and-create-package` is a bit too long IMHO... Also it's non-obvious that this is the label to apply if the reason for executing on the internal jenkins is some other reason (for instance to test a maccore bump). Other ideas:
* `run-internal-jenkins`: doesn't make it obvious that a package will be created (which is probably the most common reason to want to run on internal jenkins)
* We could have multiple labels that mean the same thing: `build-package`, `internal-build`, `run-internal-jenkins`, etc, but it's redundant and I don't quite like it either.
* Any other ideas?
[2] I'm noticing now that these two look quite similar and this might end up confusing (the main difference is that the comment from the public jenkins will say **Build success/failure** and **Build comment file:** at the top. If something goes wrong the failure will also show up differently). Should this be made clearer?
For the api diff for this PR we now show:
* `🔥 breaking changes 🔥`: If there are any breaking changes in the api diff (for this PR).
* `please review changes`: If there are any non-breaking changes in the api diff.
* `no change`: If the api diff is empty.
For the generator diff we show:
* `only version changes`: If there were only changes related to version numbers (since the XI/XM version number is added to the generator, that version number will always show up as a diff when comparing the generated source code)
* `please review changes`: If anything other that version numbers changed in the generated source code.
A few general categories of fixes:
* Sprinkle lots of quotes everywhere.
* Don't use environment variables in the format string to printf, instead pass them as arguments.
* Don't use backticks to execute commands (it's deprecated), use the new "$(...)" syntax instead.
Implement support for skipping API comparison by applying a label to a pull
request.
This also required some refactoring to move existing code to fetch the labels
for a pull request to a separate script.
We can't create an API/generator diff for a pull request with conflicts, so
detect this scenario and show a better error than this (from #3961):
Comparing the changes between origin/pr/3961/merge^1 and HEAD:
fatal: ambiguous argument 'origin/pr/3961/merge^1..HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
fatal: ambiguous argument 'origin/pr/3961/merge^1': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Headers mention macOS 10.13 but, upon verification, the latest 10.13.5
still reports the key as missing from the framework.
Also remove the 10,13,4 maximum since we now have Mac(10,14) attributes
in the platform assemblies (which solve the previous issue)
* [generator] Fixes WrapAttribute usage with interface protocols
Fixesxamarin/xamarin-macios#3869
We need to support the scenario where `WrapAttribute` is used
to wrap an interface protocol type declaration like:
```csharp
[Wrap ("WeakDelegate")]
[NullAllowed]
ICLSDataStoreDelegate Delegate { get; set; }
[NullAllowed, Export ("delegate", ArgumentSemantic.Weak)]
NSObject WeakDelegate { get; set; }
```
We generated invalid code for the setter that needed an explicit cast
and ended up with a CS0266 compiler error:
Bad generated code:
```csharp
[CompilerGenerated]
public ICLSDataStoreDelegate Delegate {
get {
return WeakDelegate as ICLSDataStoreDelegate;
}
set {
WeakDelegate = value;
}
}
```
Good generated code:
```csharp
[CompilerGenerated]
public ICLSDataStoreDelegate Delegate {
get {
return WeakDelegate as ICLSDataStoreDelegate;
}
set {
var rvalue = value as NSObject;
if (value != null && rvalue == null)
throw new ArgumentException ("The object passed of type " + value.GetType () + " does not derive from NSObject");
WeakDelegate = rvalue;
}
}
```
* [tests] Add introspection tests to ensure there are native linking instructions for all frameworks. Fixes#3976
or a good, documented (in test code) reason for not needing it.
https://github.com/xamarin/xamarin-macios/issues/3976
* Fix failures
- static registrar failed on 32bits because one type in PhotoUI missed
its `onlyOn64: true`
- link with the top, not the sub-frameworks
* [tvos] Fix mistakes in tvOS where some extranous types triggered unrequired/unavailable (or missing) frameworks
* [watchos] Fix watchOS frameworks mapping
* Bump to use Xcode 10 beta 1
* Update Versions.plist
* Add a dependency on Xcode 9.4.
* [msbuild] Fix build with Xcode 10 beta 1. (#4182)
Many years ago (in Xcode 7 according to code comment)
Developer/Platforms/iPhoneOS.platform/Developer/usr disappeared, and we coped
by looking at Developer/usr instead (and also the subsequent code to locate
the bin directory was based on the location of the usr directory).
Developer/Platforms/iPhoneOS.platform/Developer/usr reappeared in Xcode 10
beta 1, but it seems useless (for one it doesn't contain a bin directory), so
in order to try to keep things sane don't look for this directory in Xcode 10
and instead go directly for Developer/usr (which is what we've been using as
the usr directory for years anyway).
Fixes this problem when building apps with Xcode 10 beta 1:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(626,3): error : Could not locate SDK bin directory [/Users/rolf/Projects/TestApp/test-app.csproj]
* [runtime] Build 32-bit mac executables using Xcode 9.4.
* [mtouch] Work around broken tvOS headers in Xcode 10 beta 1.
* [mtouch] Work around build problem with Apple's simd headers in Objective-C++ mode.
* Use version-agnostic paths to sdk directories.
* [tests][xtro] Add todo files (from unclassified) and adjust ignore files to avoid errors
* [macos][security] Re-enable SSL[Get|Set]AlpnProtocols. Fixes#4001 (#4022)
* [macos][security] Re-enable SSL[Get}Set]AlpnProtocols. Fixes#4001
This was fixed in macOS 10.13.4
https://github.com/xamarin/xamarin-macios/issues/4001
* [tests][monotouch-tests] Disable a few test cases (one crasher, other failures). Causes to be verified later
* [xharness] Fix permission dialog suppression in Xcode 10.
* [xharness] Ignore 32-bit macOS tests by default.
* [tests] Execute mmp regression tests with Xcode 9.4 since many of them are 32-bit and needs porting to 64-bit.
* [mmptest] Ignore 32-bit XM tests if we don't have a 32-bit-capable Xcode.
* [registrar] Add workaround for broken headers in Xcode 10 beta 1 (radar 40824697).
* [mtouch] Restrict another workaround for an Xcode 10 beta 1 bug to a specific Xcode version to remove it asap.
* [tests] Fix some protocol changes (public or not) find by introspection tests
* [tests][intro] Fix DefaultCtorAllowed failures
* [Intents] Obsolete several Intents classes in watchOS.
Several existing Intents classes have been marked as unavailable in watchOS in
the headers in Xcode 10 beta 1, and corresponding tests are now failing.
So obsolete the managed wrapper types, and fix tests accordingly.
* Fix xtro wrt previous Ietents/intro changes
* [tests] Minor adjustments to mtouch tests to work with Xcode 10.
* [msbuild] Update tests to cope with additional files produced by the Core ML compiler.
* [msbuild] Xcode 10 doesn't support building watchOS 1 apps, so show a clear error message explaining it.
Also update tests accordingly.
* [coreimage] Stub new filters and exclude ?removed? ones from tests
* Update GameplayKit and SpriteKit NSSecureCoding _upgrade_ and fix other non-public cases (in tests)
* [tests] Ignore some GameKit selectors that don't respond anymore (but seems to be available, at least in header files)
* [tests] Fix intro 32bits testing for filters resutls
* [msbuild] Slightly change error message to be better English.
The PR is not final and cannot be merged until the final Xcode 9.4
release from Apple is available.
Since there's no macOS specific changes (at least up to beta 2) we can
directly merge into the _normal_ milestone branch and avoid having
separate branches to maintain for XI and XM (until 15.8).
watchOS extensions are top-level containers in our build (because we ignore
watchOS apps entirely in mtouch), so treat them as such when computing the
protocol member map.
Fixes issue https://github.com/xamarin/xamarin-macios/issues/3930.
* Add failing test for tag issue
* [msbuild] Update msbuild to use correct XM AOT variables
- The IDE saves out AOTMode and HybridAOT but msbuild was older names