Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into mono-2018-08
Browse files Browse the repository at this point in the history
  • Loading branch information
rolfbjarne committed Nov 26, 2018
2 parents 74b966e + 930e372 commit 23b7847
Show file tree
Hide file tree
Showing 49 changed files with 623 additions and 134 deletions.
20 changes: 16 additions & 4 deletions jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,8 @@ def abortExecutingBuilds ()
}

timestamps {
node ('xamarin-macios && macos-10.13') {
def mainMacOSVersion = 13
node ("xamarin-macios && macos-10.${mainMacOSVersion}") {
try {
timeout (time: 9, unit: 'HOURS') {
// Hard-code a workspace, since branch-based and PR-based
Expand Down Expand Up @@ -673,13 +674,21 @@ timestamps {
for (os = firstOS; os <= lastOS; os++)
macOSes.add (os)
// If any macOS version needs to be excluded manually, it can be done like this (in this case to remove macOS 10.14):
// Any macOS versions excluded like this still get a entry in the Jenkins UI, making it explicit that the OS version was skipped.
// excludedOSes.add (14)
// Have in mind that the value in the list is only the minor part of the macOS version number.
for (i = 0; i < macOSes.size (); i++) {
def os = macOSes [i];
def macOS = "${os}" // Need to bind the label variable before the closure
def excluded = indexOfElement (excludedOSes, os) >= 0
def nodeText = excluded ? "ℹ️ XM tests not executed on 10.${macOS} ℹ️" : "XM tests on 10.${macOS}"
def excluded = false
def nodeText = "XM tests on 10.${macOS}"
if (indexOfElement (excludedOSes, os) >= 0) {
excluded = true
nodeText = "ℹ️ XM tests not executed on 10.${macOS} ℹ️"
} else if (os == mainMacOSVersion) {
excluded = true
nodeText = "ℹ️ XM tests not executed on a separate 10.${macOS} bot because they're already executed as a part of the main test run ℹ️"
}
builders [nodeText] = {
try {
if (excluded) {
Expand Down Expand Up @@ -718,21 +727,24 @@ timestamps {
if (runTestResult != 0) {
echoError ("Test run failed")
currentBuild.result = 'FAILURE'
failedStages.add (currentStage)
}
}
}
stage ('Test docs') {
currentStage = "${STAGE_NAME}"
echo ("Building on ${env.NODE_NAME}")
def targetBranch = isPr ? githubGetPullRequestInfo () ["base"] ["ref"] : "${BRANCH_NAME}"
def testDocs = targetBranch == "master"
def hasRunDocsTestsLabel = isPr ? githubGetPullRequestLabels ().contains ("run-docs-tests") : false
def testDocs = targetBranch == "master" || hasRunDocsTestsLabel
if (!testDocs) {
echo ("Skipping docs testing, it's only done on master (current (target) branch is ${targetBranch})")
} else {
def testDocsResult = sh (script: "make -C ${workspace}/xamarin-macios/tests wrench-docs", returnStatus: true)
if (testDocsResult != 0) {
echoError ("Test docs failed")
currentBuild.result = 'FAILURE'
failedStages.add (currentStage)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion jenkins/compare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ cp -R tools/comparison/generator-diff jenkins-results/generator-diff

if [[ "x$1" == "x--publish" ]]; then
URL_PREFIX=$(./jenkins/publish-results.sh | grep "^Url Prefix: " | sed 's/^Url Prefix: //')
URL_API="$URL_PREFIX/apicomparison/index.html"
URL_API="$URL_PREFIX/apicomparison/api-diff.html"
URL_GENERATOR="$URL_PREFIX/generator-diff/index.html"
else
URL_API="$BUILD_URL/API_20diff_20_28PR_20only_29"
Expand Down
20 changes: 19 additions & 1 deletion jenkins/prepare-packaged-macos-tests.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,25 @@ rm -f -- ./*.zip
curl -fL "$URL" --output mac-test-package.zip
rm -rf mac-test-package
unzip -o mac-test-package.zip
cd mac-test-package && ./system-dependencies.sh --provision-mono --ignore-autotools --ignore-xamarin-studio --ignore-xcode --ignore-osx --ignore-cmake
cd mac-test-package

COUNTER=0
EC=0
while [[ $COUNTER -lt 5 ]]; do
./system-dependencies.sh --provision-mono --ignore-autotools --ignore-xamarin-studio --ignore-xcode --ignore-osx --ignore-cmake || EC=$?
if [[ $EC -eq 56 ]]; then
# Sometimes we get spurious "curl: (56) SSLRead() return error -9806" errors. Trying again usually works, so lets try again a few more times.
# https://github.com/xamarin/maccore/issues/1098
let COUNTER++ || true
continue
fi
break
done

if [[ "x$EC" != "x0" ]]; then
echo "Failed to provision dependencies (exit code: $EC)"
exit $EC
fi

# fetch script to install provisioning profiles and run it
if test -d maccore; then
Expand Down
2 changes: 1 addition & 1 deletion mk/xamarin.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ifdef ENABLE_XAMARIN
NEEDED_MACCORE_VERSION := 278d0e0c98c1718acd30aebba3f3c8a5cdc68805
NEEDED_MACCORE_VERSION := 6e9b63e53755a74138b78dafd098836a79660edd
NEEDED_MACCORE_BRANCH := master

MACCORE_DIRECTORY := maccore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void BasicTest ()
NugetRestore ("../MyExtensionWithPackageReference/MyExtensionWithPackageReference.csproj");

// Can't use the in-process MSBuild engine, because it complains that the project file is invalid (the attribute 'Version' in the element '<PackageReference>' is unrecognized)
var rv = ExecutionHelper.Execute ("xibuild", $"-- ../MyAppWithPackageReference/MyAppWithPackageReference.csproj /p:Platform={Platform} /p:Configuration=Debug", out var output);
var rv = ExecutionHelper.Execute (Configuration.XIBuildPath, $"-- ../MyAppWithPackageReference/MyAppWithPackageReference.csproj /p:Platform={Platform} /p:Configuration=Debug", out var output);
if (rv != 0) {
Console.WriteLine ("Build failed:");
Console.WriteLine (output);
Expand Down
19 changes: 0 additions & 19 deletions msbuild/xbuild-in-place

This file was deleted.

6 changes: 6 additions & 0 deletions runtime/extension-main.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@
#include "xamarin/main.h"
#include "main-internal.h"

#ifdef __cplusplus
extern "C" {
#endif
void
xamarin_initialize_extension_main () __attribute__ ((constructor));
#ifdef __cplusplus
}
#endif

void
xamarin_initialize_extension_main ()
Expand Down
2 changes: 1 addition & 1 deletion runtime/launcher.m
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@

/* other non-documented stuff... */

initialize_cocoa_threads (NULL);
xamarin_initialize_cocoa_threads (NULL);
init_logdir ();
mono_set_signal_chaining (TRUE);
mono_set_crash_chaining (TRUE);
Expand Down
2 changes: 1 addition & 1 deletion runtime/mono-runtime.m.t4
Original file line number Diff line number Diff line change
Expand Up @@ -147,5 +147,5 @@ bool

<# } #>
#else
int fix_ranlib_warning_about_no_symbols;
int xamarin_fix_ranlib_warning_about_no_symbols;
#endif /* DYNAMIC_MONO_RUNTIME */
37 changes: 18 additions & 19 deletions runtime/monotouch-debug.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,13 @@
#include "product.h"

// permanent connection variables
int monodevelop_port = -1;
int sdb_fd = -1;
int profiler_fd = -1;
int heapshot_fd = -1; // this is the socket to write 'heapshot' to to requests heapshots from the profiler
int heapshot_port = -1;
char *profiler_description = NULL;
static int monodevelop_port = -1;
static int sdb_fd = -1;
static int heapshot_fd = -1; // this is the socket to write 'heapshot' to to requests heapshots from the profiler
static int heapshot_port = -1;
static char *profiler_description = NULL;
// old variables
int output_port;
int debug_port;
char *debug_host = NULL;
static char *debug_host = NULL;

enum DebuggingMode
{
Expand All @@ -71,6 +68,7 @@
static DebuggingMode debugging_mode = DebuggingModeWifi;
static const char *connection_mode = "default"; // this is set from the cmd line, can be either 'usb', 'wifi', 'http' or 'none'

extern "C" {
void monotouch_connect_usb ();
void monotouch_connect_wifi (NSMutableArray *hosts);
void xamarin_connect_http (NSMutableArray *hosts);
Expand All @@ -80,6 +78,8 @@
void monotouch_load_profiler ();
void monotouch_load_debugger ();
bool monotouch_process_connection (int fd);
void monotouch_dump_objc_api (Class klass);
}

static struct timeval wait_tv;
static struct timespec wait_ts;
Expand Down Expand Up @@ -705,7 +705,7 @@ void monotouch_configure_debugging ()
pthread_mutex_unlock (&mutex);
}

void sdb_connect (const char *address)
static void sdb_connect (const char *address)
{
gboolean shaked;

Expand All @@ -719,17 +719,17 @@ void sdb_connect (const char *address)
return;
}

void sdb_close1 (void)
static void sdb_close1 (void)
{
shutdown (sdb_fd, SHUT_RD);
}

void sdb_close2 (void)
static void sdb_close2 (void)
{
shutdown (sdb_fd, SHUT_RDWR);
}

gboolean send_uninterrupted (int fd, const void *buf, int len)
static gboolean send_uninterrupted (int fd, const void *buf, int len)
{
int res;

Expand All @@ -740,7 +740,7 @@ gboolean send_uninterrupted (int fd, const void *buf, int len)
return res == len;
}

int recv_uninterrupted (int fd, void *buf, int len)
static int recv_uninterrupted (int fd, void *buf, int len)
{
int res;
int total = 0;
Expand All @@ -755,7 +755,7 @@ int recv_uninterrupted (int fd, void *buf, int len)
return total;
}

gboolean sdb_send (void *buf, int len)
static gboolean sdb_send (void *buf, int len)
{
gboolean rv;

Expand All @@ -771,7 +771,7 @@ gboolean sdb_send (void *buf, int len)
}


int sdb_recv (void *buf, int len)
static int sdb_recv (void *buf, int len)
{
int rv;

Expand Down Expand Up @@ -1323,8 +1323,7 @@ int sdb_recv (void *buf, int len)
profiler_description = strdup (prof);
#else
use_fd = true;
profiler_fd = fd;
profiler_description = xamarin_strdup_printf ("%s,output=#%i", prof, profiler_fd);
profiler_description = xamarin_strdup_printf ("%s,output=#%i", prof, fd);
#endif
xamarin_set_gc_pump_enabled (false);
} else {
Expand Down Expand Up @@ -1709,6 +1708,6 @@ int monotouch_debug_connect (NSMutableArray *ips, int debug_port, int output_por
#endif /* TARGET_OS_WATCH && !TARGET_OS_SIMULATOR */

#else
int fix_ranlib_warning_about_no_symbols_v2;
int xamarin_fix_ranlib_warning_about_no_symbols_v2;
#endif /* DEBUG */

4 changes: 2 additions & 2 deletions runtime/monotouch-main.m
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,9 @@ - (void) memoryWarning: (NSNotification *) sender
}

#ifdef DEBUG
initialize_cocoa_threads (monotouch_configure_debugging);
xamarin_initialize_cocoa_threads (monotouch_configure_debugging);
#else
initialize_cocoa_threads (NULL);
xamarin_initialize_cocoa_threads (NULL);
#endif

#if defined (__arm__) || defined(__aarch64__)
Expand Down
4 changes: 2 additions & 2 deletions runtime/runtime.m
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
(void *) &xamarin_set_gchandle_trampoline,
};

struct InitializationOptions options = { 0 };
static struct InitializationOptions options = { 0 };

struct Managed_NSObject {
MonoObject obj;
Expand Down Expand Up @@ -1407,7 +1407,7 @@ -(void) xamarinSetGCHandle: (int) gc_handle;
if (!register_assembly (assembly, &exception_gchandle))
xamarin_process_managed_exception_gchandle (exception_gchandle);

install_nsautoreleasepool_hooks ();
xamarin_install_nsautoreleasepool_hooks ();

#if defined (DEBUG)
if (xamarin_gc_pump) {
Expand Down
4 changes: 2 additions & 2 deletions runtime/shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ extern "C" {
#endif

typedef void (init_cocoa_func) (void);
void initialize_cocoa_threads (init_cocoa_func *func);
void xamarin_initialize_cocoa_threads (init_cocoa_func *func);

void install_nsautoreleasepool_hooks ();
void xamarin_install_nsautoreleasepool_hooks ();
id xamarin_init_nsthread (id obj, bool is_direct, id target, SEL sel, id arg);
void xamarin_insert_dllmap ();

Expand Down
10 changes: 5 additions & 5 deletions runtime/shared.m
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,15 @@ -(void) dealloc;
* Ref: https://bugzilla.xamarin.com/show_bug.cgi?id=798
*/

@interface CocoaThreadInitializer : NSObject
@interface XamarinCocoaThreadInitializer : NSObject
{
init_cocoa_func *the_func;
}
-(void) entryPoint: (NSObject *) obj;
-(id) initWithFunc: (init_cocoa_func *) func;
@end

@implementation CocoaThreadInitializer
@implementation XamarinCocoaThreadInitializer
{
}
-(void) entryPoint: (NSObject *) obj
Expand All @@ -144,10 +144,10 @@ -(id) initWithFunc: (init_cocoa_func *) func;
@end

void
initialize_cocoa_threads (init_cocoa_func *func)
xamarin_initialize_cocoa_threads (init_cocoa_func *func)
{
// COOP: no managed memory access: any mode.
[[[CocoaThreadInitializer alloc] initWithFunc: func] autorelease];
[[[XamarinCocoaThreadInitializer alloc] initWithFunc: func] autorelease];
}

/* Wrapping threads with NSAutoreleasePool
Expand Down Expand Up @@ -233,7 +233,7 @@ -(id) initWithFunc: (init_cocoa_func *) func;
}

void
install_nsautoreleasepool_hooks ()
xamarin_install_nsautoreleasepool_hooks ()
{
// COOP: executed at startup (and no managed memory access): any mode.
xamarin_thread_hash = CFDictionaryCreateMutable (kCFAllocatorDefault, 0, NULL, NULL);
Expand Down
4 changes: 3 additions & 1 deletion runtime/trampolines-x86_64.m
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@
#define dump_state(...)
#endif

const char* registers[] = { "rdi", "rsi", "rdx", "rcx", "r8", "r9", "err" };
#ifdef TRACE
static const char* registers[] = { "rdi", "rsi", "rdx", "rcx", "r8", "r9", "err" };
#endif

static const char *
skip_type_name (const char *ptr)
Expand Down
12 changes: 6 additions & 6 deletions runtime/xamarin/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,16 @@ int xamarin_get_launch_mode ();

int xamarin_watchextension_main (int argc, char **argv);

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif /* __XAMARIN_MAIN_H__ */

#ifndef MONOTOUCH
void xamarin_set_is_mkbundle (bool value); /* Not Public API, exact semantics is not defined yet */
bool xamarin_get_is_mkbundle (); /* Not Public API, exact semantics is not defined yet */
#endif

void xamarin_set_is_debug (bool value); /* Public API */
bool xamarin_get_is_debug (); /* Public API */

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif /* __XAMARIN_MAIN_H__ */
Loading

1 comment on commit 23b7847

@dalexsoto
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test failures are unrelated.

Please sign in to comment.