From 452aeaa59b28ffd15d1f2e91395a5734b2aff1ed Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 26 Feb 2018 07:46:32 +0100 Subject: [PATCH 1/7] [src] Fix csc warnings. (#3589) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that we've switched to csc, we're also delighted to get new warnings 🎉 ObjCRuntime/Blocks.cs(54,26): warning CS0649: Field 'XamarinBlockDescriptor.descriptor' is never assigned to, and will always have its default value AudioUnit/AudioUnit.cs(405,19): warning CS0649: Field 'AudioUnit.handle' is never assigned to, and will always have its default value ObjCRuntime/Blocks.cs(55,23): warning CS0649: Field 'XamarinBlockDescriptor.ref_count' is never assigned to, and will always have its default value 0 ObjCRuntime/Blocks.cs(54,26): warning CS0649: Field 'XamarinBlockDescriptor.descriptor' is never assigned to, and will always have its default value AudioUnit/AudioUnit.cs(405,19): warning CS0649: Field 'AudioUnit.handle' is never assigned to, and will always have its default value ObjCRuntime/Blocks.cs(55,23): warning CS0649: Field 'XamarinBlockDescriptor.ref_count' is never assigned to, and will always have its default value 0 We're so delighted that we want them gone asap 😎 --- src/AudioUnit/AudioUnit.cs | 2 ++ src/ObjCRuntime/Blocks.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/AudioUnit/AudioUnit.cs b/src/AudioUnit/AudioUnit.cs index ddc83d72cd3d..3b10a4efba0b 100644 --- a/src/AudioUnit/AudioUnit.cs +++ b/src/AudioUnit/AudioUnit.cs @@ -402,7 +402,9 @@ public struct ImmediateStruct public class AudioUnit : IDisposable, ObjCRuntime.INativeObject { +#pragma warning disable 649 // Field 'AudioUnit.handle' is never assigned to, and will always have its default value internal IntPtr handle; +#pragma warning restore 649 public IntPtr Handle { get { return handle; diff --git a/src/ObjCRuntime/Blocks.cs b/src/ObjCRuntime/Blocks.cs index 378a08293726..314f2adbf79c 100644 --- a/src/ObjCRuntime/Blocks.cs +++ b/src/ObjCRuntime/Blocks.cs @@ -38,6 +38,7 @@ namespace ObjCRuntime { +#pragma warning disable 649 // Field 'XamarinBlockDescriptor.ref_count' is never assigned to, and will always have its default value 0 [StructLayout (LayoutKind.Sequential)] #if !XAMCORE_2_0 public @@ -49,6 +50,7 @@ struct BlockDescriptor { public IntPtr dispose; public IntPtr signature; } +#pragma warning restore 649 struct XamarinBlockDescriptor { public BlockDescriptor descriptor; From f5b860cf75bea3b0636037a8edc9a5d3529da519 Mon Sep 17 00:00:00 2001 From: Bernhard Urban Date: Mon, 26 Feb 2018 14:45:26 +0100 Subject: [PATCH 2/7] [system-dependencies] simplify mono version check (#3596) --- system-dependencies.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/system-dependencies.sh b/system-dependencies.sh index ce4f9a1ecaa4..6126eb351024 100755 --- a/system-dependencies.sh +++ b/system-dependencies.sh @@ -399,7 +399,7 @@ function check_xcode () { function check_mono () { if ! test -z $IGNORE_MONO; then return; fi - PKG_CONFIG_PATH=/Library/Frameworks/Mono.framework/Versions/Current/bin/pkg-config + MONO_VERSION_FILE=/Library/Frameworks/Mono.framework/Versions/Current/VERSION if ! /Library/Frameworks/Mono.framework/Commands/mono --version 2>/dev/null >/dev/null; then if ! test -z $PROVISION_MONO; then install_mono @@ -407,11 +407,11 @@ function check_mono () { fail "You must install the Mono MDK (http://www.mono-project.com/download/)" return fi - elif ! test -e $PKG_CONFIG_PATH; then + elif ! test -e $MONO_VERSION_FILE; then if ! test -z $PROVISION_MONO; then install_mono else - fail "Could not find pkg-config, you must install the Mono MDK (http://www.mono-project.com/download/)" + fail "Could not find VERSION file, you must install the Mono MDK (http://www.mono-project.com/download/)" return fi fi @@ -419,11 +419,11 @@ function check_mono () { MIN_MONO_VERSION=`grep MIN_MONO_VERSION= Make.config | sed 's/.*=//'` MAX_MONO_VERSION=`grep MAX_MONO_VERSION= Make.config | sed 's/.*=//'` - ACTUAL_MONO_VERSION=`$PKG_CONFIG_PATH --modversion mono`.`cat /Library/Frameworks/Mono.framework/Home/updateinfo | cut -d' ' -f2 | cut -c6- | awk '{print(int($0))}'` + ACTUAL_MONO_VERSION=`cat $MONO_VERSION_FILE` if ! is_at_least_version $ACTUAL_MONO_VERSION $MIN_MONO_VERSION; then if ! test -z $PROVISION_MONO; then install_mono - ACTUAL_MONO_VERSION=`$PKG_CONFIG_PATH --modversion mono` + ACTUAL_MONO_VERSION=`cat $MONO_VERSION_FILE` else fail "You must have at least Mono $MIN_MONO_VERSION, found $ACTUAL_MONO_VERSION" return @@ -433,7 +433,7 @@ function check_mono () { elif is_at_least_version $ACTUAL_MONO_VERSION $MAX_MONO_VERSION; then if ! test -z $PROVISION_MONO; then install_mono - ACTUAL_MONO_VERSION=`$PKG_CONFIG_PATH --modversion mono`.`cat /Library/Frameworks/Mono.framework/Home/updateinfo | cut -d' ' -f2 | cut -c6- | awk '{print(int($0))}'` + ACTUAL_MONO_VERSION=`cat $MONO_VERSION_FILE` else fail "Your mono version is too new, max version is $MAX_MONO_VERSION, found $ACTUAL_MONO_VERSION." fail "You may edit Make.config and change MAX_MONO_VERSION to your actual version to continue the" From a2676ba064b878fd29f293aacb0fee59427c543d Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 26 Feb 2018 17:31:41 +0100 Subject: [PATCH 3/7] [introspection] Don't process IKPictureTaker, it may crash at any time. (#3599) See also https://bugzilla.xamarin.com/show_bug.cgi?id=46624, where the same logic was applied to apitest. Ref: https://trello.com/c/T6vkA2QF/62-29311598-ikpicturetaker-crashes-randomly-upon-deallocation?menu=filter&filter=corenfc --- tests/introspection/Mac/MacApiCtorInitTest.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/introspection/Mac/MacApiCtorInitTest.cs b/tests/introspection/Mac/MacApiCtorInitTest.cs index 70c14e3578f3..e651674c2f03 100644 --- a/tests/introspection/Mac/MacApiCtorInitTest.cs +++ b/tests/introspection/Mac/MacApiCtorInitTest.cs @@ -191,6 +191,11 @@ protected override bool Skip (Type type) if (!Mac.CheckSystemVersion (10, 12) || IntPtr.Size != 8) return true; break; + case "MonoMac.ImageKit.IKPictureTaker": + case "ImageKit.IKPictureTaker": + // https://bugzilla.xamarin.com/show_bug.cgi?id=46624 + // https://trello.com/c/T6vkA2QF/62-29311598-ikpicturetaker-crashes-randomly-upon-deallocation?menu=filter&filter=corenfc + return true; } return base.Skip (type); From 346051c5e389749b1090e64faa5e9c3d800f5acf Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 26 Feb 2018 17:36:05 +0100 Subject: [PATCH 4/7] [xharness] Don't try to execute an empty collection of tests. Fixes xamarin/maccore#600. (#3600) Fixes https://github.com/xamarin/maccore/issues/600. --- tests/xharness/Jenkins.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/xharness/Jenkins.cs b/tests/xharness/Jenkins.cs index 62f2a79e6759..d0ab22910cb0 100644 --- a/tests/xharness/Jenkins.cs +++ b/tests/xharness/Jenkins.cs @@ -3402,6 +3402,11 @@ public AggregatedRunSimulatorTask (IEnumerable tasks) protected override async Task ExecuteAsync () { + if (Tasks.All ((v) => v.Ignored)) { + ExecutionResult = TestExecutingResult.Ignored; + return; + } + // First build everything. This is required for the run simulator // task to properly configure the simulator. build_timer.Start (); From bfa4c548ed4a10e2b3dc062fae9ed84d25862144 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 26 Feb 2018 17:37:09 +0100 Subject: [PATCH 5/7] [tests] Fix ProtocolTest to work with in both monotouch-test and linkall. (#3598) The [Protocol] attributes the test checks for are not linked away in monotouch-test (because monotouch-test only links SDK assemblies), but they are linked away in link all, so adjust the test accordingly. --- tests/bindings-test/ProtocolTest.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tests/bindings-test/ProtocolTest.cs b/tests/bindings-test/ProtocolTest.cs index 1898d0b613b3..20d8e6f5faea 100644 --- a/tests/bindings-test/ProtocolTest.cs +++ b/tests/bindings-test/ProtocolTest.cs @@ -19,6 +19,16 @@ namespace Xamarin.BindingTests [Preserve (AllMembers = true)] public class ProtocolTest { + bool HasProtocolAttributes { + get { +#if LINKALL + if (!Runtime.DynamicRegistrationSupported) + return false; +#endif + return true; + } + } + [Test] public void OnlyProtocol () { @@ -30,7 +40,7 @@ public void OnlyProtocol () Assert.IsNotNull (IP1, "IP1"); // with a [Protocol] attribute var IP1Attributes = IP1.GetCustomAttributes (typeof (ProtocolAttribute), false); - if (Runtime.DynamicRegistrationSupported) { + if (HasProtocolAttributes) { Assert.AreEqual (1, IP1Attributes.Length, "[Protocol] IP1"); var IP1Protocol = (ProtocolAttribute)IP1Attributes [0]; Assert.AreEqual ("P1", IP1Protocol.Name, "Name"); @@ -62,7 +72,7 @@ public void ProtocolWithBaseType () // with a [Protocol] attribute var IP2Attributes = IP2.GetCustomAttributes (typeof (ProtocolAttribute), false); - if (Runtime.DynamicRegistrationSupported) { + if (HasProtocolAttributes) { Assert.AreEqual (1, IP2Attributes.Length, "[Protocol] IP2"); var IP2Protocol = (ProtocolAttribute)IP2Attributes [0]; Assert.AreEqual ("P2", IP2Protocol.Name, "Name"); @@ -98,7 +108,7 @@ public void ProtocolWithBaseTypeAndModel () // with a [Protocol] attribute var IP3Attributes = IP3.GetCustomAttributes (typeof (ProtocolAttribute), false); - if (Runtime.DynamicRegistrationSupported) { + if (HasProtocolAttributes) { Assert.AreEqual (1, IP3Attributes.Length, "[Protocol] IP3"); var IP3Protocol = (ProtocolAttribute)IP3Attributes [0]; Assert.AreEqual ("P3", IP3Protocol.Name, "Name"); From 2a29834ba2eac3347cdc2127052444ca73177323 Mon Sep 17 00:00:00 2001 From: John Miller Date: Mon, 26 Feb 2018 14:31:49 -0500 Subject: [PATCH 6/7] Update README.md (#3587) * Update README.md New README layout which includes sections to help direct visitors to the appropriate areas. Adds note about the license * Adds Gitter Button Back by popular demand! * Fixes Vote link --- README.md | 140 ++++++++---------------------------------------------- 1 file changed, 21 insertions(+), 119 deletions(-) diff --git a/README.md b/README.md index 1ac8445b6092..0da3474a64bb 100644 --- a/README.md +++ b/README.md @@ -9,136 +9,38 @@ [1]: https://jenkins.mono-project.com/view/Xamarin.MaciOS/job/xamarin-macios-builds-master/badge/icon [2]: https://jenkins.mono-project.com/view/Xamarin.MaciOS/job/xamarin-macios-builds-master -**Welcome!** +## Welcome! This module is the main repository for both **Xamarin.iOS** and **Xamarin.Mac**. -These frameworks allow us to create native iOS, tvOS, watchOS and Mac applications using the same UI controls we would in Objective-C and Xcode, except with the flexibility and elegance of a modern language (C#), the power of the .NET Base Class Library (BCL), and two first-class IDEs—Xamarin Studio and Visual Studio—at our fingertips. +These SDKs allow us to create native iOS, tvOS, watchOS and macOS applications using the same UI controls we would in Objective-C and Xcode, except with the flexibility and elegance of a modern language (C#), the power of the .NET Base Class Library (BCL), and two first-class IDEs—Visual Studio for Mac and Visual Studio—at our fingertips. -### Continuous Builds ### +This repository is where we do development for the Xamarin.iOS and Xamarin.Mac SDKs. There are a few ways that you can contribute, for example: -You can download continuous builds of our main development branches from [our wiki page](https://github.com/xamarin/xamarin-macios/wiki#continuous-builds). +- [Submit bugs and feature requests](https://github.com/xamarin/xamarin-macios/wiki/Submitting-Bugs-&-Suggestions) +- [Review source code changes](https://github.com/xamarin/xamarin-macios/pulls) +- [Submit pull requests](https://github.com/xamarin/xamarin-macios/wiki/How-to-Contribute#pull-requests) to resolve issues and fix bugs -## Build requirements ## +## Contributing -* Autoconf, automake and libtool. +If you are interested in fixing issues and contributing directly to the code base, please see the document [How to Contribute](https://github.com/xamarin/xamarin-macios/wiki/How-to-Contribute), which covers the following: - You can use brew, or [this script](https://gist.github.com/rolfbjarne/3a979187ddd0855da073) to get - it directly from gnu.org (you'll have to edit your PATH to include /opt/bin if you use the script) - - To install brew and all the tool dependencies: +- How to [build and run](https://github.com/xamarin/xamarin-macios/wiki/Build-&-Run) from source +- The [development workflow](https://github.com/xamarin/xamarin-macios/wiki/How-to-Contribute#work-branches), including [debugging](https://github.com/xamarin/xamarin-macios/wiki/Build-&-Run#debugging-applications-from-source) and [running tests](https://github.com/xamarin/xamarin-macios/blob/master/tests/README.md) +- [Coding Guidelines](https://github.com/xamarin/xamarin-macios/wiki/How-to-Contribute#coding-guidelines) +- [Submitting pull requests](https://github.com/xamarin/xamarin-macios/wiki/How-to-Contribute#pull-requests) - $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" - $ brew update - $ brew install libtool autoconf automake bison flex +## Feedback -* CMake +- Ask a question on [Stack Overflow](https://stackoverflow.com/questions/tagged/xamarin.ios) or the [Xamarin Forums](https://forums.xamarin.com/) +- [Request a new feature](https://github.com/xamarin/xamarin-macios/wiki/Submitting-Bugs-&-Suggestions#writing-good-bug-reports-and-feature-requests) on GitHub +- [Vote on existing feature requests](https://github.com/xamarin/xamarin-macios/wiki/Submitting-Bugs-&-Suggestions#before-submitting-an-issue) +- [Submit bugs to GitHub Issues](https://github.com/xamarin/xamarin-macios/wiki/Submitting-Bugs-&-Suggestions) +- Discuss development and design on [Gitter](https://gitter.im/xamarin/xamarin-macios) or email [macios-devel@lists.xamarin.com](http://lists.xamarin.com/mailman/listinfo/macios-devel) - You can use brew, or download manually from [cmake.org](https://cmake.org/download/). - - CMake must be in PATH, so if you install it somewhere else, you'll have to - fix up your PATH accordingly (not necessary if installed using brew). - - To install using brew: - - $ brew install cmake - -* Xcode - - To build the Xamarin.iOS and Xamarin.Mac SDKs you need a certain version of Xcode. - The build will tell you exactly which version you need. - - You can download the Xcode version you need from [Apple's Developer Center](https://developer.apple.com/downloads/index.action?name=Xcode) - (requires an Apple Developer account). - - To ease development with different versions of the SDK that require different versions - of Xcode, we require Xcode to be in a non-standard location (based on the Xcode version). - - For example Xcode 7.0 must be installed in /Applications/Xcode7.app. - - The recommended procedure is to download the corresponding Xcode dmg from Apple's - Developer Center, extract Xcode.app to your system, _and rename it before - launching it the first time_. Renaming Xcode.app after having launched it - once may confuse Xcode, and strange errors start occuring. - -* Mono MDK. - - The build will tell you if you need to update, and where to get it. - -* Xamarin Studio. - - The build will tell you if you need to update, and where to get it. - -* You can also provision some of the dependencies with an included script: - - $ ./system-dependencies.sh --provision-[xcode|xamarin-studio|mono|all] - -## Quick build & install ## - -Follow the following steps to build and install Xamarin.iOS and Xamarin.Mac: - -1. Clone this repository and its submodules - - $ git clone --recursive git@github.com:xamarin/xamarin-macios.git - $ cd xamarin-macios - -2. Fetch dependencies and build everything - - $ make world - -3. Make sure permissions are OK to install into system directories (this will ask for your password) - - $ make fix-install-permissions - -4. Install into the system - - $ make install-system - -5. Build again after any local changes - - Don't use `make world` again to rebuild, because it resets dependencies - and causes unnecessary rebuilds. Instead use the standard `make all install` - (our Makefiles are parallel safe, which greatly speeds up the build): - - $ make all -j8 && make install -j8 - -## Configure ## - -There is a configure script that can optionally be used to configure the build. -By default, everything required for both Xamarin.iOS and Xamarin.Mac will be built. - -* --disable-mac: Disable Mac-related parts. -* --disable-ios: Disable iOS-related parts. - - In both cases the resulting build will contain both iOS and Mac bits because: - - * Parts of the iOS build depends on Mac parts (in particular mtouch uses - Xamarin.Mac). - - * The class libraries builds can not be disabled because a very common error - is to end up with code that only works/builds in either iOS or Mac. - -* --enable-ccache: Enables cached builds with `ccache` (default if `ccache` is found in the path). -* --disable-ccache: Disables cached builds with `ccache`, even if it is present. -* --disable-strip: If executables should be stripped or not. This makes it easier - to debug native executables using lldb. -* --help: Show the help. - -## Contributing ## - -### Mailing Lists - -To discuss this project, and participate in the design, we use the [macios-devel@lists.xamarin.com](http://lists.xamarin.com/mailman/listinfo/macios-devel) mailing list. - -### Chat - -There is also a gitter chat room that can be used to discuss this project, and participate in the design: [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/xamarin/xamarin-macios?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -### Coding Guidelines - -We use [Mono's Coding Guidelines](http://www.mono-project.com/community/contributing/coding-guidelines/). - -### Reporting Bugs +## License -We use [Bugzilla](https://bugzilla.xamarin.com/newbug) to track issues. +Copyright (c) .NET Foundation Contributors. All rights reserved. +Licensed under the [MIT](https://github.com/xamarin/xamarin-macios/blob/master/LICENSE) License. From afb6c6cd621e708010fb99ba6e365c351f344813 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 27 Feb 2018 07:43:51 +0100 Subject: [PATCH 7/7] [xharness] Always build the test libraries before doing anything else. (#3601) Fixes an issue where multiple projects would try to build the test libraries simultaneously. --- tests/xharness/Jenkins.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/xharness/Jenkins.cs b/tests/xharness/Jenkins.cs index d0ab22910cb0..e09d780434d1 100644 --- a/tests/xharness/Jenkins.cs +++ b/tests/xharness/Jenkins.cs @@ -874,6 +874,7 @@ public int Run () populating = false; }).Wait (); GenerateReport (); + BuildTestLibraries (); if (!IsServerMode) { foreach (var task in Tasks) tasks.Add (task.RunAsync ()); @@ -892,6 +893,11 @@ public bool IsServerMode { get { return Harness.JenkinsConfiguration == "server"; } } + void BuildTestLibraries () + { + ProcessHelper.ExecuteCommandAsync ("make", $"all -j{Environment.ProcessorCount} -C {StringUtils.Quote (Path.Combine (Harness.RootDirectory, "test-libraries"))}", MainLog, TimeSpan.FromMinutes (1)).Wait (); + } + Task RunTestServer () { var server = new HttpListener ();