diff --git a/.azure-pipelines/azure-pipelines-osx.yml b/.azure-pipelines/azure-pipelines-osx.yml index ca725089..e208fbe8 100755 --- a/.azure-pipelines/azure-pipelines-osx.yml +++ b/.azure-pipelines/azure-pipelines-osx.yml @@ -73,4 +73,4 @@ jobs: displayName: Upload package env: BINSTAR_TOKEN: $(BINSTAR_TOKEN) - condition: not(eq(variables['UPLOAD_PACKAGES'], 'False')) \ No newline at end of file + condition: and(succeeded(), not(eq(variables['UPLOAD_PACKAGES'], 'False'))) \ No newline at end of file diff --git a/.ci_support/linux_.yaml b/.ci_support/linux_.yaml index 7e88bf49..33a5477a 100644 --- a/.ci_support/linux_.yaml +++ b/.ci_support/linux_.yaml @@ -12,3 +12,4 @@ cxx_compiler_version: - '7' docker_image: - condaforge/linux-anvil-comp7 + diff --git a/.ci_support/osx_.yaml b/.ci_support/osx_.yaml index 8958130b..5405e407 100644 --- a/.ci_support/osx_.yaml +++ b/.ci_support/osx_.yaml @@ -1,5 +1,5 @@ MACOSX_DEPLOYMENT_TARGET: -- '10.9' +- '10.12' c_compiler: - clang c_compiler_version: diff --git a/recipe/build.sh b/recipe/build.sh index 4da4e8cc..541b15b6 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -1,6 +1,23 @@ #!/bin/bash set -v -x -./compile.sh -mkdir -p $PREFIX/bin/ -cp output/bazel $PREFIX/bin/ + +if [ $(uname) == Darwin ]; then + if [[ $(basename $CONDA_BUILD_SYSROOT) != "MacOSX10.12.sdk" ]]; then + echo "WARNING: You asked me to use $CONDA_BUILD_SYSROOT as the MacOS SDK" + echo " But because of the use of Objective-C Generics we need at" + echo " least MacOSX10.12.sdk" + CONDA_BUILD_SYSROOT=/opt/MacOSX10.12.sdk + if [[ ! -d $CONDA_BUILD_SYSROOT ]]; then + echo "ERROR: $CONDA_BUILD_SYSROOT is not a directory" + exit 1 + fi + fi + ./compile.sh + mkdir -p $PREFIX/bin/ + mv output/bazel $PREFIX/bin +else + ./compile.sh + mkdir -p $PREFIX/bin/ + mv output/bazel $PREFIX/bin +fi diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml new file mode 100644 index 00000000..ecef9420 --- /dev/null +++ b/recipe/conda_build_config.yaml @@ -0,0 +1,2 @@ +MACOSX_DEPLOYMENT_TARGET: # [osx] + - '10.12' # [osx] \ No newline at end of file diff --git a/recipe/fix_path.patch b/recipe/fix_path.patch deleted file mode 100644 index 6bdccd8e..00000000 --- a/recipe/fix_path.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/compile.sh b/compile.sh -index c2460fa..d31d952 100755 ---- a/compile.sh -+++ b/compile.sh -@@ -94,6 +94,7 @@ log "Building output/bazel" - # have not yet been generated. - bazel_build "src:bazel_nojdk${EXE_EXT}" \ - --action_env=PATH \ -+ --incompatible_strict_action_env=false \ - --host_platform=@bazel_tools//platforms:host_platform \ - --platforms=@bazel_tools//platforms:target_platform \ - || fail "Could not build Bazel" diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 33c1cdfc..08796b47 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,4 +1,4 @@ -{% set version = "0.21.0" %} +{% set version = "2.0.0" %} package: name: bazel @@ -6,10 +6,7 @@ package: source: url: https://github.com/bazelbuild/bazel/releases/download/{{ version }}/bazel-{{ version }}-dist.zip - sha256: 6ccb831e683179e0cfb351cb11ea297b4db48f9eab987601c038aa0f83037db4 - patches: - - xcode_locator.patch # [osx] - - fix_path.patch # [linux] + sha256: 724da3c656f68e787a86ebb9844773aa1c2e3a873cc39462a8f1b336153d6cbb build: number: 0 @@ -21,9 +18,9 @@ requirements: build: - {{ compiler('c') }} - {{ compiler('cxx') }} - - openjdk >=8,<11 - - unzip # [linux] - - zip # [linux] + - openjdk >=8 + - unzip + - zip run: - openjdk >=8 diff --git a/recipe/xcode_locator.patch b/recipe/xcode_locator.patch deleted file mode 100644 index 3e7fd828..00000000 --- a/recipe/xcode_locator.patch +++ /dev/null @@ -1,120 +0,0 @@ -From 9735219083bb67f4dd8f4bb30562baae2b5a5157 Mon Sep 17 00:00:00 2001 -From: Nehal J Wani -Date: Thu, 26 Apr 2018 10:15:38 -0500 -Subject: [PATCH] Make code compatible with 10.9 SDK - -- Use LSFindApplicationForInfo for locating xcode -- Revert "Use a parameterized dict and simplify an iteration in xcode-locator." ---- - tools/osx/xcode_locator.m | 60 +++++++++++++++++++++++---------------- - 1 file changed, 36 insertions(+), 24 deletions(-) - -diff --git a/tools/osx/xcode_locator.m b/tools/osx/xcode_locator.m -index 6e318d7e56..fff0f2642a 100644 ---- a/tools/osx/xcode_locator.m -+++ b/tools/osx/xcode_locator.m -@@ -62,9 +62,8 @@ - // precedence over installed versions.) - // - // 2. Not older (at least as high version number). --static void AddEntryToDictionary( -- XcodeVersionEntry *entry, -- NSMutableDictionary *dict) { -+static void AddEntryToDictionary(XcodeVersionEntry *entry, -+ NSMutableDictionary *dict) { - BOOL inApplications = - [entry.url.path rangeOfString:@"/Applications/"].location != NSNotFound; - NSString *entryVersion = entry.version; -@@ -114,13 +113,11 @@ static NSString *ExpandVersion(NSString *version) { - // - // If there is a problem locating the Xcodes, prints one or more error messages - // and returns nil. --static NSMutableDictionary *FindXcodes() -- __attribute((ns_returns_retained)) { -+static NSMutableDictionary *FindXcodes() __attribute((ns_returns_retained)) { - CFStringRef cfBundleID = CFSTR("com.apple.dt.Xcode"); - NSString *bundleID = (__bridge NSString *)cfBundleID; - -- NSMutableDictionary *dict = -- [[NSMutableDictionary alloc] init]; -+ NSMutableDictionary *dict = [[NSMutableDictionary alloc] init]; - CFErrorRef cfError; - NSArray *array = CFBridgingRelease(LSCopyApplicationURLsForBundleIdentifier( - cfBundleID, &cfError)); -@@ -188,20 +185,17 @@ static NSMutableDictionary *FindXcodes() - - // Prints out the located Xcodes as a set of lines where each line contains the - // list of versions for a given Xcode and its location on disk. --static void DumpAsVersionsOnly( -- FILE *output, -- NSMutableDictionary *dict) { -- NSMutableDictionary *> *aliasDict = -- [[NSMutableDictionary alloc] init]; -- [dict enumerateKeysAndObjectsUsingBlock:^(NSString *aliasVersion, -- XcodeVersionEntry *entry, -- BOOL *stop) { -- NSString *versionString = entry.version; -+static void DumpAsVersionsOnly(FILE *output, NSMutableDictionary *dict) { -+ NSSet *distinctValues = [[NSSet alloc] initWithArray:[dict allValues]]; -+ NSMutableDictionary *aliasDict = [[NSMutableDictionary alloc] init]; -+ for (XcodeVersionEntry *value in distinctValues) { -+ NSString *versionString = value.version; - if (aliasDict[versionString] == nil) { - aliasDict[versionString] = [[NSMutableSet alloc] init]; - } -- [aliasDict[versionString] addObject:aliasVersion]; -- }]; -+ [aliasDict[versionString] -+ addObjectsFromArray:[dict allKeysForObject:value]]; -+ } - for (NSString *version in aliasDict) { - XcodeVersionEntry *entry = dict[version]; - fprintf(output, "%s:%s:%s\n", -@@ -213,9 +207,7 @@ static void DumpAsVersionsOnly( - } - - // Prints out the located Xcodes in JSON format. --static void DumpAsJson( -- FILE *output, -- NSMutableDictionary *dict) { -+static void DumpAsJson(FILE *output, NSMutableDictionary *dict) { - fprintf(output, "{\n"); - for (NSString *version in dict) { - XcodeVersionEntry *entry = dict[version]; -@@ -272,10 +264,30 @@ int main(int argc, const char * argv[]) { - return 1; - } - -- NSMutableDictionary *dict = FindXcodes(); -- if (dict == nil) { -- return 1; -+ NSMutableDictionary *dict = [[NSMutableDictionary alloc] init]; -+ CFURLRef t_url = NULL; -+ int rc = LSFindApplicationForInfo(kLSUnknownCreator, CFSTR("com.apple.dt.Xcode"), nil, nil, &t_url); -+ if (rc == kLSApplicationNotFoundErr) { -+ printf("error: %d\n", rc); -+ return 1; -+ } -+ NSURL *url = (__bridge NSURL *)t_url; -+ NSBundle *bundle = [NSBundle bundleWithURL:url]; -+ if (!bundle) { -+ printf("error: Unable to open bundle at URL: %s\n", url.description.UTF8String); -+ return 1; -+ } -+ NSString *version = bundle.infoDictionary[@"CFBundleShortVersionString"]; -+ if (!version) { -+ printf("error: Unable to extract CFBundleShortVersionString from URL: %s\n", -+ url.description.UTF8String); -+ return 1; - } -+ version = ExpandVersion(version); -+ NSURL *developerDir = [url URLByAppendingPathComponent:@"Contents/Developer"]; -+ XcodeVersionEntry *t_entry = -+ [[XcodeVersionEntry alloc] initWithVersion:version url:developerDir]; -+ AddEntryToDictionary(t_entry, dict); - - XcodeVersionEntry *entry = [dict objectForKey:versionArg]; - if (entry) { --- -2.19.1 -