From e8d710a2341fd6dbd73130ae5183ece344109076 Mon Sep 17 00:00:00 2001 From: Cliff Sekel Date: Wed, 14 Dec 2016 02:11:58 -0500 Subject: [PATCH 001/382] Updating Darwinbuild and Darwinxref Updating Darwinbuild and Darwinxref These updates fix issues within Darwinbuild program that would allow MacPorts and the original project to compile and run on 10.10/10.11 currently 10.12 is unsupported with this updated commit. Echo was missing before darwinxref invocation; Allow http://opensource.apple.com/tarballs/ as sources_site as src.macosforge.org/Projects is not redirected anymore; Don't change filename when fetching tarballs from apple; Replacing deprecated CFPropertyListCreateFromXMLData when osx > SL ; Replacing deprecated CFPropertyListCreateXMLData when osx > SL --- darwinbuild/darwinbuild.in | 8 +++++++- darwinxref/cfutils.c | 20 +++++++++++++++++--- darwinxref/plugins/exportIndex.c | 4 ++++ darwinxref/plugins/exportProject.c | 8 ++++++++ 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 5d05774..328ed4d 100755 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -454,7 +454,13 @@ if [ "$nosource" != "YES" ]; then filename="$project.tar.gz" fi - Download "$SourceCache" "$filename" "$($DARWINXREF source_sites $projnam)" + # prepare for the opensource.apple.com/tarballs case as it's no more redirected + if echo "$($DARWINXREF source_sites $projnam)" | grep "opensource.apple.com/tarballs" > /dev/null 2> /dev/null ; then + targetfilename=$(echo $(basename "$filename" .tar.gz) | sed -e 's,-[0-9.]*$,,') + Download "$SourceCache" "$filename" "$($DARWINXREF source_sites $projnam)/$targetfilename" + else + Download "$SourceCache" "$filename" "$($DARWINXREF source_sites $projnam)" + fi patchfilenames=$($DARWINXREF patchfiles $projnam) for p in $patchfilenames; do diff --git a/darwinxref/cfutils.c b/darwinxref/cfutils.c index 0d483a6..f0903a0 100644 --- a/darwinxref/cfutils.c +++ b/darwinxref/cfutils.c @@ -84,15 +84,29 @@ CFPropertyListRef read_plist(char* path) { if (stat(path, &sb) != -1) { size_t size = (size_t)sb.st_size; void* buffer = mmap(NULL, size, PROT_READ, MAP_FILE | MAP_PRIVATE, fd, (off_t)0); - if (buffer != (void*)-1) { - CFDataRef data = CFDataCreateWithBytesNoCopy(NULL, buffer, size, kCFAllocatorNull); - if (data) { + if (buffer != (void*)-1) { + CFDataRef data = CFDataCreateWithBytesNoCopy(NULL, buffer, size, kCFAllocatorNull); + if (data) { +#if __MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + CFErrorRef str = 0; + result = CFPropertyListCreateWithData(NULL, data, kCFPropertyListMutableContainers, 0, &str); + CFRelease(data); + if (result == NULL) { + CFStringRef errorDesc = CFErrorCopyDescription(str); + perror_cfstr(errorDesc); + CFRelease(errorDesc); + } +#else CFStringRef str = NULL; result = CFPropertyListCreateFromXMLData(NULL, data, kCFPropertyListMutableContainers, &str); CFRelease(data); if (result == NULL) { perror_cfstr(str); } +#endif + if (str) { + CFRelease(str); + } } munmap(buffer, size); } else { diff --git a/darwinxref/plugins/exportIndex.c b/darwinxref/plugins/exportIndex.c index 8baac6b..3c348f0 100644 --- a/darwinxref/plugins/exportIndex.c +++ b/darwinxref/plugins/exportIndex.c @@ -53,11 +53,15 @@ static int run(CFArrayRef argv) { CFPropertyListRef plist = DBCopyBuildPlist(build); if (xml) { +#if __MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 CFDataRef data = CFPropertyListCreateData(kCFAllocatorDefault, plist, kCFPropertyListXMLFormat_v1_0, 0, NULL); +#else + CFDataRef data = CFPropertyListCreateXMLData(NULL, plist); +#endif res = write(STDOUT_FILENO, CFDataGetBytePtr(data), (size_t)CFDataGetLength(data)); } else { res = writePlist(stdout, plist, 0); diff --git a/darwinxref/plugins/exportProject.c b/darwinxref/plugins/exportProject.c index 4c6bc67..a26062b 100644 --- a/darwinxref/plugins/exportProject.c +++ b/darwinxref/plugins/exportProject.c @@ -83,7 +83,15 @@ static int run(CFArrayRef argv) { CFPropertyListRef plist = preplist; if (xml) { +#if __MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + CFDataRef data = CFPropertyListCreateData(kCFAllocatorDefault, + plist, + kCFPropertyListXMLFormat_v1_0, + 0, + NULL); +#else CFDataRef data = CFPropertyListCreateXMLData(NULL, plist); +#endif res = write(STDOUT_FILENO, CFDataGetBytePtr(data), (ssize_t)CFDataGetLength(data)); } else { res = writePlist(stdout, plist, 0); From 1d289190ab388e837fc5b37e12ecfe70f8783690 Mon Sep 17 00:00:00 2001 From: InSaneDarwin Date: Tue, 4 Apr 2017 02:24:45 -0400 Subject: [PATCH 002/382] Modified to Build on OS X 10.12 Modified to Build on OS X 10.12 --- darwinbuild.xcodeproj/project.pbxproj | 42 ++ .../contents.xcworkspacedata | 7 + .../UserInterfaceState.xcuserstate | Bin 0 -> 16160 bytes .../xcdebugger/Breakpoints_v2.xcbkptlist | 55 +++ .../xcschemes/configuration.xcscheme | 80 ++++ .../xcschemes/darwinbuild.xcscheme | 91 ++++ .../xcschemes/darwinbuild_scripts.xcscheme | 80 ++++ .../xcschemes/darwinmaster.xcscheme | 91 ++++ .../xcschemes/darwintrace.xcscheme | 80 ++++ .../xcschemes/darwinup.xcscheme | 91 ++++ .../xcschemes/darwinxref.xcscheme | 91 ++++ .../xcschemes/darwinxref_plugins.xcscheme | 80 ++++ .../xcschemes/dependencies.xcscheme | 80 ++++ .../xcschemes/diff.xcscheme | 80 ++++ .../xcschemes/digest.xcscheme | 91 ++++ .../insane.xcuserdatad/xcschemes/dot.xcscheme | 80 ++++ .../xcschemes/edit.xcscheme | 80 ++++ .../xcschemes/environment.xcscheme | 80 ++++ .../xcschemes/exportFiles.xcscheme | 80 ++++ .../xcschemes/exportIndex.xcscheme | 80 ++++ .../xcschemes/exportProject.xcscheme | 80 ++++ .../xcschemes/findFile.xcscheme | 80 ++++ .../xcschemes/inherits.xcscheme | 80 ++++ .../xcschemes/installXcode.xcscheme | 91 ++++ .../xcschemes/installXcode32.xcscheme | 91 ++++ .../xcschemes/loadDeps.xcscheme | 80 ++++ .../xcschemes/loadFiles.xcscheme | 80 ++++ .../xcschemes/loadIndex.xcscheme | 80 ++++ .../xcschemes/manifest.xcscheme | 91 ++++ .../xcschemes/mergeBuild.xcscheme | 80 ++++ .../xcschemes/original.xcscheme | 80 ++++ .../xcschemes/packageRoots.xcscheme | 91 ++++ .../xcschemes/patchfiles.xcscheme | 80 ++++ .../xcschemes/plist_sites.xcscheme | 80 ++++ .../xcschemes/query.xcscheme | 80 ++++ .../xcschemes/register.xcscheme | 80 ++++ .../xcschemes/resolveDeps.xcscheme | 80 ++++ .../xcschemes/source_sites.xcscheme | 80 ++++ .../xcschemes/target.xcscheme | 80 ++++ .../xcschemes/tcl_plugins.xcscheme | 80 ++++ .../xcschemes/thinPackages.xcscheme | 91 ++++ .../xcschemes/version.xcscheme | 80 ++++ .../xcschemes/world.xcscheme | 80 ++++ .../xcschemes/xcschememanagement.plist | 402 ++++++++++++++++++ darwinbuild/manifest.c | 2 +- darwintrace/darwintrace.c | 8 +- darwinup/Database.cpp | 6 +- darwinup/Utils.cpp | 2 +- darwinxref/cfutils.c | 40 +- darwinxref/plugins/exportIndex.c | 2 +- darwinxref/plugins/exportProject.c | 2 +- darwinxref/plugins/register.c | 2 +- 52 files changed, 3768 insertions(+), 32 deletions(-) create mode 100644 darwinbuild.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 darwinbuild.xcodeproj/project.xcworkspace/xcuserdata/insane.xcuserdatad/UserInterfaceState.xcuserstate create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/configuration.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/darwinbuild.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/darwinbuild_scripts.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/darwinmaster.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/darwintrace.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/darwinup.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/darwinxref.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/darwinxref_plugins.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/dependencies.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/diff.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/digest.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/dot.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/edit.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/environment.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/exportFiles.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/exportIndex.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/exportProject.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/findFile.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/inherits.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/installXcode.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/installXcode32.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/loadDeps.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/loadFiles.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/loadIndex.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/manifest.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/mergeBuild.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/original.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/packageRoots.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/patchfiles.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/plist_sites.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/query.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/register.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/resolveDeps.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/source_sites.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/target.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/tcl_plugins.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/thinPackages.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/version.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/world.xcscheme create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/xcschememanagement.plist diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index cf61d3b..3e1d2ff 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -1864,6 +1864,7 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 0820; ORGANIZATIONNAME = "The DarwinBuild Project"; }; buildConfigurationList = 726DD14C10965C5700D5AEAB /* Build configuration list for PBXProject "darwinbuild" */; @@ -3397,11 +3398,23 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = c99; GCC_ENABLE_PASCAL_STRINGS = NO; GCC_MODEL_TUNING = ""; + GCC_NO_COMMON_BLOCKS = YES; GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -3417,6 +3430,7 @@ GCC_WARN_SIGN_COMPARE = NO; GCC_WARN_STRICT_SELECTOR_MATCH = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNKNOWN_PRAGMAS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_LABEL = YES; @@ -3544,11 +3558,24 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = c99; GCC_ENABLE_PASCAL_STRINGS = NO; GCC_MODEL_TUNING = ""; + GCC_NO_COMMON_BLOCKS = YES; GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -3564,12 +3591,14 @@ GCC_WARN_SIGN_COMPARE = NO; GCC_WARN_STRICT_SELECTOR_MATCH = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNKNOWN_PRAGMAS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; LD_OPENMP_FLAGS = ""; + ONLY_ACTIVE_ARCH = YES; STRIP_INSTALLED_PRODUCT = NO; STRIP_STYLE = "non-global"; WARNING_CFLAGS = "-Wall"; @@ -3580,11 +3609,23 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = c99; GCC_ENABLE_PASCAL_STRINGS = NO; GCC_MODEL_TUNING = ""; + GCC_NO_COMMON_BLOCKS = YES; GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -3600,6 +3641,7 @@ GCC_WARN_SIGN_COMPARE = NO; GCC_WARN_STRICT_SELECTOR_MATCH = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNKNOWN_PRAGMAS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_LABEL = YES; diff --git a/darwinbuild.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/darwinbuild.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/darwinbuild.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/darwinbuild.xcodeproj/project.xcworkspace/xcuserdata/insane.xcuserdatad/UserInterfaceState.xcuserstate b/darwinbuild.xcodeproj/project.xcworkspace/xcuserdata/insane.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000000000000000000000000000000000000..315fed62ca5d4a499fc023c9f9a501babae03307 GIT binary patch literal 16160 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 literal 0 HcmV?d00001 diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..2e26d3d --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/configuration.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/configuration.xcscheme new file mode 100644 index 0000000..0667147 --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/configuration.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/darwinbuild.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/darwinbuild.xcscheme new file mode 100644 index 0000000..e4638ec --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/darwinbuild.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/darwinbuild_scripts.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/darwinbuild_scripts.xcscheme new file mode 100644 index 0000000..328e536 --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/darwinbuild_scripts.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/darwinmaster.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/darwinmaster.xcscheme new file mode 100644 index 0000000..01742fb --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/darwinmaster.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/darwintrace.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/darwintrace.xcscheme new file mode 100644 index 0000000..e3fcdbd --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/darwintrace.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/darwinup.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/darwinup.xcscheme new file mode 100644 index 0000000..88247bd --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/darwinup.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/darwinxref.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/darwinxref.xcscheme new file mode 100644 index 0000000..5626a92 --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/darwinxref.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/darwinxref_plugins.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/darwinxref_plugins.xcscheme new file mode 100644 index 0000000..9c626c9 --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/darwinxref_plugins.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/dependencies.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/dependencies.xcscheme new file mode 100644 index 0000000..3d2ce0a --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/dependencies.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/diff.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/diff.xcscheme new file mode 100644 index 0000000..5110521 --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/diff.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/digest.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/digest.xcscheme new file mode 100644 index 0000000..d973714 --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/digest.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/dot.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/dot.xcscheme new file mode 100644 index 0000000..6693c69 --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/dot.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/edit.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/edit.xcscheme new file mode 100644 index 0000000..7e662fb --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/edit.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/environment.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/environment.xcscheme new file mode 100644 index 0000000..08dafd6 --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/environment.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/exportFiles.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/exportFiles.xcscheme new file mode 100644 index 0000000..22490a3 --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/exportFiles.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/exportIndex.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/exportIndex.xcscheme new file mode 100644 index 0000000..bde29c1 --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/exportIndex.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/exportProject.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/exportProject.xcscheme new file mode 100644 index 0000000..680b700 --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/exportProject.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/findFile.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/findFile.xcscheme new file mode 100644 index 0000000..c1c4fd8 --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/findFile.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/inherits.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/inherits.xcscheme new file mode 100644 index 0000000..1ef181c --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/inherits.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/installXcode.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/installXcode.xcscheme new file mode 100644 index 0000000..19cfd03 --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/installXcode.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/installXcode32.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/installXcode32.xcscheme new file mode 100644 index 0000000..9a46401 --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/installXcode32.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/loadDeps.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/loadDeps.xcscheme new file mode 100644 index 0000000..b7c582f --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/loadDeps.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/loadFiles.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/loadFiles.xcscheme new file mode 100644 index 0000000..651edf7 --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/loadFiles.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/loadIndex.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/loadIndex.xcscheme new file mode 100644 index 0000000..efb9c0c --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/loadIndex.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/manifest.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/manifest.xcscheme new file mode 100644 index 0000000..5f4e198 --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/manifest.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/mergeBuild.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/mergeBuild.xcscheme new file mode 100644 index 0000000..38ebc1a --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/mergeBuild.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/original.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/original.xcscheme new file mode 100644 index 0000000..f03e6e4 --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/original.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/packageRoots.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/packageRoots.xcscheme new file mode 100644 index 0000000..4180ae1 --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/packageRoots.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/patchfiles.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/patchfiles.xcscheme new file mode 100644 index 0000000..5ba90e4 --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/patchfiles.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/plist_sites.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/plist_sites.xcscheme new file mode 100644 index 0000000..d25adac --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/plist_sites.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/query.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/query.xcscheme new file mode 100644 index 0000000..0dfcd1c --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/query.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/register.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/register.xcscheme new file mode 100644 index 0000000..abc9859 --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/register.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/resolveDeps.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/resolveDeps.xcscheme new file mode 100644 index 0000000..9bf00f6 --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/resolveDeps.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/source_sites.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/source_sites.xcscheme new file mode 100644 index 0000000..c98aa68 --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/source_sites.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/target.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/target.xcscheme new file mode 100644 index 0000000..4f9f93b --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/target.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/tcl_plugins.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/tcl_plugins.xcscheme new file mode 100644 index 0000000..f0826cf --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/tcl_plugins.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/thinPackages.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/thinPackages.xcscheme new file mode 100644 index 0000000..f6b3f6c --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/thinPackages.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/version.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/version.xcscheme new file mode 100644 index 0000000..86a63f7 --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/version.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/world.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/world.xcscheme new file mode 100644 index 0000000..aa2b6ac --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/world.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/xcschememanagement.plist b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..8ded6ca --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,402 @@ + + + + + SchemeUserState + + configuration.xcscheme + + orderHint + 6 + + darwinbuild.xcscheme + + orderHint + 31 + + darwinbuild_scripts.xcscheme + + orderHint + 1 + + darwinmaster.xcscheme + + orderHint + 33 + + darwintrace.xcscheme + + orderHint + 4 + + darwinup.xcscheme + + orderHint + 3 + + darwinxref.xcscheme + + orderHint + 5 + + darwinxref_plugins.xcscheme + + orderHint + 2 + + dependencies.xcscheme + + orderHint + 7 + + diff.xcscheme + + orderHint + 8 + + digest.xcscheme + + orderHint + 38 + + dot.xcscheme + + orderHint + 9 + + edit.xcscheme + + orderHint + 10 + + environment.xcscheme + + orderHint + 11 + + exportFiles.xcscheme + + orderHint + 12 + + exportIndex.xcscheme + + orderHint + 13 + + exportProject.xcscheme + + orderHint + 14 + + findFile.xcscheme + + orderHint + 15 + + inherits.xcscheme + + orderHint + 16 + + installXcode.xcscheme + + orderHint + 36 + + installXcode32.xcscheme + + orderHint + 37 + + loadDeps.xcscheme + + orderHint + 17 + + loadFiles.xcscheme + + orderHint + 18 + + loadIndex.xcscheme + + orderHint + 19 + + manifest.xcscheme + + orderHint + 32 + + mergeBuild.xcscheme + + orderHint + 20 + + original.xcscheme + + orderHint + 21 + + packageRoots.xcscheme + + orderHint + 34 + + patchfiles.xcscheme + + orderHint + 22 + + plist_sites.xcscheme + + orderHint + 23 + + query.xcscheme + + orderHint + 24 + + register.xcscheme + + orderHint + 25 + + resolveDeps.xcscheme + + orderHint + 26 + + source_sites.xcscheme + + orderHint + 27 + + target.xcscheme + + orderHint + 28 + + tcl_plugins.xcscheme + + orderHint + 30 + + thinPackages.xcscheme + + orderHint + 35 + + version.xcscheme + + orderHint + 29 + + world.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 720BE2EA120C90A700B3C4A5 + + primary + + + 7227AB3D1098977C00BE33D7 + + primary + + + 7227AB6C10989A9900BE33D7 + + primary + + + 7227ABFF1098D78C00BE33D7 + + primary + + + 7227AC0C1098D84600BE33D7 + + primary + + + 7227AC151098D8DB00BE33D7 + + primary + + + 7227AC1E1098DB9200BE33D7 + + primary + + + 7227AC271098DBDF00BE33D7 + + primary + + + 7227AC311098DC4E00BE33D7 + + primary + + + 72573F771097A488008AD4D7 + + primary + + + 72573FCA1097A4B7008AD4D7 + + primary + + + 72573FD31097A538008AD4D7 + + primary + + + 72573FDC1097A5A2008AD4D7 + + primary + + + 72573FE51097A5BA008AD4D7 + + primary + + + 72573FEE1097A5D8008AD4D7 + + primary + + + 72573FFD1097A6CC008AD4D7 + + primary + + + 7257400B1097AA25008AD4D7 + + primary + + + 725740151097AA5F008AD4D7 + + primary + + + 7257401D1097AA6E008AD4D7 + + primary + + + 725740251097AA79008AD4D7 + + primary + + + 7257402F1097AA95008AD4D7 + + primary + + + 725740371097AAA6008AD4D7 + + primary + + + 7257403F1097AABA008AD4D7 + + primary + + + 725740471097ABDC008AD4D7 + + primary + + + 7257404F1097AEC1008AD4D7 + + primary + + + 725740571097AECC008AD4D7 + + primary + + + 7257405F1097AEDE008AD4D7 + + primary + + + 725740671097AEF0008AD4D7 + + primary + + + 7257406F1097AEFE008AD4D7 + + primary + + + 725740771097AF0A008AD4D7 + + primary + + + 7257407F1097AF30008AD4D7 + + primary + + + 725740981097B051008AD4D7 + + primary + + + 7257499F1097697300B13BC3 + + primary + + + 72574B581097A36300B13BC3 + + primary + + + 72C86C371096607900C66E90 + + primary + + + 72C86C471096609500C66E90 + + primary + + + 72C86C51109660CA00C66E90 + + primary + + + 72C86C561096614C00C66E90 + + primary + + + 72D05CAD11D267C400B33EDD + + primary + + + + + diff --git a/darwinbuild/manifest.c b/darwinbuild/manifest.c index 4e87a03..0b48950 100644 --- a/darwinbuild/manifest.c +++ b/darwinbuild/manifest.c @@ -110,7 +110,7 @@ static size_t ent_filename(FTSENT* ent, char* filename, size_t bufsiz) { } strncat(filename, "/", bufsiz); bufsiz -= 1; - if (ent->fts_name) { + if (ent->fts_namelen) { strncat(filename, ent->fts_name, bufsiz); bufsiz -= strlen(ent->fts_name); } diff --git a/darwintrace/darwintrace.c b/darwintrace/darwintrace.c index 94f499b..810b1ab 100644 --- a/darwintrace/darwintrace.c +++ b/darwintrace/darwintrace.c @@ -142,7 +142,7 @@ static inline void darwintrace_free_path(char* path, const char* test) { if (path != test) free(path); } -static void _darwintrace_setup(void) { +static void darwintrace_setup(void) { char* path = getenv("DARWINTRACE_LOG"); if (path != NULL) { int olderrno = errno; @@ -221,10 +221,10 @@ static void _darwintrace_setup(void) { } } -static inline void darwintrace_setup(void) { +/* static inline void _darwintrace_setup(void) { static pthread_once_t once = PTHREAD_ONCE_INIT; - pthread_once(&once, &_darwintrace_setup); -} + pthread_once(&once, &darwintrace_setup); +} */ /* darwintrace_setup must have been called already */ static inline void darwintrace_logpath(int fd, const char *procname, char *tag, const char *path) { diff --git a/darwinup/Database.cpp b/darwinup/Database.cpp index c787d3d..5516a6d 100644 --- a/darwinup/Database.cpp +++ b/darwinup/Database.cpp @@ -211,9 +211,9 @@ int Database::post_connect() { // debug settings extern uint32_t verbosity; - if (verbosity & VERBOSE_SQL) { - sqlite3_trace(m_db, dbtrace, NULL); - } + //if 0 //(verbosity & VERBOSE_SQL) { + // sqlite3_trace_v2(sql, m_db, dbtrace, NULL); + //} return res; } diff --git a/darwinup/Utils.cpp b/darwinup/Utils.cpp index 20ef838..8552559 100644 --- a/darwinup/Utils.cpp +++ b/darwinup/Utils.cpp @@ -45,7 +45,7 @@ size_t ftsent_filename(FTSENT* ent, char* filename, size_t bufsiz) { } strlcat(filename, "/", bufsiz); bufsiz -= 1; - if (ent->fts_name) { + if (ent->fts_namelen) { strlcat(filename, ent->fts_name, bufsiz); bufsiz -= strlen(ent->fts_name); } diff --git a/darwinxref/cfutils.c b/darwinxref/cfutils.c index f0903a0..f7ecee1 100644 --- a/darwinxref/cfutils.c +++ b/darwinxref/cfutils.c @@ -87,26 +87,26 @@ CFPropertyListRef read_plist(char* path) { if (buffer != (void*)-1) { CFDataRef data = CFDataCreateWithBytesNoCopy(NULL, buffer, size, kCFAllocatorNull); if (data) { -#if __MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 - CFErrorRef str = 0; - result = CFPropertyListCreateWithData(NULL, data, kCFPropertyListMutableContainers, 0, &str); - CFRelease(data); - if (result == NULL) { - CFStringRef errorDesc = CFErrorCopyDescription(str); - perror_cfstr(errorDesc); - CFRelease(errorDesc); - } -#else - CFStringRef str = NULL; - result = CFPropertyListCreateFromXMLData(NULL, data, kCFPropertyListMutableContainers, &str); - CFRelease(data); - if (result == NULL) { - perror_cfstr(str); - } -#endif - if (str) { - CFRelease(str); - } +//#if 0 //__MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + //CFErrorRef str = 0; + // result = CFPropertyListCreateWithData(NULL, data, kCFPropertyListMutableContainers, 0, &str); + // CFRelease(data); + // if (result == NULL) { + // CFStringRef errorDesc = CFErrorCopyDescription(str); + // perror_cfstr(errorDesc); + // CFRelease(errorDesc); + // } +//#else + //CFStringRef str = NULL; + //result = CFPropertyListCreateWithData(<#CFAllocatorRef allocator#>, <#CFDataRef data#>, <#CFOptionFlags options#>, kCFPropertyListMutableContainers); + //CFRelease(data); + //if (result == NULL) { + // perror_cfstr(str); + //} +//#endif + // if (str) { + // CFRelease(str); + // } } munmap(buffer, size); } else { diff --git a/darwinxref/plugins/exportIndex.c b/darwinxref/plugins/exportIndex.c index 3c348f0..bedbbc7 100644 --- a/darwinxref/plugins/exportIndex.c +++ b/darwinxref/plugins/exportIndex.c @@ -60,7 +60,7 @@ static int run(CFArrayRef argv) { 0, NULL); #else - CFDataRef data = CFPropertyListCreateXMLData(NULL, plist); + CFDataRef data = CFPropertyListCreateData(NULL, kCFAllocatorDefault, kCFPropertyListXMLFormat_v1_0, 0, 0); #endif res = write(STDOUT_FILENO, CFDataGetBytePtr(data), (size_t)CFDataGetLength(data)); } else { diff --git a/darwinxref/plugins/exportProject.c b/darwinxref/plugins/exportProject.c index a26062b..13d5bca 100644 --- a/darwinxref/plugins/exportProject.c +++ b/darwinxref/plugins/exportProject.c @@ -90,7 +90,7 @@ static int run(CFArrayRef argv) { 0, NULL); #else - CFDataRef data = CFPropertyListCreateXMLData(NULL, plist); + CFDataRef data = CFPropertyListCreateData(NULL, kCFAllocatorDefault, kCFPropertyListXMLFormat_v1_0, 0, 0); #endif res = write(STDOUT_FILENO, CFDataGetBytePtr(data), (ssize_t)CFDataGetLength(data)); } else { diff --git a/darwinxref/plugins/register.c b/darwinxref/plugins/register.c index 4eea2b7..65f2cb7 100644 --- a/darwinxref/plugins/register.c +++ b/darwinxref/plugins/register.c @@ -122,7 +122,7 @@ static size_t ent_filename(FTSENT* ent, char* filename, size_t bufsiz) { } strncat(filename, "/", bufsiz); bufsiz -= 1; - if (ent->fts_name) { + if (ent->fts_namelen) { strncat(filename, ent->fts_name, bufsiz); bufsiz -= strlen(ent->fts_name); } From c70ae05d2193b0d955c2c2b004ccfb9c44c1310f Mon Sep 17 00:00:00 2001 From: InSaneDarwin Date: Thu, 6 Apr 2017 03:13:19 -0400 Subject: [PATCH 003/382] Fixed Errors in Darwinbuild --- CHANGES | 0 CONTRIBUTING.md | 0 LICENSE.txt | 0 PULL_REQUEST_TEMPLATE.md | 0 README | 0 common.mk | 0 darwinbuild.xcodeproj/project.pbxproj | 102 ++++++++++++++++++ .../xcshareddata/WorkspaceSettings.xcsettings | 8 ++ .../UserInterfaceState.xcuserstate | Bin 16160 -> 72886 bytes .../xcdebugger/Breakpoints_v2.xcbkptlist | 54 +++------- .../xcschemes/installXcode821.xcscheme | 91 ++++++++++++++++ .../xcschemes/xcschememanagement.plist | 90 +++++++++------- darwinbuild/Info.plist | 0 darwinbuild/SDKSettings.plist | 0 darwinbuild/darwinbuild.common | 0 darwinbuild/digest.c | 0 darwinbuild/installXcode821.in | 44 ++++++++ darwinbuild/manifest.c | 4 +- darwintrace/darwintrace.c | 8 +- darwinup/Archive.cpp | 0 darwinup/Archive.h | 0 darwinup/Column.cpp | 0 darwinup/Column.h | 0 darwinup/DB.cpp | 0 darwinup/DB.h | 0 darwinup/Database.cpp | 6 +- darwinup/Database.h | 0 darwinup/Depot.cpp | 0 darwinup/Depot.h | 0 darwinup/Digest.cpp | 0 darwinup/Digest.h | 0 darwinup/File.cpp | 0 darwinup/File.h | 0 darwinup/NOTES | 0 darwinup/SerialSet.cpp | 0 darwinup/SerialSet.h | 0 darwinup/Table.cpp | 0 darwinup/Table.h | 0 darwinup/Utils.cpp | 5 +- darwinup/Utils.h | 0 darwinup/darwinup.1 | 0 darwinup/main.cpp | 0 darwinxref/DBDataStore.c | 0 darwinxref/DBDataStore.h | 0 darwinxref/DBPlugin.c | 0 darwinxref/DBPlugin.h | 0 darwinxref/DBPluginPriv.h | 0 darwinxref/DBTclPlugin.c | 0 darwinxref/cfutils.c | 40 +++---- darwinxref/cfutils.h | 0 darwinxref/main.c | 0 darwinxref/plugins-darwinports/Portfile.tcl | 0 darwinxref/plugins-darwinports/categories.tcl | 0 .../plugins-darwinports/depends_build.tcl | 0 .../plugins-darwinports/depends_lib.tcl | 0 .../plugins-darwinports/description.tcl | 0 darwinxref/plugins-darwinports/homepage.tcl | 0 darwinxref/plugins-darwinports/loadPortfile.c | 0 .../plugins-darwinports/long_description.tcl | 0 .../plugins-darwinports/maintainers.tcl | 0 .../plugins-darwinports/master_sites.tcl | 0 .../plugins-darwinports/patch_sites.tcl | 0 darwinxref/plugins-darwinports/platforms.tcl | 0 darwinxref/plugins/binary_sites.tcl | 0 darwinxref/plugins/branch.tcl | 0 darwinxref/plugins/c_plugins.xcconfig | 0 darwinxref/plugins/configuration.c | 0 darwinxref/plugins/currentBuild.tcl | 0 darwinxref/plugins/darwin.tcl | 0 darwinxref/plugins/dependencies.c | 0 darwinxref/plugins/descrip.txt | 0 darwinxref/plugins/diff.c | 0 darwinxref/plugins/dot.c | 0 darwinxref/plugins/edit.c | 0 darwinxref/plugins/environment.c | 0 darwinxref/plugins/exportFiles.c | 0 darwinxref/plugins/exportIndex.c | 2 +- darwinxref/plugins/exportProject.c | 2 +- darwinxref/plugins/findFile.c | 0 darwinxref/plugins/group.tcl | 0 darwinxref/plugins/inherits.c | 0 darwinxref/plugins/loadDeps.c | 0 darwinxref/plugins/loadFiles.c | 0 darwinxref/plugins/loadIndex.c | 0 darwinxref/plugins/macosx.tcl | 0 darwinxref/plugins/mergeBuild.c | 0 darwinxref/plugins/original.c | 0 darwinxref/plugins/patchfiles.c | 0 darwinxref/plugins/plist_sites.c | 0 darwinxref/plugins/query.c | 0 darwinxref/plugins/register.c | 5 +- darwinxref/plugins/resolveDeps.c | 0 darwinxref/plugins/source_sites.c | 0 darwinxref/plugins/target.c | 0 darwinxref/plugins/version.c | 0 darwinxref/upgrade_plist.c | 0 patches/CarbonHeaders-18.1.ccdest.patch | 0 patches/IOKitUser-502.nohidevent.patch | 0 ...PowerManagement-209.1.unused_symbols.patch | 0 .../SmartCardServices-34733.MacTypes.patch | 0 patches/Tokend-35209.MacTypes.patch | 0 patches/clamav-125.noupdate.patch | 0 patches/launchd-258.22.CFNotification.patch | 0 ...libsecurity_utilities-36984.MacTypes.patch | 0 patches/perl-63.pldtrace.patch | 0 patches/postfix-197.dtrace-postfix.patch | 0 patches/ppp-412.miniterm_and_noerr.patch | 0 patches/ppp-412.xauthvendor.patch | 0 ...n-36515.kCFDateFormatterIsLenientKey.patch | 0 patches/system_cmds-433.8.patch | 0 patches/top-67.kNilOptions.patch | 0 plists/10A432.plist | 0 plists/10B504.plist | 0 plists/10C540.plist | 0 plists/10D573.plist | 0 plists/10F569.plist | 0 plists/10H574.plist | 0 plists/10J567.plist | 0 plists/10J869.plist | 0 plists/10K540.plist | 0 plists/11A511a.plist | 0 plists/11B26.plist | 0 plists/11C74.plist | 0 plists/11D50.plist | 0 plists/11E53.plist | 0 plists/12A269.plist | 0 plists/7B85.plist | 0 plists/7C107.plist | 0 plists/7D24.plist | 0 plists/7F44.plist | 0 plists/7H63.plist | 0 plists/7M34.plist | 0 plists/7R28.plist | 0 plists/7S215.plist | 0 plists/7U16.plist | 0 plists/7W98.plist | 0 plists/8A428.plist | 0 plists/8B15.plist | 0 plists/8C46.plist | 0 plists/8F46.plist | 0 plists/8G1165.plist | 0 plists/8G1454.plist | 0 plists/8G32.plist | 0 plists/8H14.plist | 0 plists/8I1119.plist | 0 plists/8I127.plist | 0 plists/8J135.plist | 0 plists/8J2135.plist | 0 plists/8L127.plist | 0 plists/8L2127.plist | 0 plists/8M1910.plist | 0 plists/8M2558.plist | 0 plists/8P135.plist | 0 plists/8P2137.plist | 0 plists/8R218.plist | 0 plists/8R2218.plist | 0 plists/8S165.plist | 0 plists/8S2167.plist | 0 plists/9A581.plist | 0 plists/9B18.plist | 0 plists/9C31.plist | 0 plists/9D34.plist | 0 plists/9E17.plist | 0 plists/9F33.plist | 0 plists/9G55.plist | 0 plists/9J61.plist | 0 plists/9L30.plist | 0 prefix.xcconfig | 0 testing/darwinup/300dirs.tbz2 | Bin testing/darwinup/300files.tbz2 | Bin testing/darwinup/corrupt.tgz | 0 testing/darwinup/deep-rollback-2.xar | Bin testing/darwinup/deep-rollback.cpgz | Bin testing/darwinup/depotroot.tar.gz | Bin testing/darwinup/dest.tar.gz | Bin testing/darwinup/extension.tar.bz2 | Bin testing/darwinup/rep_dir_file.tar.gz | Bin testing/darwinup/rep_dir_link.tar.gz | Bin testing/darwinup/rep_file_dir.tar.gz | Bin testing/darwinup/rep_file_link.tar.gz | Bin testing/darwinup/rep_flink_dir.tar.gz | Bin testing/darwinup/rep_flink_file.tar.gz | Bin testing/darwinup/rep_link_dir.tar.gz | Bin testing/darwinup/rep_link_file.tar.gz | Bin testing/darwinup/root.tar.gz | Bin testing/darwinup/root2.tar.gz | Bin testing/darwinup/root3.tar.gz | Bin testing/darwinup/root5.tar.gz | Bin testing/darwinup/root6.tar.gz | Bin testing/darwinup/root7.tar.gz | Bin testing/darwinup/sandboxprofile.tar.bz2 | Bin testing/darwinup/symlink_update.tar.gz | Bin testing/darwinup/symlinks.tar.gz | Bin testing/darwinup/xpcservice.tar.bz2 | Bin 194 files changed, 351 insertions(+), 110 deletions(-) mode change 100644 => 100755 CHANGES mode change 100644 => 100755 CONTRIBUTING.md mode change 100644 => 100755 LICENSE.txt mode change 100644 => 100755 PULL_REQUEST_TEMPLATE.md mode change 100644 => 100755 README mode change 100644 => 100755 common.mk mode change 100644 => 100755 darwinbuild.xcodeproj/project.pbxproj create mode 100644 darwinbuild.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings create mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/installXcode821.xcscheme mode change 100644 => 100755 darwinbuild/Info.plist mode change 100644 => 100755 darwinbuild/SDKSettings.plist mode change 100644 => 100755 darwinbuild/darwinbuild.common mode change 100644 => 100755 darwinbuild/digest.c create mode 100644 darwinbuild/installXcode821.in mode change 100644 => 100755 darwinbuild/manifest.c mode change 100644 => 100755 darwintrace/darwintrace.c mode change 100644 => 100755 darwinup/Archive.cpp mode change 100644 => 100755 darwinup/Archive.h mode change 100644 => 100755 darwinup/Column.cpp mode change 100644 => 100755 darwinup/Column.h mode change 100644 => 100755 darwinup/DB.cpp mode change 100644 => 100755 darwinup/DB.h mode change 100644 => 100755 darwinup/Database.cpp mode change 100644 => 100755 darwinup/Database.h mode change 100644 => 100755 darwinup/Depot.cpp mode change 100644 => 100755 darwinup/Depot.h mode change 100644 => 100755 darwinup/Digest.cpp mode change 100644 => 100755 darwinup/Digest.h mode change 100644 => 100755 darwinup/File.cpp mode change 100644 => 100755 darwinup/File.h mode change 100644 => 100755 darwinup/NOTES mode change 100644 => 100755 darwinup/SerialSet.cpp mode change 100644 => 100755 darwinup/SerialSet.h mode change 100644 => 100755 darwinup/Table.cpp mode change 100644 => 100755 darwinup/Table.h mode change 100644 => 100755 darwinup/Utils.cpp mode change 100644 => 100755 darwinup/Utils.h mode change 100644 => 100755 darwinup/darwinup.1 mode change 100644 => 100755 darwinup/main.cpp mode change 100644 => 100755 darwinxref/DBDataStore.c mode change 100644 => 100755 darwinxref/DBDataStore.h mode change 100644 => 100755 darwinxref/DBPlugin.c mode change 100644 => 100755 darwinxref/DBPlugin.h mode change 100644 => 100755 darwinxref/DBPluginPriv.h mode change 100644 => 100755 darwinxref/DBTclPlugin.c mode change 100644 => 100755 darwinxref/cfutils.c mode change 100644 => 100755 darwinxref/cfutils.h mode change 100644 => 100755 darwinxref/main.c mode change 100644 => 100755 darwinxref/plugins-darwinports/Portfile.tcl mode change 100644 => 100755 darwinxref/plugins-darwinports/categories.tcl mode change 100644 => 100755 darwinxref/plugins-darwinports/depends_build.tcl mode change 100644 => 100755 darwinxref/plugins-darwinports/depends_lib.tcl mode change 100644 => 100755 darwinxref/plugins-darwinports/description.tcl mode change 100644 => 100755 darwinxref/plugins-darwinports/homepage.tcl mode change 100644 => 100755 darwinxref/plugins-darwinports/loadPortfile.c mode change 100644 => 100755 darwinxref/plugins-darwinports/long_description.tcl mode change 100644 => 100755 darwinxref/plugins-darwinports/maintainers.tcl mode change 100644 => 100755 darwinxref/plugins-darwinports/master_sites.tcl mode change 100644 => 100755 darwinxref/plugins-darwinports/patch_sites.tcl mode change 100644 => 100755 darwinxref/plugins-darwinports/platforms.tcl mode change 100644 => 100755 darwinxref/plugins/binary_sites.tcl mode change 100644 => 100755 darwinxref/plugins/branch.tcl mode change 100644 => 100755 darwinxref/plugins/c_plugins.xcconfig mode change 100644 => 100755 darwinxref/plugins/configuration.c mode change 100644 => 100755 darwinxref/plugins/currentBuild.tcl mode change 100644 => 100755 darwinxref/plugins/darwin.tcl mode change 100644 => 100755 darwinxref/plugins/dependencies.c mode change 100644 => 100755 darwinxref/plugins/descrip.txt mode change 100644 => 100755 darwinxref/plugins/diff.c mode change 100644 => 100755 darwinxref/plugins/dot.c mode change 100644 => 100755 darwinxref/plugins/edit.c mode change 100644 => 100755 darwinxref/plugins/environment.c mode change 100644 => 100755 darwinxref/plugins/exportFiles.c mode change 100644 => 100755 darwinxref/plugins/exportIndex.c mode change 100644 => 100755 darwinxref/plugins/exportProject.c mode change 100644 => 100755 darwinxref/plugins/findFile.c mode change 100644 => 100755 darwinxref/plugins/group.tcl mode change 100644 => 100755 darwinxref/plugins/inherits.c mode change 100644 => 100755 darwinxref/plugins/loadDeps.c mode change 100644 => 100755 darwinxref/plugins/loadFiles.c mode change 100644 => 100755 darwinxref/plugins/loadIndex.c mode change 100644 => 100755 darwinxref/plugins/macosx.tcl mode change 100644 => 100755 darwinxref/plugins/mergeBuild.c mode change 100644 => 100755 darwinxref/plugins/original.c mode change 100644 => 100755 darwinxref/plugins/patchfiles.c mode change 100644 => 100755 darwinxref/plugins/plist_sites.c mode change 100644 => 100755 darwinxref/plugins/query.c mode change 100644 => 100755 darwinxref/plugins/register.c mode change 100644 => 100755 darwinxref/plugins/resolveDeps.c mode change 100644 => 100755 darwinxref/plugins/source_sites.c mode change 100644 => 100755 darwinxref/plugins/target.c mode change 100644 => 100755 darwinxref/plugins/version.c mode change 100644 => 100755 darwinxref/upgrade_plist.c mode change 100644 => 100755 patches/CarbonHeaders-18.1.ccdest.patch mode change 100644 => 100755 patches/IOKitUser-502.nohidevent.patch mode change 100644 => 100755 patches/PowerManagement-209.1.unused_symbols.patch mode change 100644 => 100755 patches/SmartCardServices-34733.MacTypes.patch mode change 100644 => 100755 patches/Tokend-35209.MacTypes.patch mode change 100644 => 100755 patches/clamav-125.noupdate.patch mode change 100644 => 100755 patches/launchd-258.22.CFNotification.patch mode change 100644 => 100755 patches/libsecurity_utilities-36984.MacTypes.patch mode change 100644 => 100755 patches/perl-63.pldtrace.patch mode change 100644 => 100755 patches/postfix-197.dtrace-postfix.patch mode change 100644 => 100755 patches/ppp-412.miniterm_and_noerr.patch mode change 100644 => 100755 patches/ppp-412.xauthvendor.patch mode change 100644 => 100755 patches/security_systemkeychain-36515.kCFDateFormatterIsLenientKey.patch mode change 100644 => 100755 patches/system_cmds-433.8.patch mode change 100644 => 100755 patches/top-67.kNilOptions.patch mode change 100644 => 100755 plists/10A432.plist mode change 100644 => 100755 plists/10B504.plist mode change 100644 => 100755 plists/10C540.plist mode change 100644 => 100755 plists/10D573.plist mode change 100644 => 100755 plists/10F569.plist mode change 100644 => 100755 plists/10H574.plist mode change 100644 => 100755 plists/10J567.plist mode change 100644 => 100755 plists/10J869.plist mode change 100644 => 100755 plists/10K540.plist mode change 100644 => 100755 plists/11A511a.plist mode change 100644 => 100755 plists/11B26.plist mode change 100644 => 100755 plists/11C74.plist mode change 100644 => 100755 plists/11D50.plist mode change 100644 => 100755 plists/11E53.plist mode change 100644 => 100755 plists/12A269.plist mode change 100644 => 100755 plists/7B85.plist mode change 100644 => 100755 plists/7C107.plist mode change 100644 => 100755 plists/7D24.plist mode change 100644 => 100755 plists/7F44.plist mode change 100644 => 100755 plists/7H63.plist mode change 100644 => 100755 plists/7M34.plist mode change 100644 => 100755 plists/7R28.plist mode change 100644 => 100755 plists/7S215.plist mode change 100644 => 100755 plists/7U16.plist mode change 100644 => 100755 plists/7W98.plist mode change 100644 => 100755 plists/8A428.plist mode change 100644 => 100755 plists/8B15.plist mode change 100644 => 100755 plists/8C46.plist mode change 100644 => 100755 plists/8F46.plist mode change 100644 => 100755 plists/8G1165.plist mode change 100644 => 100755 plists/8G1454.plist mode change 100644 => 100755 plists/8G32.plist mode change 100644 => 100755 plists/8H14.plist mode change 100644 => 100755 plists/8I1119.plist mode change 100644 => 100755 plists/8I127.plist mode change 100644 => 100755 plists/8J135.plist mode change 100644 => 100755 plists/8J2135.plist mode change 100644 => 100755 plists/8L127.plist mode change 100644 => 100755 plists/8L2127.plist mode change 100644 => 100755 plists/8M1910.plist mode change 100644 => 100755 plists/8M2558.plist mode change 100644 => 100755 plists/8P135.plist mode change 100644 => 100755 plists/8P2137.plist mode change 100644 => 100755 plists/8R218.plist mode change 100644 => 100755 plists/8R2218.plist mode change 100644 => 100755 plists/8S165.plist mode change 100644 => 100755 plists/8S2167.plist mode change 100644 => 100755 plists/9A581.plist mode change 100644 => 100755 plists/9B18.plist mode change 100644 => 100755 plists/9C31.plist mode change 100644 => 100755 plists/9D34.plist mode change 100644 => 100755 plists/9E17.plist mode change 100644 => 100755 plists/9F33.plist mode change 100644 => 100755 plists/9G55.plist mode change 100644 => 100755 plists/9J61.plist mode change 100644 => 100755 plists/9L30.plist mode change 100644 => 100755 prefix.xcconfig mode change 100644 => 100755 testing/darwinup/300dirs.tbz2 mode change 100644 => 100755 testing/darwinup/300files.tbz2 mode change 100644 => 100755 testing/darwinup/corrupt.tgz mode change 100644 => 100755 testing/darwinup/deep-rollback-2.xar mode change 100644 => 100755 testing/darwinup/deep-rollback.cpgz mode change 100644 => 100755 testing/darwinup/depotroot.tar.gz mode change 100644 => 100755 testing/darwinup/dest.tar.gz mode change 100644 => 100755 testing/darwinup/extension.tar.bz2 mode change 100644 => 100755 testing/darwinup/rep_dir_file.tar.gz mode change 100644 => 100755 testing/darwinup/rep_dir_link.tar.gz mode change 100644 => 100755 testing/darwinup/rep_file_dir.tar.gz mode change 100644 => 100755 testing/darwinup/rep_file_link.tar.gz mode change 100644 => 100755 testing/darwinup/rep_flink_dir.tar.gz mode change 100644 => 100755 testing/darwinup/rep_flink_file.tar.gz mode change 100644 => 100755 testing/darwinup/rep_link_dir.tar.gz mode change 100644 => 100755 testing/darwinup/rep_link_file.tar.gz mode change 100644 => 100755 testing/darwinup/root.tar.gz mode change 100644 => 100755 testing/darwinup/root2.tar.gz mode change 100644 => 100755 testing/darwinup/root3.tar.gz mode change 100644 => 100755 testing/darwinup/root5.tar.gz mode change 100644 => 100755 testing/darwinup/root6.tar.gz mode change 100644 => 100755 testing/darwinup/root7.tar.gz mode change 100644 => 100755 testing/darwinup/sandboxprofile.tar.bz2 mode change 100644 => 100755 testing/darwinup/symlink_update.tar.gz mode change 100644 => 100755 testing/darwinup/symlinks.tar.gz mode change 100644 => 100755 testing/darwinup/xpcservice.tar.bz2 diff --git a/CHANGES b/CHANGES old mode 100644 new mode 100755 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md old mode 100644 new mode 100755 diff --git a/LICENSE.txt b/LICENSE.txt old mode 100644 new mode 100755 diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md old mode 100644 new mode 100755 diff --git a/README b/README old mode 100644 new mode 100755 diff --git a/common.mk b/common.mk old mode 100644 new mode 100755 diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj old mode 100644 new mode 100755 index 3e1d2ff..45b38c0 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -25,6 +25,7 @@ 7227AD1B109A053900BE33D7 /* CopyFiles */, ); dependencies = ( + 391ABCA51E64183A002B338C /* PBXTargetDependency */, 720BE2F6120C90E500B3C4A5 /* PBXTargetDependency */, 7227AC421098DC6A00BE33D7 /* PBXTargetDependency */, 7227AC401098DC6A00BE33D7 /* PBXTargetDependency */, @@ -161,6 +162,13 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 391ABCA41E64183A002B338C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 726DD14910965C5700D5AEAB /* Project object */; + proxyType = 1; + remoteGlobalIDString = 391ABC9C1E64171C002B338C; + remoteInfo = installXcode821; + }; 720BE2F5120C90E500B3C4A5 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 726DD14910965C5700D5AEAB /* Project object */; @@ -648,6 +656,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 391ABCA31E64171C002B338C /* installXcode821 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = installXcode821; sourceTree = BUILT_PRODUCTS_DIR; }; 720BE2E9120C909E00B3C4A5 /* digest.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = digest.c; path = darwinbuild/digest.c; sourceTree = ""; }; 720BE2F2120C90A700B3C4A5 /* digest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = digest; sourceTree = BUILT_PRODUCTS_DIR; }; 7227AB6D10989A9900BE33D7 /* manifest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = manifest; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -1190,6 +1199,7 @@ 7227AC2E1098DBDF00BE33D7 /* installXcode32 */, 72D05CB711D267C400B33EDD /* query.so */, 720BE2F2120C90A700B3C4A5 /* digest */, + 391ABCA31E64171C002B338C /* installXcode821 */, ); name = Products; sourceTree = ""; @@ -1270,6 +1280,22 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ + 391ABC9C1E64171C002B338C /* installXcode821 */ = { + isa = PBXNativeTarget; + buildConfigurationList = 391ABC9F1E64171C002B338C /* Build configuration list for PBXNativeTarget "installXcode821" */; + buildPhases = ( + 391ABC9D1E64171C002B338C /* ShellScript */, + 391ABC9E1E64171C002B338C /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = installXcode821; + productName = darwinbuild; + productReference = 391ABCA31E64171C002B338C /* installXcode821 */; + productType = "com.apple.product-type.tool"; + }; 720BE2EA120C90A700B3C4A5 /* digest */ = { isa = PBXNativeTarget; buildConfigurationList = 720BE2EE120C90A700B3C4A5 /* Build configuration list for PBXNativeTarget "digest" */; @@ -1921,11 +1947,42 @@ 7227AC1E1098DB9200BE33D7 /* installXcode */, 7227AC271098DBDF00BE33D7 /* installXcode32 */, 720BE2EA120C90A700B3C4A5 /* digest */, + 391ABC9C1E64171C002B338C /* installXcode821 */, ); }; /* End PBXProject section */ /* Begin PBXShellScriptBuildPhase section */ + 391ABC9D1E64171C002B338C /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/darwinbuild/installXcode821.in", + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/installXcode821", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/usr/bin/sed -e \"s,%%PREFIX%%,$PREFIX,\" $SRCROOT/darwinbuild/installXcode821.in > $DERIVED_FILE_DIR/installXcode821\n\n/bin/chmod 755 $DERIVED_FILE_DIR/installXcode821\n\n"; + }; + 391ABC9E1E64171C002B338C /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(DERIVED_FILE_DIR)/installXcode821", + ); + outputPaths = ( + "$(BUILT_PRODUCTS_DIR)/installXcode821", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/cp $DERIVED_FILE_DIR/installXcode821 $BUILT_PRODUCTS_DIR/installXcode821"; + }; 7227AB8F1098A89700BE33D7 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -2358,6 +2415,11 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 391ABCA51E64183A002B338C /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 391ABC9C1E64171C002B338C /* installXcode821 */; + targetProxy = 391ABCA41E64183A002B338C /* PBXContainerItemProxy */; + }; 720BE2F6120C90E500B3C4A5 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 720BE2EA120C90A700B3C4A5 /* digest */; @@ -2671,6 +2733,33 @@ /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ + 391ABCA01E64171C002B338C /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; + buildSettings = { + INSTALL_PATH = "$(DATDIR)/darwinbuild"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 391ABCA11E64171C002B338C /* Public */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; + buildSettings = { + INSTALL_PATH = "$(DATDIR)/darwinbuild"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Public; + }; + 391ABCA21E64171C002B338C /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; + buildSettings = { + INSTALL_PATH = "$(DATDIR)/darwinbuild"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; 720BE2EF120C90A700B3C4A5 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; @@ -3437,6 +3526,7 @@ GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; LD_OPENMP_FLAGS = ""; + MACOSX_DEPLOYMENT_TARGET = 10.12; STRIP_INSTALLED_PRODUCT = NO; STRIP_STYLE = "non-global"; WARNING_CFLAGS = "-Wall"; @@ -3598,6 +3688,7 @@ GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; LD_OPENMP_FLAGS = ""; + MACOSX_DEPLOYMENT_TARGET = 10.12; ONLY_ACTIVE_ARCH = YES; STRIP_INSTALLED_PRODUCT = NO; STRIP_STYLE = "non-global"; @@ -3648,6 +3739,7 @@ GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; LD_OPENMP_FLAGS = ""; + MACOSX_DEPLOYMENT_TARGET = 10.12; STRIP_INSTALLED_PRODUCT = NO; STRIP_STYLE = "non-global"; WARNING_CFLAGS = "-Wall"; @@ -3759,6 +3851,16 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 391ABC9F1E64171C002B338C /* Build configuration list for PBXNativeTarget "installXcode821" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 391ABCA01E64171C002B338C /* Debug */, + 391ABCA11E64171C002B338C /* Public */, + 391ABCA21E64171C002B338C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Public; + }; 720BE2EE120C90A700B3C4A5 /* Build configuration list for PBXNativeTarget "digest" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/darwinbuild.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/darwinbuild.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..08de0be --- /dev/null +++ b/darwinbuild.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded + + + diff --git a/darwinbuild.xcodeproj/project.xcworkspace/xcuserdata/insane.xcuserdatad/UserInterfaceState.xcuserstate b/darwinbuild.xcodeproj/project.xcworkspace/xcuserdata/insane.xcuserdatad/UserInterfaceState.xcuserstate index 315fed62ca5d4a499fc023c9f9a501babae03307..6d9fa24028c27f17679587f8007eced2f4e55ac2 100644 GIT binary patch literal 72886 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

?eT{BRk>jL@?|E?N0_osL;^ATFy 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 DG@aAP literal 16160 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 diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index 2e26d3d..c8e276e 100644 --- a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -7,48 +7,24 @@ BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> - - - - - - - - + startingLineNumber = "215" + endingLineNumber = "215" + landmarkName = "Database::post_connect()" + landmarkType = "7"> + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/installXcode821.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/installXcode821.xcscheme new file mode 100644 index 0000000..439eb03 --- /dev/null +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/installXcode821.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/xcschememanagement.plist b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/xcschememanagement.plist index 8ded6ca..25e25ed 100644 --- a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/xcschememanagement.plist @@ -7,201 +7,213 @@ configuration.xcscheme orderHint - 6 + 7 darwinbuild.xcscheme orderHint - 31 + 32 darwinbuild_scripts.xcscheme orderHint - 1 + 2 darwinmaster.xcscheme orderHint - 33 + 34 darwintrace.xcscheme orderHint - 4 + 5 darwinup.xcscheme orderHint - 3 + 4 darwinxref.xcscheme orderHint - 5 + 6 darwinxref_plugins.xcscheme orderHint - 2 + 3 dependencies.xcscheme orderHint - 7 + 8 diff.xcscheme orderHint - 8 + 9 digest.xcscheme orderHint - 38 + 39 dot.xcscheme orderHint - 9 + 10 edit.xcscheme orderHint - 10 + 11 environment.xcscheme orderHint - 11 + 12 exportFiles.xcscheme orderHint - 12 + 13 exportIndex.xcscheme orderHint - 13 + 14 exportProject.xcscheme orderHint - 14 + 15 findFile.xcscheme orderHint - 15 + 16 inherits.xcscheme orderHint - 16 + 17 installXcode.xcscheme orderHint - 36 + 37 installXcode32.xcscheme orderHint - 37 + 38 + + installXcode821.xcscheme + + isShown + + orderHint + 0 loadDeps.xcscheme orderHint - 17 + 18 loadFiles.xcscheme orderHint - 18 + 19 loadIndex.xcscheme orderHint - 19 + 20 manifest.xcscheme orderHint - 32 + 33 mergeBuild.xcscheme orderHint - 20 + 21 original.xcscheme orderHint - 21 + 22 packageRoots.xcscheme orderHint - 34 + 35 patchfiles.xcscheme orderHint - 22 + 23 plist_sites.xcscheme orderHint - 23 + 24 query.xcscheme orderHint - 24 + 25 register.xcscheme orderHint - 25 + 26 resolveDeps.xcscheme orderHint - 26 + 27 source_sites.xcscheme orderHint - 27 + 28 target.xcscheme orderHint - 28 + 29 tcl_plugins.xcscheme orderHint - 30 + 31 thinPackages.xcscheme orderHint - 35 + 36 version.xcscheme orderHint - 29 + 30 world.xcscheme orderHint - 0 + 1 SuppressBuildableAutocreation + 391ABC9C1E64171C002B338C + + primary + + 720BE2EA120C90A700B3C4A5 primary diff --git a/darwinbuild/Info.plist b/darwinbuild/Info.plist old mode 100644 new mode 100755 diff --git a/darwinbuild/SDKSettings.plist b/darwinbuild/SDKSettings.plist old mode 100644 new mode 100755 diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common old mode 100644 new mode 100755 diff --git a/darwinbuild/digest.c b/darwinbuild/digest.c old mode 100644 new mode 100755 diff --git a/darwinbuild/installXcode821.in b/darwinbuild/installXcode821.in new file mode 100644 index 0000000..02170fa --- /dev/null +++ b/darwinbuild/installXcode821.in @@ -0,0 +1,44 @@ +#!/bin/sh + +FORCE="YES" +XCODEBUILD=/usr/bin/xcodebuild +BUILDROOT="$1" +DBROOT=$(dirname $BUILDROOT) +PLATFORMDIR="${DBROOT}/Platform" +STAMP=$(date +%Y%m%d%H%M%S) +BUILD=$(cat $DBROOT/.build/build) +PLATFORM="Darwinbuild_${BUILD}_${STAMP}" +INFOPLIST=%%PREFIX%%/share/darwinbuild/Info.plist +SDKPLIST=%%PREFIX%%/share/darwinbuild/SDKSettings.plist + +echo $PLATFORM > "${DBROOT}/.build/platform" +echo "Installing Platform/SDK $PLATFORM for Xcode 8.2.1" + +mkdir -p "${PLATFORMDIR}/Developer/SDKs" +mkdir -p "${PLATFORMDIR}/Developer/Library/Xcode" + +rsync -a "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Xcode" \ + "${PLATFORMDIR}/Developer/Library/Xcode" + +sed -e "s,%%PLATFORM%%,${PLATFORM}," $INFOPLIST > "${PLATFORMDIR}/Info.plist" +sed -e "s,%%PLATFORM%%,${PLATFORM}," $SDKPLIST > "${BUILDROOT}/SDKSettings.plist" + +pushd "${PLATFORMDIR}/Library/Developer" > /dev/null +ln -s ../../BuildRoot/usr/ usr +popd > /dev/null + +pushd "${PLATFORMDIR}/Library/Developer/SDKs" > /dev/null +ln -s ../../../BuildRoot/ "${PLATFORM}.sdk" +popd > /dev/null + +pushd "/Developer/Platforms" > /dev/null +ln -s "$PLATFORMDIR" "${PLATFORM}.platform" +popd > /dev/null + +mkdir -p "${DBROOT}/BuildRoot/Developer/" +pushd "${DBROOT}/BuildRoot/Developer/" > /dev/null +ln -s ../usr usr +popd > /dev/null + +echo "Completed Platform/SDK install" + diff --git a/darwinbuild/manifest.c b/darwinbuild/manifest.c old mode 100644 new mode 100755 index 0b48950..aa4da65 --- a/darwinbuild/manifest.c +++ b/darwinbuild/manifest.c @@ -43,6 +43,8 @@ #include #include +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Waddress" static char* format_digest(const unsigned char* m) { char* result = NULL; @@ -110,7 +112,7 @@ static size_t ent_filename(FTSENT* ent, char* filename, size_t bufsiz) { } strncat(filename, "/", bufsiz); bufsiz -= 1; - if (ent->fts_namelen) { + if (ent->fts_name) { strncat(filename, ent->fts_name, bufsiz); bufsiz -= strlen(ent->fts_name); } diff --git a/darwintrace/darwintrace.c b/darwintrace/darwintrace.c old mode 100644 new mode 100755 index 810b1ab..94f499b --- a/darwintrace/darwintrace.c +++ b/darwintrace/darwintrace.c @@ -142,7 +142,7 @@ static inline void darwintrace_free_path(char* path, const char* test) { if (path != test) free(path); } -static void darwintrace_setup(void) { +static void _darwintrace_setup(void) { char* path = getenv("DARWINTRACE_LOG"); if (path != NULL) { int olderrno = errno; @@ -221,10 +221,10 @@ static void darwintrace_setup(void) { } } -/* static inline void _darwintrace_setup(void) { +static inline void darwintrace_setup(void) { static pthread_once_t once = PTHREAD_ONCE_INIT; - pthread_once(&once, &darwintrace_setup); -} */ + pthread_once(&once, &_darwintrace_setup); +} /* darwintrace_setup must have been called already */ static inline void darwintrace_logpath(int fd, const char *procname, char *tag, const char *path) { diff --git a/darwinup/Archive.cpp b/darwinup/Archive.cpp old mode 100644 new mode 100755 diff --git a/darwinup/Archive.h b/darwinup/Archive.h old mode 100644 new mode 100755 diff --git a/darwinup/Column.cpp b/darwinup/Column.cpp old mode 100644 new mode 100755 diff --git a/darwinup/Column.h b/darwinup/Column.h old mode 100644 new mode 100755 diff --git a/darwinup/DB.cpp b/darwinup/DB.cpp old mode 100644 new mode 100755 diff --git a/darwinup/DB.h b/darwinup/DB.h old mode 100644 new mode 100755 diff --git a/darwinup/Database.cpp b/darwinup/Database.cpp old mode 100644 new mode 100755 index 5516a6d..754ac74 --- a/darwinup/Database.cpp +++ b/darwinup/Database.cpp @@ -210,9 +210,9 @@ int Database::post_connect() { &m_commit_transaction, NULL); // debug settings - extern uint32_t verbosity; - //if 0 //(verbosity & VERBOSE_SQL) { - // sqlite3_trace_v2(sql, m_db, dbtrace, NULL); + //extern uint32_t verbosity; + //if (verbosity & VERBOSE_SQL) { + // sqlite3_trace_v2 (m_db, dbtrace, NULL); //} return res; diff --git a/darwinup/Database.h b/darwinup/Database.h old mode 100644 new mode 100755 diff --git a/darwinup/Depot.cpp b/darwinup/Depot.cpp old mode 100644 new mode 100755 diff --git a/darwinup/Depot.h b/darwinup/Depot.h old mode 100644 new mode 100755 diff --git a/darwinup/Digest.cpp b/darwinup/Digest.cpp old mode 100644 new mode 100755 diff --git a/darwinup/Digest.h b/darwinup/Digest.h old mode 100644 new mode 100755 diff --git a/darwinup/File.cpp b/darwinup/File.cpp old mode 100644 new mode 100755 diff --git a/darwinup/File.h b/darwinup/File.h old mode 100644 new mode 100755 diff --git a/darwinup/NOTES b/darwinup/NOTES old mode 100644 new mode 100755 diff --git a/darwinup/SerialSet.cpp b/darwinup/SerialSet.cpp old mode 100644 new mode 100755 diff --git a/darwinup/SerialSet.h b/darwinup/SerialSet.h old mode 100644 new mode 100755 diff --git a/darwinup/Table.cpp b/darwinup/Table.cpp old mode 100644 new mode 100755 diff --git a/darwinup/Table.h b/darwinup/Table.h old mode 100644 new mode 100755 diff --git a/darwinup/Utils.cpp b/darwinup/Utils.cpp old mode 100644 new mode 100755 index 8552559..36f3f3a --- a/darwinup/Utils.cpp +++ b/darwinup/Utils.cpp @@ -32,6 +32,9 @@ #include "Utils.h" +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Waddress" + extern char** environ; int fts_compare(const FTSENT **a, const FTSENT **b) { @@ -45,7 +48,7 @@ size_t ftsent_filename(FTSENT* ent, char* filename, size_t bufsiz) { } strlcat(filename, "/", bufsiz); bufsiz -= 1; - if (ent->fts_namelen) { + if (ent->fts_name) { strlcat(filename, ent->fts_name, bufsiz); bufsiz -= strlen(ent->fts_name); } diff --git a/darwinup/Utils.h b/darwinup/Utils.h old mode 100644 new mode 100755 diff --git a/darwinup/darwinup.1 b/darwinup/darwinup.1 old mode 100644 new mode 100755 diff --git a/darwinup/main.cpp b/darwinup/main.cpp old mode 100644 new mode 100755 diff --git a/darwinxref/DBDataStore.c b/darwinxref/DBDataStore.c old mode 100644 new mode 100755 diff --git a/darwinxref/DBDataStore.h b/darwinxref/DBDataStore.h old mode 100644 new mode 100755 diff --git a/darwinxref/DBPlugin.c b/darwinxref/DBPlugin.c old mode 100644 new mode 100755 diff --git a/darwinxref/DBPlugin.h b/darwinxref/DBPlugin.h old mode 100644 new mode 100755 diff --git a/darwinxref/DBPluginPriv.h b/darwinxref/DBPluginPriv.h old mode 100644 new mode 100755 diff --git a/darwinxref/DBTclPlugin.c b/darwinxref/DBTclPlugin.c old mode 100644 new mode 100755 diff --git a/darwinxref/cfutils.c b/darwinxref/cfutils.c old mode 100644 new mode 100755 index f7ecee1..f0903a0 --- a/darwinxref/cfutils.c +++ b/darwinxref/cfutils.c @@ -87,26 +87,26 @@ CFPropertyListRef read_plist(char* path) { if (buffer != (void*)-1) { CFDataRef data = CFDataCreateWithBytesNoCopy(NULL, buffer, size, kCFAllocatorNull); if (data) { -//#if 0 //__MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 - //CFErrorRef str = 0; - // result = CFPropertyListCreateWithData(NULL, data, kCFPropertyListMutableContainers, 0, &str); - // CFRelease(data); - // if (result == NULL) { - // CFStringRef errorDesc = CFErrorCopyDescription(str); - // perror_cfstr(errorDesc); - // CFRelease(errorDesc); - // } -//#else - //CFStringRef str = NULL; - //result = CFPropertyListCreateWithData(<#CFAllocatorRef allocator#>, <#CFDataRef data#>, <#CFOptionFlags options#>, kCFPropertyListMutableContainers); - //CFRelease(data); - //if (result == NULL) { - // perror_cfstr(str); - //} -//#endif - // if (str) { - // CFRelease(str); - // } +#if __MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + CFErrorRef str = 0; + result = CFPropertyListCreateWithData(NULL, data, kCFPropertyListMutableContainers, 0, &str); + CFRelease(data); + if (result == NULL) { + CFStringRef errorDesc = CFErrorCopyDescription(str); + perror_cfstr(errorDesc); + CFRelease(errorDesc); + } +#else + CFStringRef str = NULL; + result = CFPropertyListCreateFromXMLData(NULL, data, kCFPropertyListMutableContainers, &str); + CFRelease(data); + if (result == NULL) { + perror_cfstr(str); + } +#endif + if (str) { + CFRelease(str); + } } munmap(buffer, size); } else { diff --git a/darwinxref/cfutils.h b/darwinxref/cfutils.h old mode 100644 new mode 100755 diff --git a/darwinxref/main.c b/darwinxref/main.c old mode 100644 new mode 100755 diff --git a/darwinxref/plugins-darwinports/Portfile.tcl b/darwinxref/plugins-darwinports/Portfile.tcl old mode 100644 new mode 100755 diff --git a/darwinxref/plugins-darwinports/categories.tcl b/darwinxref/plugins-darwinports/categories.tcl old mode 100644 new mode 100755 diff --git a/darwinxref/plugins-darwinports/depends_build.tcl b/darwinxref/plugins-darwinports/depends_build.tcl old mode 100644 new mode 100755 diff --git a/darwinxref/plugins-darwinports/depends_lib.tcl b/darwinxref/plugins-darwinports/depends_lib.tcl old mode 100644 new mode 100755 diff --git a/darwinxref/plugins-darwinports/description.tcl b/darwinxref/plugins-darwinports/description.tcl old mode 100644 new mode 100755 diff --git a/darwinxref/plugins-darwinports/homepage.tcl b/darwinxref/plugins-darwinports/homepage.tcl old mode 100644 new mode 100755 diff --git a/darwinxref/plugins-darwinports/loadPortfile.c b/darwinxref/plugins-darwinports/loadPortfile.c old mode 100644 new mode 100755 diff --git a/darwinxref/plugins-darwinports/long_description.tcl b/darwinxref/plugins-darwinports/long_description.tcl old mode 100644 new mode 100755 diff --git a/darwinxref/plugins-darwinports/maintainers.tcl b/darwinxref/plugins-darwinports/maintainers.tcl old mode 100644 new mode 100755 diff --git a/darwinxref/plugins-darwinports/master_sites.tcl b/darwinxref/plugins-darwinports/master_sites.tcl old mode 100644 new mode 100755 diff --git a/darwinxref/plugins-darwinports/patch_sites.tcl b/darwinxref/plugins-darwinports/patch_sites.tcl old mode 100644 new mode 100755 diff --git a/darwinxref/plugins-darwinports/platforms.tcl b/darwinxref/plugins-darwinports/platforms.tcl old mode 100644 new mode 100755 diff --git a/darwinxref/plugins/binary_sites.tcl b/darwinxref/plugins/binary_sites.tcl old mode 100644 new mode 100755 diff --git a/darwinxref/plugins/branch.tcl b/darwinxref/plugins/branch.tcl old mode 100644 new mode 100755 diff --git a/darwinxref/plugins/c_plugins.xcconfig b/darwinxref/plugins/c_plugins.xcconfig old mode 100644 new mode 100755 diff --git a/darwinxref/plugins/configuration.c b/darwinxref/plugins/configuration.c old mode 100644 new mode 100755 diff --git a/darwinxref/plugins/currentBuild.tcl b/darwinxref/plugins/currentBuild.tcl old mode 100644 new mode 100755 diff --git a/darwinxref/plugins/darwin.tcl b/darwinxref/plugins/darwin.tcl old mode 100644 new mode 100755 diff --git a/darwinxref/plugins/dependencies.c b/darwinxref/plugins/dependencies.c old mode 100644 new mode 100755 diff --git a/darwinxref/plugins/descrip.txt b/darwinxref/plugins/descrip.txt old mode 100644 new mode 100755 diff --git a/darwinxref/plugins/diff.c b/darwinxref/plugins/diff.c old mode 100644 new mode 100755 diff --git a/darwinxref/plugins/dot.c b/darwinxref/plugins/dot.c old mode 100644 new mode 100755 diff --git a/darwinxref/plugins/edit.c b/darwinxref/plugins/edit.c old mode 100644 new mode 100755 diff --git a/darwinxref/plugins/environment.c b/darwinxref/plugins/environment.c old mode 100644 new mode 100755 diff --git a/darwinxref/plugins/exportFiles.c b/darwinxref/plugins/exportFiles.c old mode 100644 new mode 100755 diff --git a/darwinxref/plugins/exportIndex.c b/darwinxref/plugins/exportIndex.c old mode 100644 new mode 100755 index bedbbc7..3c348f0 --- a/darwinxref/plugins/exportIndex.c +++ b/darwinxref/plugins/exportIndex.c @@ -60,7 +60,7 @@ static int run(CFArrayRef argv) { 0, NULL); #else - CFDataRef data = CFPropertyListCreateData(NULL, kCFAllocatorDefault, kCFPropertyListXMLFormat_v1_0, 0, 0); + CFDataRef data = CFPropertyListCreateXMLData(NULL, plist); #endif res = write(STDOUT_FILENO, CFDataGetBytePtr(data), (size_t)CFDataGetLength(data)); } else { diff --git a/darwinxref/plugins/exportProject.c b/darwinxref/plugins/exportProject.c old mode 100644 new mode 100755 index 13d5bca..a26062b --- a/darwinxref/plugins/exportProject.c +++ b/darwinxref/plugins/exportProject.c @@ -90,7 +90,7 @@ static int run(CFArrayRef argv) { 0, NULL); #else - CFDataRef data = CFPropertyListCreateData(NULL, kCFAllocatorDefault, kCFPropertyListXMLFormat_v1_0, 0, 0); + CFDataRef data = CFPropertyListCreateXMLData(NULL, plist); #endif res = write(STDOUT_FILENO, CFDataGetBytePtr(data), (ssize_t)CFDataGetLength(data)); } else { diff --git a/darwinxref/plugins/findFile.c b/darwinxref/plugins/findFile.c old mode 100644 new mode 100755 diff --git a/darwinxref/plugins/group.tcl b/darwinxref/plugins/group.tcl old mode 100644 new mode 100755 diff --git a/darwinxref/plugins/inherits.c b/darwinxref/plugins/inherits.c old mode 100644 new mode 100755 diff --git a/darwinxref/plugins/loadDeps.c b/darwinxref/plugins/loadDeps.c old mode 100644 new mode 100755 diff --git a/darwinxref/plugins/loadFiles.c b/darwinxref/plugins/loadFiles.c old mode 100644 new mode 100755 diff --git a/darwinxref/plugins/loadIndex.c b/darwinxref/plugins/loadIndex.c old mode 100644 new mode 100755 diff --git a/darwinxref/plugins/macosx.tcl b/darwinxref/plugins/macosx.tcl old mode 100644 new mode 100755 diff --git a/darwinxref/plugins/mergeBuild.c b/darwinxref/plugins/mergeBuild.c old mode 100644 new mode 100755 diff --git a/darwinxref/plugins/original.c b/darwinxref/plugins/original.c old mode 100644 new mode 100755 diff --git a/darwinxref/plugins/patchfiles.c b/darwinxref/plugins/patchfiles.c old mode 100644 new mode 100755 diff --git a/darwinxref/plugins/plist_sites.c b/darwinxref/plugins/plist_sites.c old mode 100644 new mode 100755 diff --git a/darwinxref/plugins/query.c b/darwinxref/plugins/query.c old mode 100644 new mode 100755 diff --git a/darwinxref/plugins/register.c b/darwinxref/plugins/register.c old mode 100644 new mode 100755 index 65f2cb7..e490188 --- a/darwinxref/plugins/register.c +++ b/darwinxref/plugins/register.c @@ -47,6 +47,9 @@ #include #include "sqlite3.h" +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Waddress" + extern char** environ; int register_files(char* build, char* project, char* path); @@ -122,7 +125,7 @@ static size_t ent_filename(FTSENT* ent, char* filename, size_t bufsiz) { } strncat(filename, "/", bufsiz); bufsiz -= 1; - if (ent->fts_namelen) { + if (ent->fts_name) { strncat(filename, ent->fts_name, bufsiz); bufsiz -= strlen(ent->fts_name); } diff --git a/darwinxref/plugins/resolveDeps.c b/darwinxref/plugins/resolveDeps.c old mode 100644 new mode 100755 diff --git a/darwinxref/plugins/source_sites.c b/darwinxref/plugins/source_sites.c old mode 100644 new mode 100755 diff --git a/darwinxref/plugins/target.c b/darwinxref/plugins/target.c old mode 100644 new mode 100755 diff --git a/darwinxref/plugins/version.c b/darwinxref/plugins/version.c old mode 100644 new mode 100755 diff --git a/darwinxref/upgrade_plist.c b/darwinxref/upgrade_plist.c old mode 100644 new mode 100755 diff --git a/patches/CarbonHeaders-18.1.ccdest.patch b/patches/CarbonHeaders-18.1.ccdest.patch old mode 100644 new mode 100755 diff --git a/patches/IOKitUser-502.nohidevent.patch b/patches/IOKitUser-502.nohidevent.patch old mode 100644 new mode 100755 diff --git a/patches/PowerManagement-209.1.unused_symbols.patch b/patches/PowerManagement-209.1.unused_symbols.patch old mode 100644 new mode 100755 diff --git a/patches/SmartCardServices-34733.MacTypes.patch b/patches/SmartCardServices-34733.MacTypes.patch old mode 100644 new mode 100755 diff --git a/patches/Tokend-35209.MacTypes.patch b/patches/Tokend-35209.MacTypes.patch old mode 100644 new mode 100755 diff --git a/patches/clamav-125.noupdate.patch b/patches/clamav-125.noupdate.patch old mode 100644 new mode 100755 diff --git a/patches/launchd-258.22.CFNotification.patch b/patches/launchd-258.22.CFNotification.patch old mode 100644 new mode 100755 diff --git a/patches/libsecurity_utilities-36984.MacTypes.patch b/patches/libsecurity_utilities-36984.MacTypes.patch old mode 100644 new mode 100755 diff --git a/patches/perl-63.pldtrace.patch b/patches/perl-63.pldtrace.patch old mode 100644 new mode 100755 diff --git a/patches/postfix-197.dtrace-postfix.patch b/patches/postfix-197.dtrace-postfix.patch old mode 100644 new mode 100755 diff --git a/patches/ppp-412.miniterm_and_noerr.patch b/patches/ppp-412.miniterm_and_noerr.patch old mode 100644 new mode 100755 diff --git a/patches/ppp-412.xauthvendor.patch b/patches/ppp-412.xauthvendor.patch old mode 100644 new mode 100755 diff --git a/patches/security_systemkeychain-36515.kCFDateFormatterIsLenientKey.patch b/patches/security_systemkeychain-36515.kCFDateFormatterIsLenientKey.patch old mode 100644 new mode 100755 diff --git a/patches/system_cmds-433.8.patch b/patches/system_cmds-433.8.patch old mode 100644 new mode 100755 diff --git a/patches/top-67.kNilOptions.patch b/patches/top-67.kNilOptions.patch old mode 100644 new mode 100755 diff --git a/plists/10A432.plist b/plists/10A432.plist old mode 100644 new mode 100755 diff --git a/plists/10B504.plist b/plists/10B504.plist old mode 100644 new mode 100755 diff --git a/plists/10C540.plist b/plists/10C540.plist old mode 100644 new mode 100755 diff --git a/plists/10D573.plist b/plists/10D573.plist old mode 100644 new mode 100755 diff --git a/plists/10F569.plist b/plists/10F569.plist old mode 100644 new mode 100755 diff --git a/plists/10H574.plist b/plists/10H574.plist old mode 100644 new mode 100755 diff --git a/plists/10J567.plist b/plists/10J567.plist old mode 100644 new mode 100755 diff --git a/plists/10J869.plist b/plists/10J869.plist old mode 100644 new mode 100755 diff --git a/plists/10K540.plist b/plists/10K540.plist old mode 100644 new mode 100755 diff --git a/plists/11A511a.plist b/plists/11A511a.plist old mode 100644 new mode 100755 diff --git a/plists/11B26.plist b/plists/11B26.plist old mode 100644 new mode 100755 diff --git a/plists/11C74.plist b/plists/11C74.plist old mode 100644 new mode 100755 diff --git a/plists/11D50.plist b/plists/11D50.plist old mode 100644 new mode 100755 diff --git a/plists/11E53.plist b/plists/11E53.plist old mode 100644 new mode 100755 diff --git a/plists/12A269.plist b/plists/12A269.plist old mode 100644 new mode 100755 diff --git a/plists/7B85.plist b/plists/7B85.plist old mode 100644 new mode 100755 diff --git a/plists/7C107.plist b/plists/7C107.plist old mode 100644 new mode 100755 diff --git a/plists/7D24.plist b/plists/7D24.plist old mode 100644 new mode 100755 diff --git a/plists/7F44.plist b/plists/7F44.plist old mode 100644 new mode 100755 diff --git a/plists/7H63.plist b/plists/7H63.plist old mode 100644 new mode 100755 diff --git a/plists/7M34.plist b/plists/7M34.plist old mode 100644 new mode 100755 diff --git a/plists/7R28.plist b/plists/7R28.plist old mode 100644 new mode 100755 diff --git a/plists/7S215.plist b/plists/7S215.plist old mode 100644 new mode 100755 diff --git a/plists/7U16.plist b/plists/7U16.plist old mode 100644 new mode 100755 diff --git a/plists/7W98.plist b/plists/7W98.plist old mode 100644 new mode 100755 diff --git a/plists/8A428.plist b/plists/8A428.plist old mode 100644 new mode 100755 diff --git a/plists/8B15.plist b/plists/8B15.plist old mode 100644 new mode 100755 diff --git a/plists/8C46.plist b/plists/8C46.plist old mode 100644 new mode 100755 diff --git a/plists/8F46.plist b/plists/8F46.plist old mode 100644 new mode 100755 diff --git a/plists/8G1165.plist b/plists/8G1165.plist old mode 100644 new mode 100755 diff --git a/plists/8G1454.plist b/plists/8G1454.plist old mode 100644 new mode 100755 diff --git a/plists/8G32.plist b/plists/8G32.plist old mode 100644 new mode 100755 diff --git a/plists/8H14.plist b/plists/8H14.plist old mode 100644 new mode 100755 diff --git a/plists/8I1119.plist b/plists/8I1119.plist old mode 100644 new mode 100755 diff --git a/plists/8I127.plist b/plists/8I127.plist old mode 100644 new mode 100755 diff --git a/plists/8J135.plist b/plists/8J135.plist old mode 100644 new mode 100755 diff --git a/plists/8J2135.plist b/plists/8J2135.plist old mode 100644 new mode 100755 diff --git a/plists/8L127.plist b/plists/8L127.plist old mode 100644 new mode 100755 diff --git a/plists/8L2127.plist b/plists/8L2127.plist old mode 100644 new mode 100755 diff --git a/plists/8M1910.plist b/plists/8M1910.plist old mode 100644 new mode 100755 diff --git a/plists/8M2558.plist b/plists/8M2558.plist old mode 100644 new mode 100755 diff --git a/plists/8P135.plist b/plists/8P135.plist old mode 100644 new mode 100755 diff --git a/plists/8P2137.plist b/plists/8P2137.plist old mode 100644 new mode 100755 diff --git a/plists/8R218.plist b/plists/8R218.plist old mode 100644 new mode 100755 diff --git a/plists/8R2218.plist b/plists/8R2218.plist old mode 100644 new mode 100755 diff --git a/plists/8S165.plist b/plists/8S165.plist old mode 100644 new mode 100755 diff --git a/plists/8S2167.plist b/plists/8S2167.plist old mode 100644 new mode 100755 diff --git a/plists/9A581.plist b/plists/9A581.plist old mode 100644 new mode 100755 diff --git a/plists/9B18.plist b/plists/9B18.plist old mode 100644 new mode 100755 diff --git a/plists/9C31.plist b/plists/9C31.plist old mode 100644 new mode 100755 diff --git a/plists/9D34.plist b/plists/9D34.plist old mode 100644 new mode 100755 diff --git a/plists/9E17.plist b/plists/9E17.plist old mode 100644 new mode 100755 diff --git a/plists/9F33.plist b/plists/9F33.plist old mode 100644 new mode 100755 diff --git a/plists/9G55.plist b/plists/9G55.plist old mode 100644 new mode 100755 diff --git a/plists/9J61.plist b/plists/9J61.plist old mode 100644 new mode 100755 diff --git a/plists/9L30.plist b/plists/9L30.plist old mode 100644 new mode 100755 diff --git a/prefix.xcconfig b/prefix.xcconfig old mode 100644 new mode 100755 diff --git a/testing/darwinup/300dirs.tbz2 b/testing/darwinup/300dirs.tbz2 old mode 100644 new mode 100755 diff --git a/testing/darwinup/300files.tbz2 b/testing/darwinup/300files.tbz2 old mode 100644 new mode 100755 diff --git a/testing/darwinup/corrupt.tgz b/testing/darwinup/corrupt.tgz old mode 100644 new mode 100755 diff --git a/testing/darwinup/deep-rollback-2.xar b/testing/darwinup/deep-rollback-2.xar old mode 100644 new mode 100755 diff --git a/testing/darwinup/deep-rollback.cpgz b/testing/darwinup/deep-rollback.cpgz old mode 100644 new mode 100755 diff --git a/testing/darwinup/depotroot.tar.gz b/testing/darwinup/depotroot.tar.gz old mode 100644 new mode 100755 diff --git a/testing/darwinup/dest.tar.gz b/testing/darwinup/dest.tar.gz old mode 100644 new mode 100755 diff --git a/testing/darwinup/extension.tar.bz2 b/testing/darwinup/extension.tar.bz2 old mode 100644 new mode 100755 diff --git a/testing/darwinup/rep_dir_file.tar.gz b/testing/darwinup/rep_dir_file.tar.gz old mode 100644 new mode 100755 diff --git a/testing/darwinup/rep_dir_link.tar.gz b/testing/darwinup/rep_dir_link.tar.gz old mode 100644 new mode 100755 diff --git a/testing/darwinup/rep_file_dir.tar.gz b/testing/darwinup/rep_file_dir.tar.gz old mode 100644 new mode 100755 diff --git a/testing/darwinup/rep_file_link.tar.gz b/testing/darwinup/rep_file_link.tar.gz old mode 100644 new mode 100755 diff --git a/testing/darwinup/rep_flink_dir.tar.gz b/testing/darwinup/rep_flink_dir.tar.gz old mode 100644 new mode 100755 diff --git a/testing/darwinup/rep_flink_file.tar.gz b/testing/darwinup/rep_flink_file.tar.gz old mode 100644 new mode 100755 diff --git a/testing/darwinup/rep_link_dir.tar.gz b/testing/darwinup/rep_link_dir.tar.gz old mode 100644 new mode 100755 diff --git a/testing/darwinup/rep_link_file.tar.gz b/testing/darwinup/rep_link_file.tar.gz old mode 100644 new mode 100755 diff --git a/testing/darwinup/root.tar.gz b/testing/darwinup/root.tar.gz old mode 100644 new mode 100755 diff --git a/testing/darwinup/root2.tar.gz b/testing/darwinup/root2.tar.gz old mode 100644 new mode 100755 diff --git a/testing/darwinup/root3.tar.gz b/testing/darwinup/root3.tar.gz old mode 100644 new mode 100755 diff --git a/testing/darwinup/root5.tar.gz b/testing/darwinup/root5.tar.gz old mode 100644 new mode 100755 diff --git a/testing/darwinup/root6.tar.gz b/testing/darwinup/root6.tar.gz old mode 100644 new mode 100755 diff --git a/testing/darwinup/root7.tar.gz b/testing/darwinup/root7.tar.gz old mode 100644 new mode 100755 diff --git a/testing/darwinup/sandboxprofile.tar.bz2 b/testing/darwinup/sandboxprofile.tar.bz2 old mode 100644 new mode 100755 diff --git a/testing/darwinup/symlink_update.tar.gz b/testing/darwinup/symlink_update.tar.gz old mode 100644 new mode 100755 diff --git a/testing/darwinup/symlinks.tar.gz b/testing/darwinup/symlinks.tar.gz old mode 100644 new mode 100755 diff --git a/testing/darwinup/xpcservice.tar.bz2 b/testing/darwinup/xpcservice.tar.bz2 old mode 100644 new mode 100755 From e9ba665d0001a34bc27725209d10bce8b7af7ff2 Mon Sep 17 00:00:00 2001 From: Cliff Sekel aKa InSaneDarwin Date: Mon, 17 Apr 2017 11:12:41 -0400 Subject: [PATCH 004/382] fixed dirty patch. --- darwinup/Database.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/darwinup/Database.cpp b/darwinup/Database.cpp index 754ac74..b91a81d 100755 --- a/darwinup/Database.cpp +++ b/darwinup/Database.cpp @@ -31,12 +31,15 @@ */ #include "Database.h" - -/** - * sqlite3_trace callback for debugging - */ -void dbtrace(void* context, const char* sql) { +/* +* sqlite3_trace_v2 callback for debugging +*/ + static int dbtrace(unsigned, void*, void *p, void*) { + sqlite3_stmt *stmt = (sqlite3_stmt*)p; + char *sql = sqlite3_expanded_sql(stmt); fprintf(stderr, "[SQL] %s\n", sql); + sqlite3_free(sql); + return 0; } Database::Database() { @@ -209,11 +212,11 @@ int Database::post_connect() { res = sqlite3_prepare_v2(m_db, "COMMIT TRANSACTION", 19, &m_commit_transaction, NULL); - // debug settings - //extern uint32_t verbosity; - //if (verbosity & VERBOSE_SQL) { - // sqlite3_trace_v2 (m_db, dbtrace, NULL); - //} + debug settings + extern uint32_t verbosity; + if (verbosity & VERBOSE_SQL) { + sqlite3_trace_v2(m_db, SQLITE_TRACE_STMT, dbtrace, NULL); + } return res; } From 2669b8a3a1afb53b630abf7e4aa5c188f1af0924 Mon Sep 17 00:00:00 2001 From: Cliff Sekel aKa InSaneDarwin Date: Mon, 17 Apr 2017 11:24:30 -0400 Subject: [PATCH 005/382] Fixed patch --- darwinxref/cfutils.c | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/darwinxref/cfutils.c b/darwinxref/cfutils.c index f0903a0..8149a29 100755 --- a/darwinxref/cfutils.c +++ b/darwinxref/cfutils.c @@ -84,29 +84,17 @@ CFPropertyListRef read_plist(char* path) { if (stat(path, &sb) != -1) { size_t size = (size_t)sb.st_size; void* buffer = mmap(NULL, size, PROT_READ, MAP_FILE | MAP_PRIVATE, fd, (off_t)0); - if (buffer != (void*)-1) { - CFDataRef data = CFDataCreateWithBytesNoCopy(NULL, buffer, size, kCFAllocatorNull); - if (data) { -#if __MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 - CFErrorRef str = 0; - result = CFPropertyListCreateWithData(NULL, data, kCFPropertyListMutableContainers, 0, &str); - CFRelease(data); - if (result == NULL) { - CFStringRef errorDesc = CFErrorCopyDescription(str); - perror_cfstr(errorDesc); - CFRelease(errorDesc); - } -#else + if (buffer != (void*)-1) { + CFDataRef data = CFDataCreateWithBytesNoCopy(NULL, buffer, size, kCFAllocatorNull); + if (data) { + CFErrorRef err = NULL; CFStringRef str = NULL; - result = CFPropertyListCreateFromXMLData(NULL, data, kCFPropertyListMutableContainers, &str); + result = CFPropertyListCreateWithData(NULL, data, kCFPropertyListMutableContainers, NULL, &err); CFRelease(data); if (result == NULL) { + str = CFErrorCopyFailureReason(err); perror_cfstr(str); } -#endif - if (str) { - CFRelease(str); - } } munmap(buffer, size); } else { @@ -119,8 +107,6 @@ CFPropertyListRef read_plist(char* path) { } return result; } - - int cfprintf(FILE* file, const char* format, ...) { char* cstr; int result; From f2e64c283a2e22fd575f8887ecbc92959c1e31fc Mon Sep 17 00:00:00 2001 From: Cliff Sekel aKa InSaneDarwin Date: Mon, 17 Apr 2017 11:31:25 -0400 Subject: [PATCH 006/382] fixed patch --- darwinxref/plugins/exportProject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinxref/plugins/exportProject.c b/darwinxref/plugins/exportProject.c index a26062b..5800802 100755 --- a/darwinxref/plugins/exportProject.c +++ b/darwinxref/plugins/exportProject.c @@ -90,7 +90,7 @@ static int run(CFArrayRef argv) { 0, NULL); #else - CFDataRef data = CFPropertyListCreateXMLData(NULL, plist); + CFDataRef data = CFPropertyListCreateData(NULL, plist, kCFPropertyListOpenStepFormat, 0, NULL); #endif res = write(STDOUT_FILENO, CFDataGetBytePtr(data), (ssize_t)CFDataGetLength(data)); } else { From c17a01e24a6b87d9041d48a43362b06a183de602 Mon Sep 17 00:00:00 2001 From: Cliff Sekel aKa InSaneDarwin Date: Tue, 18 Apr 2017 13:08:01 -0400 Subject: [PATCH 007/382] Fixed line 215 --- darwinup/Database.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinup/Database.cpp b/darwinup/Database.cpp index b91a81d..82eb9fa 100755 --- a/darwinup/Database.cpp +++ b/darwinup/Database.cpp @@ -212,7 +212,7 @@ int Database::post_connect() { res = sqlite3_prepare_v2(m_db, "COMMIT TRANSACTION", 19, &m_commit_transaction, NULL); - debug settings + // debug settings extern uint32_t verbosity; if (verbosity & VERBOSE_SQL) { sqlite3_trace_v2(m_db, SQLITE_TRACE_STMT, dbtrace, NULL); From 5028f6d67912410428f7276c294bc9e3f47bb279 Mon Sep 17 00:00:00 2001 From: InSaneDarwin Date: Tue, 18 Apr 2017 19:35:00 -0400 Subject: [PATCH 008/382] Added .gitignore --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9797113 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +build/ +.DS_Store +darwinbuild.xcodeproj/project.xcworkspace/ +darwinbuild.xcodeproj/xcuserdata/ \ No newline at end of file From 10844ac9d48c6f1b4914f1ee13d687c272e87d02 Mon Sep 17 00:00:00 2001 From: Cliff Sekel Date: Sat, 22 Apr 2017 09:01:03 -0400 Subject: [PATCH 009/382] Added Feature to Darwinbuild Added patch_sites like how you can added source_sites but for patches of source codes. Example!! patch_sites http://6X.2XX.XX5.1XX/Patches --- README | 14 +- darwinbuild.xcodeproj/project.pbxproj | 160 ++++++------------ .../xcshareddata/WorkspaceSettings.xcsettings | 8 - .../UserInterfaceState.xcuserstate | Bin 72886 -> 15116 bytes .../xcdebugger/Breakpoints_v2.xcbkptlist | 31 ---- .../xcschemes/configuration.xcscheme | 2 +- .../xcschemes/darwinbuild.xcscheme | 2 +- .../xcschemes/darwinbuild_scripts.xcscheme | 2 +- .../xcschemes/darwinmaster.xcscheme | 2 +- .../xcschemes/darwintrace.xcscheme | 2 +- .../xcschemes/darwinup.xcscheme | 2 +- .../xcschemes/darwinxref.xcscheme | 2 +- .../xcschemes/darwinxref_plugins.xcscheme | 2 +- .../xcschemes/dependencies.xcscheme | 2 +- .../xcschemes/diff.xcscheme | 2 +- .../xcschemes/digest.xcscheme | 2 +- .../insane.xcuserdatad/xcschemes/dot.xcscheme | 2 +- .../xcschemes/edit.xcscheme | 2 +- .../xcschemes/environment.xcscheme | 2 +- .../xcschemes/exportFiles.xcscheme | 2 +- .../xcschemes/exportIndex.xcscheme | 2 +- .../xcschemes/exportProject.xcscheme | 2 +- .../xcschemes/findFile.xcscheme | 2 +- .../xcschemes/inherits.xcscheme | 2 +- .../xcschemes/installXcode.xcscheme | 2 +- .../xcschemes/installXcode32.xcscheme | 2 +- .../xcschemes/installXcode821.xcscheme | 91 ---------- .../xcschemes/loadDeps.xcscheme | 2 +- .../xcschemes/loadFiles.xcscheme | 2 +- .../xcschemes/loadIndex.xcscheme | 2 +- .../xcschemes/manifest.xcscheme | 2 +- .../xcschemes/mergeBuild.xcscheme | 2 +- .../xcschemes/original.xcscheme | 2 +- .../xcschemes/packageRoots.xcscheme | 2 +- .../xcschemes/patchfiles.xcscheme | 2 +- .../xcschemes/plist_sites.xcscheme | 2 +- .../xcschemes/query.xcscheme | 2 +- .../xcschemes/register.xcscheme | 2 +- .../xcschemes/resolveDeps.xcscheme | 2 +- .../xcschemes/source_sites.xcscheme | 2 +- .../xcschemes/target.xcscheme | 2 +- .../xcschemes/tcl_plugins.xcscheme | 2 +- .../xcschemes/thinPackages.xcscheme | 2 +- .../xcschemes/version.xcscheme | 2 +- .../xcschemes/world.xcscheme | 2 +- .../xcschemes/xcschememanagement.plist | 92 +++++----- darwinbuild/darwinbuild.in | 6 +- darwinbuild/installXcode821.in | 44 ----- darwinbuild/manifest.c | 2 - darwinup/Database.cpp | 3 +- darwinup/Utils.cpp | 3 - darwinxref/cfutils.c | 26 ++- .../plugins-darwinports/patch_sites.tcl | 0 darwinxref/plugins/exportProject.c | 6 +- darwinxref/plugins/patch_sites.c | 44 +++++ darwinxref/plugins/patch_sites.tcl | 3 + darwinxref/plugins/register.c | 3 - 57 files changed, 219 insertions(+), 395 deletions(-) delete mode 100644 darwinbuild.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings delete mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist delete mode 100644 darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/installXcode821.xcscheme delete mode 100644 darwinbuild/installXcode821.in mode change 100755 => 100644 darwinxref/plugins-darwinports/patch_sites.tcl create mode 100644 darwinxref/plugins/patch_sites.c create mode 100755 darwinxref/plugins/patch_sites.tcl diff --git a/README b/README index b669556..ad0c328 100755 --- a/README +++ b/README @@ -1,8 +1,8 @@ Darwinbuild Updated 2009-02-17 -Kevin Van Vechten -William Siegrist +Kevin Van Vechten No longer @ @ppl3 +William Siegrist No longer @ @ppl3 1. Overview 1.1 Availability, Bug Reports, Contributions, and Discussion @@ -27,7 +27,7 @@ A. darwinxref Darwinbuild is a collection of tools that assist compilation of the many projects contained in Darwin[1], the open source base of Apple's -Mac OS X operating system[2]. Apple publishes the sources of these projects +macOS operating system[2]. Apple publishes the sources of these projects in an archive format (.tar.gz). An archive is published for each project version on Apple's site[3]. @@ -206,7 +206,7 @@ passed since cpp-precomp is not available. During the build, the RC_ARCHS and RC_NONARCH_CFLAGS variables will be combined to create the RC_ARCHS environment variable; a -arch flag will be appended for each architecture listed in RC_ARCHS. -The MACOSX_DEPLOYMENT_TARGET variable should match the major Mac OS X release +The MACOSX_DEPLOYMENT_TARGET variable should match the major macOS release that is being targeted, such as 10.2 or 10.3. @@ -232,7 +232,7 @@ list contains a "target" attribute, that string will be passed instead. 5.1 Private Headers -Many open source header files are not present in a standard Mac OS X install. +Many open source header files are not present in a standard macOS install. These "private headers" are not needed by application developers, and are not part of any SDK officially supported by Apple. However, Darwin projects are part of the operating system itself and these headers are required. The @@ -294,9 +294,9 @@ A. darwinxref ============= The darwinxref tool allows you to query which source version of a Darwin -project is present in a particular Mac OS X build. It also stores information +project is present in a particular macOS build. It also stores information about what dependencies a particular project has, and what files the project -produces. As each Mac OS X release is made available, Apple publishes a +produces. As each macOS release is made available, Apple publishes a property list file containing the project names and versions in that release. These property lists are read by the darwinxref tool to seed its internal database. Property lists are available via Subversion[1]. diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 45b38c0..416d3b4 100755 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -25,7 +25,6 @@ 7227AD1B109A053900BE33D7 /* CopyFiles */, ); dependencies = ( - 391ABCA51E64183A002B338C /* PBXTargetDependency */, 720BE2F6120C90E500B3C4A5 /* PBXTargetDependency */, 7227AC421098DC6A00BE33D7 /* PBXTargetDependency */, 7227AC401098DC6A00BE33D7 /* PBXTargetDependency */, @@ -91,6 +90,9 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ + 3963011A1EAB4D60006081C7 /* source_sites.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86C0E10965EEA00C66E90 /* source_sites.c */; }; + 396301211EAB4E01006081C7 /* patch_sites.c in Sources */ = {isa = PBXBuildFile; fileRef = 396301191EAB42B6006081C7 /* patch_sites.c */; }; + 396301291EAB5DBC006081C7 /* patch_sites.tcl in CopyFiles */ = {isa = PBXBuildFile; fileRef = 396301281EAB5DB5006081C7 /* patch_sites.tcl */; }; 61E0A6BD10A8DCC700DA7EBC /* exportIndex.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BFF10965EEA00C66E90 /* exportIndex.c */; }; 720BE2F4120C90C500B3C4A5 /* digest.c in Sources */ = {isa = PBXBuildFile; fileRef = 720BE2E9120C909E00B3C4A5 /* digest.c */; }; 7227AB41109897D500BE33D7 /* binary_sites.tcl in CopyFiles */ = {isa = PBXBuildFile; fileRef = 72C86BF310965EEA00C66E90 /* binary_sites.tcl */; }; @@ -132,7 +134,6 @@ 725740901097AFFB008AD4D7 /* plist_sites.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86C0B10965EEA00C66E90 /* plist_sites.c */; }; 725740911097B004008AD4D7 /* register.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86C0C10965EEA00C66E90 /* register.c */; }; 725740921097B00C008AD4D7 /* resolveDeps.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86C0D10965EEA00C66E90 /* resolveDeps.c */; }; - 725740931097B012008AD4D7 /* source_sites.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86C0E10965EEA00C66E90 /* source_sites.c */; }; 725740941097B018008AD4D7 /* target.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86C0F10965EEA00C66E90 /* target.c */; }; 725740951097B01E008AD4D7 /* version.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86C1010965EEA00C66E90 /* version.c */; }; 725749AD10976A6300B13BC3 /* cfutils.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BE810965E7500C66E90 /* cfutils.c */; }; @@ -162,12 +163,12 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 391ABCA41E64183A002B338C /* PBXContainerItemProxy */ = { + 3963011E1EAB4E01006081C7 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 726DD14910965C5700D5AEAB /* Project object */; proxyType = 1; - remoteGlobalIDString = 391ABC9C1E64171C002B338C; - remoteInfo = installXcode821; + remoteGlobalIDString = 7257499F1097697300B13BC3; + remoteInfo = darwinxref; }; 720BE2F5120C90E500B3C4A5 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; @@ -615,6 +616,7 @@ 7227AB41109897D500BE33D7 /* binary_sites.tcl in CopyFiles */, 7227AB42109897D500BE33D7 /* branch.tcl in CopyFiles */, 7227AB43109897D500BE33D7 /* currentBuild.tcl in CopyFiles */, + 396301291EAB5DBC006081C7 /* patch_sites.tcl in CopyFiles */, 7227AB44109897D500BE33D7 /* darwin.tcl in CopyFiles */, 7227AB45109897D500BE33D7 /* group.tcl in CopyFiles */, 7227AB46109897D500BE33D7 /* macosx.tcl in CopyFiles */, @@ -656,7 +658,9 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 391ABCA31E64171C002B338C /* installXcode821 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = installXcode821; sourceTree = BUILT_PRODUCTS_DIR; }; + 396301191EAB42B6006081C7 /* patch_sites.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = patch_sites.c; sourceTree = ""; }; + 396301271EAB4E01006081C7 /* patch_sites.so */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.objfile"; includeInIndex = 0; path = patch_sites.so; sourceTree = BUILT_PRODUCTS_DIR; }; + 396301281EAB5DB5006081C7 /* patch_sites.tcl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = patch_sites.tcl; sourceTree = ""; }; 720BE2E9120C909E00B3C4A5 /* digest.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = digest.c; path = darwinbuild/digest.c; sourceTree = ""; }; 720BE2F2120C90A700B3C4A5 /* digest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = digest; sourceTree = BUILT_PRODUCTS_DIR; }; 7227AB6D10989A9900BE33D7 /* manifest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = manifest; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -814,6 +818,13 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 396301221EAB4E01006081C7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 720BE2ED120C90A700B3C4A5 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -1124,6 +1135,7 @@ 72C86BF210965EEA00C66E90 /* plugins */ = { isa = PBXGroup; children = ( + 396301281EAB5DB5006081C7 /* patch_sites.tcl */, 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */, 72C86BF310965EEA00C66E90 /* binary_sites.tcl */, 72C86BF410965EEA00C66E90 /* branch.tcl */, @@ -1152,6 +1164,7 @@ 72C86C0B10965EEA00C66E90 /* plist_sites.c */, 72D05CA911D2678F00B33EDD /* query.c */, 72C86C0C10965EEA00C66E90 /* register.c */, + 396301191EAB42B6006081C7 /* patch_sites.c */, 72C86C0D10965EEA00C66E90 /* resolveDeps.c */, 72C86C0E10965EEA00C66E90 /* source_sites.c */, 72C86C0F10965EEA00C66E90 /* target.c */, @@ -1199,7 +1212,7 @@ 7227AC2E1098DBDF00BE33D7 /* installXcode32 */, 72D05CB711D267C400B33EDD /* query.so */, 720BE2F2120C90A700B3C4A5 /* digest */, - 391ABCA31E64171C002B338C /* installXcode821 */, + 396301271EAB4E01006081C7 /* patch_sites.so */, ); name = Products; sourceTree = ""; @@ -1280,21 +1293,22 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - 391ABC9C1E64171C002B338C /* installXcode821 */ = { + 3963011C1EAB4E01006081C7 /* patch_sites */ = { isa = PBXNativeTarget; - buildConfigurationList = 391ABC9F1E64171C002B338C /* Build configuration list for PBXNativeTarget "installXcode821" */; + buildConfigurationList = 396301231EAB4E01006081C7 /* Build configuration list for PBXNativeTarget "patch_sites" */; buildPhases = ( - 391ABC9D1E64171C002B338C /* ShellScript */, - 391ABC9E1E64171C002B338C /* ShellScript */, + 3963011F1EAB4E01006081C7 /* Sources */, + 396301221EAB4E01006081C7 /* Frameworks */, ); buildRules = ( ); dependencies = ( + 3963011D1EAB4E01006081C7 /* PBXTargetDependency */, ); - name = installXcode821; - productName = darwinbuild; - productReference = 391ABCA31E64171C002B338C /* installXcode821 */; - productType = "com.apple.product-type.tool"; + name = patch_sites; + productName = configuration; + productReference = 396301271EAB4E01006081C7 /* patch_sites.so */; + productType = "com.apple.product-type.objfile"; }; 720BE2EA120C90A700B3C4A5 /* digest */ = { isa = PBXNativeTarget; @@ -1890,7 +1904,6 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; - LastUpgradeCheck = 0820; ORGANIZATIONNAME = "The DarwinBuild Project"; }; buildConfigurationList = 726DD14C10965C5700D5AEAB /* Build configuration list for PBXProject "darwinbuild" */; @@ -1947,42 +1960,12 @@ 7227AC1E1098DB9200BE33D7 /* installXcode */, 7227AC271098DBDF00BE33D7 /* installXcode32 */, 720BE2EA120C90A700B3C4A5 /* digest */, - 391ABC9C1E64171C002B338C /* installXcode821 */, + 3963011C1EAB4E01006081C7 /* patch_sites */, ); }; /* End PBXProject section */ /* Begin PBXShellScriptBuildPhase section */ - 391ABC9D1E64171C002B338C /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "$(SRCROOT)/darwinbuild/installXcode821.in", - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/installXcode821", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/usr/bin/sed -e \"s,%%PREFIX%%,$PREFIX,\" $SRCROOT/darwinbuild/installXcode821.in > $DERIVED_FILE_DIR/installXcode821\n\n/bin/chmod 755 $DERIVED_FILE_DIR/installXcode821\n\n"; - }; - 391ABC9E1E64171C002B338C /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "$(DERIVED_FILE_DIR)/installXcode821", - ); - outputPaths = ( - "$(BUILT_PRODUCTS_DIR)/installXcode821", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/cp $DERIVED_FILE_DIR/installXcode821 $BUILT_PRODUCTS_DIR/installXcode821"; - }; 7227AB8F1098A89700BE33D7 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -2166,6 +2149,14 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 3963011F1EAB4E01006081C7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 396301211EAB4E01006081C7 /* patch_sites.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 720BE2EB120C90A700B3C4A5 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -2338,7 +2329,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 725740931097B012008AD4D7 /* source_sites.c in Sources */, + 3963011A1EAB4D60006081C7 /* source_sites.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2415,10 +2406,10 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 391ABCA51E64183A002B338C /* PBXTargetDependency */ = { + 3963011D1EAB4E01006081C7 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 391ABC9C1E64171C002B338C /* installXcode821 */; - targetProxy = 391ABCA41E64183A002B338C /* PBXContainerItemProxy */; + target = 7257499F1097697300B13BC3 /* darwinxref */; + targetProxy = 3963011E1EAB4E01006081C7 /* PBXContainerItemProxy */; }; 720BE2F6120C90E500B3C4A5 /* PBXTargetDependency */ = { isa = PBXTargetDependency; @@ -2733,29 +2724,26 @@ /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ - 391ABCA01E64171C002B338C /* Debug */ = { + 396301241EAB4E01006081C7 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; + baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { - INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; }; - 391ABCA11E64171C002B338C /* Public */ = { + 396301251EAB4E01006081C7 /* Public */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; + baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { - INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Public; }; - 391ABCA21E64171C002B338C /* Release */ = { + 396301261EAB4E01006081C7 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; + baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { - INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; @@ -3487,23 +3475,11 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = c99; GCC_ENABLE_PASCAL_STRINGS = NO; GCC_MODEL_TUNING = ""; - GCC_NO_COMMON_BLOCKS = YES; GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -3519,14 +3495,12 @@ GCC_WARN_SIGN_COMPARE = NO; GCC_WARN_STRICT_SELECTOR_MATCH = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNKNOWN_PRAGMAS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; LD_OPENMP_FLAGS = ""; - MACOSX_DEPLOYMENT_TARGET = 10.12; STRIP_INSTALLED_PRODUCT = NO; STRIP_STYLE = "non-global"; WARNING_CFLAGS = "-Wall"; @@ -3648,24 +3622,11 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = c99; GCC_ENABLE_PASCAL_STRINGS = NO; GCC_MODEL_TUNING = ""; - GCC_NO_COMMON_BLOCKS = YES; GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -3681,15 +3642,12 @@ GCC_WARN_SIGN_COMPARE = NO; GCC_WARN_STRICT_SELECTOR_MATCH = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNKNOWN_PRAGMAS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; LD_OPENMP_FLAGS = ""; - MACOSX_DEPLOYMENT_TARGET = 10.12; - ONLY_ACTIVE_ARCH = YES; STRIP_INSTALLED_PRODUCT = NO; STRIP_STYLE = "non-global"; WARNING_CFLAGS = "-Wall"; @@ -3700,23 +3658,11 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = c99; GCC_ENABLE_PASCAL_STRINGS = NO; GCC_MODEL_TUNING = ""; - GCC_NO_COMMON_BLOCKS = YES; GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -3732,14 +3678,12 @@ GCC_WARN_SIGN_COMPARE = NO; GCC_WARN_STRICT_SELECTOR_MATCH = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNKNOWN_PRAGMAS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; LD_OPENMP_FLAGS = ""; - MACOSX_DEPLOYMENT_TARGET = 10.12; STRIP_INSTALLED_PRODUCT = NO; STRIP_STYLE = "non-global"; WARNING_CFLAGS = "-Wall"; @@ -3851,12 +3795,12 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 391ABC9F1E64171C002B338C /* Build configuration list for PBXNativeTarget "installXcode821" */ = { + 396301231EAB4E01006081C7 /* Build configuration list for PBXNativeTarget "patch_sites" */ = { isa = XCConfigurationList; buildConfigurations = ( - 391ABCA01E64171C002B338C /* Debug */, - 391ABCA11E64171C002B338C /* Public */, - 391ABCA21E64171C002B338C /* Release */, + 396301241EAB4E01006081C7 /* Debug */, + 396301251EAB4E01006081C7 /* Public */, + 396301261EAB4E01006081C7 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Public; diff --git a/darwinbuild.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/darwinbuild.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index 08de0be..0000000 --- a/darwinbuild.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded - - - diff --git a/darwinbuild.xcodeproj/project.xcworkspace/xcuserdata/insane.xcuserdatad/UserInterfaceState.xcuserstate b/darwinbuild.xcodeproj/project.xcworkspace/xcuserdata/insane.xcuserdatad/UserInterfaceState.xcuserstate index 6d9fa24028c27f17679587f8007eced2f4e55ac2..4d84831e5ba9356ff4e42e33e79a0baa674c22d4 100644 GIT binary patch literal 15116 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 literal 72886 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

?eT{BRk>jL@?|E?N0_osL;^ATFy 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 DG@aAP diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist deleted file mode 100644 index c8e276e..0000000 --- a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/configuration.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/configuration.xcscheme index 0667147..0be9cc1 100644 --- a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/configuration.xcscheme +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/configuration.xcscheme @@ -1,6 +1,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/loadDeps.xcscheme b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/loadDeps.xcscheme index b7c582f..67b1b27 100644 --- a/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/loadDeps.xcscheme +++ b/darwinbuild.xcodeproj/xcuserdata/insane.xcuserdatad/xcschemes/loadDeps.xcscheme @@ -1,6 +1,6 @@ configuration.xcscheme orderHint - 7 + 6 darwinbuild.xcscheme orderHint - 32 + 31 darwinbuild_scripts.xcscheme orderHint - 2 + 1 darwinmaster.xcscheme orderHint - 34 + 33 darwintrace.xcscheme orderHint - 5 + 4 darwinup.xcscheme orderHint - 4 + 3 darwinxref.xcscheme orderHint - 6 + 5 darwinxref_plugins.xcscheme orderHint - 3 + 2 dependencies.xcscheme orderHint - 8 + 7 diff.xcscheme orderHint - 9 + 8 digest.xcscheme orderHint - 39 + 38 dot.xcscheme orderHint - 10 + 9 edit.xcscheme orderHint - 11 + 10 environment.xcscheme orderHint - 12 + 11 exportFiles.xcscheme orderHint - 13 + 12 exportIndex.xcscheme orderHint - 14 + 13 exportProject.xcscheme orderHint - 15 + 14 findFile.xcscheme orderHint - 16 + 15 inherits.xcscheme orderHint - 17 + 16 installXcode.xcscheme orderHint - 37 + 36 installXcode32.xcscheme orderHint - 38 - - installXcode821.xcscheme - - isShown - - orderHint - 0 + 37 loadDeps.xcscheme orderHint - 18 + 17 loadFiles.xcscheme orderHint - 19 + 18 loadIndex.xcscheme orderHint - 20 + 19 manifest.xcscheme orderHint - 33 + 32 mergeBuild.xcscheme orderHint - 21 + 20 original.xcscheme orderHint - 22 + 21 packageRoots.xcscheme orderHint - 35 + 34 patchfiles.xcscheme orderHint - 23 + 22 plist_sites.xcscheme orderHint - 24 + 23 query.xcscheme orderHint - 25 + 24 register.xcscheme orderHint - 26 + 25 resolveDeps.xcscheme orderHint - 27 + 26 + + source_sites copy.xcscheme + + orderHint + 39 source_sites.xcscheme orderHint - 28 + 27 target.xcscheme orderHint - 29 + 28 tcl_plugins.xcscheme orderHint - 31 + 30 thinPackages.xcscheme orderHint - 36 + 35 version.xcscheme orderHint - 30 + 29 world.xcscheme orderHint - 1 + 0 SuppressBuildableAutocreation - 391ABC9C1E64171C002B338C + 3963011C1EAB4E01006081C7 primary diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 328ed4d..0e293ed 100755 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -464,7 +464,7 @@ if [ "$nosource" != "YES" ]; then patchfilenames=$($DARWINXREF patchfiles $projnam) for p in $patchfilenames; do - Download "$SourceCache" "$p" "$($DARWINXREF source_sites $projnam)" + Download "$SourceCache" "$p" "$($DARWINXREF patch_sites $projnam)" done ### If we are doing a -fetch, stop here. @@ -564,10 +564,10 @@ for patchfile in $patchfilenames; do esac case $patchfile in *.p1.patch*) - $catprog "$SourceCache/$patchfile" | patch -l -f -p1 + $catprog "$SourceCache/$patchfile" | patch -p1 -r . ;; *.patch*) - $catprog "$SourceCache/$patchfile" | patch -l -f -p0 + $catprog "$SourceCache/$patchfile" | patch -p0 -r . ;; *.add*) newfile=`echo $patchfile | sed -e 's/^.*-\([^-]*\)\.add.*/\1/' -e 's,_,/,g'` diff --git a/darwinbuild/installXcode821.in b/darwinbuild/installXcode821.in deleted file mode 100644 index 02170fa..0000000 --- a/darwinbuild/installXcode821.in +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh - -FORCE="YES" -XCODEBUILD=/usr/bin/xcodebuild -BUILDROOT="$1" -DBROOT=$(dirname $BUILDROOT) -PLATFORMDIR="${DBROOT}/Platform" -STAMP=$(date +%Y%m%d%H%M%S) -BUILD=$(cat $DBROOT/.build/build) -PLATFORM="Darwinbuild_${BUILD}_${STAMP}" -INFOPLIST=%%PREFIX%%/share/darwinbuild/Info.plist -SDKPLIST=%%PREFIX%%/share/darwinbuild/SDKSettings.plist - -echo $PLATFORM > "${DBROOT}/.build/platform" -echo "Installing Platform/SDK $PLATFORM for Xcode 8.2.1" - -mkdir -p "${PLATFORMDIR}/Developer/SDKs" -mkdir -p "${PLATFORMDIR}/Developer/Library/Xcode" - -rsync -a "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Xcode" \ - "${PLATFORMDIR}/Developer/Library/Xcode" - -sed -e "s,%%PLATFORM%%,${PLATFORM}," $INFOPLIST > "${PLATFORMDIR}/Info.plist" -sed -e "s,%%PLATFORM%%,${PLATFORM}," $SDKPLIST > "${BUILDROOT}/SDKSettings.plist" - -pushd "${PLATFORMDIR}/Library/Developer" > /dev/null -ln -s ../../BuildRoot/usr/ usr -popd > /dev/null - -pushd "${PLATFORMDIR}/Library/Developer/SDKs" > /dev/null -ln -s ../../../BuildRoot/ "${PLATFORM}.sdk" -popd > /dev/null - -pushd "/Developer/Platforms" > /dev/null -ln -s "$PLATFORMDIR" "${PLATFORM}.platform" -popd > /dev/null - -mkdir -p "${DBROOT}/BuildRoot/Developer/" -pushd "${DBROOT}/BuildRoot/Developer/" > /dev/null -ln -s ../usr usr -popd > /dev/null - -echo "Completed Platform/SDK install" - diff --git a/darwinbuild/manifest.c b/darwinbuild/manifest.c index aa4da65..4e87a03 100755 --- a/darwinbuild/manifest.c +++ b/darwinbuild/manifest.c @@ -43,8 +43,6 @@ #include #include -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Waddress" static char* format_digest(const unsigned char* m) { char* result = NULL; diff --git a/darwinup/Database.cpp b/darwinup/Database.cpp index 82eb9fa..ec2bead 100755 --- a/darwinup/Database.cpp +++ b/darwinup/Database.cpp @@ -31,6 +31,7 @@ */ #include "Database.h" + /* * sqlite3_trace_v2 callback for debugging */ @@ -215,7 +216,7 @@ int Database::post_connect() { // debug settings extern uint32_t verbosity; if (verbosity & VERBOSE_SQL) { - sqlite3_trace_v2(m_db, SQLITE_TRACE_STMT, dbtrace, NULL); + sqlite3_trace_v2(m_db, SQLITE_TRACE_STMT, dbtrace, NULL); } return res; diff --git a/darwinup/Utils.cpp b/darwinup/Utils.cpp index 36f3f3a..20ef838 100755 --- a/darwinup/Utils.cpp +++ b/darwinup/Utils.cpp @@ -32,9 +32,6 @@ #include "Utils.h" -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Waddress" - extern char** environ; int fts_compare(const FTSENT **a, const FTSENT **b) { diff --git a/darwinxref/cfutils.c b/darwinxref/cfutils.c index 8149a29..f0903a0 100755 --- a/darwinxref/cfutils.c +++ b/darwinxref/cfutils.c @@ -84,17 +84,29 @@ CFPropertyListRef read_plist(char* path) { if (stat(path, &sb) != -1) { size_t size = (size_t)sb.st_size; void* buffer = mmap(NULL, size, PROT_READ, MAP_FILE | MAP_PRIVATE, fd, (off_t)0); - if (buffer != (void*)-1) { - CFDataRef data = CFDataCreateWithBytesNoCopy(NULL, buffer, size, kCFAllocatorNull); - if (data) { - CFErrorRef err = NULL; + if (buffer != (void*)-1) { + CFDataRef data = CFDataCreateWithBytesNoCopy(NULL, buffer, size, kCFAllocatorNull); + if (data) { +#if __MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + CFErrorRef str = 0; + result = CFPropertyListCreateWithData(NULL, data, kCFPropertyListMutableContainers, 0, &str); + CFRelease(data); + if (result == NULL) { + CFStringRef errorDesc = CFErrorCopyDescription(str); + perror_cfstr(errorDesc); + CFRelease(errorDesc); + } +#else CFStringRef str = NULL; - result = CFPropertyListCreateWithData(NULL, data, kCFPropertyListMutableContainers, NULL, &err); + result = CFPropertyListCreateFromXMLData(NULL, data, kCFPropertyListMutableContainers, &str); CFRelease(data); if (result == NULL) { - str = CFErrorCopyFailureReason(err); perror_cfstr(str); } +#endif + if (str) { + CFRelease(str); + } } munmap(buffer, size); } else { @@ -107,6 +119,8 @@ CFPropertyListRef read_plist(char* path) { } return result; } + + int cfprintf(FILE* file, const char* format, ...) { char* cstr; int result; diff --git a/darwinxref/plugins-darwinports/patch_sites.tcl b/darwinxref/plugins-darwinports/patch_sites.tcl old mode 100755 new mode 100644 diff --git a/darwinxref/plugins/exportProject.c b/darwinxref/plugins/exportProject.c index 5800802..121d0ae 100755 --- a/darwinxref/plugins/exportProject.c +++ b/darwinxref/plugins/exportProject.c @@ -44,7 +44,7 @@ static int run(CFArrayRef argv) { CFDictionaryRef project = NULL; CFStringRef projname; CFArrayRef builds; - const void *ssites, *bsites; + const void *ssites, *bsites, *psites; CFStringRef build = DBGetCurrentBuild(); if (count == 2) { @@ -64,6 +64,7 @@ static int run(CFArrayRef argv) { preplist = (CFMutableDictionaryRef)DBCopyProjectPlist(build, NULL); ssites = CFDictionaryGetValue(preplist, CFSTR("source_sites")); bsites = CFDictionaryGetValue(preplist, CFSTR("binary_sites")); + psites = CFDictionaryGetValue(preplist, CFSTR("patch_sites")); preplist = CFDictionaryCreateMutable(NULL, 0, &kCFTypeDictionaryKeyCallBacks,&kCFTypeDictionaryValueCallBacks); for( i = 0; i < CFArrayGetCount(builds); i++ ) { @@ -80,6 +81,7 @@ static int run(CFArrayRef argv) { CFDictionarySetValue(preplist, CFSTR("projects"), dict); if(ssites) CFDictionarySetValue(preplist, CFSTR("source_sites"), ssites); if(bsites) CFDictionarySetValue(preplist, CFSTR("binary_sites"), bsites); + if(psites) CFDictionarySetValue(preplist, CFSTR("patch_sites"), psites); CFPropertyListRef plist = preplist; if (xml) { @@ -90,7 +92,7 @@ static int run(CFArrayRef argv) { 0, NULL); #else - CFDataRef data = CFPropertyListCreateData(NULL, plist, kCFPropertyListOpenStepFormat, 0, NULL); + CFDataRef data = CFPropertyListCreateXMLData(NULL, plist); #endif res = write(STDOUT_FILENO, CFDataGetBytePtr(data), (ssize_t)CFDataGetLength(data)); } else { diff --git a/darwinxref/plugins/patch_sites.c b/darwinxref/plugins/patch_sites.c new file mode 100644 index 0000000..296375d --- /dev/null +++ b/darwinxref/plugins/patch_sites.c @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_BSD_LICENSE_HEADER_START@ + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * @APPLE_BSD_LICENSE_HEADER_END@ + */ + +#include "DBPlugin.h" + +int initialize(int version) { + //if ( version < kDBPluginCurrentVersion ) return -1; + + DBPluginSetType(kDBPluginPropertyType); + DBPluginSetName(CFSTR("patch_sites")); + DBPluginSetRunFunc(&DBPluginPropertyDefaultRun); + DBPluginSetUsageFunc(&DBPluginPropertyDefaultUsage); + DBPluginSetDataType(CFArrayGetTypeID()); + return 0; +} diff --git a/darwinxref/plugins/patch_sites.tcl b/darwinxref/plugins/patch_sites.tcl new file mode 100755 index 0000000..67dfdb2 --- /dev/null +++ b/darwinxref/plugins/patch_sites.tcl @@ -0,0 +1,3 @@ +DBPluginSetName patch_sites +DBPluginSetType property.project +DBPluginSetDatatype array diff --git a/darwinxref/plugins/register.c b/darwinxref/plugins/register.c index e490188..4eea2b7 100755 --- a/darwinxref/plugins/register.c +++ b/darwinxref/plugins/register.c @@ -47,9 +47,6 @@ #include #include "sqlite3.h" -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Waddress" - extern char** environ; int register_files(char* build, char* project, char* path); From 8184cd4a72027fd526ab08db0ceb111056848d6b Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 22 May 2017 22:28:23 -0400 Subject: [PATCH 010/382] Fix permissions --- CHANGES | 0 CONTRIBUTING.md | 0 LICENSE.txt | 0 PULL_REQUEST_TEMPLATE.md | 0 README | 0 archs.sh | 0 common.mk | 0 darwinbuild.xcodeproj/project.pbxproj | 0 darwinbuild/Info.plist | 0 darwinbuild/SDKSettings.plist | 0 darwinbuild/buildlist | 0 darwinbuild/buildorder | 0 darwinbuild/createChroot | 0 darwinbuild/darwinbuild.common | 0 darwinbuild/darwinbuild.in | 0 darwinbuild/darwinmaster.in | 0 darwinbuild/digest.c | 0 darwinbuild/ditto | 0 darwinbuild/installXcode.in | 0 darwinbuild/installXcode2 | 0 darwinbuild/installXcode3 | 0 darwinbuild/installXcode31 | 0 darwinbuild/installXcode32.in | 0 darwinbuild/log-index.pl | 0 darwinbuild/manifest.c | 0 darwinbuild/packageRoots.in | 0 darwinbuild/processtrace.sh | 0 darwinbuild/synthfat | 0 darwinbuild/thinFile | 0 darwinbuild/thinPackages.in | 0 darwintrace/darwintrace.c | 0 darwinup/Archive.cpp | 0 darwinup/Archive.h | 0 darwinup/Column.cpp | 0 darwinup/Column.h | 0 darwinup/DB.cpp | 0 darwinup/DB.h | 0 darwinup/Database.cpp | 0 darwinup/Database.h | 0 darwinup/Depot.cpp | 0 darwinup/Depot.h | 0 darwinup/Digest.cpp | 0 darwinup/Digest.h | 0 darwinup/File.cpp | 0 darwinup/File.h | 0 darwinup/NOTES | 0 darwinup/SerialSet.cpp | 0 darwinup/SerialSet.h | 0 darwinup/Table.cpp | 0 darwinup/Table.h | 0 darwinup/Utils.cpp | 0 darwinup/Utils.h | 0 darwinup/darwinup.1 | 0 darwinup/main.cpp | 0 darwinxref/DBDataStore.c | 0 darwinxref/DBDataStore.h | 0 darwinxref/DBPlugin.c | 0 darwinxref/DBPlugin.h | 0 darwinxref/DBPluginPriv.h | 0 darwinxref/DBTclPlugin.c | 0 darwinxref/cfutils.c | 0 darwinxref/cfutils.h | 0 darwinxref/main.c | 0 darwinxref/plugins-darwinports/Portfile.tcl | 0 darwinxref/plugins-darwinports/categories.tcl | 0 darwinxref/plugins-darwinports/depends_build.tcl | 0 darwinxref/plugins-darwinports/depends_lib.tcl | 0 darwinxref/plugins-darwinports/description.tcl | 0 darwinxref/plugins-darwinports/homepage.tcl | 0 darwinxref/plugins-darwinports/loadPortfile.c | 0 darwinxref/plugins-darwinports/long_description.tcl | 0 darwinxref/plugins-darwinports/maintainers.tcl | 0 darwinxref/plugins-darwinports/master_sites.tcl | 0 darwinxref/plugins-darwinports/platforms.tcl | 0 darwinxref/plugins/binary_sites.tcl | 0 darwinxref/plugins/branch.tcl | 0 darwinxref/plugins/c_plugins.xcconfig | 0 darwinxref/plugins/configuration.c | 0 darwinxref/plugins/currentBuild.tcl | 0 darwinxref/plugins/darwin.tcl | 0 darwinxref/plugins/dependencies.c | 0 darwinxref/plugins/descrip.txt | 0 darwinxref/plugins/diff.c | 0 darwinxref/plugins/dot.c | 0 darwinxref/plugins/edit.c | 0 darwinxref/plugins/environment.c | 0 darwinxref/plugins/exportFiles.c | 0 darwinxref/plugins/exportIndex.c | 0 darwinxref/plugins/exportProject.c | 0 darwinxref/plugins/findFile.c | 0 darwinxref/plugins/group.tcl | 0 darwinxref/plugins/inherits.c | 0 darwinxref/plugins/loadDeps.c | 0 darwinxref/plugins/loadFiles.c | 0 darwinxref/plugins/loadIndex.c | 0 darwinxref/plugins/macosx.tcl | 0 darwinxref/plugins/mergeBuild.c | 0 darwinxref/plugins/original.c | 0 darwinxref/plugins/patch_sites.tcl | 0 darwinxref/plugins/patchfiles.c | 0 darwinxref/plugins/plist_sites.c | 0 darwinxref/plugins/query.c | 0 darwinxref/plugins/register.c | 0 darwinxref/plugins/resolveDeps.c | 0 darwinxref/plugins/source_sites.c | 0 darwinxref/plugins/target.c | 0 darwinxref/plugins/version.c | 0 darwinxref/upgrade_plist.c | 0 patches/CarbonHeaders-18.1.ccdest.patch | 0 patches/IOKitUser-502.nohidevent.patch | 0 patches/PowerManagement-209.1.unused_symbols.patch | 0 patches/SmartCardServices-34733.MacTypes.patch | 0 patches/Tokend-35209.MacTypes.patch | 0 patches/clamav-125.noupdate.patch | 0 patches/launchd-258.22.CFNotification.patch | 0 patches/libsecurity_utilities-36984.MacTypes.patch | 0 patches/perl-63.pldtrace.patch | 0 patches/postfix-197.dtrace-postfix.patch | 0 patches/ppp-412.miniterm_and_noerr.patch | 0 patches/ppp-412.xauthvendor.patch | 0 ...eychain-36515.kCFDateFormatterIsLenientKey.patch | 0 patches/system_cmds-433.8.patch | 0 patches/top-67.kNilOptions.patch | 0 plists/10A432.plist | 0 plists/10B504.plist | 0 plists/10C540.plist | 0 plists/10D573.plist | 0 plists/10F569.plist | 0 plists/10H574.plist | 0 plists/10J567.plist | 0 plists/10J869.plist | 0 plists/10K540.plist | 0 plists/11A511a.plist | 0 plists/11B26.plist | 0 plists/11C74.plist | 0 plists/11D50.plist | 0 plists/11E53.plist | 0 plists/12A269.plist | 0 plists/7B85.plist | 0 plists/7C107.plist | 0 plists/7D24.plist | 0 plists/7F44.plist | 0 plists/7H63.plist | 0 plists/7M34.plist | 0 plists/7R28.plist | 0 plists/7S215.plist | 0 plists/7U16.plist | 0 plists/7W98.plist | 0 plists/8A428.plist | 0 plists/8B15.plist | 0 plists/8C46.plist | 0 plists/8F46.plist | 0 plists/8G1165.plist | 0 plists/8G1454.plist | 0 plists/8G32.plist | 0 plists/8H14.plist | 0 plists/8I1119.plist | 0 plists/8I127.plist | 0 plists/8J135.plist | 0 plists/8J2135.plist | 0 plists/8L127.plist | 0 plists/8L2127.plist | 0 plists/8M1910.plist | 0 plists/8M2558.plist | 0 plists/8P135.plist | 0 plists/8P2137.plist | 0 plists/8R218.plist | 0 plists/8R2218.plist | 0 plists/8S165.plist | 0 plists/8S2167.plist | 0 plists/9A581.plist | 0 plists/9B18.plist | 0 plists/9C31.plist | 0 plists/9D34.plist | 0 plists/9E17.plist | 0 plists/9F33.plist | 0 plists/9G55.plist | 0 plists/9J61.plist | 0 plists/9L30.plist | 0 prefix.xcconfig | 0 testing/darwintrace/close-test | 0 testing/darwintrace/exec | 0 testing/darwintrace/realpath | 0 testing/darwintrace/redirection-test | 0 testing/darwintrace/run-tests.sh | 0 testing/darwinup/300dirs.tbz2 | Bin testing/darwinup/300files.tbz2 | Bin testing/darwinup/corrupt.tgz | 0 testing/darwinup/deep-rollback-2.xar | Bin testing/darwinup/deep-rollback.cpgz | Bin testing/darwinup/depotroot.tar.gz | Bin testing/darwinup/dest.tar.gz | Bin testing/darwinup/extension.tar.bz2 | Bin testing/darwinup/rep_dir_file.tar.gz | Bin testing/darwinup/rep_dir_link.tar.gz | Bin testing/darwinup/rep_file_dir.tar.gz | Bin testing/darwinup/rep_file_link.tar.gz | Bin testing/darwinup/rep_flink_dir.tar.gz | Bin testing/darwinup/rep_flink_file.tar.gz | Bin testing/darwinup/rep_link_dir.tar.gz | Bin testing/darwinup/rep_link_file.tar.gz | Bin testing/darwinup/root.tar.gz | Bin testing/darwinup/root2.tar.gz | Bin testing/darwinup/root3.tar.gz | Bin testing/darwinup/root5.tar.gz | Bin testing/darwinup/root6.tar.gz | Bin testing/darwinup/root7.tar.gz | Bin testing/darwinup/run-tests.sh | 0 testing/darwinup/sandboxprofile.tar.bz2 | Bin testing/darwinup/symlink_update.tar.gz | Bin testing/darwinup/symlinks.tar.gz | Bin testing/darwinup/xpcservice.tar.bz2 | Bin testing/run-all-tests.sh | 0 213 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 CHANGES mode change 100755 => 100644 CONTRIBUTING.md mode change 100755 => 100644 LICENSE.txt mode change 100755 => 100644 PULL_REQUEST_TEMPLATE.md mode change 100755 => 100644 README mode change 100755 => 100644 archs.sh mode change 100755 => 100644 common.mk mode change 100755 => 100644 darwinbuild.xcodeproj/project.pbxproj mode change 100755 => 100644 darwinbuild/Info.plist mode change 100755 => 100644 darwinbuild/SDKSettings.plist mode change 100755 => 100644 darwinbuild/buildlist mode change 100755 => 100644 darwinbuild/buildorder mode change 100755 => 100644 darwinbuild/createChroot mode change 100755 => 100644 darwinbuild/darwinbuild.common mode change 100755 => 100644 darwinbuild/darwinbuild.in mode change 100755 => 100644 darwinbuild/darwinmaster.in mode change 100755 => 100644 darwinbuild/digest.c mode change 100755 => 100644 darwinbuild/ditto mode change 100755 => 100644 darwinbuild/installXcode.in mode change 100755 => 100644 darwinbuild/installXcode2 mode change 100755 => 100644 darwinbuild/installXcode3 mode change 100755 => 100644 darwinbuild/installXcode31 mode change 100755 => 100644 darwinbuild/installXcode32.in mode change 100755 => 100644 darwinbuild/log-index.pl mode change 100755 => 100644 darwinbuild/manifest.c mode change 100755 => 100644 darwinbuild/packageRoots.in mode change 100755 => 100644 darwinbuild/processtrace.sh mode change 100755 => 100644 darwinbuild/synthfat mode change 100755 => 100644 darwinbuild/thinFile mode change 100755 => 100644 darwinbuild/thinPackages.in mode change 100755 => 100644 darwintrace/darwintrace.c mode change 100755 => 100644 darwinup/Archive.cpp mode change 100755 => 100644 darwinup/Archive.h mode change 100755 => 100644 darwinup/Column.cpp mode change 100755 => 100644 darwinup/Column.h mode change 100755 => 100644 darwinup/DB.cpp mode change 100755 => 100644 darwinup/DB.h mode change 100755 => 100644 darwinup/Database.cpp mode change 100755 => 100644 darwinup/Database.h mode change 100755 => 100644 darwinup/Depot.cpp mode change 100755 => 100644 darwinup/Depot.h mode change 100755 => 100644 darwinup/Digest.cpp mode change 100755 => 100644 darwinup/Digest.h mode change 100755 => 100644 darwinup/File.cpp mode change 100755 => 100644 darwinup/File.h mode change 100755 => 100644 darwinup/NOTES mode change 100755 => 100644 darwinup/SerialSet.cpp mode change 100755 => 100644 darwinup/SerialSet.h mode change 100755 => 100644 darwinup/Table.cpp mode change 100755 => 100644 darwinup/Table.h mode change 100755 => 100644 darwinup/Utils.cpp mode change 100755 => 100644 darwinup/Utils.h mode change 100755 => 100644 darwinup/darwinup.1 mode change 100755 => 100644 darwinup/main.cpp mode change 100755 => 100644 darwinxref/DBDataStore.c mode change 100755 => 100644 darwinxref/DBDataStore.h mode change 100755 => 100644 darwinxref/DBPlugin.c mode change 100755 => 100644 darwinxref/DBPlugin.h mode change 100755 => 100644 darwinxref/DBPluginPriv.h mode change 100755 => 100644 darwinxref/DBTclPlugin.c mode change 100755 => 100644 darwinxref/cfutils.c mode change 100755 => 100644 darwinxref/cfutils.h mode change 100755 => 100644 darwinxref/main.c mode change 100755 => 100644 darwinxref/plugins-darwinports/Portfile.tcl mode change 100755 => 100644 darwinxref/plugins-darwinports/categories.tcl mode change 100755 => 100644 darwinxref/plugins-darwinports/depends_build.tcl mode change 100755 => 100644 darwinxref/plugins-darwinports/depends_lib.tcl mode change 100755 => 100644 darwinxref/plugins-darwinports/description.tcl mode change 100755 => 100644 darwinxref/plugins-darwinports/homepage.tcl mode change 100755 => 100644 darwinxref/plugins-darwinports/loadPortfile.c mode change 100755 => 100644 darwinxref/plugins-darwinports/long_description.tcl mode change 100755 => 100644 darwinxref/plugins-darwinports/maintainers.tcl mode change 100755 => 100644 darwinxref/plugins-darwinports/master_sites.tcl mode change 100755 => 100644 darwinxref/plugins-darwinports/platforms.tcl mode change 100755 => 100644 darwinxref/plugins/binary_sites.tcl mode change 100755 => 100644 darwinxref/plugins/branch.tcl mode change 100755 => 100644 darwinxref/plugins/c_plugins.xcconfig mode change 100755 => 100644 darwinxref/plugins/configuration.c mode change 100755 => 100644 darwinxref/plugins/currentBuild.tcl mode change 100755 => 100644 darwinxref/plugins/darwin.tcl mode change 100755 => 100644 darwinxref/plugins/dependencies.c mode change 100755 => 100644 darwinxref/plugins/descrip.txt mode change 100755 => 100644 darwinxref/plugins/diff.c mode change 100755 => 100644 darwinxref/plugins/dot.c mode change 100755 => 100644 darwinxref/plugins/edit.c mode change 100755 => 100644 darwinxref/plugins/environment.c mode change 100755 => 100644 darwinxref/plugins/exportFiles.c mode change 100755 => 100644 darwinxref/plugins/exportIndex.c mode change 100755 => 100644 darwinxref/plugins/exportProject.c mode change 100755 => 100644 darwinxref/plugins/findFile.c mode change 100755 => 100644 darwinxref/plugins/group.tcl mode change 100755 => 100644 darwinxref/plugins/inherits.c mode change 100755 => 100644 darwinxref/plugins/loadDeps.c mode change 100755 => 100644 darwinxref/plugins/loadFiles.c mode change 100755 => 100644 darwinxref/plugins/loadIndex.c mode change 100755 => 100644 darwinxref/plugins/macosx.tcl mode change 100755 => 100644 darwinxref/plugins/mergeBuild.c mode change 100755 => 100644 darwinxref/plugins/original.c mode change 100755 => 100644 darwinxref/plugins/patch_sites.tcl mode change 100755 => 100644 darwinxref/plugins/patchfiles.c mode change 100755 => 100644 darwinxref/plugins/plist_sites.c mode change 100755 => 100644 darwinxref/plugins/query.c mode change 100755 => 100644 darwinxref/plugins/register.c mode change 100755 => 100644 darwinxref/plugins/resolveDeps.c mode change 100755 => 100644 darwinxref/plugins/source_sites.c mode change 100755 => 100644 darwinxref/plugins/target.c mode change 100755 => 100644 darwinxref/plugins/version.c mode change 100755 => 100644 darwinxref/upgrade_plist.c mode change 100755 => 100644 patches/CarbonHeaders-18.1.ccdest.patch mode change 100755 => 100644 patches/IOKitUser-502.nohidevent.patch mode change 100755 => 100644 patches/PowerManagement-209.1.unused_symbols.patch mode change 100755 => 100644 patches/SmartCardServices-34733.MacTypes.patch mode change 100755 => 100644 patches/Tokend-35209.MacTypes.patch mode change 100755 => 100644 patches/clamav-125.noupdate.patch mode change 100755 => 100644 patches/launchd-258.22.CFNotification.patch mode change 100755 => 100644 patches/libsecurity_utilities-36984.MacTypes.patch mode change 100755 => 100644 patches/perl-63.pldtrace.patch mode change 100755 => 100644 patches/postfix-197.dtrace-postfix.patch mode change 100755 => 100644 patches/ppp-412.miniterm_and_noerr.patch mode change 100755 => 100644 patches/ppp-412.xauthvendor.patch mode change 100755 => 100644 patches/security_systemkeychain-36515.kCFDateFormatterIsLenientKey.patch mode change 100755 => 100644 patches/system_cmds-433.8.patch mode change 100755 => 100644 patches/top-67.kNilOptions.patch mode change 100755 => 100644 plists/10A432.plist mode change 100755 => 100644 plists/10B504.plist mode change 100755 => 100644 plists/10C540.plist mode change 100755 => 100644 plists/10D573.plist mode change 100755 => 100644 plists/10F569.plist mode change 100755 => 100644 plists/10H574.plist mode change 100755 => 100644 plists/10J567.plist mode change 100755 => 100644 plists/10J869.plist mode change 100755 => 100644 plists/10K540.plist mode change 100755 => 100644 plists/11A511a.plist mode change 100755 => 100644 plists/11B26.plist mode change 100755 => 100644 plists/11C74.plist mode change 100755 => 100644 plists/11D50.plist mode change 100755 => 100644 plists/11E53.plist mode change 100755 => 100644 plists/12A269.plist mode change 100755 => 100644 plists/7B85.plist mode change 100755 => 100644 plists/7C107.plist mode change 100755 => 100644 plists/7D24.plist mode change 100755 => 100644 plists/7F44.plist mode change 100755 => 100644 plists/7H63.plist mode change 100755 => 100644 plists/7M34.plist mode change 100755 => 100644 plists/7R28.plist mode change 100755 => 100644 plists/7S215.plist mode change 100755 => 100644 plists/7U16.plist mode change 100755 => 100644 plists/7W98.plist mode change 100755 => 100644 plists/8A428.plist mode change 100755 => 100644 plists/8B15.plist mode change 100755 => 100644 plists/8C46.plist mode change 100755 => 100644 plists/8F46.plist mode change 100755 => 100644 plists/8G1165.plist mode change 100755 => 100644 plists/8G1454.plist mode change 100755 => 100644 plists/8G32.plist mode change 100755 => 100644 plists/8H14.plist mode change 100755 => 100644 plists/8I1119.plist mode change 100755 => 100644 plists/8I127.plist mode change 100755 => 100644 plists/8J135.plist mode change 100755 => 100644 plists/8J2135.plist mode change 100755 => 100644 plists/8L127.plist mode change 100755 => 100644 plists/8L2127.plist mode change 100755 => 100644 plists/8M1910.plist mode change 100755 => 100644 plists/8M2558.plist mode change 100755 => 100644 plists/8P135.plist mode change 100755 => 100644 plists/8P2137.plist mode change 100755 => 100644 plists/8R218.plist mode change 100755 => 100644 plists/8R2218.plist mode change 100755 => 100644 plists/8S165.plist mode change 100755 => 100644 plists/8S2167.plist mode change 100755 => 100644 plists/9A581.plist mode change 100755 => 100644 plists/9B18.plist mode change 100755 => 100644 plists/9C31.plist mode change 100755 => 100644 plists/9D34.plist mode change 100755 => 100644 plists/9E17.plist mode change 100755 => 100644 plists/9F33.plist mode change 100755 => 100644 plists/9G55.plist mode change 100755 => 100644 plists/9J61.plist mode change 100755 => 100644 plists/9L30.plist mode change 100755 => 100644 prefix.xcconfig mode change 100755 => 100644 testing/darwintrace/close-test mode change 100755 => 100644 testing/darwintrace/exec mode change 100755 => 100644 testing/darwintrace/realpath mode change 100755 => 100644 testing/darwintrace/redirection-test mode change 100755 => 100644 testing/darwintrace/run-tests.sh mode change 100755 => 100644 testing/darwinup/300dirs.tbz2 mode change 100755 => 100644 testing/darwinup/300files.tbz2 mode change 100755 => 100644 testing/darwinup/corrupt.tgz mode change 100755 => 100644 testing/darwinup/deep-rollback-2.xar mode change 100755 => 100644 testing/darwinup/deep-rollback.cpgz mode change 100755 => 100644 testing/darwinup/depotroot.tar.gz mode change 100755 => 100644 testing/darwinup/dest.tar.gz mode change 100755 => 100644 testing/darwinup/extension.tar.bz2 mode change 100755 => 100644 testing/darwinup/rep_dir_file.tar.gz mode change 100755 => 100644 testing/darwinup/rep_dir_link.tar.gz mode change 100755 => 100644 testing/darwinup/rep_file_dir.tar.gz mode change 100755 => 100644 testing/darwinup/rep_file_link.tar.gz mode change 100755 => 100644 testing/darwinup/rep_flink_dir.tar.gz mode change 100755 => 100644 testing/darwinup/rep_flink_file.tar.gz mode change 100755 => 100644 testing/darwinup/rep_link_dir.tar.gz mode change 100755 => 100644 testing/darwinup/rep_link_file.tar.gz mode change 100755 => 100644 testing/darwinup/root.tar.gz mode change 100755 => 100644 testing/darwinup/root2.tar.gz mode change 100755 => 100644 testing/darwinup/root3.tar.gz mode change 100755 => 100644 testing/darwinup/root5.tar.gz mode change 100755 => 100644 testing/darwinup/root6.tar.gz mode change 100755 => 100644 testing/darwinup/root7.tar.gz mode change 100755 => 100644 testing/darwinup/run-tests.sh mode change 100755 => 100644 testing/darwinup/sandboxprofile.tar.bz2 mode change 100755 => 100644 testing/darwinup/symlink_update.tar.gz mode change 100755 => 100644 testing/darwinup/symlinks.tar.gz mode change 100755 => 100644 testing/darwinup/xpcservice.tar.bz2 mode change 100755 => 100644 testing/run-all-tests.sh diff --git a/CHANGES b/CHANGES old mode 100755 new mode 100644 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md old mode 100755 new mode 100644 diff --git a/LICENSE.txt b/LICENSE.txt old mode 100755 new mode 100644 diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md old mode 100755 new mode 100644 diff --git a/README b/README old mode 100755 new mode 100644 diff --git a/archs.sh b/archs.sh old mode 100755 new mode 100644 diff --git a/common.mk b/common.mk old mode 100755 new mode 100644 diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj old mode 100755 new mode 100644 diff --git a/darwinbuild/Info.plist b/darwinbuild/Info.plist old mode 100755 new mode 100644 diff --git a/darwinbuild/SDKSettings.plist b/darwinbuild/SDKSettings.plist old mode 100755 new mode 100644 diff --git a/darwinbuild/buildlist b/darwinbuild/buildlist old mode 100755 new mode 100644 diff --git a/darwinbuild/buildorder b/darwinbuild/buildorder old mode 100755 new mode 100644 diff --git a/darwinbuild/createChroot b/darwinbuild/createChroot old mode 100755 new mode 100644 diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common old mode 100755 new mode 100644 diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in old mode 100755 new mode 100644 diff --git a/darwinbuild/darwinmaster.in b/darwinbuild/darwinmaster.in old mode 100755 new mode 100644 diff --git a/darwinbuild/digest.c b/darwinbuild/digest.c old mode 100755 new mode 100644 diff --git a/darwinbuild/ditto b/darwinbuild/ditto old mode 100755 new mode 100644 diff --git a/darwinbuild/installXcode.in b/darwinbuild/installXcode.in old mode 100755 new mode 100644 diff --git a/darwinbuild/installXcode2 b/darwinbuild/installXcode2 old mode 100755 new mode 100644 diff --git a/darwinbuild/installXcode3 b/darwinbuild/installXcode3 old mode 100755 new mode 100644 diff --git a/darwinbuild/installXcode31 b/darwinbuild/installXcode31 old mode 100755 new mode 100644 diff --git a/darwinbuild/installXcode32.in b/darwinbuild/installXcode32.in old mode 100755 new mode 100644 diff --git a/darwinbuild/log-index.pl b/darwinbuild/log-index.pl old mode 100755 new mode 100644 diff --git a/darwinbuild/manifest.c b/darwinbuild/manifest.c old mode 100755 new mode 100644 diff --git a/darwinbuild/packageRoots.in b/darwinbuild/packageRoots.in old mode 100755 new mode 100644 diff --git a/darwinbuild/processtrace.sh b/darwinbuild/processtrace.sh old mode 100755 new mode 100644 diff --git a/darwinbuild/synthfat b/darwinbuild/synthfat old mode 100755 new mode 100644 diff --git a/darwinbuild/thinFile b/darwinbuild/thinFile old mode 100755 new mode 100644 diff --git a/darwinbuild/thinPackages.in b/darwinbuild/thinPackages.in old mode 100755 new mode 100644 diff --git a/darwintrace/darwintrace.c b/darwintrace/darwintrace.c old mode 100755 new mode 100644 diff --git a/darwinup/Archive.cpp b/darwinup/Archive.cpp old mode 100755 new mode 100644 diff --git a/darwinup/Archive.h b/darwinup/Archive.h old mode 100755 new mode 100644 diff --git a/darwinup/Column.cpp b/darwinup/Column.cpp old mode 100755 new mode 100644 diff --git a/darwinup/Column.h b/darwinup/Column.h old mode 100755 new mode 100644 diff --git a/darwinup/DB.cpp b/darwinup/DB.cpp old mode 100755 new mode 100644 diff --git a/darwinup/DB.h b/darwinup/DB.h old mode 100755 new mode 100644 diff --git a/darwinup/Database.cpp b/darwinup/Database.cpp old mode 100755 new mode 100644 diff --git a/darwinup/Database.h b/darwinup/Database.h old mode 100755 new mode 100644 diff --git a/darwinup/Depot.cpp b/darwinup/Depot.cpp old mode 100755 new mode 100644 diff --git a/darwinup/Depot.h b/darwinup/Depot.h old mode 100755 new mode 100644 diff --git a/darwinup/Digest.cpp b/darwinup/Digest.cpp old mode 100755 new mode 100644 diff --git a/darwinup/Digest.h b/darwinup/Digest.h old mode 100755 new mode 100644 diff --git a/darwinup/File.cpp b/darwinup/File.cpp old mode 100755 new mode 100644 diff --git a/darwinup/File.h b/darwinup/File.h old mode 100755 new mode 100644 diff --git a/darwinup/NOTES b/darwinup/NOTES old mode 100755 new mode 100644 diff --git a/darwinup/SerialSet.cpp b/darwinup/SerialSet.cpp old mode 100755 new mode 100644 diff --git a/darwinup/SerialSet.h b/darwinup/SerialSet.h old mode 100755 new mode 100644 diff --git a/darwinup/Table.cpp b/darwinup/Table.cpp old mode 100755 new mode 100644 diff --git a/darwinup/Table.h b/darwinup/Table.h old mode 100755 new mode 100644 diff --git a/darwinup/Utils.cpp b/darwinup/Utils.cpp old mode 100755 new mode 100644 diff --git a/darwinup/Utils.h b/darwinup/Utils.h old mode 100755 new mode 100644 diff --git a/darwinup/darwinup.1 b/darwinup/darwinup.1 old mode 100755 new mode 100644 diff --git a/darwinup/main.cpp b/darwinup/main.cpp old mode 100755 new mode 100644 diff --git a/darwinxref/DBDataStore.c b/darwinxref/DBDataStore.c old mode 100755 new mode 100644 diff --git a/darwinxref/DBDataStore.h b/darwinxref/DBDataStore.h old mode 100755 new mode 100644 diff --git a/darwinxref/DBPlugin.c b/darwinxref/DBPlugin.c old mode 100755 new mode 100644 diff --git a/darwinxref/DBPlugin.h b/darwinxref/DBPlugin.h old mode 100755 new mode 100644 diff --git a/darwinxref/DBPluginPriv.h b/darwinxref/DBPluginPriv.h old mode 100755 new mode 100644 diff --git a/darwinxref/DBTclPlugin.c b/darwinxref/DBTclPlugin.c old mode 100755 new mode 100644 diff --git a/darwinxref/cfutils.c b/darwinxref/cfutils.c old mode 100755 new mode 100644 diff --git a/darwinxref/cfutils.h b/darwinxref/cfutils.h old mode 100755 new mode 100644 diff --git a/darwinxref/main.c b/darwinxref/main.c old mode 100755 new mode 100644 diff --git a/darwinxref/plugins-darwinports/Portfile.tcl b/darwinxref/plugins-darwinports/Portfile.tcl old mode 100755 new mode 100644 diff --git a/darwinxref/plugins-darwinports/categories.tcl b/darwinxref/plugins-darwinports/categories.tcl old mode 100755 new mode 100644 diff --git a/darwinxref/plugins-darwinports/depends_build.tcl b/darwinxref/plugins-darwinports/depends_build.tcl old mode 100755 new mode 100644 diff --git a/darwinxref/plugins-darwinports/depends_lib.tcl b/darwinxref/plugins-darwinports/depends_lib.tcl old mode 100755 new mode 100644 diff --git a/darwinxref/plugins-darwinports/description.tcl b/darwinxref/plugins-darwinports/description.tcl old mode 100755 new mode 100644 diff --git a/darwinxref/plugins-darwinports/homepage.tcl b/darwinxref/plugins-darwinports/homepage.tcl old mode 100755 new mode 100644 diff --git a/darwinxref/plugins-darwinports/loadPortfile.c b/darwinxref/plugins-darwinports/loadPortfile.c old mode 100755 new mode 100644 diff --git a/darwinxref/plugins-darwinports/long_description.tcl b/darwinxref/plugins-darwinports/long_description.tcl old mode 100755 new mode 100644 diff --git a/darwinxref/plugins-darwinports/maintainers.tcl b/darwinxref/plugins-darwinports/maintainers.tcl old mode 100755 new mode 100644 diff --git a/darwinxref/plugins-darwinports/master_sites.tcl b/darwinxref/plugins-darwinports/master_sites.tcl old mode 100755 new mode 100644 diff --git a/darwinxref/plugins-darwinports/platforms.tcl b/darwinxref/plugins-darwinports/platforms.tcl old mode 100755 new mode 100644 diff --git a/darwinxref/plugins/binary_sites.tcl b/darwinxref/plugins/binary_sites.tcl old mode 100755 new mode 100644 diff --git a/darwinxref/plugins/branch.tcl b/darwinxref/plugins/branch.tcl old mode 100755 new mode 100644 diff --git a/darwinxref/plugins/c_plugins.xcconfig b/darwinxref/plugins/c_plugins.xcconfig old mode 100755 new mode 100644 diff --git a/darwinxref/plugins/configuration.c b/darwinxref/plugins/configuration.c old mode 100755 new mode 100644 diff --git a/darwinxref/plugins/currentBuild.tcl b/darwinxref/plugins/currentBuild.tcl old mode 100755 new mode 100644 diff --git a/darwinxref/plugins/darwin.tcl b/darwinxref/plugins/darwin.tcl old mode 100755 new mode 100644 diff --git a/darwinxref/plugins/dependencies.c b/darwinxref/plugins/dependencies.c old mode 100755 new mode 100644 diff --git a/darwinxref/plugins/descrip.txt b/darwinxref/plugins/descrip.txt old mode 100755 new mode 100644 diff --git a/darwinxref/plugins/diff.c b/darwinxref/plugins/diff.c old mode 100755 new mode 100644 diff --git a/darwinxref/plugins/dot.c b/darwinxref/plugins/dot.c old mode 100755 new mode 100644 diff --git a/darwinxref/plugins/edit.c b/darwinxref/plugins/edit.c old mode 100755 new mode 100644 diff --git a/darwinxref/plugins/environment.c b/darwinxref/plugins/environment.c old mode 100755 new mode 100644 diff --git a/darwinxref/plugins/exportFiles.c b/darwinxref/plugins/exportFiles.c old mode 100755 new mode 100644 diff --git a/darwinxref/plugins/exportIndex.c b/darwinxref/plugins/exportIndex.c old mode 100755 new mode 100644 diff --git a/darwinxref/plugins/exportProject.c b/darwinxref/plugins/exportProject.c old mode 100755 new mode 100644 diff --git a/darwinxref/plugins/findFile.c b/darwinxref/plugins/findFile.c old mode 100755 new mode 100644 diff --git a/darwinxref/plugins/group.tcl b/darwinxref/plugins/group.tcl old mode 100755 new mode 100644 diff --git a/darwinxref/plugins/inherits.c b/darwinxref/plugins/inherits.c old mode 100755 new mode 100644 diff --git a/darwinxref/plugins/loadDeps.c b/darwinxref/plugins/loadDeps.c old mode 100755 new mode 100644 diff --git a/darwinxref/plugins/loadFiles.c b/darwinxref/plugins/loadFiles.c old mode 100755 new mode 100644 diff --git a/darwinxref/plugins/loadIndex.c b/darwinxref/plugins/loadIndex.c old mode 100755 new mode 100644 diff --git a/darwinxref/plugins/macosx.tcl b/darwinxref/plugins/macosx.tcl old mode 100755 new mode 100644 diff --git a/darwinxref/plugins/mergeBuild.c b/darwinxref/plugins/mergeBuild.c old mode 100755 new mode 100644 diff --git a/darwinxref/plugins/original.c b/darwinxref/plugins/original.c old mode 100755 new mode 100644 diff --git a/darwinxref/plugins/patch_sites.tcl b/darwinxref/plugins/patch_sites.tcl old mode 100755 new mode 100644 diff --git a/darwinxref/plugins/patchfiles.c b/darwinxref/plugins/patchfiles.c old mode 100755 new mode 100644 diff --git a/darwinxref/plugins/plist_sites.c b/darwinxref/plugins/plist_sites.c old mode 100755 new mode 100644 diff --git a/darwinxref/plugins/query.c b/darwinxref/plugins/query.c old mode 100755 new mode 100644 diff --git a/darwinxref/plugins/register.c b/darwinxref/plugins/register.c old mode 100755 new mode 100644 diff --git a/darwinxref/plugins/resolveDeps.c b/darwinxref/plugins/resolveDeps.c old mode 100755 new mode 100644 diff --git a/darwinxref/plugins/source_sites.c b/darwinxref/plugins/source_sites.c old mode 100755 new mode 100644 diff --git a/darwinxref/plugins/target.c b/darwinxref/plugins/target.c old mode 100755 new mode 100644 diff --git a/darwinxref/plugins/version.c b/darwinxref/plugins/version.c old mode 100755 new mode 100644 diff --git a/darwinxref/upgrade_plist.c b/darwinxref/upgrade_plist.c old mode 100755 new mode 100644 diff --git a/patches/CarbonHeaders-18.1.ccdest.patch b/patches/CarbonHeaders-18.1.ccdest.patch old mode 100755 new mode 100644 diff --git a/patches/IOKitUser-502.nohidevent.patch b/patches/IOKitUser-502.nohidevent.patch old mode 100755 new mode 100644 diff --git a/patches/PowerManagement-209.1.unused_symbols.patch b/patches/PowerManagement-209.1.unused_symbols.patch old mode 100755 new mode 100644 diff --git a/patches/SmartCardServices-34733.MacTypes.patch b/patches/SmartCardServices-34733.MacTypes.patch old mode 100755 new mode 100644 diff --git a/patches/Tokend-35209.MacTypes.patch b/patches/Tokend-35209.MacTypes.patch old mode 100755 new mode 100644 diff --git a/patches/clamav-125.noupdate.patch b/patches/clamav-125.noupdate.patch old mode 100755 new mode 100644 diff --git a/patches/launchd-258.22.CFNotification.patch b/patches/launchd-258.22.CFNotification.patch old mode 100755 new mode 100644 diff --git a/patches/libsecurity_utilities-36984.MacTypes.patch b/patches/libsecurity_utilities-36984.MacTypes.patch old mode 100755 new mode 100644 diff --git a/patches/perl-63.pldtrace.patch b/patches/perl-63.pldtrace.patch old mode 100755 new mode 100644 diff --git a/patches/postfix-197.dtrace-postfix.patch b/patches/postfix-197.dtrace-postfix.patch old mode 100755 new mode 100644 diff --git a/patches/ppp-412.miniterm_and_noerr.patch b/patches/ppp-412.miniterm_and_noerr.patch old mode 100755 new mode 100644 diff --git a/patches/ppp-412.xauthvendor.patch b/patches/ppp-412.xauthvendor.patch old mode 100755 new mode 100644 diff --git a/patches/security_systemkeychain-36515.kCFDateFormatterIsLenientKey.patch b/patches/security_systemkeychain-36515.kCFDateFormatterIsLenientKey.patch old mode 100755 new mode 100644 diff --git a/patches/system_cmds-433.8.patch b/patches/system_cmds-433.8.patch old mode 100755 new mode 100644 diff --git a/patches/top-67.kNilOptions.patch b/patches/top-67.kNilOptions.patch old mode 100755 new mode 100644 diff --git a/plists/10A432.plist b/plists/10A432.plist old mode 100755 new mode 100644 diff --git a/plists/10B504.plist b/plists/10B504.plist old mode 100755 new mode 100644 diff --git a/plists/10C540.plist b/plists/10C540.plist old mode 100755 new mode 100644 diff --git a/plists/10D573.plist b/plists/10D573.plist old mode 100755 new mode 100644 diff --git a/plists/10F569.plist b/plists/10F569.plist old mode 100755 new mode 100644 diff --git a/plists/10H574.plist b/plists/10H574.plist old mode 100755 new mode 100644 diff --git a/plists/10J567.plist b/plists/10J567.plist old mode 100755 new mode 100644 diff --git a/plists/10J869.plist b/plists/10J869.plist old mode 100755 new mode 100644 diff --git a/plists/10K540.plist b/plists/10K540.plist old mode 100755 new mode 100644 diff --git a/plists/11A511a.plist b/plists/11A511a.plist old mode 100755 new mode 100644 diff --git a/plists/11B26.plist b/plists/11B26.plist old mode 100755 new mode 100644 diff --git a/plists/11C74.plist b/plists/11C74.plist old mode 100755 new mode 100644 diff --git a/plists/11D50.plist b/plists/11D50.plist old mode 100755 new mode 100644 diff --git a/plists/11E53.plist b/plists/11E53.plist old mode 100755 new mode 100644 diff --git a/plists/12A269.plist b/plists/12A269.plist old mode 100755 new mode 100644 diff --git a/plists/7B85.plist b/plists/7B85.plist old mode 100755 new mode 100644 diff --git a/plists/7C107.plist b/plists/7C107.plist old mode 100755 new mode 100644 diff --git a/plists/7D24.plist b/plists/7D24.plist old mode 100755 new mode 100644 diff --git a/plists/7F44.plist b/plists/7F44.plist old mode 100755 new mode 100644 diff --git a/plists/7H63.plist b/plists/7H63.plist old mode 100755 new mode 100644 diff --git a/plists/7M34.plist b/plists/7M34.plist old mode 100755 new mode 100644 diff --git a/plists/7R28.plist b/plists/7R28.plist old mode 100755 new mode 100644 diff --git a/plists/7S215.plist b/plists/7S215.plist old mode 100755 new mode 100644 diff --git a/plists/7U16.plist b/plists/7U16.plist old mode 100755 new mode 100644 diff --git a/plists/7W98.plist b/plists/7W98.plist old mode 100755 new mode 100644 diff --git a/plists/8A428.plist b/plists/8A428.plist old mode 100755 new mode 100644 diff --git a/plists/8B15.plist b/plists/8B15.plist old mode 100755 new mode 100644 diff --git a/plists/8C46.plist b/plists/8C46.plist old mode 100755 new mode 100644 diff --git a/plists/8F46.plist b/plists/8F46.plist old mode 100755 new mode 100644 diff --git a/plists/8G1165.plist b/plists/8G1165.plist old mode 100755 new mode 100644 diff --git a/plists/8G1454.plist b/plists/8G1454.plist old mode 100755 new mode 100644 diff --git a/plists/8G32.plist b/plists/8G32.plist old mode 100755 new mode 100644 diff --git a/plists/8H14.plist b/plists/8H14.plist old mode 100755 new mode 100644 diff --git a/plists/8I1119.plist b/plists/8I1119.plist old mode 100755 new mode 100644 diff --git a/plists/8I127.plist b/plists/8I127.plist old mode 100755 new mode 100644 diff --git a/plists/8J135.plist b/plists/8J135.plist old mode 100755 new mode 100644 diff --git a/plists/8J2135.plist b/plists/8J2135.plist old mode 100755 new mode 100644 diff --git a/plists/8L127.plist b/plists/8L127.plist old mode 100755 new mode 100644 diff --git a/plists/8L2127.plist b/plists/8L2127.plist old mode 100755 new mode 100644 diff --git a/plists/8M1910.plist b/plists/8M1910.plist old mode 100755 new mode 100644 diff --git a/plists/8M2558.plist b/plists/8M2558.plist old mode 100755 new mode 100644 diff --git a/plists/8P135.plist b/plists/8P135.plist old mode 100755 new mode 100644 diff --git a/plists/8P2137.plist b/plists/8P2137.plist old mode 100755 new mode 100644 diff --git a/plists/8R218.plist b/plists/8R218.plist old mode 100755 new mode 100644 diff --git a/plists/8R2218.plist b/plists/8R2218.plist old mode 100755 new mode 100644 diff --git a/plists/8S165.plist b/plists/8S165.plist old mode 100755 new mode 100644 diff --git a/plists/8S2167.plist b/plists/8S2167.plist old mode 100755 new mode 100644 diff --git a/plists/9A581.plist b/plists/9A581.plist old mode 100755 new mode 100644 diff --git a/plists/9B18.plist b/plists/9B18.plist old mode 100755 new mode 100644 diff --git a/plists/9C31.plist b/plists/9C31.plist old mode 100755 new mode 100644 diff --git a/plists/9D34.plist b/plists/9D34.plist old mode 100755 new mode 100644 diff --git a/plists/9E17.plist b/plists/9E17.plist old mode 100755 new mode 100644 diff --git a/plists/9F33.plist b/plists/9F33.plist old mode 100755 new mode 100644 diff --git a/plists/9G55.plist b/plists/9G55.plist old mode 100755 new mode 100644 diff --git a/plists/9J61.plist b/plists/9J61.plist old mode 100755 new mode 100644 diff --git a/plists/9L30.plist b/plists/9L30.plist old mode 100755 new mode 100644 diff --git a/prefix.xcconfig b/prefix.xcconfig old mode 100755 new mode 100644 diff --git a/testing/darwintrace/close-test b/testing/darwintrace/close-test old mode 100755 new mode 100644 diff --git a/testing/darwintrace/exec b/testing/darwintrace/exec old mode 100755 new mode 100644 diff --git a/testing/darwintrace/realpath b/testing/darwintrace/realpath old mode 100755 new mode 100644 diff --git a/testing/darwintrace/redirection-test b/testing/darwintrace/redirection-test old mode 100755 new mode 100644 diff --git a/testing/darwintrace/run-tests.sh b/testing/darwintrace/run-tests.sh old mode 100755 new mode 100644 diff --git a/testing/darwinup/300dirs.tbz2 b/testing/darwinup/300dirs.tbz2 old mode 100755 new mode 100644 diff --git a/testing/darwinup/300files.tbz2 b/testing/darwinup/300files.tbz2 old mode 100755 new mode 100644 diff --git a/testing/darwinup/corrupt.tgz b/testing/darwinup/corrupt.tgz old mode 100755 new mode 100644 diff --git a/testing/darwinup/deep-rollback-2.xar b/testing/darwinup/deep-rollback-2.xar old mode 100755 new mode 100644 diff --git a/testing/darwinup/deep-rollback.cpgz b/testing/darwinup/deep-rollback.cpgz old mode 100755 new mode 100644 diff --git a/testing/darwinup/depotroot.tar.gz b/testing/darwinup/depotroot.tar.gz old mode 100755 new mode 100644 diff --git a/testing/darwinup/dest.tar.gz b/testing/darwinup/dest.tar.gz old mode 100755 new mode 100644 diff --git a/testing/darwinup/extension.tar.bz2 b/testing/darwinup/extension.tar.bz2 old mode 100755 new mode 100644 diff --git a/testing/darwinup/rep_dir_file.tar.gz b/testing/darwinup/rep_dir_file.tar.gz old mode 100755 new mode 100644 diff --git a/testing/darwinup/rep_dir_link.tar.gz b/testing/darwinup/rep_dir_link.tar.gz old mode 100755 new mode 100644 diff --git a/testing/darwinup/rep_file_dir.tar.gz b/testing/darwinup/rep_file_dir.tar.gz old mode 100755 new mode 100644 diff --git a/testing/darwinup/rep_file_link.tar.gz b/testing/darwinup/rep_file_link.tar.gz old mode 100755 new mode 100644 diff --git a/testing/darwinup/rep_flink_dir.tar.gz b/testing/darwinup/rep_flink_dir.tar.gz old mode 100755 new mode 100644 diff --git a/testing/darwinup/rep_flink_file.tar.gz b/testing/darwinup/rep_flink_file.tar.gz old mode 100755 new mode 100644 diff --git a/testing/darwinup/rep_link_dir.tar.gz b/testing/darwinup/rep_link_dir.tar.gz old mode 100755 new mode 100644 diff --git a/testing/darwinup/rep_link_file.tar.gz b/testing/darwinup/rep_link_file.tar.gz old mode 100755 new mode 100644 diff --git a/testing/darwinup/root.tar.gz b/testing/darwinup/root.tar.gz old mode 100755 new mode 100644 diff --git a/testing/darwinup/root2.tar.gz b/testing/darwinup/root2.tar.gz old mode 100755 new mode 100644 diff --git a/testing/darwinup/root3.tar.gz b/testing/darwinup/root3.tar.gz old mode 100755 new mode 100644 diff --git a/testing/darwinup/root5.tar.gz b/testing/darwinup/root5.tar.gz old mode 100755 new mode 100644 diff --git a/testing/darwinup/root6.tar.gz b/testing/darwinup/root6.tar.gz old mode 100755 new mode 100644 diff --git a/testing/darwinup/root7.tar.gz b/testing/darwinup/root7.tar.gz old mode 100755 new mode 100644 diff --git a/testing/darwinup/run-tests.sh b/testing/darwinup/run-tests.sh old mode 100755 new mode 100644 diff --git a/testing/darwinup/sandboxprofile.tar.bz2 b/testing/darwinup/sandboxprofile.tar.bz2 old mode 100755 new mode 100644 diff --git a/testing/darwinup/symlink_update.tar.gz b/testing/darwinup/symlink_update.tar.gz old mode 100755 new mode 100644 diff --git a/testing/darwinup/symlinks.tar.gz b/testing/darwinup/symlinks.tar.gz old mode 100755 new mode 100644 diff --git a/testing/darwinup/xpcservice.tar.bz2 b/testing/darwinup/xpcservice.tar.bz2 old mode 100755 new mode 100644 diff --git a/testing/run-all-tests.sh b/testing/run-all-tests.sh old mode 100755 new mode 100644 From c34579b58f5a1e0a2a96b09ed5c335499a0bfa92 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 23 May 2017 08:23:19 -0400 Subject: [PATCH 011/382] Fix createChroot script to work on modern systems --- darwinbuild/createChroot | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) mode change 100644 => 100755 darwinbuild/createChroot diff --git a/darwinbuild/createChroot b/darwinbuild/createChroot old mode 100644 new mode 100755 index 7c3a5bd..78a0dfc --- a/darwinbuild/createChroot +++ b/darwinbuild/createChroot @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash FORCE="YES" @@ -14,7 +14,6 @@ EXTRADIR=( \ /private/var/tmp ) EXTRACOPY=( \ - /Developer/Makefiles \ /Library/Application\ Support \ /System/Library/Frameworks \ /System/Library/PrivateFrameworks \ @@ -23,12 +22,10 @@ EXTRACOPY=( \ /System/Library/Keyboard\ Layouts \ /System/Library/Perl \ /System/Library/Tcl \ - /System/Library/CoreServices/CharacterSets \ /bin \ /private/etc \ /sbin \ /usr/bin \ - /usr/include \ /usr/lib \ /usr/libexec \ /usr/sbin \ @@ -62,7 +59,7 @@ AppendExtraFiles() { GenerateFileNames() { cat /tmp/installXcode.libs.$$ | sort -u | while read X; do - # echo adding children for "$X" + echo adding children for "$X" # first mkdir parent directories PARENT=$(dirname "$X") @@ -78,7 +75,7 @@ GenerateFileNames() { CopyFiles() { # VERBOSECPIO="v" VERBOSECPIO="" - echo -n "Copying system ..." + echo -n "Copying system... " cpio -o -c < /tmp/installXcode.files.$$ | \ (cd "$BUILDROOT"; cpio -ium${VERBOSECPIO}d ) @@ -96,7 +93,7 @@ pushd / > /dev/null RemoveTemps touch /tmp/installXcode.seen.$$ -echo Analyzing files to copy into chroot ... +echo Analyzing files to copy into chroot... AppendExtraFiles GenerateFileNames CopyFiles @@ -111,9 +108,8 @@ done # We provide this functionality, at least mkdir -p $BUILDROOT/usr/local/darwinbuild/receipts -for i in "files" "bash"; do - touch $BUILDROOT/usr/local/darwinbuild/receipts/$i -done +touch $BUILDROOT/usr/local/darwinbuild/receipts/files +touch $BUILDROOT/usr/local/darwinbuild/receipts/bash popd > /dev/null From fdc171f738deaf3b05e5f07285c4b34f840d6d81 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 23 May 2017 08:23:49 -0400 Subject: [PATCH 012/382] Also write a perl receipt into the chroot --- darwinbuild/createChroot | 1 + 1 file changed, 1 insertion(+) diff --git a/darwinbuild/createChroot b/darwinbuild/createChroot index 78a0dfc..53ce4b9 100755 --- a/darwinbuild/createChroot +++ b/darwinbuild/createChroot @@ -110,6 +110,7 @@ done mkdir -p $BUILDROOT/usr/local/darwinbuild/receipts touch $BUILDROOT/usr/local/darwinbuild/receipts/files touch $BUILDROOT/usr/local/darwinbuild/receipts/bash +touch $BUILDROOT/usr/local/darwinbuild/receipts/perl popd > /dev/null From 0a58fbdf9e3844926def67660ce9d1f0e7c19d66 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 23 May 2017 08:28:29 -0400 Subject: [PATCH 013/382] Reformat installXcode.in This was done automatically by my editor. --- darwinbuild/installXcode.in | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/darwinbuild/installXcode.in b/darwinbuild/installXcode.in index 45b40e2..9efd788 100644 --- a/darwinbuild/installXcode.in +++ b/darwinbuild/installXcode.in @@ -14,13 +14,11 @@ then then "$BINDIR/installXcode32" "$BROOT"; else - "$BINDIR/installXcode31" "$BROOT"; + "$BINDIR/installXcode31" "$BROOT"; fi else - "$BINDIR/installXcode3" "$BROOT"; + "$BINDIR/installXcode3" "$BROOT"; fi else "$BINDIR/installXcode2" "$BROOT"; fi - - From 5d826ca4c65026b25430ea67774355bc9049ccca Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 23 May 2017 08:29:02 -0400 Subject: [PATCH 014/382] Add installXcode_Modern script --- darwinbuild/installXcode.in | 6 ++++++ darwinbuild/installXcode_Modern | 6 ++++++ 2 files changed, 12 insertions(+) create mode 100755 darwinbuild/installXcode_Modern diff --git a/darwinbuild/installXcode.in b/darwinbuild/installXcode.in index 9efd788..9bfac4b 100644 --- a/darwinbuild/installXcode.in +++ b/darwinbuild/installXcode.in @@ -6,6 +6,12 @@ BINDIR=$PREFIX/share/darwinbuild BROOT=$1 VER=$(/usr/bin/xcodebuild -version | grep version | cut -d "-" -f 2 | cut -d ";" -f 1 | cut -d "." -f 1) +if [ -e /Applications/Xcode.app ]; then + "$BINDIR/createChroot" "$BROOT" + "$BINDIR/installXcode_Modern" "$BROOT" + exit 0 +fi + if [ "$VER" -gt "920" ]; then if [ "$VER" -gt "1000" ]; diff --git a/darwinbuild/installXcode_Modern b/darwinbuild/installXcode_Modern new file mode 100755 index 0000000..1316596 --- /dev/null +++ b/darwinbuild/installXcode_Modern @@ -0,0 +1,6 @@ +#!/bin/sh + +BUILDROOT="$1" +mkdir -p "$BUILDROOT" +mkdir -p $BUILDROOT/Applications +ditto /Applications/Xcode.app $BUILDROOT/Applications From 4dd5535e4aec876e48009280cbe439f3b4122dab Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 23 May 2017 08:39:18 -0400 Subject: [PATCH 015/382] Fix ditto invocation --- darwinbuild/installXcode_Modern | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/installXcode_Modern b/darwinbuild/installXcode_Modern index 1316596..0ca887e 100755 --- a/darwinbuild/installXcode_Modern +++ b/darwinbuild/installXcode_Modern @@ -3,4 +3,4 @@ BUILDROOT="$1" mkdir -p "$BUILDROOT" mkdir -p $BUILDROOT/Applications -ditto /Applications/Xcode.app $BUILDROOT/Applications +ditto /Applications/Xcode.app $BUILDROOT/Applications/Xcode.app From f479619fa2e5e2e8e2e6b7ad06030c706da1dc1d Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 23 May 2017 08:39:40 -0400 Subject: [PATCH 016/382] Add installXcode_Modern to install script --- darwinbuild.xcodeproj/project.pbxproj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 416d3b4..98013c1 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -90,6 +90,7 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ + 1FC854011ED462EE00EA2AF5 /* installXcode_Modern in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1FC854001ED462DF00EA2AF5 /* installXcode_Modern */; }; 3963011A1EAB4D60006081C7 /* source_sites.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86C0E10965EEA00C66E90 /* source_sites.c */; }; 396301211EAB4E01006081C7 /* patch_sites.c in Sources */ = {isa = PBXBuildFile; fileRef = 396301191EAB42B6006081C7 /* patch_sites.c */; }; 396301291EAB5DBC006081C7 /* patch_sites.tcl in CopyFiles */ = {isa = PBXBuildFile; fileRef = 396301281EAB5DB5006081C7 /* patch_sites.tcl */; }; @@ -629,6 +630,7 @@ dstPath = "$(DATDIR)/darwinbuild"; dstSubfolderSpec = 0; files = ( + 1FC854011ED462EE00EA2AF5 /* installXcode_Modern in CopyFiles */, 7227AD1C109A05FA00BE33D7 /* buildlist in CopyFiles */, 7227AD1D109A05FA00BE33D7 /* buildorder in CopyFiles */, 7227AD1E109A05FA00BE33D7 /* ditto in CopyFiles */, @@ -658,6 +660,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 1FC854001ED462DF00EA2AF5 /* installXcode_Modern */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = installXcode_Modern; path = darwinbuild/installXcode_Modern; sourceTree = ""; }; 396301191EAB42B6006081C7 /* patch_sites.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = patch_sites.c; sourceTree = ""; }; 396301271EAB4E01006081C7 /* patch_sites.so */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.objfile"; includeInIndex = 0; path = patch_sites.so; sourceTree = BUILT_PRODUCTS_DIR; }; 396301281EAB5DB5006081C7 /* patch_sites.tcl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = patch_sites.tcl; sourceTree = ""; }; @@ -1072,6 +1075,7 @@ 72C86C2A1096600B00C66E90 /* installXcode3 */, 72C86C2B1096600B00C66E90 /* installXcode31 */, 72C86C2C1096600B00C66E90 /* installXcode32.in */, + 1FC854001ED462DF00EA2AF5 /* installXcode_Modern */, 72C86C2E1096600B00C66E90 /* manifest.c */, 72C86C311096600B00C66E90 /* SDKSettings.plist */, ); From 81103acd0afc844ffa3c0c6649bdbd2acd7c68d3 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 23 May 2017 08:48:40 -0400 Subject: [PATCH 017/382] Reformat darwinbuild.in This is done automatically by my editor. --- darwinbuild/darwinbuild.in | 58 +++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 0e293ed..8fa6c5b 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -1,19 +1,19 @@ #!/bin/sh # # Copyright (c) 2004-2010, Apple Computer, Inc. All rights reserved. -# +# # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. +# notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. +# documentation and/or other materials provided with the distribution. # 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of # its contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# +# from this software without specific prior written permission. +# # THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -59,20 +59,20 @@ ### The script checks its source cache (BuildRoot/Sources) for a .tar.gz archive ### of the given project-version. If one exists, it is used. If it does not ### exist, then this script will attempt to use curl(1) to fetch the sources -### from the source sites specified in the plist. +### from the source sites specified in the plist. ### ### If the -chroot option is specified, the script will use the darwinxref tool ### to populate the build root with the "Roots" necessary to build the project ### (Roots are pre-compiled projects ready for installation). This script ### will look for an existing root in the root cache (BuildRoot/Roots). If a -### root is missing, then this script will attempt to use curl(1) to fetch the -### roots from the binary sites specified in the build plist. +### root is missing, then this script will attempt to use curl(1) to fetch the +### roots from the binary sites specified in the build plist. ### ### If the specified project requires Xcode to build (i.e. it does not use ### a makefile, but instead has a .pbproj or .xcodeproj file), then an SDK -### will be synthesized and chroot will not be used. +### will be synthesized and chroot will not be used. +### ### -### PREFIX=%%PREFIX%% PWDP=$(pwd -P) @@ -160,7 +160,7 @@ if [ "$1" == "-init" ]; then fi build=$(echo "$filename" | sed 's/.plist$//') - echo "$build" > .build/build + echo "$build" > .build/build ### ### Create the build root @@ -176,7 +176,7 @@ if [ "$1" == "-init" ]; then echo "# Added by darwinbuild on ${stamp}" >> /etc/exports echo $exportline >> /etc/exports fi - nfsd update + nfsd update echo "Checking exports file ..." nfsd checkexports elif [ "$3" == "-nodmg" ]; then @@ -208,11 +208,11 @@ fi function PrintUsage() { cat <<-EOF 1>&2 usage: $(basename $0) [action] [options] [] - actions: [-headers] [-fetch] [-source] [-load] [-loadonly] + actions: [-headers] [-fetch] [-source] [-load] [-loadonly] options: [-build=X] [-target=X] [-configuration=X] [-logdeps] [-nochroot] [-nopatch] [-noload] [-depsbuild=X [-depsbuild=Y]] [-nosource] - + EOF exit 1 } @@ -233,7 +233,7 @@ if [ ! -d "$BuildRoot/var" -a -d $NFSDIR ]; then if [ $? -ne 0 ]; then echo "Error: Unable to mount build root"; exit 72 - fi + fi elif [ -d $DMGFILE ]; then stat -L $BuildRoot >> /dev/null 2>&1 if [ $? -eq 1 ]; then @@ -242,7 +242,7 @@ elif [ -d $DMGFILE ]; then if [ $? -ne 0 ]; then echo "Error: Unable to attach sparse disk image"; exit 70 - fi + fi fi fi @@ -281,8 +281,8 @@ fi ### don't build. ### ### Options: -### -nosource Do not fetch or stage source. This assumes that the -### source is already in place in the BuildRoot. +### -nosource Do not fetch or stage source. This assumes that the +### source is already in place in the BuildRoot. ### -logdeps Do magic to log the build-time dependencies ### -nopatch Don't patch sources before building. ### -noload Don't load dependencies into the chroot. @@ -291,7 +291,7 @@ fi ### -target=X The makefile or xcode target to build ### -configuration=X Specify the build configuration to use ### -build=X Specify the darwin build number to buld, e.g. 8B15 -### -depsbuild=X Specify the darwin build number to populate the BuildRoot +### -depsbuild=X Specify the darwin build number to populate the BuildRoot ### ### Parameters: ### The name of the project to build @@ -456,7 +456,7 @@ if [ "$nosource" != "YES" ]; then # prepare for the opensource.apple.com/tarballs case as it's no more redirected if echo "$($DARWINXREF source_sites $projnam)" | grep "opensource.apple.com/tarballs" > /dev/null 2> /dev/null ; then - targetfilename=$(echo $(basename "$filename" .tar.gz) | sed -e 's,-[0-9.]*$,,') + targetfilename=$(echo $(basename "$filename" .tar.gz) | sed -e 's,-[0-9.]*$,,') Download "$SourceCache" "$filename" "$($DARWINXREF source_sites $projnam)/$targetfilename" else Download "$SourceCache" "$filename" "$($DARWINXREF source_sites $projnam)" @@ -464,7 +464,7 @@ if [ "$nosource" != "YES" ]; then patchfilenames=$($DARWINXREF patchfiles $projnam) for p in $patchfilenames; do - Download "$SourceCache" "$p" "$($DARWINXREF patch_sites $projnam)" + Download "$SourceCache" "$p" "$($DARWINXREF patch_sites $projnam)" done ### If we are doing a -fetch, stop here. @@ -506,14 +506,14 @@ if [ "$nosource" != "YES" ]; then rm -Rf "$REAL_SRCROOT" "$REAL_OBJROOT" "$REAL_SYMROOT" "$REAL_DSTROOT" mkdir -p "$REAL_SRCROOT" "$REAL_OBJROOT" "$REAL_SYMROOT" "$REAL_DSTROOT" chown root:wheel "$REAL_SRCROOT" "$REAL_OBJROOT" "$REAL_SYMROOT" "$REAL_DSTROOT" - + ### ### Install the sources and patches into the BuildRoot ### cd "$REAL_SRCROOT/.." echo "*** Copying Sources ..." if [ -d "$SourceCache/$project" ]; then - tar c -C "$SourceCache" "$project" | tar xf - + tar c -C "$SourceCache" "$project" | tar xf - elif [ "$alias" != "" -a -d "$SourceCache/$alias-$version" ]; then tar c -C "$SourceCache" "$alias-$version" | tar xf - rmdir "$REAL_SRCROOT" @@ -624,7 +624,7 @@ if [ $INSTALL_XCODE == "YES" ]; then fi ### -### If we are going to build in a chroot, +### If we are going to build in a chroot, ### install the roots into the BuildRoot. ### Make sure we have at least a minimally functioning root ### by installing bash and its dependencies. @@ -651,20 +651,20 @@ if [ "$NEED_ROOTS" == "YES" -a "$noload" != "YES" ]; then cp "$DITTO" "$BuildRoot/usr/bin/ditto" fi - ### need dsymutil + ### need dsymutil if [ ! -x "$BuildRoot/usr/bin/dsymutil" ]; then cp "/usr/bin/dsymutil" "$BuildRoot/usr/bin/dsymutil" fi - ### CoreOSMakefiles + ### CoreOSMakefiles if [ ! -d "$BuildRoot/Developer/Makefiles/CoreOS" ]; then InstallRoot "$BuildRoot" "CoreOSMakefiles" "$depsbuild" - fi + fi ### Perl if [ ! -x "$BuildRoot/usr/bin/perl" ]; then InstallRoot "$BuildRoot" "perl" "$depsbuild" - fi + fi echo "*** Installing Headers ..." deps=$($DARWINXREF dependencies -header "$projnam") @@ -896,7 +896,7 @@ cat <<-EOF >> $SCRIPT if [ -x /bin/date ]; then START_DATE=\$(date "+%s") fi - $buildtool $action $build_string < /dev/null + $buildtool $action $build_string < /dev/null EXIT_STATUS="\$?" if [ -x /bin/date ]; then END_DATE=\$(date "+%s") From 60d94ed6410117559536b91040018ba483a925f8 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 23 May 2017 08:51:15 -0400 Subject: [PATCH 018/382] Change darwinbuild to run createChroot script correctly --- darwinbuild/createChroot | 1 + darwinbuild/darwinbuild.in | 28 ++++++---------------------- darwinbuild/installXcode.in | 1 - 3 files changed, 7 insertions(+), 23 deletions(-) diff --git a/darwinbuild/createChroot b/darwinbuild/createChroot index 53ce4b9..cc0a288 100755 --- a/darwinbuild/createChroot +++ b/darwinbuild/createChroot @@ -111,6 +111,7 @@ mkdir -p $BUILDROOT/usr/local/darwinbuild/receipts touch $BUILDROOT/usr/local/darwinbuild/receipts/files touch $BUILDROOT/usr/local/darwinbuild/receipts/bash touch $BUILDROOT/usr/local/darwinbuild/receipts/perl +touch $BUILDROOT/usr/local/darwinbuild/receipts/.host-system-chroot popd > /dev/null diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 8fa6c5b..b1068d5 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -638,34 +638,18 @@ if [ $USE_CHROOT == "NO" -a $INSTALL_XCODE == "NO" ]; then fi if [ "$NEED_ROOTS" == "YES" -a "$noload" != "YES" ]; then + if [ ! -f "$BuildRoot/usr/local/darwinbuild/receipts/.host-system-chroot" ]; then + echo "*** Creating chroot environment from host system, this may take a while ..." + $DATADIR/createChroot "$BuildRoot" + fi + echo "*** Installing Roots ..." - bash_deps=$($DARWINXREF dependencies -run "bash") deps=$($DARWINXREF dependencies -build "$projnam") - for X in files bash $bash_deps $deps ; do + for X in $deps ; do InstallRoot "$BuildRoot" "$X" "$depsbuild" done - ### so many things require ditto, we have hacked around it - if [ ! -x "$BuildRoot/usr/bin/ditto" ]; then - cp "$DITTO" "$BuildRoot/usr/bin/ditto" - fi - - ### need dsymutil - if [ ! -x "$BuildRoot/usr/bin/dsymutil" ]; then - cp "/usr/bin/dsymutil" "$BuildRoot/usr/bin/dsymutil" - fi - - ### CoreOSMakefiles - if [ ! -d "$BuildRoot/Developer/Makefiles/CoreOS" ]; then - InstallRoot "$BuildRoot" "CoreOSMakefiles" "$depsbuild" - fi - - ### Perl - if [ ! -x "$BuildRoot/usr/bin/perl" ]; then - InstallRoot "$BuildRoot" "perl" "$depsbuild" - fi - echo "*** Installing Headers ..." deps=$($DARWINXREF dependencies -header "$projnam") for X in $deps ; do diff --git a/darwinbuild/installXcode.in b/darwinbuild/installXcode.in index 9bfac4b..5dbbd78 100644 --- a/darwinbuild/installXcode.in +++ b/darwinbuild/installXcode.in @@ -7,7 +7,6 @@ BROOT=$1 VER=$(/usr/bin/xcodebuild -version | grep version | cut -d "-" -f 2 | cut -d ";" -f 1 | cut -d "." -f 1) if [ -e /Applications/Xcode.app ]; then - "$BINDIR/createChroot" "$BROOT" "$BINDIR/installXcode_Modern" "$BROOT" exit 0 fi From c4b10c6ba7710b6ad9a76c1a7f604d7703b48097 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 23 May 2017 12:04:38 -0400 Subject: [PATCH 019/382] Ditto only parts of Xcode.app, instead of the whole thing This significantly reduces time spent waiting for ditto to complete, as well as reduces disk space usage on the build root image. --- darwinbuild/installXcode_Modern | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/darwinbuild/installXcode_Modern b/darwinbuild/installXcode_Modern index 0ca887e..02fd5ec 100755 --- a/darwinbuild/installXcode_Modern +++ b/darwinbuild/installXcode_Modern @@ -1,6 +1,26 @@ #!/bin/sh +do_ditto () { + echo ditto $1 + ditto "$1" "$2" || exit 1 +} + BUILDROOT="$1" mkdir -p "$BUILDROOT" -mkdir -p $BUILDROOT/Applications -ditto /Applications/Xcode.app $BUILDROOT/Applications/Xcode.app + +mkdir -p $BUILDROOT/Applications/Xcode.app/Contents +do_ditto /Applications/Xcode.app/Contents/Frameworks $BUILDROOT/Applications/Xcode.app/Contents +do_ditto /Applications/Xcode.app/Contents/SharedFrameworks $BUILDROOT/Applications/Xcode.app/Contents +do_ditto /Applications/Xcode.app/Contents/OtherFrameworks $BUILDROOT/Applications/Xcode.app/Contents +do_ditto /Applications/Xcode.app/Contents/Plugins $BUILDROOT/Applications/Xcode.app/Contents +do_ditto /Applications/Xcode.app/Contents/XPCServices $BUILDROOT/Applications/Xcode.app/Contents + +mkdir -p $BUILDROOT/Applications/Xcode.app/Contents/Developer +do_ditto /Applications/Xcode.app/Contents/Developer/Library $BUILDROOT/Applications/Xcode.app/Contents/Developer +do_ditto /Applications/Xcode.app/Contents/Developer/Makefiles $BUILDROOT/Applications/Xcode.app/Contents/Developer +do_ditto /Applications/Xcode.app/Contents/Developer/Toolchains $BUILDROOT/Applications/Xcode.app/Contents/Developer +do_ditto /Applications/Xcode.app/Contents/Developer/Tools $BUILDROOT/Applications/Xcode.app/Contents/Developer +do_ditto /Applications/Xcode.app/Contents/Developer/usr $BUILDROOT/Applications/Xcode.app/Contents/Developer + +mkdir -p $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms +do_ditto /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms From a23ffc076f17a7049985b4213172707dc9e743cf Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 23 May 2017 12:10:37 -0400 Subject: [PATCH 020/382] Fix ditto command invocation --- darwinbuild/installXcode_Modern | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/darwinbuild/installXcode_Modern b/darwinbuild/installXcode_Modern index 02fd5ec..833f693 100755 --- a/darwinbuild/installXcode_Modern +++ b/darwinbuild/installXcode_Modern @@ -1,26 +1,28 @@ #!/bin/sh do_ditto () { - echo ditto $1 - ditto "$1" "$2" || exit 1 + local path=$1 + echo ditto $path + mkdir -p $BUILDROOT/$path + ditto "$path" "$BUILDROOT/$path" || exit 1 } BUILDROOT="$1" mkdir -p "$BUILDROOT" mkdir -p $BUILDROOT/Applications/Xcode.app/Contents -do_ditto /Applications/Xcode.app/Contents/Frameworks $BUILDROOT/Applications/Xcode.app/Contents -do_ditto /Applications/Xcode.app/Contents/SharedFrameworks $BUILDROOT/Applications/Xcode.app/Contents -do_ditto /Applications/Xcode.app/Contents/OtherFrameworks $BUILDROOT/Applications/Xcode.app/Contents -do_ditto /Applications/Xcode.app/Contents/Plugins $BUILDROOT/Applications/Xcode.app/Contents -do_ditto /Applications/Xcode.app/Contents/XPCServices $BUILDROOT/Applications/Xcode.app/Contents +do_ditto /Applications/Xcode.app/Contents/Frameworks +do_ditto /Applications/Xcode.app/Contents/SharedFrameworks +do_ditto /Applications/Xcode.app/Contents/OtherFrameworks +do_ditto /Applications/Xcode.app/Contents/Plugins +do_ditto /Applications/Xcode.app/Contents/XPCServices mkdir -p $BUILDROOT/Applications/Xcode.app/Contents/Developer -do_ditto /Applications/Xcode.app/Contents/Developer/Library $BUILDROOT/Applications/Xcode.app/Contents/Developer -do_ditto /Applications/Xcode.app/Contents/Developer/Makefiles $BUILDROOT/Applications/Xcode.app/Contents/Developer -do_ditto /Applications/Xcode.app/Contents/Developer/Toolchains $BUILDROOT/Applications/Xcode.app/Contents/Developer -do_ditto /Applications/Xcode.app/Contents/Developer/Tools $BUILDROOT/Applications/Xcode.app/Contents/Developer -do_ditto /Applications/Xcode.app/Contents/Developer/usr $BUILDROOT/Applications/Xcode.app/Contents/Developer +do_ditto /Applications/Xcode.app/Contents/Developer/Library +do_ditto /Applications/Xcode.app/Contents/Developer/Makefiles +do_ditto /Applications/Xcode.app/Contents/Developer/Toolchains +do_ditto /Applications/Xcode.app/Contents/Developer/Tools +do_ditto /Applications/Xcode.app/Contents/Developer/usr mkdir -p $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms -do_ditto /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms +do_ditto /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform From 3422368736c4954f27ce4d8c4eade5b2b3e05bb8 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 23 May 2017 12:11:49 -0400 Subject: [PATCH 021/382] Remove now-duplicate mkdir statements --- darwinbuild/installXcode_Modern | 3 --- 1 file changed, 3 deletions(-) diff --git a/darwinbuild/installXcode_Modern b/darwinbuild/installXcode_Modern index 833f693..378642c 100755 --- a/darwinbuild/installXcode_Modern +++ b/darwinbuild/installXcode_Modern @@ -10,19 +10,16 @@ do_ditto () { BUILDROOT="$1" mkdir -p "$BUILDROOT" -mkdir -p $BUILDROOT/Applications/Xcode.app/Contents do_ditto /Applications/Xcode.app/Contents/Frameworks do_ditto /Applications/Xcode.app/Contents/SharedFrameworks do_ditto /Applications/Xcode.app/Contents/OtherFrameworks do_ditto /Applications/Xcode.app/Contents/Plugins do_ditto /Applications/Xcode.app/Contents/XPCServices -mkdir -p $BUILDROOT/Applications/Xcode.app/Contents/Developer do_ditto /Applications/Xcode.app/Contents/Developer/Library do_ditto /Applications/Xcode.app/Contents/Developer/Makefiles do_ditto /Applications/Xcode.app/Contents/Developer/Toolchains do_ditto /Applications/Xcode.app/Contents/Developer/Tools do_ditto /Applications/Xcode.app/Contents/Developer/usr -mkdir -p $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms do_ditto /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform From 898576f8eef2ccfc468efee97d7b85a754fc54d9 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 23 May 2017 12:19:10 -0400 Subject: [PATCH 022/382] Set the SDK as required by xcodebuild Without this change, darwinbuild will not be able to build Xcode projects successfully. --- darwinbuild/installXcode.in | 1 + 1 file changed, 1 insertion(+) diff --git a/darwinbuild/installXcode.in b/darwinbuild/installXcode.in index 5dbbd78..c92f179 100644 --- a/darwinbuild/installXcode.in +++ b/darwinbuild/installXcode.in @@ -8,6 +8,7 @@ VER=$(/usr/bin/xcodebuild -version | grep version | cut -d "-" -f 2 | cut -d ";" if [ -e /Applications/Xcode.app ]; then "$BINDIR/installXcode_Modern" "$BROOT" + echo macosx10.12 > .build/platform exit 0 fi From bf4c2f8d00665f206e2f8637b07d6b91f7f0f580 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 23 May 2017 12:23:35 -0400 Subject: [PATCH 023/382] Add copyright notice, as requested by the CONTRIBUTING instructions --- darwinbuild/installXcode_Modern | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/darwinbuild/installXcode_Modern b/darwinbuild/installXcode_Modern index 378642c..9a0e96c 100755 --- a/darwinbuild/installXcode_Modern +++ b/darwinbuild/installXcode_Modern @@ -1,4 +1,32 @@ #!/bin/sh +# +# Copyright (c) 2017 William Kent. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of +# its contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY ITS CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + do_ditto () { local path=$1 From b966cb35b1f5d51e01debee6485f7daeff621a2f Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 23 May 2017 14:50:50 -0400 Subject: [PATCH 024/382] Copy Xcode's Info.plist file as well --- darwinbuild/installXcode_Modern | 1 + 1 file changed, 1 insertion(+) diff --git a/darwinbuild/installXcode_Modern b/darwinbuild/installXcode_Modern index 9a0e96c..fba4f22 100755 --- a/darwinbuild/installXcode_Modern +++ b/darwinbuild/installXcode_Modern @@ -51,3 +51,4 @@ do_ditto /Applications/Xcode.app/Contents/Developer/Tools do_ditto /Applications/Xcode.app/Contents/Developer/usr do_ditto /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform +ditto /Applications/Xcode.app/Contents/Info.plist /Applications/Xcode.app/Contents From 5f2c10505a4b8bc51f0b24519d60f13bcf7a3863 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 23 May 2017 14:57:00 -0400 Subject: [PATCH 025/382] Don't disable chroot if Xcode is required --- darwinbuild/darwinbuild.in | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index b1068d5..d12397a 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -592,19 +592,13 @@ fi numfiles=$(echo *.pbxproj *.pbproj *.xcode *.xcodeproj 2> /dev/null ) if [ -n "$numfiles" ]; then buildtool="xcodebuild" - # we use a platform/sdk instead of chrooting for Xcode projects - # but allow -nochroot to disable Xcode integration - if [ $USE_CHROOT == "YES" ]; then - export USE_CHROOT="NO" - export INSTALL_XCODE="YES" - fi + export INSTALL_XCODE="YES" else buildtool="make" # test for hybrid make-xcode project uses_xcrun=$(grep -Elir 'xcodebuild|xcrun|Commands.make|BSDCommon.make|Standard.make|Common.make' .) if [ -n "$uses_xcrun" -a $USE_CHROOT == "YES" ]; then - export USE_CHROOT="NO" export INSTALL_XCODE="YES" fi fi From 162776e896dacced0727f0e62d74a746ca729e30 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 23 May 2017 14:57:41 -0400 Subject: [PATCH 026/382] Fix path in ditto statement --- darwinbuild/installXcode_Modern | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/installXcode_Modern b/darwinbuild/installXcode_Modern index fba4f22..0eb78f4 100755 --- a/darwinbuild/installXcode_Modern +++ b/darwinbuild/installXcode_Modern @@ -51,4 +51,4 @@ do_ditto /Applications/Xcode.app/Contents/Developer/Tools do_ditto /Applications/Xcode.app/Contents/Developer/usr do_ditto /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform -ditto /Applications/Xcode.app/Contents/Info.plist /Applications/Xcode.app/Contents +ditto /Applications/Xcode.app/Contents/Info.plist $BUILDROOT/Applications/Xcode.app/Contents From 2d142738349748fc28a4c97cce41c27027131077 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 23 May 2017 15:00:15 -0400 Subject: [PATCH 027/382] Ditto another required file --- darwinbuild/installXcode_Modern | 3 +++ 1 file changed, 3 insertions(+) diff --git a/darwinbuild/installXcode_Modern b/darwinbuild/installXcode_Modern index 0eb78f4..ef941cd 100755 --- a/darwinbuild/installXcode_Modern +++ b/darwinbuild/installXcode_Modern @@ -52,3 +52,6 @@ do_ditto /Applications/Xcode.app/Contents/Developer/usr do_ditto /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform ditto /Applications/Xcode.app/Contents/Info.plist $BUILDROOT/Applications/Xcode.app/Contents + +mkdir -p $BUILDROOT/System/Library/CoreServices +ditto /System/Library/CoreServices/SystemVersion.plist $BUILDROOT/System/Library/CoreServices From fa75d7582c8509d8ca4177a9dfc193e69f12f3df Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 23 May 2017 15:00:28 -0400 Subject: [PATCH 028/382] Ditto another required file --- darwinbuild/installXcode_Modern | 1 + 1 file changed, 1 insertion(+) diff --git a/darwinbuild/installXcode_Modern b/darwinbuild/installXcode_Modern index ef941cd..782418b 100755 --- a/darwinbuild/installXcode_Modern +++ b/darwinbuild/installXcode_Modern @@ -52,6 +52,7 @@ do_ditto /Applications/Xcode.app/Contents/Developer/usr do_ditto /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform ditto /Applications/Xcode.app/Contents/Info.plist $BUILDROOT/Applications/Xcode.app/Contents +ditto /Applications/Xcode.app/Contents/version.plist $BUILDROOT/Applications/Xcode.app/Contents mkdir -p $BUILDROOT/System/Library/CoreServices ditto /System/Library/CoreServices/SystemVersion.plist $BUILDROOT/System/Library/CoreServices From 18d75bb7683d9c646c38720fd3784f1fd7b90fb4 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 23 May 2017 15:03:43 -0400 Subject: [PATCH 029/382] Create extra required directories --- darwinbuild/installXcode_Modern | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/darwinbuild/installXcode_Modern b/darwinbuild/installXcode_Modern index 782418b..c196adf 100755 --- a/darwinbuild/installXcode_Modern +++ b/darwinbuild/installXcode_Modern @@ -56,3 +56,8 @@ ditto /Applications/Xcode.app/Contents/version.plist $BUILDROOT/Applications/Xco mkdir -p $BUILDROOT/System/Library/CoreServices ditto /System/Library/CoreServices/SystemVersion.plist $BUILDROOT/System/Library/CoreServices + +# Create extra directories required by the Xcode tools. +# While not strictly part of Xcode, without them the tools will crash. +mkdir -p $BUILDROOT/Users/$(whoami) +mkdir -p $BUILDROOT/$TMPDIR From ec69efd04a4dbfe876f62990c040a55954a125a6 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 23 May 2017 15:11:42 -0400 Subject: [PATCH 030/382] Fix remaining Xcode-in-chroot bugs As of this commit, both Make-based and xcodeproj-based projects build successfully in the chroot. Hooray! I also took the opportunity to remove the usage of DYLD_FORCE_FLAT_NAMESPACE from darwinbuild. As of OS X Lion this is no longer required, and darwintrace has long since been updated to use the newer method of interposing methods. --- darwinbuild/darwinbuild.in | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index d12397a..d3db69c 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -756,32 +756,27 @@ cat <<-EOF > $SCRIPT EOF if [ "$logdeps" == "YES" ]; then if [ "$USE_CHROOT" == "YES" ]; then - if [ "$DARWINTRACE" -nt "$BuildRoot/usr/lib/darwintrace.dylib" ]; then - mkdir -p "$BuildRoot/usr/lib" - cp "$DARWINTRACE" \ - "$BuildRoot/usr/lib/darwintrace.dylib" - fi + mkdir -p "$BuildRoot/usr/lib" + cp "$DARWINTRACE" \ + "$BuildRoot/usr/lib/darwintrace.dylib" + echo "export DARWINTRACE_LOG=\"${TRACELOG/$BuildRoot/}\"" >> $SCRIPT echo "export DYLD_INSERT_LIBRARIES=/usr/lib/darwintrace.dylib" >> $SCRIPT else echo "export DARWINTRACE_LOG=\"${TRACELOG}\"" >> $SCRIPT echo "export DYLD_INSERT_LIBRARIES=$DARWINTRACE" >> $SCRIPT fi - - echo "export DYLD_FORCE_FLAT_NAMESPACE=1" >> $SCRIPT fi -if [ "$INSTALL_XCODE" == "YES" ]; then +if [ "$INSTALL_XCODE" == "YES" -a "$USE_CHROOT" == "NO" ]; then echo "*** Redirecting ..." echo "DARWINTRACE_REDIRECT=\"${BuildRoot}\"" echo "DARWINTRACE_LOG=\"${TRACELOG}\"" echo "DYLD_INSERT_LIBRARIES=$DARWINTRACE" - echo "DYLD_FORCE_FLAT_NAMESPACE=1" echo "" echo "export DARWINTRACE_REDIRECT=\"${BuildRoot}\"" >> $SCRIPT echo "export DARWINTRACE_LOG=\"${TRACELOG}\"" >> $SCRIPT echo "export DYLD_INSERT_LIBRARIES=$DARWINTRACE" >> $SCRIPT - echo "export DYLD_FORCE_FLAT_NAMESPACE=1" >> $SCRIPT fi if [ "$buildtool" == "xcodebuild" ]; then From 97c592af533d7b931fc1664cfe78ce9c6b6bc1f8 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 23 May 2017 19:36:16 -0400 Subject: [PATCH 031/382] Adjust behavior of patch command Now, *.rej files will be discarded (saved to /dev/null) instead of accumulating in the build root. In addition, previously, if a patch created a new file that is already present, the patch program would pause for interactive input. Now, patch simply ignores such patches. --- darwinbuild/darwinbuild.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index d3db69c..8b52a08 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -564,10 +564,10 @@ for patchfile in $patchfilenames; do esac case $patchfile in *.p1.patch*) - $catprog "$SourceCache/$patchfile" | patch -p1 -r . + $catprog "$SourceCache/$patchfile" | patch -p1 -N -r /dev/null ;; *.patch*) - $catprog "$SourceCache/$patchfile" | patch -p0 -r . + $catprog "$SourceCache/$patchfile" | patch -p0 -N -r /dev/null ;; *.add*) newfile=`echo $patchfile | sed -e 's/^.*-\([^-]*\)\.add.*/\1/' -e 's,_,/,g'` From 3338c39f6d30fb155c2fde51164088728edee353 Mon Sep 17 00:00:00 2001 From: William Kent Date: Wed, 24 May 2017 11:34:20 -0400 Subject: [PATCH 032/382] Fix case in path name Since the build root disk image is formatted as case-sensitive HFS+, this discrepancy will cause Xcode command-line tools to crash. --- darwinbuild/installXcode_Modern | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/installXcode_Modern b/darwinbuild/installXcode_Modern index c196adf..8832c3c 100755 --- a/darwinbuild/installXcode_Modern +++ b/darwinbuild/installXcode_Modern @@ -41,7 +41,7 @@ mkdir -p "$BUILDROOT" do_ditto /Applications/Xcode.app/Contents/Frameworks do_ditto /Applications/Xcode.app/Contents/SharedFrameworks do_ditto /Applications/Xcode.app/Contents/OtherFrameworks -do_ditto /Applications/Xcode.app/Contents/Plugins +do_ditto /Applications/Xcode.app/Contents/PlugIns do_ditto /Applications/Xcode.app/Contents/XPCServices do_ditto /Applications/Xcode.app/Contents/Developer/Library From af587720e1ef3cf245ffdfe91199b99ce87d0b61 Mon Sep 17 00:00:00 2001 From: William Kent Date: Wed, 24 May 2017 11:56:03 -0400 Subject: [PATCH 033/382] Correctly add required directories Without these directories, the Xcode command-line tools will crash. --- darwinbuild/installXcode_Modern | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/darwinbuild/installXcode_Modern b/darwinbuild/installXcode_Modern index 8832c3c..696a4bd 100755 --- a/darwinbuild/installXcode_Modern +++ b/darwinbuild/installXcode_Modern @@ -60,4 +60,6 @@ ditto /System/Library/CoreServices/SystemVersion.plist $BUILDROOT/System/Library # Create extra directories required by the Xcode tools. # While not strictly part of Xcode, without them the tools will crash. mkdir -p $BUILDROOT/Users/$(whoami) -mkdir -p $BUILDROOT/$TMPDIR +mkdir -p $BUILDROOT/$(getconf DARWIN_USER_DIR) +mkdir -p $BUILDOROT/$(getconf DARWIN_USER_TEMP_DIR) +mkdir -p $BUILDROOT/$(getconf DARWIN_USER_CACHE_DIR) From c3e9f57acebd2f8420d3f27547aa75021ffea9a7 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 23 May 2017 18:43:24 -0400 Subject: [PATCH 034/382] Fix build issue involving writing the platform version file Previously, this script assumed it was run in the darwinbuild working directory. Since empirical testing has proved that this is not the case, I must specify an absolute path instead. --- darwinbuild/darwinbuild.in | 2 +- darwinbuild/installXcode.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 8b52a08..dd624f0 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -612,7 +612,7 @@ mkdir -p "$receipts" if [ $INSTALL_XCODE == "YES" ]; then if [ ! -f "$receipts/xcodebuild" ]; then echo "*** Installing Xcode Tools ..." - "$DATADIR/installXcode" "$BuildRoot" + "$DATADIR/installXcode" "$BuildRoot" "$PWDP" touch "$receipts/xcodebuild" fi fi diff --git a/darwinbuild/installXcode.in b/darwinbuild/installXcode.in index c92f179..eaad285 100644 --- a/darwinbuild/installXcode.in +++ b/darwinbuild/installXcode.in @@ -8,7 +8,7 @@ VER=$(/usr/bin/xcodebuild -version | grep version | cut -d "-" -f 2 | cut -d ";" if [ -e /Applications/Xcode.app ]; then "$BINDIR/installXcode_Modern" "$BROOT" - echo macosx10.12 > .build/platform + echo macosx10.12 > $2/.build/platform exit 0 fi From e9a4e94f4316de56cd9ac299527b1ff0d1194146 Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 25 May 2017 12:18:27 -0400 Subject: [PATCH 035/382] Fix a problem concerning symbolic links darwinbuild invokes ditto, which does not traverse symbolic links when installing files. (It simply prints an error and exits instead.) I must therefore remove the symbolic link, and then move its target over it so nothing appears to have changed. --- darwinbuild/installXcode_Modern | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/darwinbuild/installXcode_Modern b/darwinbuild/installXcode_Modern index 696a4bd..62a9197 100755 --- a/darwinbuild/installXcode_Modern +++ b/darwinbuild/installXcode_Modern @@ -63,3 +63,7 @@ mkdir -p $BUILDROOT/Users/$(whoami) mkdir -p $BUILDROOT/$(getconf DARWIN_USER_DIR) mkdir -p $BUILDOROT/$(getconf DARWIN_USER_TEMP_DIR) mkdir -p $BUILDROOT/$(getconf DARWIN_USER_CACHE_DIR) + +# Now I must remove a symbolic link, or darwinbuild will fail later. +rm $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk +mv $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk From 631952486126a95163e9115fd60c7152ed26325f Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 25 May 2017 19:07:27 -0400 Subject: [PATCH 036/382] Add patch files from my fork --- ...tch-703.50.37.libfirehose-install.p1.patch | 24 + ...libdispatch-703.50.37.libfirehose.p1.patch | 13 + patches/libplatform-126.50.8.xcode.p1.patch | 964 ++++++++++++++++++ patches/xnu-3789.51.2.fix-codesign.p1.patch | 91 ++ patches/xnu-3789.51.2.fix-path.patch | 31 + 5 files changed, 1123 insertions(+) create mode 100644 patches/libdispatch-703.50.37.libfirehose-install.p1.patch create mode 100644 patches/libdispatch-703.50.37.libfirehose.p1.patch create mode 100644 patches/libplatform-126.50.8.xcode.p1.patch create mode 100644 patches/xnu-3789.51.2.fix-codesign.p1.patch create mode 100644 patches/xnu-3789.51.2.fix-path.patch diff --git a/patches/libdispatch-703.50.37.libfirehose-install.p1.patch b/patches/libdispatch-703.50.37.libfirehose-install.p1.patch new file mode 100644 index 0000000..cb3c191 --- /dev/null +++ b/patches/libdispatch-703.50.37.libfirehose-install.p1.patch @@ -0,0 +1,24 @@ +diff --git a/libdispatch.xcodeproj/project.pbxproj b/libdispatch.xcodeproj/project.pbxproj +index 5fa010b..ef132a5 100644 +--- a/libdispatch.xcodeproj/project.pbxproj ++++ b/libdispatch.xcodeproj/project.pbxproj +@@ -2253,6 +2253,9 @@ + isa = XCBuildConfiguration; + baseConfigurationReference = 6E040C721C499C3600411A2E /* libfirehose_kernel.xcconfig */; + buildSettings = { ++ INSTALL_PATH = "$(SDKROOT)/usr/local/lib/kernel/"; ++ PRIVATE_HEADERS_FOLDER_PATH = "$(SDKROOT)/usr/local/include/kernel/os"; ++ PUBLIC_HEADERS_FOLDER_PATH = "$(SDKROOT)/usr/include/os"; + }; + name = Release; + }; +@@ -2260,6 +2263,9 @@ + isa = XCBuildConfiguration; + baseConfigurationReference = 6E040C721C499C3600411A2E /* libfirehose_kernel.xcconfig */; + buildSettings = { ++ INSTALL_PATH = "$(SDKROOT)/usr/local/lib/kernel/"; ++ PRIVATE_HEADERS_FOLDER_PATH = "$(SDKROOT)/usr/local/include/kernel/os"; ++ PUBLIC_HEADERS_FOLDER_PATH = "$(SDKROOT)/usr/include/os"; + }; + name = Debug; + }; diff --git a/patches/libdispatch-703.50.37.libfirehose.p1.patch b/patches/libdispatch-703.50.37.libfirehose.p1.patch new file mode 100644 index 0000000..991ccff --- /dev/null +++ b/patches/libdispatch-703.50.37.libfirehose.p1.patch @@ -0,0 +1,13 @@ +diff --git a/xcodeconfig/libfirehose_kernel.xcconfig b/xcodeconfig/libfirehose_kernel.xcconfig +index f6b2a99..ab26649 100644 +--- a/xcodeconfig/libfirehose_kernel.xcconfig ++++ b/xcodeconfig/libfirehose_kernel.xcconfig +@@ -27,7 +27,7 @@ INSTALL_PATH = /usr/local/lib/kernel/ + PRIVATE_HEADERS_FOLDER_PATH = /usr/local/include/kernel/os + SUPPORTED_PLATFORMS = macosx iphoneos appletvos watchos + +-HEADER_SEARCH_PATHS = $(PROJECT_DIR) $(SDKROOT)/System/Library/Frameworks/Kernel.framework/PrivateHeaders $(SDKROOT)/System/Library/Frameworks/Kernel.framework/Headers $(SDKROOT)/usr/local/include/os $(SDKROOT)/usr/local/include/firehose ++HEADER_SEARCH_PATHS = $(PROJECT_DIR) /System/Library/Frameworks/Kernel.framework/PrivateHeaders $(SDKROOT)/System/Library/Frameworks/Kernel.framework/Headers /usr/local/include/os /usr/local/include/firehose + + GCC_PREPROCESSOR_DEFINITIONS = $(inherited) KERNEL=1 DISPATCH_USE_DTRACE=0 + diff --git a/patches/libplatform-126.50.8.xcode.p1.patch b/patches/libplatform-126.50.8.xcode.p1.patch new file mode 100644 index 0000000..d1c2221 --- /dev/null +++ b/patches/libplatform-126.50.8.xcode.p1.patch @@ -0,0 +1,964 @@ +diff --git a/libplatform.xcodeproj/project.pbxproj b/libplatform.xcodeproj/project.pbxproj +new file mode 100644 +index 0000000..7f64f67 +--- /dev/null ++++ b/libplatform.xcodeproj/project.pbxproj +@@ -0,0 +1,945 @@ ++// !$*UTF8*$! ++{ ++ archiveVersion = 1; ++ classes = { ++ }; ++ objectVersion = 46; ++ objects = { ++ ++/* Begin PBXBuildFile section */ ++ 1F2E2B8C1ED4FFB300518432 /* atomic.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F2E2AD61ED4F81200518432 /* atomic.h */; settings = {ATTRIBUTES = (Private, ); }; }; ++ 1F2E2B8D1ED4FFB300518432 /* crashlog.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F2E2AD71ED4F81200518432 /* crashlog.h */; settings = {ATTRIBUTES = (Private, ); }; }; ++ 1F2E2B8E1ED4FFB300518432 /* internal_shared.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F2E2AD81ED4F81200518432 /* internal_shared.h */; settings = {ATTRIBUTES = (Private, ); }; }; ++ 1F2E2B911ED4FFBF00518432 /* alloc_once_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F2E2AD21ED4F81200518432 /* alloc_once_impl.h */; settings = {ATTRIBUTES = (Private, ); }; }; ++ 1F2E2B921ED4FFBF00518432 /* base.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F2E2AD31ED4F81200518432 /* base.h */; settings = {ATTRIBUTES = (Public, ); }; }; ++ 1F2E2B931ED4FFBF00518432 /* base_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F2E2AD41ED4F81200518432 /* base_private.h */; settings = {ATTRIBUTES = (Private, ); }; }; ++ 1F2E2B941ED4FFBF00518432 /* lock.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F2E2AD91ED4F81200518432 /* lock.h */; settings = {ATTRIBUTES = (Public, ); }; }; ++ 1F2E2B951ED4FFBF00518432 /* lock_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F2E2ADA1ED4F81200518432 /* lock_private.h */; settings = {ATTRIBUTES = (Private, ); }; }; ++ 1F2E2B961ED4FFBF00518432 /* once_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F2E2ADB1ED4F81200518432 /* once_private.h */; settings = {ATTRIBUTES = (Private, ); }; }; ++ 1F2E2B971ED4FFBF00518432 /* semaphore_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F2E2ADC1ED4F81200518432 /* semaphore_private.h */; settings = {ATTRIBUTES = (Private, ); }; }; ++/* End PBXBuildFile section */ ++ ++/* Begin PBXContainerItemProxy section */ ++ 1F2E2B8F1ED4FFB900518432 /* PBXContainerItemProxy */ = { ++ isa = PBXContainerItemProxy; ++ containerPortal = 1F2E2AC31ED4F80200518432 /* Project object */; ++ proxyType = 1; ++ remoteGlobalIDString = 1F2E2B871ED4FFA300518432; ++ remoteInfo = "os_internal headers"; ++ }; ++/* End PBXContainerItemProxy section */ ++ ++/* Begin PBXFileReference section */ ++ 1F2E2ACA1ED4F81200518432 /* _simple.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _simple.h; sourceTree = ""; }; ++ 1F2E2ACC1ED4F81200518432 /* OSAtomic.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OSAtomic.h; sourceTree = ""; }; ++ 1F2E2ACD1ED4F81200518432 /* OSAtomicDeprecated.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OSAtomicDeprecated.h; sourceTree = ""; }; ++ 1F2E2ACE1ED4F81200518432 /* OSAtomicQueue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OSAtomicQueue.h; sourceTree = ""; }; ++ 1F2E2ACF1ED4F81200518432 /* OSCacheControl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OSCacheControl.h; sourceTree = ""; }; ++ 1F2E2AD01ED4F81200518432 /* OSSpinLockDeprecated.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OSSpinLockDeprecated.h; sourceTree = ""; }; ++ 1F2E2AD21ED4F81200518432 /* alloc_once_impl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = alloc_once_impl.h; sourceTree = ""; }; ++ 1F2E2AD31ED4F81200518432 /* base.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = base.h; sourceTree = ""; }; ++ 1F2E2AD41ED4F81200518432 /* base_private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = base_private.h; sourceTree = ""; }; ++ 1F2E2AD61ED4F81200518432 /* atomic.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = atomic.h; sourceTree = ""; }; ++ 1F2E2AD71ED4F81200518432 /* crashlog.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = crashlog.h; sourceTree = ""; }; ++ 1F2E2AD81ED4F81200518432 /* internal_shared.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = internal_shared.h; sourceTree = ""; }; ++ 1F2E2AD91ED4F81200518432 /* lock.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = lock.h; sourceTree = ""; }; ++ 1F2E2ADA1ED4F81200518432 /* lock_private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = lock_private.h; sourceTree = ""; }; ++ 1F2E2ADB1ED4F81200518432 /* once_private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = once_private.h; sourceTree = ""; }; ++ 1F2E2ADC1ED4F81200518432 /* semaphore_private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = semaphore_private.h; sourceTree = ""; }; ++ 1F2E2ADE1ED4F81200518432 /* compat.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = compat.h; sourceTree = ""; }; ++ 1F2E2ADF1ED4F81200518432 /* introspection_private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = introspection_private.h; sourceTree = ""; }; ++ 1F2E2AE01ED4F81200518432 /* string.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = string.h; sourceTree = ""; }; ++ 1F2E2AE11ED4F81200518432 /* setjmp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = setjmp.h; sourceTree = ""; }; ++ 1F2E2AE21ED4F81200518432 /* ucontext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ucontext.h; sourceTree = ""; }; ++ 1F2E2AE51ED4F81200518432 /* internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = internal.h; sourceTree = ""; }; ++ 1F2E2AE61ED4F81200518432 /* internal_asm.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = internal_asm.h; sourceTree = ""; }; ++ 1F2E2AE71ED4F81200518432 /* yield.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = yield.h; sourceTree = ""; }; ++ 1F2E2AE91ED4F81200518432 /* atomic.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = atomic.3; sourceTree = ""; }; ++ 1F2E2AEA1ED4F81200518432 /* atomic_deprecated.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = atomic_deprecated.3; sourceTree = ""; }; ++ 1F2E2AEB1ED4F81200518432 /* cache.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = cache.3; sourceTree = ""; }; ++ 1F2E2AEC1ED4F81200518432 /* ffs.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = ffs.3; sourceTree = ""; }; ++ 1F2E2AED1ED4F81200518432 /* getcontext.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = getcontext.3; sourceTree = ""; }; ++ 1F2E2AEE1ED4F81200518432 /* makecontext.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = makecontext.3; sourceTree = ""; }; ++ 1F2E2AEF1ED4F81200518432 /* manpages.lst */ = {isa = PBXFileReference; lastKnownFileType = text; path = manpages.lst; sourceTree = ""; }; ++ 1F2E2AF01ED4F81200518432 /* setjmp.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = setjmp.3; sourceTree = ""; }; ++ 1F2E2AF11ED4F81200518432 /* spinlock_deprecated.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = spinlock_deprecated.3; sourceTree = ""; }; ++ 1F2E2AF21ED4F81200518432 /* ucontext.3 */ = {isa = PBXFileReference; lastKnownFileType = text; path = ucontext.3; sourceTree = ""; }; ++ 1F2E2AF51ED4F81200518432 /* module.modulemap */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.module-map"; path = module.modulemap; sourceTree = ""; }; ++ 1F2E2AF61ED4F81200518432 /* OSAtomic.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OSAtomic.h; sourceTree = ""; }; ++ 1F2E2AFA1ED4F81200518432 /* MKGetTimeBaseInfo.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = MKGetTimeBaseInfo.c; sourceTree = ""; }; ++ 1F2E2AFC1ED4F81200518432 /* OSAtomic.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = OSAtomic.s; sourceTree = ""; }; ++ 1F2E2AFD1ED4F81200518432 /* pfz.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = pfz.s; sourceTree = ""; }; ++ 1F2E2AFE1ED4F81200518432 /* init.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = init.c; sourceTree = ""; }; ++ 1F2E2B001ED4F81200518432 /* OSAtomic.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = OSAtomic.s; sourceTree = ""; }; ++ 1F2E2B011ED4F81200518432 /* pfz.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = pfz.s; sourceTree = ""; }; ++ 1F2E2B041ED4F81200518432 /* cache.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = cache.s; sourceTree = ""; }; ++ 1F2E2B061ED4F81200518432 /* cache.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = cache.s; sourceTree = ""; }; ++ 1F2E2B081ED4F81200518432 /* cache.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cache.c; sourceTree = ""; }; ++ 1F2E2B0A1ED4F81200518432 /* cache.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = cache.s; sourceTree = ""; }; ++ 1F2E2B0C1ED4F81200518432 /* cache.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = cache.s; sourceTree = ""; }; ++ 1F2E2B0D1ED4F81200518432 /* force_libplatform_to_build.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = force_libplatform_to_build.c; sourceTree = ""; }; ++ 1F2E2B0E1ED4F81200518432 /* init.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = init.c; sourceTree = ""; }; ++ 1F2E2B101ED4F81200518432 /* introspection.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = introspection.c; sourceTree = ""; }; ++ 1F2E2B111ED4F81200518432 /* introspection_internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = introspection_internal.h; sourceTree = ""; }; ++ 1F2E2B131ED4F81200518432 /* alloc_once.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = alloc_once.c; sourceTree = ""; }; ++ 1F2E2B141ED4F81200518432 /* atomic.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = atomic.c; sourceTree = ""; }; ++ 1F2E2B151ED4F81200518432 /* atomic_up.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = atomic_up.c; sourceTree = ""; }; ++ 1F2E2B161ED4F81200518432 /* lock.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = lock.c; sourceTree = ""; }; ++ 1F2E2B171ED4F81200518432 /* lock_internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = lock_internal.h; sourceTree = ""; }; ++ 1F2E2B181ED4F81200518432 /* lock_up.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = lock_up.c; sourceTree = ""; }; ++ 1F2E2B191ED4F81200518432 /* lock_wfe.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = lock_wfe.c; sourceTree = ""; }; ++ 1F2E2B1A1ED4F81200518432 /* resolver.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = resolver.c; sourceTree = ""; }; ++ 1F2E2B1B1ED4F81200518432 /* resolver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = resolver.h; sourceTree = ""; }; ++ 1F2E2B1C1ED4F81200518432 /* semaphore.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = semaphore.c; sourceTree = ""; }; ++ 1F2E2B1F1ED4F81200518432 /* _longjmp.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = _longjmp.s; sourceTree = ""; }; ++ 1F2E2B201ED4F81200518432 /* _setjmp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _setjmp.h; sourceTree = ""; }; ++ 1F2E2B211ED4F81200518432 /* _setjmp.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = _setjmp.s; sourceTree = ""; }; ++ 1F2E2B221ED4F81200518432 /* longjmp.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = longjmp.s; sourceTree = ""; }; ++ 1F2E2B231ED4F81200518432 /* setjmp.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = setjmp.s; sourceTree = ""; }; ++ 1F2E2B251ED4F81200518432 /* setjmp.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = setjmp.s; sourceTree = ""; }; ++ 1F2E2B271ED4F81200518432 /* setjmperr.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = setjmperr.c; sourceTree = ""; }; ++ 1F2E2B281ED4F81200518432 /* sigtramp.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = sigtramp.c; sourceTree = ""; }; ++ 1F2E2B2A1ED4F81200518432 /* _setjmp.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = _setjmp.s; sourceTree = ""; }; ++ 1F2E2B2B1ED4F81200518432 /* _sigtramp.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = _sigtramp.s; sourceTree = ""; }; ++ 1F2E2B2C1ED4F81200518432 /* setjmp.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = setjmp.s; sourceTree = ""; }; ++ 1F2E2B2E1ED4F81200518432 /* _setjmp.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = _setjmp.s; sourceTree = ""; }; ++ 1F2E2B2F1ED4F81200518432 /* _sigtramp.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = _sigtramp.s; sourceTree = ""; }; ++ 1F2E2B301ED4F81200518432 /* setjmp.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = setjmp.s; sourceTree = ""; }; ++ 1F2E2B321ED4F81200518432 /* asl.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = asl.c; sourceTree = ""; }; ++ 1F2E2B331ED4F81200518432 /* getenv.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = getenv.c; sourceTree = ""; }; ++ 1F2E2B341ED4F81200518432 /* string_io.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = string_io.c; sourceTree = ""; }; ++ 1F2E2B371ED4F81200518432 /* bzero.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = bzero.c; sourceTree = ""; }; ++ 1F2E2B381ED4F81200518432 /* ffsll.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = ffsll.c; sourceTree = ""; }; ++ 1F2E2B391ED4F81200518432 /* flsll.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = flsll.c; sourceTree = ""; }; ++ 1F2E2B3A1ED4F81200518432 /* memccpy.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = memccpy.c; sourceTree = ""; }; ++ 1F2E2B3B1ED4F81200518432 /* memchr.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = memchr.c; sourceTree = ""; }; ++ 1F2E2B3C1ED4F81200518432 /* memcmp.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = memcmp.c; sourceTree = ""; }; ++ 1F2E2B3D1ED4F81200518432 /* memmove.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = memmove.c; sourceTree = ""; }; ++ 1F2E2B3E1ED4F81200518432 /* memset_pattern.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = memset_pattern.c; sourceTree = ""; }; ++ 1F2E2B3F1ED4F81200518432 /* strchr.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strchr.c; sourceTree = ""; }; ++ 1F2E2B401ED4F81200518432 /* strcmp.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strcmp.c; sourceTree = ""; }; ++ 1F2E2B411ED4F81200518432 /* strncmp.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = strncmp.c; sourceTree = ""; }; ++ 1F2E2B441ED4F81200518432 /* getmcontext.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = getmcontext.c; sourceTree = ""; }; ++ 1F2E2B451ED4F81200518432 /* makecontext.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = makecontext.c; sourceTree = ""; }; ++ 1F2E2B461ED4F81200518432 /* setcontext.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = setcontext.c; sourceTree = ""; }; ++ 1F2E2B471ED4F81200518432 /* swapcontext.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = swapcontext.c; sourceTree = ""; }; ++ 1F2E2B491ED4F81200518432 /* _ctx_start.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = _ctx_start.s; sourceTree = ""; }; ++ 1F2E2B4A1ED4F81200518432 /* _setcontext.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = _setcontext.s; sourceTree = ""; }; ++ 1F2E2B4B1ED4F81200518432 /* getcontext.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = getcontext.s; sourceTree = ""; }; ++ 1F2E2B4D1ED4F81200518432 /* _ctx_start.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = _ctx_start.s; sourceTree = ""; }; ++ 1F2E2B4E1ED4F81200518432 /* _setcontext.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = _setcontext.s; sourceTree = ""; }; ++ 1F2E2B4F1ED4F81200518432 /* getcontext.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = getcontext.s; sourceTree = ""; }; ++ 1F2E2B511ED4F81200518432 /* atomics.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = atomics.xcconfig; sourceTree = ""; }; ++ 1F2E2B521ED4F81200518432 /* libplatform.aliases */ = {isa = PBXFileReference; lastKnownFileType = text; path = libplatform.aliases; sourceTree = ""; }; ++ 1F2E2B531ED4F81200518432 /* libplatform.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = libplatform.xcconfig; sourceTree = ""; }; ++ 1F2E2B541ED4F81200518432 /* os.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = os.xcconfig; sourceTree = ""; }; ++ 1F2E2B551ED4F81200518432 /* perarch.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = perarch.xcconfig; sourceTree = ""; }; ++ 1F2E2B561ED4F81200518432 /* static.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = static.xcconfig; sourceTree = ""; }; ++ 1F2E2B801ED4FF8300518432 /* libos headers.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libos headers.a"; sourceTree = BUILT_PRODUCTS_DIR; }; ++ 1F2E2B881ED4FFA300518432 /* libos_internal headers.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libos_internal headers.a"; sourceTree = BUILT_PRODUCTS_DIR; }; ++/* End PBXFileReference section */ ++ ++/* Begin PBXFrameworksBuildPhase section */ ++ 1F2E2B7D1ED4FF8300518432 /* Frameworks */ = { ++ isa = PBXFrameworksBuildPhase; ++ buildActionMask = 2147483647; ++ files = ( ++ ); ++ runOnlyForDeploymentPostprocessing = 0; ++ }; ++ 1F2E2B851ED4FFA300518432 /* Frameworks */ = { ++ isa = PBXFrameworksBuildPhase; ++ buildActionMask = 2147483647; ++ files = ( ++ ); ++ runOnlyForDeploymentPostprocessing = 0; ++ }; ++/* End PBXFrameworksBuildPhase section */ ++ ++/* Begin PBXGroup section */ ++ 1F2E2AC21ED4F80200518432 = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2AC91ED4F81200518432 /* include */, ++ 1F2E2AE31ED4F81200518432 /* internal */, ++ 1F2E2AE81ED4F81200518432 /* man */, ++ 1F2E2AF31ED4F81200518432 /* private */, ++ 1F2E2AF71ED4F81200518432 /* src */, ++ 1F2E2B501ED4F81200518432 /* xcodeconfig */, ++ 1F2E2B5C1ED4F8EA00518432 /* Products */, ++ ); ++ sourceTree = ""; ++ }; ++ 1F2E2AC91ED4F81200518432 /* include */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2ACA1ED4F81200518432 /* _simple.h */, ++ 1F2E2ACB1ED4F81200518432 /* libkern */, ++ 1F2E2AD11ED4F81200518432 /* os */, ++ 1F2E2ADD1ED4F81200518432 /* platform */, ++ 1F2E2AE11ED4F81200518432 /* setjmp.h */, ++ 1F2E2AE21ED4F81200518432 /* ucontext.h */, ++ ); ++ path = include; ++ sourceTree = ""; ++ }; ++ 1F2E2ACB1ED4F81200518432 /* libkern */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2ACC1ED4F81200518432 /* OSAtomic.h */, ++ 1F2E2ACD1ED4F81200518432 /* OSAtomicDeprecated.h */, ++ 1F2E2ACE1ED4F81200518432 /* OSAtomicQueue.h */, ++ 1F2E2ACF1ED4F81200518432 /* OSCacheControl.h */, ++ 1F2E2AD01ED4F81200518432 /* OSSpinLockDeprecated.h */, ++ ); ++ path = libkern; ++ sourceTree = ""; ++ }; ++ 1F2E2AD11ED4F81200518432 /* os */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2AD21ED4F81200518432 /* alloc_once_impl.h */, ++ 1F2E2AD31ED4F81200518432 /* base.h */, ++ 1F2E2AD41ED4F81200518432 /* base_private.h */, ++ 1F2E2AD51ED4F81200518432 /* internal */, ++ 1F2E2AD91ED4F81200518432 /* lock.h */, ++ 1F2E2ADA1ED4F81200518432 /* lock_private.h */, ++ 1F2E2ADB1ED4F81200518432 /* once_private.h */, ++ 1F2E2ADC1ED4F81200518432 /* semaphore_private.h */, ++ ); ++ path = os; ++ sourceTree = ""; ++ }; ++ 1F2E2AD51ED4F81200518432 /* internal */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2AD61ED4F81200518432 /* atomic.h */, ++ 1F2E2AD71ED4F81200518432 /* crashlog.h */, ++ 1F2E2AD81ED4F81200518432 /* internal_shared.h */, ++ ); ++ path = internal; ++ sourceTree = ""; ++ }; ++ 1F2E2ADD1ED4F81200518432 /* platform */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2ADE1ED4F81200518432 /* compat.h */, ++ 1F2E2ADF1ED4F81200518432 /* introspection_private.h */, ++ 1F2E2AE01ED4F81200518432 /* string.h */, ++ ); ++ path = platform; ++ sourceTree = ""; ++ }; ++ 1F2E2AE31ED4F81200518432 /* internal */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2AE41ED4F81200518432 /* os */, ++ ); ++ path = internal; ++ sourceTree = ""; ++ }; ++ 1F2E2AE41ED4F81200518432 /* os */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2AE51ED4F81200518432 /* internal.h */, ++ 1F2E2AE61ED4F81200518432 /* internal_asm.h */, ++ 1F2E2AE71ED4F81200518432 /* yield.h */, ++ ); ++ path = os; ++ sourceTree = ""; ++ }; ++ 1F2E2AE81ED4F81200518432 /* man */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2AE91ED4F81200518432 /* atomic.3 */, ++ 1F2E2AEA1ED4F81200518432 /* atomic_deprecated.3 */, ++ 1F2E2AEB1ED4F81200518432 /* cache.3 */, ++ 1F2E2AEC1ED4F81200518432 /* ffs.3 */, ++ 1F2E2AED1ED4F81200518432 /* getcontext.3 */, ++ 1F2E2AEE1ED4F81200518432 /* makecontext.3 */, ++ 1F2E2AEF1ED4F81200518432 /* manpages.lst */, ++ 1F2E2AF01ED4F81200518432 /* setjmp.3 */, ++ 1F2E2AF11ED4F81200518432 /* spinlock_deprecated.3 */, ++ 1F2E2AF21ED4F81200518432 /* ucontext.3 */, ++ ); ++ path = man; ++ sourceTree = ""; ++ }; ++ 1F2E2AF31ED4F81200518432 /* private */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2AF41ED4F81200518432 /* libkern */, ++ ); ++ path = private; ++ sourceTree = ""; ++ }; ++ 1F2E2AF41ED4F81200518432 /* libkern */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2AF51ED4F81200518432 /* module.modulemap */, ++ 1F2E2AF61ED4F81200518432 /* OSAtomic.h */, ++ ); ++ path = libkern; ++ sourceTree = ""; ++ }; ++ 1F2E2AF71ED4F81200518432 /* src */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2B0D1ED4F81200518432 /* force_libplatform_to_build.c */, ++ 1F2E2B0E1ED4F81200518432 /* init.c */, ++ 1F2E2AF81ED4F81200518432 /* atomics */, ++ 1F2E2B021ED4F81200518432 /* cachecontrol */, ++ 1F2E2B0F1ED4F81200518432 /* introspection */, ++ 1F2E2B121ED4F81200518432 /* os */, ++ 1F2E2B1D1ED4F81200518432 /* setjmp */, ++ 1F2E2B311ED4F81200518432 /* simple */, ++ 1F2E2B351ED4F81200518432 /* string */, ++ 1F2E2B421ED4F81200518432 /* ucontext */, ++ ); ++ path = src; ++ sourceTree = ""; ++ }; ++ 1F2E2AF81ED4F81200518432 /* atomics */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2AF91ED4F81200518432 /* common */, ++ 1F2E2AFB1ED4F81200518432 /* i386 */, ++ 1F2E2AFE1ED4F81200518432 /* init.c */, ++ 1F2E2AFF1ED4F81200518432 /* x86_64 */, ++ ); ++ path = atomics; ++ sourceTree = ""; ++ }; ++ 1F2E2AF91ED4F81200518432 /* common */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2AFA1ED4F81200518432 /* MKGetTimeBaseInfo.c */, ++ ); ++ path = common; ++ sourceTree = ""; ++ }; ++ 1F2E2AFB1ED4F81200518432 /* i386 */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2AFC1ED4F81200518432 /* OSAtomic.s */, ++ 1F2E2AFD1ED4F81200518432 /* pfz.s */, ++ ); ++ path = i386; ++ sourceTree = ""; ++ }; ++ 1F2E2AFF1ED4F81200518432 /* x86_64 */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2B001ED4F81200518432 /* OSAtomic.s */, ++ 1F2E2B011ED4F81200518432 /* pfz.s */, ++ ); ++ path = x86_64; ++ sourceTree = ""; ++ }; ++ 1F2E2B021ED4F81200518432 /* cachecontrol */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2B031ED4F81200518432 /* arm */, ++ 1F2E2B051ED4F81200518432 /* arm64 */, ++ 1F2E2B071ED4F81200518432 /* generic */, ++ 1F2E2B091ED4F81200518432 /* i386 */, ++ 1F2E2B0B1ED4F81200518432 /* x86_64 */, ++ ); ++ path = cachecontrol; ++ sourceTree = ""; ++ }; ++ 1F2E2B031ED4F81200518432 /* arm */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2B041ED4F81200518432 /* cache.s */, ++ ); ++ path = arm; ++ sourceTree = ""; ++ }; ++ 1F2E2B051ED4F81200518432 /* arm64 */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2B061ED4F81200518432 /* cache.s */, ++ ); ++ path = arm64; ++ sourceTree = ""; ++ }; ++ 1F2E2B071ED4F81200518432 /* generic */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2B081ED4F81200518432 /* cache.c */, ++ ); ++ path = generic; ++ sourceTree = ""; ++ }; ++ 1F2E2B091ED4F81200518432 /* i386 */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2B0A1ED4F81200518432 /* cache.s */, ++ ); ++ path = i386; ++ sourceTree = ""; ++ }; ++ 1F2E2B0B1ED4F81200518432 /* x86_64 */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2B0C1ED4F81200518432 /* cache.s */, ++ ); ++ path = x86_64; ++ sourceTree = ""; ++ }; ++ 1F2E2B0F1ED4F81200518432 /* introspection */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2B101ED4F81200518432 /* introspection.c */, ++ 1F2E2B111ED4F81200518432 /* introspection_internal.h */, ++ ); ++ path = introspection; ++ sourceTree = ""; ++ }; ++ 1F2E2B121ED4F81200518432 /* os */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2B131ED4F81200518432 /* alloc_once.c */, ++ 1F2E2B141ED4F81200518432 /* atomic.c */, ++ 1F2E2B151ED4F81200518432 /* atomic_up.c */, ++ 1F2E2B161ED4F81200518432 /* lock.c */, ++ 1F2E2B171ED4F81200518432 /* lock_internal.h */, ++ 1F2E2B181ED4F81200518432 /* lock_up.c */, ++ 1F2E2B191ED4F81200518432 /* lock_wfe.c */, ++ 1F2E2B1A1ED4F81200518432 /* resolver.c */, ++ 1F2E2B1B1ED4F81200518432 /* resolver.h */, ++ 1F2E2B1C1ED4F81200518432 /* semaphore.c */, ++ ); ++ path = os; ++ sourceTree = ""; ++ }; ++ 1F2E2B1D1ED4F81200518432 /* setjmp */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2B1E1ED4F81200518432 /* arm */, ++ 1F2E2B241ED4F81200518432 /* arm64 */, ++ 1F2E2B261ED4F81200518432 /* generic */, ++ 1F2E2B291ED4F81200518432 /* i386 */, ++ 1F2E2B2D1ED4F81200518432 /* x86_64 */, ++ ); ++ path = setjmp; ++ sourceTree = ""; ++ }; ++ 1F2E2B1E1ED4F81200518432 /* arm */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2B1F1ED4F81200518432 /* _longjmp.s */, ++ 1F2E2B201ED4F81200518432 /* _setjmp.h */, ++ 1F2E2B211ED4F81200518432 /* _setjmp.s */, ++ 1F2E2B221ED4F81200518432 /* longjmp.s */, ++ 1F2E2B231ED4F81200518432 /* setjmp.s */, ++ ); ++ path = arm; ++ sourceTree = ""; ++ }; ++ 1F2E2B241ED4F81200518432 /* arm64 */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2B251ED4F81200518432 /* setjmp.s */, ++ ); ++ path = arm64; ++ sourceTree = ""; ++ }; ++ 1F2E2B261ED4F81200518432 /* generic */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2B271ED4F81200518432 /* setjmperr.c */, ++ 1F2E2B281ED4F81200518432 /* sigtramp.c */, ++ ); ++ path = generic; ++ sourceTree = ""; ++ }; ++ 1F2E2B291ED4F81200518432 /* i386 */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2B2A1ED4F81200518432 /* _setjmp.s */, ++ 1F2E2B2B1ED4F81200518432 /* _sigtramp.s */, ++ 1F2E2B2C1ED4F81200518432 /* setjmp.s */, ++ ); ++ path = i386; ++ sourceTree = ""; ++ }; ++ 1F2E2B2D1ED4F81200518432 /* x86_64 */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2B2E1ED4F81200518432 /* _setjmp.s */, ++ 1F2E2B2F1ED4F81200518432 /* _sigtramp.s */, ++ 1F2E2B301ED4F81200518432 /* setjmp.s */, ++ ); ++ path = x86_64; ++ sourceTree = ""; ++ }; ++ 1F2E2B311ED4F81200518432 /* simple */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2B321ED4F81200518432 /* asl.c */, ++ 1F2E2B331ED4F81200518432 /* getenv.c */, ++ 1F2E2B341ED4F81200518432 /* string_io.c */, ++ ); ++ path = simple; ++ sourceTree = ""; ++ }; ++ 1F2E2B351ED4F81200518432 /* string */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2B361ED4F81200518432 /* generic */, ++ ); ++ path = string; ++ sourceTree = ""; ++ }; ++ 1F2E2B361ED4F81200518432 /* generic */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2B371ED4F81200518432 /* bzero.c */, ++ 1F2E2B381ED4F81200518432 /* ffsll.c */, ++ 1F2E2B391ED4F81200518432 /* flsll.c */, ++ 1F2E2B3A1ED4F81200518432 /* memccpy.c */, ++ 1F2E2B3B1ED4F81200518432 /* memchr.c */, ++ 1F2E2B3C1ED4F81200518432 /* memcmp.c */, ++ 1F2E2B3D1ED4F81200518432 /* memmove.c */, ++ 1F2E2B3E1ED4F81200518432 /* memset_pattern.c */, ++ 1F2E2B3F1ED4F81200518432 /* strchr.c */, ++ 1F2E2B401ED4F81200518432 /* strcmp.c */, ++ 1F2E2B411ED4F81200518432 /* strncmp.c */, ++ ); ++ path = generic; ++ sourceTree = ""; ++ }; ++ 1F2E2B421ED4F81200518432 /* ucontext */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2B431ED4F81200518432 /* generic */, ++ 1F2E2B481ED4F81200518432 /* i386 */, ++ 1F2E2B4C1ED4F81200518432 /* x86_64 */, ++ ); ++ path = ucontext; ++ sourceTree = ""; ++ }; ++ 1F2E2B431ED4F81200518432 /* generic */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2B441ED4F81200518432 /* getmcontext.c */, ++ 1F2E2B451ED4F81200518432 /* makecontext.c */, ++ 1F2E2B461ED4F81200518432 /* setcontext.c */, ++ 1F2E2B471ED4F81200518432 /* swapcontext.c */, ++ ); ++ path = generic; ++ sourceTree = ""; ++ }; ++ 1F2E2B481ED4F81200518432 /* i386 */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2B491ED4F81200518432 /* _ctx_start.s */, ++ 1F2E2B4A1ED4F81200518432 /* _setcontext.s */, ++ 1F2E2B4B1ED4F81200518432 /* getcontext.s */, ++ ); ++ path = i386; ++ sourceTree = ""; ++ }; ++ 1F2E2B4C1ED4F81200518432 /* x86_64 */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2B4D1ED4F81200518432 /* _ctx_start.s */, ++ 1F2E2B4E1ED4F81200518432 /* _setcontext.s */, ++ 1F2E2B4F1ED4F81200518432 /* getcontext.s */, ++ ); ++ path = x86_64; ++ sourceTree = ""; ++ }; ++ 1F2E2B501ED4F81200518432 /* xcodeconfig */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2B511ED4F81200518432 /* atomics.xcconfig */, ++ 1F2E2B521ED4F81200518432 /* libplatform.aliases */, ++ 1F2E2B531ED4F81200518432 /* libplatform.xcconfig */, ++ 1F2E2B541ED4F81200518432 /* os.xcconfig */, ++ 1F2E2B551ED4F81200518432 /* perarch.xcconfig */, ++ 1F2E2B561ED4F81200518432 /* static.xcconfig */, ++ ); ++ path = xcodeconfig; ++ sourceTree = ""; ++ }; ++ 1F2E2B5C1ED4F8EA00518432 /* Products */ = { ++ isa = PBXGroup; ++ children = ( ++ 1F2E2B801ED4FF8300518432 /* libos headers.a */, ++ 1F2E2B881ED4FFA300518432 /* libos_internal headers.a */, ++ ); ++ name = Products; ++ sourceTree = ""; ++ }; ++/* End PBXGroup section */ ++ ++/* Begin PBXHeadersBuildPhase section */ ++ 1F2E2B7E1ED4FF8300518432 /* Headers */ = { ++ isa = PBXHeadersBuildPhase; ++ buildActionMask = 2147483647; ++ files = ( ++ 1F2E2B921ED4FFBF00518432 /* base.h in Headers */, ++ 1F2E2B941ED4FFBF00518432 /* lock.h in Headers */, ++ 1F2E2B911ED4FFBF00518432 /* alloc_once_impl.h in Headers */, ++ 1F2E2B931ED4FFBF00518432 /* base_private.h in Headers */, ++ 1F2E2B951ED4FFBF00518432 /* lock_private.h in Headers */, ++ 1F2E2B961ED4FFBF00518432 /* once_private.h in Headers */, ++ 1F2E2B971ED4FFBF00518432 /* semaphore_private.h in Headers */, ++ ); ++ runOnlyForDeploymentPostprocessing = 0; ++ }; ++ 1F2E2B861ED4FFA300518432 /* Headers */ = { ++ isa = PBXHeadersBuildPhase; ++ buildActionMask = 2147483647; ++ files = ( ++ 1F2E2B8C1ED4FFB300518432 /* atomic.h in Headers */, ++ 1F2E2B8D1ED4FFB300518432 /* crashlog.h in Headers */, ++ 1F2E2B8E1ED4FFB300518432 /* internal_shared.h in Headers */, ++ ); ++ runOnlyForDeploymentPostprocessing = 0; ++ }; ++/* End PBXHeadersBuildPhase section */ ++ ++/* Begin PBXNativeTarget section */ ++ 1F2E2B7F1ED4FF8300518432 /* os headers */ = { ++ isa = PBXNativeTarget; ++ buildConfigurationList = 1F2E2B811ED4FF8300518432 /* Build configuration list for PBXNativeTarget "os headers" */; ++ buildPhases = ( ++ 1F2E2B7C1ED4FF8300518432 /* Sources */, ++ 1F2E2B7D1ED4FF8300518432 /* Frameworks */, ++ 1F2E2B7E1ED4FF8300518432 /* Headers */, ++ ); ++ buildRules = ( ++ ); ++ dependencies = ( ++ 1F2E2B901ED4FFB900518432 /* PBXTargetDependency */, ++ ); ++ name = "os headers"; ++ productName = "os headers"; ++ productReference = 1F2E2B801ED4FF8300518432 /* libos headers.a */; ++ productType = "com.apple.product-type.library.static"; ++ }; ++ 1F2E2B871ED4FFA300518432 /* os_internal headers */ = { ++ isa = PBXNativeTarget; ++ buildConfigurationList = 1F2E2B891ED4FFA300518432 /* Build configuration list for PBXNativeTarget "os_internal headers" */; ++ buildPhases = ( ++ 1F2E2B841ED4FFA300518432 /* Sources */, ++ 1F2E2B851ED4FFA300518432 /* Frameworks */, ++ 1F2E2B861ED4FFA300518432 /* Headers */, ++ ); ++ buildRules = ( ++ ); ++ dependencies = ( ++ ); ++ name = "os_internal headers"; ++ productName = "os_internal headers"; ++ productReference = 1F2E2B881ED4FFA300518432 /* libos_internal headers.a */; ++ productType = "com.apple.product-type.library.static"; ++ }; ++/* End PBXNativeTarget section */ ++ ++/* Begin PBXProject section */ ++ 1F2E2AC31ED4F80200518432 /* Project object */ = { ++ isa = PBXProject; ++ attributes = { ++ LastUpgradeCheck = 0830; ++ TargetAttributes = { ++ 1F2E2B7F1ED4FF8300518432 = { ++ CreatedOnToolsVersion = 8.3.2; ++ DevelopmentTeam = 3P242C9ES5; ++ ProvisioningStyle = Automatic; ++ }; ++ 1F2E2B871ED4FFA300518432 = { ++ CreatedOnToolsVersion = 8.3.2; ++ DevelopmentTeam = 3P242C9ES5; ++ ProvisioningStyle = Automatic; ++ }; ++ }; ++ }; ++ buildConfigurationList = 1F2E2AC61ED4F80200518432 /* Build configuration list for PBXProject "libplatform" */; ++ compatibilityVersion = "Xcode 3.2"; ++ developmentRegion = English; ++ hasScannedForEncodings = 0; ++ knownRegions = ( ++ en, ++ ); ++ mainGroup = 1F2E2AC21ED4F80200518432; ++ productRefGroup = 1F2E2B5C1ED4F8EA00518432 /* Products */; ++ projectDirPath = ""; ++ projectRoot = ""; ++ targets = ( ++ 1F2E2B7F1ED4FF8300518432 /* os headers */, ++ 1F2E2B871ED4FFA300518432 /* os_internal headers */, ++ ); ++ }; ++/* End PBXProject section */ ++ ++/* Begin PBXSourcesBuildPhase section */ ++ 1F2E2B7C1ED4FF8300518432 /* Sources */ = { ++ isa = PBXSourcesBuildPhase; ++ buildActionMask = 2147483647; ++ files = ( ++ ); ++ runOnlyForDeploymentPostprocessing = 0; ++ }; ++ 1F2E2B841ED4FFA300518432 /* Sources */ = { ++ isa = PBXSourcesBuildPhase; ++ buildActionMask = 2147483647; ++ files = ( ++ ); ++ runOnlyForDeploymentPostprocessing = 0; ++ }; ++/* End PBXSourcesBuildPhase section */ ++ ++/* Begin PBXTargetDependency section */ ++ 1F2E2B901ED4FFB900518432 /* PBXTargetDependency */ = { ++ isa = PBXTargetDependency; ++ target = 1F2E2B871ED4FFA300518432 /* os_internal headers */; ++ targetProxy = 1F2E2B8F1ED4FFB900518432 /* PBXContainerItemProxy */; ++ }; ++/* End PBXTargetDependency section */ ++ ++/* Begin XCBuildConfiguration section */ ++ 1F2E2AC71ED4F80200518432 /* Debug */ = { ++ isa = XCBuildConfiguration; ++ buildSettings = { ++ }; ++ name = Debug; ++ }; ++ 1F2E2AC81ED4F80200518432 /* Release */ = { ++ isa = XCBuildConfiguration; ++ buildSettings = { ++ }; ++ name = Release; ++ }; ++ 1F2E2B821ED4FF8300518432 /* Debug */ = { ++ isa = XCBuildConfiguration; ++ buildSettings = { ++ ALWAYS_SEARCH_USER_PATHS = NO; ++ CLANG_ANALYZER_NONNULL = YES; ++ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; ++ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; ++ CLANG_CXX_LIBRARY = "libc++"; ++ CLANG_ENABLE_MODULES = YES; ++ CLANG_ENABLE_OBJC_ARC = YES; ++ CLANG_WARN_BOOL_CONVERSION = YES; ++ CLANG_WARN_CONSTANT_CONVERSION = YES; ++ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; ++ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; ++ CLANG_WARN_EMPTY_BODY = YES; ++ CLANG_WARN_ENUM_CONVERSION = YES; ++ CLANG_WARN_INFINITE_RECURSION = YES; ++ CLANG_WARN_INT_CONVERSION = YES; ++ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; ++ CLANG_WARN_SUSPICIOUS_MOVE = YES; ++ CLANG_WARN_UNREACHABLE_CODE = YES; ++ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; ++ CODE_SIGN_IDENTITY = "-"; ++ COPY_PHASE_STRIP = NO; ++ DEBUG_INFORMATION_FORMAT = dwarf; ++ DEVELOPMENT_TEAM = 3P242C9ES5; ++ ENABLE_STRICT_OBJC_MSGSEND = YES; ++ ENABLE_TESTABILITY = YES; ++ EXECUTABLE_PREFIX = lib; ++ GCC_C_LANGUAGE_STANDARD = gnu99; ++ GCC_DYNAMIC_NO_PIC = NO; ++ GCC_NO_COMMON_BLOCKS = YES; ++ GCC_OPTIMIZATION_LEVEL = 0; ++ GCC_PREPROCESSOR_DEFINITIONS = ( ++ "DEBUG=1", ++ "$(inherited)", ++ ); ++ GCC_WARN_64_TO_32_BIT_CONVERSION = YES; ++ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; ++ GCC_WARN_UNDECLARED_SELECTOR = YES; ++ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; ++ GCC_WARN_UNUSED_FUNCTION = YES; ++ GCC_WARN_UNUSED_VARIABLE = YES; ++ MACOSX_DEPLOYMENT_TARGET = 10.12; ++ MTL_ENABLE_DEBUG_INFO = YES; ++ ONLY_ACTIVE_ARCH = YES; ++ PRIVATE_HEADERS_FOLDER_PATH = /usr/local/include/os; ++ PRODUCT_NAME = "$(TARGET_NAME)"; ++ PUBLIC_HEADERS_FOLDER_PATH = /usr/include/os; ++ SDKROOT = macosx; ++ }; ++ name = Debug; ++ }; ++ 1F2E2B831ED4FF8300518432 /* Release */ = { ++ isa = XCBuildConfiguration; ++ buildSettings = { ++ ALWAYS_SEARCH_USER_PATHS = NO; ++ CLANG_ANALYZER_NONNULL = YES; ++ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; ++ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; ++ CLANG_CXX_LIBRARY = "libc++"; ++ CLANG_ENABLE_MODULES = YES; ++ CLANG_ENABLE_OBJC_ARC = YES; ++ CLANG_WARN_BOOL_CONVERSION = YES; ++ CLANG_WARN_CONSTANT_CONVERSION = YES; ++ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; ++ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; ++ CLANG_WARN_EMPTY_BODY = YES; ++ CLANG_WARN_ENUM_CONVERSION = YES; ++ CLANG_WARN_INFINITE_RECURSION = YES; ++ CLANG_WARN_INT_CONVERSION = YES; ++ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; ++ CLANG_WARN_SUSPICIOUS_MOVE = YES; ++ CLANG_WARN_UNREACHABLE_CODE = YES; ++ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; ++ CODE_SIGN_IDENTITY = "-"; ++ COPY_PHASE_STRIP = NO; ++ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ++ DEVELOPMENT_TEAM = 3P242C9ES5; ++ ENABLE_NS_ASSERTIONS = NO; ++ ENABLE_STRICT_OBJC_MSGSEND = YES; ++ EXECUTABLE_PREFIX = lib; ++ GCC_C_LANGUAGE_STANDARD = gnu99; ++ GCC_NO_COMMON_BLOCKS = YES; ++ GCC_WARN_64_TO_32_BIT_CONVERSION = YES; ++ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; ++ GCC_WARN_UNDECLARED_SELECTOR = YES; ++ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; ++ GCC_WARN_UNUSED_FUNCTION = YES; ++ GCC_WARN_UNUSED_VARIABLE = YES; ++ MACOSX_DEPLOYMENT_TARGET = 10.12; ++ MTL_ENABLE_DEBUG_INFO = NO; ++ PRIVATE_HEADERS_FOLDER_PATH = /usr/local/include/os; ++ PRODUCT_NAME = "$(TARGET_NAME)"; ++ PUBLIC_HEADERS_FOLDER_PATH = /usr/include/os; ++ SDKROOT = macosx; ++ }; ++ name = Release; ++ }; ++ 1F2E2B8A1ED4FFA300518432 /* Debug */ = { ++ isa = XCBuildConfiguration; ++ buildSettings = { ++ ALWAYS_SEARCH_USER_PATHS = NO; ++ CLANG_ANALYZER_NONNULL = YES; ++ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; ++ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; ++ CLANG_CXX_LIBRARY = "libc++"; ++ CLANG_ENABLE_MODULES = YES; ++ CLANG_ENABLE_OBJC_ARC = YES; ++ CLANG_WARN_BOOL_CONVERSION = YES; ++ CLANG_WARN_CONSTANT_CONVERSION = YES; ++ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; ++ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; ++ CLANG_WARN_EMPTY_BODY = YES; ++ CLANG_WARN_ENUM_CONVERSION = YES; ++ CLANG_WARN_INFINITE_RECURSION = YES; ++ CLANG_WARN_INT_CONVERSION = YES; ++ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; ++ CLANG_WARN_SUSPICIOUS_MOVE = YES; ++ CLANG_WARN_UNREACHABLE_CODE = YES; ++ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; ++ CODE_SIGN_IDENTITY = "-"; ++ COPY_PHASE_STRIP = NO; ++ DEBUG_INFORMATION_FORMAT = dwarf; ++ DEVELOPMENT_TEAM = 3P242C9ES5; ++ ENABLE_STRICT_OBJC_MSGSEND = YES; ++ ENABLE_TESTABILITY = YES; ++ EXECUTABLE_PREFIX = lib; ++ GCC_C_LANGUAGE_STANDARD = gnu99; ++ GCC_DYNAMIC_NO_PIC = NO; ++ GCC_NO_COMMON_BLOCKS = YES; ++ GCC_OPTIMIZATION_LEVEL = 0; ++ GCC_PREPROCESSOR_DEFINITIONS = ( ++ "DEBUG=1", ++ "$(inherited)", ++ ); ++ GCC_WARN_64_TO_32_BIT_CONVERSION = YES; ++ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; ++ GCC_WARN_UNDECLARED_SELECTOR = YES; ++ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; ++ GCC_WARN_UNUSED_FUNCTION = YES; ++ GCC_WARN_UNUSED_VARIABLE = YES; ++ MACOSX_DEPLOYMENT_TARGET = 10.12; ++ MTL_ENABLE_DEBUG_INFO = YES; ++ ONLY_ACTIVE_ARCH = YES; ++ PRIVATE_HEADERS_FOLDER_PATH = /usr/local/include/os/internal; ++ PRODUCT_NAME = "$(TARGET_NAME)"; ++ SDKROOT = macosx; ++ }; ++ name = Debug; ++ }; ++ 1F2E2B8B1ED4FFA300518432 /* Release */ = { ++ isa = XCBuildConfiguration; ++ buildSettings = { ++ ALWAYS_SEARCH_USER_PATHS = NO; ++ CLANG_ANALYZER_NONNULL = YES; ++ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; ++ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; ++ CLANG_CXX_LIBRARY = "libc++"; ++ CLANG_ENABLE_MODULES = YES; ++ CLANG_ENABLE_OBJC_ARC = YES; ++ CLANG_WARN_BOOL_CONVERSION = YES; ++ CLANG_WARN_CONSTANT_CONVERSION = YES; ++ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; ++ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; ++ CLANG_WARN_EMPTY_BODY = YES; ++ CLANG_WARN_ENUM_CONVERSION = YES; ++ CLANG_WARN_INFINITE_RECURSION = YES; ++ CLANG_WARN_INT_CONVERSION = YES; ++ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; ++ CLANG_WARN_SUSPICIOUS_MOVE = YES; ++ CLANG_WARN_UNREACHABLE_CODE = YES; ++ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; ++ CODE_SIGN_IDENTITY = "-"; ++ COPY_PHASE_STRIP = NO; ++ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ++ DEVELOPMENT_TEAM = 3P242C9ES5; ++ ENABLE_NS_ASSERTIONS = NO; ++ ENABLE_STRICT_OBJC_MSGSEND = YES; ++ EXECUTABLE_PREFIX = lib; ++ GCC_C_LANGUAGE_STANDARD = gnu99; ++ GCC_NO_COMMON_BLOCKS = YES; ++ GCC_WARN_64_TO_32_BIT_CONVERSION = YES; ++ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; ++ GCC_WARN_UNDECLARED_SELECTOR = YES; ++ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; ++ GCC_WARN_UNUSED_FUNCTION = YES; ++ GCC_WARN_UNUSED_VARIABLE = YES; ++ MACOSX_DEPLOYMENT_TARGET = 10.12; ++ MTL_ENABLE_DEBUG_INFO = NO; ++ PRIVATE_HEADERS_FOLDER_PATH = /usr/local/include/os/internal; ++ PRODUCT_NAME = "$(TARGET_NAME)"; ++ SDKROOT = macosx; ++ }; ++ name = Release; ++ }; ++/* End XCBuildConfiguration section */ ++ ++/* Begin XCConfigurationList section */ ++ 1F2E2AC61ED4F80200518432 /* Build configuration list for PBXProject "libplatform" */ = { ++ isa = XCConfigurationList; ++ buildConfigurations = ( ++ 1F2E2AC71ED4F80200518432 /* Debug */, ++ 1F2E2AC81ED4F80200518432 /* Release */, ++ ); ++ defaultConfigurationIsVisible = 0; ++ defaultConfigurationName = Release; ++ }; ++ 1F2E2B811ED4FF8300518432 /* Build configuration list for PBXNativeTarget "os headers" */ = { ++ isa = XCConfigurationList; ++ buildConfigurations = ( ++ 1F2E2B821ED4FF8300518432 /* Debug */, ++ 1F2E2B831ED4FF8300518432 /* Release */, ++ ); ++ defaultConfigurationIsVisible = 0; ++ }; ++ 1F2E2B891ED4FFA300518432 /* Build configuration list for PBXNativeTarget "os_internal headers" */ = { ++ isa = XCConfigurationList; ++ buildConfigurations = ( ++ 1F2E2B8A1ED4FFA300518432 /* Debug */, ++ 1F2E2B8B1ED4FFA300518432 /* Release */, ++ ); ++ defaultConfigurationIsVisible = 0; ++ }; ++/* End XCConfigurationList section */ ++ }; ++ rootObject = 1F2E2AC31ED4F80200518432 /* Project object */; ++} +diff --git a/libplatform.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/libplatform.xcodeproj/project.xcworkspace/contents.xcworkspacedata +new file mode 100644 +index 0000000..aa6ce5d +--- /dev/null ++++ b/libplatform.xcodeproj/project.xcworkspace/contents.xcworkspacedata +@@ -0,0 +1,7 @@ ++ ++ ++ ++ ++ diff --git a/patches/xnu-3789.51.2.fix-codesign.p1.patch b/patches/xnu-3789.51.2.fix-codesign.p1.patch new file mode 100644 index 0000000..e39071d --- /dev/null +++ b/patches/xnu-3789.51.2.fix-codesign.p1.patch @@ -0,0 +1,91 @@ +diff --git a/SETUP/config/Makefile b/SETUP/config/Makefile +index 56032b4..1e73452 100644 +--- a/SETUP/config/Makefile ++++ b/SETUP/config/Makefile +@@ -20,7 +20,7 @@ config: $(OBJS) + @echo "$(ColorH)HOST_LD$(Color0) $(ColorF)$@$(Color0)" + $(_v)$(HOST_CC) $(LDFLAGS) -o $@ $^ + @echo "$(ColorH)HOST_CODESIGN$(Color0) $(ColorF)$@$(Color0)" +- $(_v)env CODESIGN_ALLOCATE=$(HOST_CODESIGN_ALLOCATE) $(HOST_CODESIGN) -s - $@ ++ $(_v)env $(HOST_CODESIGN) -s - $@ + + %.o: %.c + @echo "$(ColorH)HOST_CC$(Color0) $(ColorF)$@$(Color0)" +diff --git a/SETUP/decomment/Makefile b/SETUP/decomment/Makefile +index 7018eb1..877ca15 100644 +--- a/SETUP/decomment/Makefile ++++ b/SETUP/decomment/Makefile +@@ -18,7 +18,7 @@ decomment: $(OBJS) + @echo "$(ColorH)HOST_LD$(Color0) $(ColorF)$@$(Color0)" + $(_v)$(HOST_CC) $(LDFLAGS) -o $@ $^ + @echo "$(ColorH)HOST_CODESIGN$(Color0) $(ColorF)$@$(Color0)" +- $(_v)env CODESIGN_ALLOCATE=$(HOST_CODESIGN_ALLOCATE) $(HOST_CODESIGN) -s - $@ ++ $(_v)env $(HOST_CODESIGN) -s - $@ + + %.o: %.c + @echo "$(ColorH)HOST_CC$(Color0) $(ColorF)$@$(Color0)" +diff --git a/SETUP/installfile/Makefile b/SETUP/installfile/Makefile +index eb1f3af..a74b483 100644 +--- a/SETUP/installfile/Makefile ++++ b/SETUP/installfile/Makefile +@@ -18,7 +18,7 @@ installfile: $(OBJS) + @echo "$(ColorH)HOST_LD$(Color0) $(ColorF)$@$(Color0)" + $(_v)$(HOST_CC) $(LDFLAGS) -o $@ $^ + @echo "$(ColorH)HOST_CODESIGN$(Color0) $(ColorF)$@$(Color0)" +- $(_v)env CODESIGN_ALLOCATE=$(HOST_CODESIGN_ALLOCATE) $(HOST_CODESIGN) -s - $@ ++ $(_v)env $(HOST_CODESIGN) -s - $@ + + %.o: %.c + @echo "$(ColorH)HOST_CC$(Color0) $(ColorF)$@$(Color0)" +diff --git a/SETUP/json_compilation_db/Makefile b/SETUP/json_compilation_db/Makefile +index 518644c..bf453c3 100644 +--- a/SETUP/json_compilation_db/Makefile ++++ b/SETUP/json_compilation_db/Makefile +@@ -18,7 +18,7 @@ json_compilation_db: $(OBJS) + @echo "$(ColorH)HOST_LD$(Color0) $(ColorF)$@$(Color0)" + $(_v)$(HOST_CC) $(LDFLAGS) -o $@ $^ + @echo "$(ColorH)HOST_CODESIGN$(Color0) $(ColorF)$@$(Color0)" +- $(_v)env CODESIGN_ALLOCATE=$(HOST_CODESIGN_ALLOCATE) $(HOST_CODESIGN) -s - $@ ++ $(_v)env $(HOST_CODESIGN) -s - $@ + + %.o: %.c + @echo "$(ColorH)HOST_CC$(Color0) $(ColorF)$@$(Color0)" +diff --git a/SETUP/kextsymboltool/Makefile b/SETUP/kextsymboltool/Makefile +index af6cdca..e38782f 100644 +--- a/SETUP/kextsymboltool/Makefile ++++ b/SETUP/kextsymboltool/Makefile +@@ -18,7 +18,7 @@ kextsymboltool: $(OBJS) + @echo "$(ColorH)HOST_LD$(Color0) $(ColorF)$@$(Color0)" + $(_v)$(HOST_CC) $(LDFLAGS) -o $@ $^ + @echo "$(ColorH)HOST_CODESIGN$(Color0) $(ColorF)$@$(Color0)" +- $(_v)env CODESIGN_ALLOCATE=$(HOST_CODESIGN_ALLOCATE) $(HOST_CODESIGN) -s - $@ ++ $(_v)env $(HOST_CODESIGN) -s - $@ + + %.o: %.c + @echo "$(ColorH)HOST_CC$(Color0) $(ColorF)$@$(Color0)" +diff --git a/SETUP/replacecontents/Makefile b/SETUP/replacecontents/Makefile +index e1e8484..44b81b9 100644 +--- a/SETUP/replacecontents/Makefile ++++ b/SETUP/replacecontents/Makefile +@@ -18,7 +18,7 @@ replacecontents: $(OBJS) + @echo "$(ColorH)HOST_LD$(Color0) $(ColorF)$@$(Color0)" + $(_v)$(HOST_CC) $(LDFLAGS) -o $@ $^ + @echo "$(ColorH)HOST_CODESIGN$(Color0) $(ColorF)$@$(Color0)" +- $(_v)env CODESIGN_ALLOCATE=$(HOST_CODESIGN_ALLOCATE) $(HOST_CODESIGN) -s - $@ ++ $(_v)env $(HOST_CODESIGN) -s - $@ + + %.o: %.c + @echo "$(ColorH)HOST_CC$(Color0) $(ColorF)$@$(Color0)" +diff --git a/SETUP/setsegname/Makefile b/SETUP/setsegname/Makefile +index 7e9224e..c2ed335 100644 +--- a/SETUP/setsegname/Makefile ++++ b/SETUP/setsegname/Makefile +@@ -18,7 +18,7 @@ setsegname: $(OBJS) + @echo "$(ColorH)HOST_LD$(Color0) $(ColorF)$@$(Color0)" + $(_v)$(HOST_CC) $(LDFLAGS) -o $@ $^ + @echo "$(ColorH)HOST_CODESIGN$(Color0) $(ColorF)$@$(Color0)" +- $(_v)env CODESIGN_ALLOCATE=$(HOST_CODESIGN_ALLOCATE) $(HOST_CODESIGN) -s - $@ ++ $(_v)env $(HOST_CODESIGN) -s - $@ + + %.o: %.c + @echo "$(ColorH)HOST_CC$(Color0) $(ColorF)$@$(Color0)" diff --git a/patches/xnu-3789.51.2.fix-path.patch b/patches/xnu-3789.51.2.fix-path.patch new file mode 100644 index 0000000..70a110b --- /dev/null +++ b/patches/xnu-3789.51.2.fix-path.patch @@ -0,0 +1,31 @@ +--- ../xnu-3789.51.2.orig/bsd/sys/make_symbol_aliasing.sh 2017-05-23 18:07:20.000000000 -0400 ++++ bsd/sys/make_symbol_aliasing.sh 2017-05-23 17:57:10.000000000 -0400 +@@ -34,8 +34,8 @@ + SDKROOT="$1" + OUTPUT="$2" + +-if [ ! -x "${SDKROOT}/usr/local/libexec/availability.pl" ] ; then +- echo "Unable to locate ${SDKROOT}/usr/local/libexec/availability.pl (or not executable)" >&2 ++if [ ! -x "/usr/local/libexec/availability.pl" ] ; then ++ echo "Unable to locate /usr/local/libexec/availability.pl (or not executable)" >&2 + exit 1 + fi + +@@ -74,7 +74,7 @@ + + EOF + +-for ver in $(${SDKROOT}/usr/local/libexec/availability.pl --ios) ; do ++for ver in $(/usr/local/libexec/availability.pl --ios) ; do + ver_major=${ver%.*} + ver_minor=${ver#*.} + value=$(printf "%d%02d00" ${ver_major} ${ver_minor}) +@@ -87,7 +87,7 @@ + echo "" + done + +-for ver in $(${SDKROOT}/usr/local/libexec/availability.pl --macosx) ; do ++for ver in $(/usr/local/libexec/availability.pl --macosx) ; do + set -- $(echo "$ver" | tr '.' ' ') + ver_major=$1 + ver_minor=$2 From 0285813b77fcb6d1e1765f4710c5ea249623f365 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 23 Jul 2017 20:54:58 -0400 Subject: [PATCH 037/382] Add support for macOS High Sierra to installXcode_Modern --- darwinbuild/installXcode_Modern | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/darwinbuild/installXcode_Modern b/darwinbuild/installXcode_Modern index 62a9197..cbe2fec 100755 --- a/darwinbuild/installXcode_Modern +++ b/darwinbuild/installXcode_Modern @@ -35,6 +35,7 @@ do_ditto () { ditto "$path" "$BUILDROOT/$path" || exit 1 } +HOST_DARWIN_VERSION=$(sw_vers -productVersion) BUILDROOT="$1" mkdir -p "$BUILDROOT" @@ -65,5 +66,10 @@ mkdir -p $BUILDOROT/$(getconf DARWIN_USER_TEMP_DIR) mkdir -p $BUILDROOT/$(getconf DARWIN_USER_CACHE_DIR) # Now I must remove a symbolic link, or darwinbuild will fail later. -rm $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mv $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk +if [ "$HOST_DARWIN_VERSION" == "10.13" ]; then + rm $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk + mv $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk +elif [ "$HOST_DARWIN_VERSION" == "10.12" ]; then + rm $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk + mv $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk +fi From f0230105ebc5c6e8f9f99af3c1922d5b77e787da Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 23 Jul 2017 21:26:08 -0400 Subject: [PATCH 038/382] Create the symbolic link required by xcode-select --- darwinbuild/installXcode_Modern | 3 +++ 1 file changed, 3 insertions(+) diff --git a/darwinbuild/installXcode_Modern b/darwinbuild/installXcode_Modern index cbe2fec..6c3f3ef 100755 --- a/darwinbuild/installXcode_Modern +++ b/darwinbuild/installXcode_Modern @@ -69,6 +69,9 @@ mkdir -p $BUILDROOT/$(getconf DARWIN_USER_CACHE_DIR) if [ "$HOST_DARWIN_VERSION" == "10.13" ]; then rm $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk mv $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk + + mkdir -p $BUILDROOT/var/db + ln -s /Applications/Xcode.app/Contents/Developer $BUILDROOT/var/db/xcode_select_link elif [ "$HOST_DARWIN_VERSION" == "10.12" ]; then rm $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk mv $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk From 128a509c168bac8e6e9b3233e05c72a43667a004 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 23 Jul 2017 21:26:16 -0400 Subject: [PATCH 039/382] Typo fix --- darwinbuild/installXcode_Modern | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/installXcode_Modern b/darwinbuild/installXcode_Modern index 6c3f3ef..0c35a9d 100755 --- a/darwinbuild/installXcode_Modern +++ b/darwinbuild/installXcode_Modern @@ -62,7 +62,7 @@ ditto /System/Library/CoreServices/SystemVersion.plist $BUILDROOT/System/Library # While not strictly part of Xcode, without them the tools will crash. mkdir -p $BUILDROOT/Users/$(whoami) mkdir -p $BUILDROOT/$(getconf DARWIN_USER_DIR) -mkdir -p $BUILDOROT/$(getconf DARWIN_USER_TEMP_DIR) +mkdir -p $BUILDROOT/$(getconf DARWIN_USER_TEMP_DIR) mkdir -p $BUILDROOT/$(getconf DARWIN_USER_CACHE_DIR) # Now I must remove a symbolic link, or darwinbuild will fail later. From 294d3a2ed43b7e9644f4d278b43d1cbee14e3071 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 23 Jul 2017 21:27:02 -0400 Subject: [PATCH 040/382] Remove outdated comment This block of code is no longer limited to merely removing a symlink. It now contains all code that is specific to getting the chroot to work given a specific macOS version and Xcode version. --- darwinbuild/installXcode_Modern | 1 - 1 file changed, 1 deletion(-) diff --git a/darwinbuild/installXcode_Modern b/darwinbuild/installXcode_Modern index 0c35a9d..6e6221f 100755 --- a/darwinbuild/installXcode_Modern +++ b/darwinbuild/installXcode_Modern @@ -65,7 +65,6 @@ mkdir -p $BUILDROOT/$(getconf DARWIN_USER_DIR) mkdir -p $BUILDROOT/$(getconf DARWIN_USER_TEMP_DIR) mkdir -p $BUILDROOT/$(getconf DARWIN_USER_CACHE_DIR) -# Now I must remove a symbolic link, or darwinbuild will fail later. if [ "$HOST_DARWIN_VERSION" == "10.13" ]; then rm $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk mv $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk From e77a16afc1319ba62872e816bba999755e4906b5 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 23 Jul 2017 21:30:21 -0400 Subject: [PATCH 041/382] Don't rely on the presence of a symbolic link --- darwinbuild/installXcode_Modern | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/darwinbuild/installXcode_Modern b/darwinbuild/installXcode_Modern index 6e6221f..464c3e6 100755 --- a/darwinbuild/installXcode_Modern +++ b/darwinbuild/installXcode_Modern @@ -69,8 +69,8 @@ if [ "$HOST_DARWIN_VERSION" == "10.13" ]; then rm $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk mv $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk - mkdir -p $BUILDROOT/var/db - ln -s /Applications/Xcode.app/Contents/Developer $BUILDROOT/var/db/xcode_select_link + mkdir -p $BUILDROOT/private/var/db + ln -s /Applications/Xcode.app/Contents/Developer $BUILDROOT/private/var/db/xcode_select_link elif [ "$HOST_DARWIN_VERSION" == "10.12" ]; then rm $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk mv $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk From c964eca50314a28ecdd375b6f19299d7148e4e5d Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 23 Jul 2017 21:52:32 -0400 Subject: [PATCH 042/382] Create the chroot before installing the Xcode tools This solves an issue wherein xcode-select would not be able to find the path to the Xcode directory. --- darwinbuild/darwinbuild.in | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index dd624f0..56ccaaf 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -607,16 +607,6 @@ fi receipts="$BuildRoot/usr/local/darwinbuild/receipts" mkdir -p "$receipts" -### xcodebuild is a special case because it is not open source -### we try to integrate the host copy of Xcode if required -if [ $INSTALL_XCODE == "YES" ]; then - if [ ! -f "$receipts/xcodebuild" ]; then - echo "*** Installing Xcode Tools ..." - "$DATADIR/installXcode" "$BuildRoot" "$PWDP" - touch "$receipts/xcodebuild" - fi -fi - ### ### If we are going to build in a chroot, ### install the roots into the BuildRoot. @@ -656,6 +646,16 @@ if [ "$NEED_ROOTS" == "YES" -a "$noload" != "YES" ]; then fi +### xcodebuild is a special case because it is not open source +### we try to integrate the host copy of Xcode if required +if [ $INSTALL_XCODE == "YES" ]; then + if [ ! -f "$receipts/xcodebuild" ]; then + echo "*** Installing Xcode Tools ..." + "$DATADIR/installXcode" "$BuildRoot" "$PWDP" + touch "$receipts/xcodebuild" + fi +fi + ### ### Read in the environment ### From 745fd7b299ec45c2203112a1e30e446e6e3c2723 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 24 Jul 2017 12:13:54 -0400 Subject: [PATCH 043/382] Make xcodebuild work inside a chroot High Sierra does not allow processes with entitlements to run inside a chroot. Therefore, I must strip the entitlements and re-sign xcodebuild. Hopefully, this won't break anything. --- darwinbuild/installXcode_Modern | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/darwinbuild/installXcode_Modern b/darwinbuild/installXcode_Modern index 464c3e6..d8562ca 100755 --- a/darwinbuild/installXcode_Modern +++ b/darwinbuild/installXcode_Modern @@ -71,6 +71,20 @@ if [ "$HOST_DARWIN_VERSION" == "10.13" ]; then mkdir -p $BUILDROOT/private/var/db ln -s /Applications/Xcode.app/Contents/Developer $BUILDROOT/private/var/db/xcode_select_link + + # High Sierra does not allow processes with entitlements to run inside a chroot. + # Therefore, I must strip the entitlements and re-sign xcodebuild. + # Hopefully, this won't break anything. + cat < $BUILDROOT/private/tmp/empty.entitlements + + + + + + +EOF + + codesign -s - -f --entitlements $BUILDROOT/private/tmp/empty.entitlements $BUILDROOT/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild elif [ "$HOST_DARWIN_VERSION" == "10.12" ]; then rm $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk mv $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk From 5d80528a15f7519430bee238c1599c422866132e Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 24 Jul 2017 16:42:07 -0400 Subject: [PATCH 044/382] Write out the correct SDK version --- darwinbuild/installXcode.in | 3 +-- darwinbuild/installXcode_Modern | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/darwinbuild/installXcode.in b/darwinbuild/installXcode.in index eaad285..1f81156 100644 --- a/darwinbuild/installXcode.in +++ b/darwinbuild/installXcode.in @@ -7,8 +7,7 @@ BROOT=$1 VER=$(/usr/bin/xcodebuild -version | grep version | cut -d "-" -f 2 | cut -d ";" -f 1 | cut -d "." -f 1) if [ -e /Applications/Xcode.app ]; then - "$BINDIR/installXcode_Modern" "$BROOT" - echo macosx10.12 > $2/.build/platform + "$BINDIR/installXcode_Modern" "$BROOT" "$2" exit 0 fi diff --git a/darwinbuild/installXcode_Modern b/darwinbuild/installXcode_Modern index d8562ca..a04793e 100755 --- a/darwinbuild/installXcode_Modern +++ b/darwinbuild/installXcode_Modern @@ -85,7 +85,11 @@ if [ "$HOST_DARWIN_VERSION" == "10.13" ]; then EOF codesign -s - -f --entitlements $BUILDROOT/private/tmp/empty.entitlements $BUILDROOT/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild + + echo macosx10.13 > $2/.build/platform elif [ "$HOST_DARWIN_VERSION" == "10.12" ]; then rm $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk mv $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk + + echo macosx10.12 > $2/.build/platform fi From 8351bca1839fb026bd34ec31d3c878858a2d586e Mon Sep 17 00:00:00 2001 From: William Kent Date: Wed, 26 Jul 2017 10:53:05 -0400 Subject: [PATCH 045/382] Use the correct SDK version --- darwinbuild/installXcode_Modern | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/installXcode_Modern b/darwinbuild/installXcode_Modern index a04793e..d856e51 100755 --- a/darwinbuild/installXcode_Modern +++ b/darwinbuild/installXcode_Modern @@ -67,7 +67,7 @@ mkdir -p $BUILDROOT/$(getconf DARWIN_USER_CACHE_DIR) if [ "$HOST_DARWIN_VERSION" == "10.13" ]; then rm $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk - mv $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk + mv $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk mkdir -p $BUILDROOT/private/var/db ln -s /Applications/Xcode.app/Contents/Developer $BUILDROOT/private/var/db/xcode_select_link From 6c82c66884623bb3d70df81d8c084217e75a37ec Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 27 Jul 2017 20:38:50 -0400 Subject: [PATCH 046/382] Always copy Xcode into the chroot xcodebuild et al are now required for any compilation, including those done using make. --- darwinbuild/darwinbuild.in | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 56ccaaf..ae2ec75 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -595,12 +595,6 @@ if [ -n "$numfiles" ]; then export INSTALL_XCODE="YES" else buildtool="make" - - # test for hybrid make-xcode project - uses_xcrun=$(grep -Elir 'xcodebuild|xcrun|Commands.make|BSDCommon.make|Standard.make|Common.make' .) - if [ -n "$uses_xcrun" -a $USE_CHROOT == "YES" ]; then - export INSTALL_XCODE="YES" - fi fi @@ -646,14 +640,10 @@ if [ "$NEED_ROOTS" == "YES" -a "$noload" != "YES" ]; then fi -### xcodebuild is a special case because it is not open source -### we try to integrate the host copy of Xcode if required -if [ $INSTALL_XCODE == "YES" ]; then - if [ ! -f "$receipts/xcodebuild" ]; then - echo "*** Installing Xcode Tools ..." - "$DATADIR/installXcode" "$BuildRoot" "$PWDP" - touch "$receipts/xcodebuild" - fi +if [ ! -f "$receipts/xcodebuild" ]; then + echo "*** Installing Xcode Tools ..." + "$DATADIR/installXcode" "$BuildRoot" "$PWDP" + touch "$receipts/xcodebuild" fi ### From 9fdf3dc019635cf7ffd9d880bc7264198970c1d0 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 20 Aug 2017 13:13:10 -0400 Subject: [PATCH 047/382] Add patch for xnu This patch resolves warnings caused by the Xcode 9 compiler, which were causing the build to fail because xnu compiles with -Werror. --- .../xnu-3789.51.2.xcode9-warnings.p1.patch | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 patches/xnu-3789.51.2.xcode9-warnings.p1.patch diff --git a/patches/xnu-3789.51.2.xcode9-warnings.p1.patch b/patches/xnu-3789.51.2.xcode9-warnings.p1.patch new file mode 100644 index 0000000..499a189 --- /dev/null +++ b/patches/xnu-3789.51.2.xcode9-warnings.p1.patch @@ -0,0 +1,37 @@ +diff --git a/makedefs/MakeInc.def b/makedefs/MakeInc.def +index 9edf262..31825ce 100644 +--- a/makedefs/MakeInc.def ++++ b/makedefs/MakeInc.def +@@ -99,13 +99,16 @@ CWARNFLAGS_STD = \ + -Wno-bad-function-cast \ + -Wno-c++98-compat \ + -Wno-c++-compat \ ++ -Wno-cast-align \ + -Wno-conditional-uninitialized \ + -Wno-conversion \ + -Wno-covered-switch-default \ + -Wno-disabled-macro-expansion \ + -Wno-documentation-unknown-command \ ++ -Wno-format-invalid-specifier \ + -Wno-format-non-iso \ + -Wno-format-nonliteral \ ++ -Wno-ignored-attributes \ + -Wno-reserved-id-macro \ + -Wno-language-extension-token \ + -Wno-missing-variable-declarations \ +@@ -114,6 +117,7 @@ CWARNFLAGS_STD = \ + -Wno-partial-availability \ + -Wno-pedantic \ + -Wno-shift-sign-overflow \ ++ -Wno-strict-prototypes \ + -Wno-switch-enum \ + -Wno-undef \ + -Wno-unused-macros \ +@@ -148,6 +152,7 @@ CXXWARNFLAGS_STD = \ + -Wno-format-non-iso \ + -Wno-format-nonliteral \ + -Wno-global-constructors \ ++ -Wno-ignored-attributes \ + -Wno-reserved-id-macro \ + -Wno-language-extension-token \ + -Wno-missing-variable-declarations \ From 92e35041af33aca5dfe0493097683c5a52a9b6a0 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 20 Aug 2017 14:24:41 -0400 Subject: [PATCH 048/382] Add xnu copyright check patch With this patch applied, kexts no longer need to specify their copyright string as being in the name of "Apple Inc." to reference certain kernel APIs. The kernel will also accept a copyright string referencing "PureDarwin Project". --- .../xnu-3789.51.2.copyright-check.p1.patch | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 patches/xnu-3789.51.2.copyright-check.p1.patch diff --git a/patches/xnu-3789.51.2.copyright-check.p1.patch b/patches/xnu-3789.51.2.copyright-check.p1.patch new file mode 100644 index 0000000..3801639 --- /dev/null +++ b/patches/xnu-3789.51.2.copyright-check.p1.patch @@ -0,0 +1,22 @@ +diff --git a/libkern/kxld/kxld_copyright.c b/libkern/kxld/kxld_copyright.c +index e1f13c2..8664226 100644 +--- a/libkern/kxld/kxld_copyright.c ++++ b/libkern/kxld/kxld_copyright.c +@@ -49,6 +49,7 @@ + + #define kCopyrightToken "Copyright © " + #define kRightsToken " Apple Inc. All rights reserved." ++#define kRightsTokenPD " PureDarwin Project. All rights reserved." + + /****************************************************************************** + * Globals +@@ -252,6 +253,9 @@ kxld_validate_copyright_string(const char *str) + + copyright = kxld_strstr(str, kCopyrightToken); + rights = kxld_strstr(str, kRightsToken); ++ if (!rights) { ++ rights = kxld_strstr(str, kRightsTokenPD); ++ } + + if (!copyright || !rights || copyright > rights) goto finish; + From 21933c7cd3031e8554c0a59487115b261faf9a74 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 20 Aug 2017 20:00:43 -0400 Subject: [PATCH 049/382] Add a script to fetch a release tarball from GitHub --- darwinbuild/fetch-from-github | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 darwinbuild/fetch-from-github diff --git a/darwinbuild/fetch-from-github b/darwinbuild/fetch-from-github new file mode 100755 index 0000000..7f335f6 --- /dev/null +++ b/darwinbuild/fetch-from-github @@ -0,0 +1,42 @@ +#!/bin/bash + +DARWINBUILD_PLIST=$1 +PROJECT_NAME=$2 +PROJECT_VERSION=$3 +SOURCES_DIR=$4 + +EXTRACT_SCRIPT_FILENAME=$(mktemp /tmp/darwinbuild-fetch-from-github.XXXXXXXXXX) +cat > $EXTRACT_SCRIPT_FILENAME < /dev/null || { + echo Python extraction script failed 1>&2 + rm $EXTRACT_SCRIPT_FILENAME + exit 1 +} + +GITHUB_PROJECT=$(python $EXTRACT_SCRIPT_FILENAME $DARWINBUILD_PLIST $PROJECT_NAME) +GITHUB_URL=https://github.com/${GITHUB_PROJECT}/archive/${PROJECT_VERSION}.tar.gz + +echo -n "Attempting download from $GITHUB_URL " +curl -Ls -o "${SOURCES_DIR}/${PROJECT_NAME}-${PROJECT_VERSION}.tar.gz" "${GITHUB_URL}" +CURL_STATUS=$? + +rm -f $EXTRACT_SCRIPT_FILENAME +if [ $CURL_STATUS = 0 ]; then + echo "- OK" + exit 0 +else + echo "- not found" + exit 1 +fi From d701ca278ee05c13f51a286f096703af02b40268 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 20 Aug 2017 20:10:04 -0400 Subject: [PATCH 050/382] Fix bug in fetch-from-github fetch-from-github no longer fails when it tries to compute the GitHub URL for a darwinbuild project that does not have one. In that case, it now exits silently, without downloading anything. --- darwinbuild/fetch-from-github | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/darwinbuild/fetch-from-github b/darwinbuild/fetch-from-github index 7f335f6..0c52964 100755 --- a/darwinbuild/fetch-from-github +++ b/darwinbuild/fetch-from-github @@ -14,7 +14,9 @@ import sys filename = sys.argv[1] project = sys.argv[2] pl = plistlib.readPlist(filename) -print(pl['projects'][project]['github']) + +if 'github' in pl['projects'][project]: + print(pl['projects'][project]['github']) EOF # Check to see if the Python script fails. @@ -26,6 +28,8 @@ python $EXTRACT_SCRIPT_FILENAME $DARWINBUILD_PLIST $PROJECT_NAME 1> /dev/null || } GITHUB_PROJECT=$(python $EXTRACT_SCRIPT_FILENAME $DARWINBUILD_PLIST $PROJECT_NAME) +[ "$GITHUB_PROJECT" = "" ] && exit + GITHUB_URL=https://github.com/${GITHUB_PROJECT}/archive/${PROJECT_VERSION}.tar.gz echo -n "Attempting download from $GITHUB_URL " From 28583b321aa7fc959c2adc037999176f743706bf Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 20 Aug 2017 20:16:13 -0400 Subject: [PATCH 051/382] Install the fetch-from-github script --- darwinbuild.xcodeproj/project.pbxproj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 98013c1..b361e92 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -90,6 +90,7 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ + 1F514C441F4A5CDA008D9341 /* fetch-from-github in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1F514C431F4A5CC0008D9341 /* fetch-from-github */; }; 1FC854011ED462EE00EA2AF5 /* installXcode_Modern in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1FC854001ED462DF00EA2AF5 /* installXcode_Modern */; }; 3963011A1EAB4D60006081C7 /* source_sites.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86C0E10965EEA00C66E90 /* source_sites.c */; }; 396301211EAB4E01006081C7 /* patch_sites.c in Sources */ = {isa = PBXBuildFile; fileRef = 396301191EAB42B6006081C7 /* patch_sites.c */; }; @@ -630,6 +631,7 @@ dstPath = "$(DATDIR)/darwinbuild"; dstSubfolderSpec = 0; files = ( + 1F514C441F4A5CDA008D9341 /* fetch-from-github in CopyFiles */, 1FC854011ED462EE00EA2AF5 /* installXcode_Modern in CopyFiles */, 7227AD1C109A05FA00BE33D7 /* buildlist in CopyFiles */, 7227AD1D109A05FA00BE33D7 /* buildorder in CopyFiles */, @@ -660,6 +662,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 1F514C431F4A5CC0008D9341 /* fetch-from-github */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = "fetch-from-github"; path = "darwinbuild/fetch-from-github"; sourceTree = ""; }; 1FC854001ED462DF00EA2AF5 /* installXcode_Modern */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = installXcode_Modern; path = darwinbuild/installXcode_Modern; sourceTree = ""; }; 396301191EAB42B6006081C7 /* patch_sites.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = patch_sites.c; sourceTree = ""; }; 396301271EAB4E01006081C7 /* patch_sites.so */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.objfile"; includeInIndex = 0; path = patch_sites.so; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -1057,6 +1060,7 @@ 72C86BD510965DC900C66E90 /* darwinbuild */ = { isa = PBXGroup; children = ( + 1F514C431F4A5CC0008D9341 /* fetch-from-github */, 720BE2E9120C909E00B3C4A5 /* digest.c */, 7227AB871098A7BF00BE33D7 /* buildlist */, 7227AB881098A7BF00BE33D7 /* buildorder */, From fcb78aee4d689837909a28f3c99cc7059cd974e7 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 20 Aug 2017 20:19:56 -0400 Subject: [PATCH 052/382] Make darwinxref silently ignore unrecognized properties Previously, it would exit with an error if it found one. --- darwinxref/DBDataStore.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/darwinxref/DBDataStore.c b/darwinxref/DBDataStore.c index 1f67107..492a599 100644 --- a/darwinxref/DBDataStore.c +++ b/darwinxref/DBDataStore.c @@ -557,8 +557,8 @@ int DBSetProp(CFStringRef build, CFStringRef project, CFStringRef property, CFTy int res = 0; CFTypeID type = DBCopyPropType(property); if (type == -1) { - cfprintf(stderr, "Error: unknown property in project \"%@\": %@\n", project, property); - return -1; + // Silently ignore unknown properties. + return 0; } if (type != CFGetTypeID(value)) { CFStringRef expected = CFCopyTypeIDDescription(type); From 6b747fa989e81dcf647aa6554357e4d8c7ab5e76 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 20 Aug 2017 20:22:19 -0400 Subject: [PATCH 053/382] darwinbuild now calls fetch-from-github where appropriate --- darwinbuild/darwinbuild.in | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index dd624f0..97da0b0 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -462,6 +462,13 @@ if [ "$nosource" != "YES" ]; then Download "$SourceCache" "$filename" "$($DARWINXREF source_sites $projnam)" fi + if [ ! -f "$SourceCache/$filename" ]; then + github_projname=$(echo $filename | sed -e 's,-.*$,,') + github_projversion=$(echo $filename | sed -e 's,\.tar\.gz$,,' | sed -e 's,^.*-,,') + github_dxref_plist=.build/$($DARWINXREF currentBuild).plist + $DATADIR/fetch-from-github "$github_dxref_plist" $github_projname $github_projversion "$SourceCache" + fi + patchfilenames=$($DARWINXREF patchfiles $projnam) for p in $patchfilenames; do Download "$SourceCache" "$p" "$($DARWINXREF patch_sites $projnam)" From 0ab25113f4f6e2f196865bbbbfb1379a2f578747 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 20 Aug 2017 20:22:33 -0400 Subject: [PATCH 054/382] Adjust wording --- darwinbuild/fetch-from-github | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/fetch-from-github b/darwinbuild/fetch-from-github index 0c52964..1c5fb94 100755 --- a/darwinbuild/fetch-from-github +++ b/darwinbuild/fetch-from-github @@ -32,7 +32,7 @@ GITHUB_PROJECT=$(python $EXTRACT_SCRIPT_FILENAME $DARWINBUILD_PLIST $PROJECT_NAM GITHUB_URL=https://github.com/${GITHUB_PROJECT}/archive/${PROJECT_VERSION}.tar.gz -echo -n "Attempting download from $GITHUB_URL " +echo -n "Downloading $GITHUB_URL " curl -Ls -o "${SOURCES_DIR}/${PROJECT_NAME}-${PROJECT_VERSION}.tar.gz" "${GITHUB_URL}" CURL_STATUS=$? From 1f5b3ce1ac601fe38c6eafb4d3631c2bcfac1637 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 20 Aug 2017 20:24:22 -0400 Subject: [PATCH 055/382] Add copyright notice to fetch-from-github script --- darwinbuild/fetch-from-github | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/darwinbuild/fetch-from-github b/darwinbuild/fetch-from-github index 1c5fb94..2e7c986 100755 --- a/darwinbuild/fetch-from-github +++ b/darwinbuild/fetch-from-github @@ -1,4 +1,31 @@ #!/bin/bash +# +# Copyright (c) 2017 William Kent. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of +# its contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY ITS CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# DARWINBUILD_PLIST=$1 PROJECT_NAME=$2 From 047e46332ed6431fc761f0d2b06a9ec202b518f3 Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 25 Aug 2017 14:57:38 -0400 Subject: [PATCH 056/382] Make darwinmaster remove the Xcode.app directory Installations into $(SDKROOT) write into a deep subdirectory of Xcode.app, instead of /Developer as was custom when darwinmaster was first written. --- darwinbuild/darwinmaster.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/darwinbuild/darwinmaster.in b/darwinbuild/darwinmaster.in index d51e198..76c2219 100644 --- a/darwinbuild/darwinmaster.in +++ b/darwinbuild/darwinmaster.in @@ -189,11 +189,13 @@ export -n TMPDIR ### echo "Pruning ..." find "$DESTDIR" -type f \( -name '*.[ch]' -or -name '*.cp' -or -name '*.cpp' \) -print -exec rm -f {} ';' +rm -Rf "$DESTDIR/Applications/Xcode.app" rm -Rf "$DESTDIR/AppleInternal" rm -Rf "$DESTDIR/Developer" rm -Rf "$DESTDIR/usr/local" rm -Rf "$DESTDIR/usr/share/doc" rm -Rf "$DESTDIR"/usr/share/man/man3/* +rmdir "$DESTDIR/Applications" 2> /dev/null ### ### Modify the root password to blank From d2a1a481dcb11cb23fed51dea14afebf186bf814 Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 25 Aug 2017 14:58:06 -0400 Subject: [PATCH 057/382] Remove usage of long-since-removed nicl tool --- darwinbuild/darwinmaster.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinmaster.in b/darwinbuild/darwinmaster.in index 76c2219..c28ea41 100644 --- a/darwinbuild/darwinmaster.in +++ b/darwinbuild/darwinmaster.in @@ -201,7 +201,7 @@ rmdir "$DESTDIR/Applications" 2> /dev/null ### Modify the root password to blank ### echo "Modifying Root Password ..." -nicl -raw "$DESTDIR/var/db/netinfo/local.nidb" -create /users/root passwd '' +echo "(Not implemented, making no changes)" ### ### Copy installation packages From 92f71953b55683022f19c8d86a288fb24e30650c Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 25 Aug 2017 14:59:19 -0400 Subject: [PATCH 058/382] Do not hardcode a path to mkisofs, and error out if it was not found --- darwinbuild/darwinmaster.in | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/darwinbuild/darwinmaster.in b/darwinbuild/darwinmaster.in index c28ea41..3bec0c3 100644 --- a/darwinbuild/darwinmaster.in +++ b/darwinbuild/darwinmaster.in @@ -87,7 +87,6 @@ DMG="/tmp/$VOLNAME.dmg" CDR="/tmp/$VOLNAME.cdr" ISO="/tmp/$VOLNAME.iso" PKGDIR="$DARWIN_BUILDROOT/Packages" -MKISOFS="/opt/local/bin/mkisofs" SIZE="650m" if [ ! -z "$ARCH" ]; then ARCHSFX="_$ARCH" @@ -95,6 +94,12 @@ else ARCHSFX="" fi +MKISOFS=$(which mkisofs) +if [ -z "$MKISOFS" ]; then + echo "Error: mkisofs not found, this tool is required." 1>&2 + exit 1 +fi + export DARWINXREF_DB_FILE="$DARWIN_BUILDROOT/$XREFDB" ### From ac999e95e0cd4b387f4f772303d8e9d382e72bcd Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 25 Aug 2017 18:59:01 -0400 Subject: [PATCH 059/382] You can now set the mkisofs path in the environment --- darwinbuild/darwinmaster.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/darwinbuild/darwinmaster.in b/darwinbuild/darwinmaster.in index 3bec0c3..27d85d8 100644 --- a/darwinbuild/darwinmaster.in +++ b/darwinbuild/darwinmaster.in @@ -94,7 +94,10 @@ else ARCHSFX="" fi -MKISOFS=$(which mkisofs) +if [ -z "$MKISOFS" ]; then + MKISOFS=$(which mkisofs) +fi + if [ -z "$MKISOFS" ]; then echo "Error: mkisofs not found, this tool is required." 1>&2 exit 1 From 76fe6562164ec5de2acac9d419e3888de29b5eaf Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 25 Aug 2017 19:09:15 -0400 Subject: [PATCH 060/382] Remove the mkext cache generation from darwinmaster mkext caches aren't used any more. --- darwinbuild/darwinmaster.in | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/darwinbuild/darwinmaster.in b/darwinbuild/darwinmaster.in index 27d85d8..1af9977 100644 --- a/darwinbuild/darwinmaster.in +++ b/darwinbuild/darwinmaster.in @@ -178,20 +178,6 @@ for Project in $("$DARWINXREF" group boot) ; do InstallRoot "$DESTDIR" "$Project" "$build" done -### -### Generate the mkext cache -### -echo "Generating MKext ..." - -export TMPDIR="$DESTDIR/private/tmp" -if [ -z "$ARCH" ]; then - KEXTARCH="-a ppc -a i386" -else - KEXTARCH="-a $ARCH" -fi -kextcache $KEXTARCH -k -K "$DESTDIR/mach_kernel" -m "$DESTDIR/System/Library/Extensions.mkext" "$DESTDIR/System/Library/Extensions" -export -n TMPDIR - ### ### Remove extraneous files ### From 91539d33dc9e2d4afc7f84c0192a9fb7da47b7cd Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 25 Aug 2017 19:09:40 -0400 Subject: [PATCH 061/382] Tone down the verbosity of the pruning step --- darwinbuild/darwinmaster.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinmaster.in b/darwinbuild/darwinmaster.in index 1af9977..7ed3893 100644 --- a/darwinbuild/darwinmaster.in +++ b/darwinbuild/darwinmaster.in @@ -182,7 +182,7 @@ done ### Remove extraneous files ### echo "Pruning ..." -find "$DESTDIR" -type f \( -name '*.[ch]' -or -name '*.cp' -or -name '*.cpp' \) -print -exec rm -f {} ';' +find "$DESTDIR" -type f \( -name '*.[ch]' -or -name '*.cp' -or -name '*.cpp' \) -exec rm -f {} ';' rm -Rf "$DESTDIR/Applications/Xcode.app" rm -Rf "$DESTDIR/AppleInternal" rm -Rf "$DESTDIR/Developer" From 872d85be13285843cace85eb543d912d57f7e17f Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 25 Aug 2017 19:35:51 -0400 Subject: [PATCH 062/382] Remove unneeded, failing bless tool call --- darwinbuild/darwinmaster.in | 3 --- 1 file changed, 3 deletions(-) diff --git a/darwinbuild/darwinmaster.in b/darwinbuild/darwinmaster.in index 7ed3893..2891f54 100644 --- a/darwinbuild/darwinmaster.in +++ b/darwinbuild/darwinmaster.in @@ -283,9 +283,6 @@ elif [ "$ARCH" == "i386" -o -z "$ARCH" ]; then mkdir -p /mnt mount -t hfs -o perm "${DEV}s${SLICE}" /mnt ditto -rsrc "$DESTDIR" /mnt - bless -folder /mnt/System/Library/CoreServices \ - -bootinfo /mnt/usr/standalone/ppc/bootx.bootinfo \ - -label "$VOLNAME" umount /mnt hdiutil eject "$DEV" mv "$ISO.dmg" "$ISO" From fec3db8eb1463866236e3caa9152f0a91404a192 Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 25 Aug 2017 19:36:03 -0400 Subject: [PATCH 063/382] Add missing cleanup step --- darwinbuild/darwinmaster.in | 1 + 1 file changed, 1 insertion(+) diff --git a/darwinbuild/darwinmaster.in b/darwinbuild/darwinmaster.in index 2891f54..5910576 100644 --- a/darwinbuild/darwinmaster.in +++ b/darwinbuild/darwinmaster.in @@ -284,6 +284,7 @@ elif [ "$ARCH" == "i386" -o -z "$ARCH" ]; then mount -t hfs -o perm "${DEV}s${SLICE}" /mnt ditto -rsrc "$DESTDIR" /mnt umount /mnt + rmdir /mnt hdiutil eject "$DEV" mv "$ISO.dmg" "$ISO" fi From 6ebfaf9f2f4a19b22141ec3f8c15af909900c9b4 Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 25 Aug 2017 19:40:19 -0400 Subject: [PATCH 064/382] Remove ill-advised ditto function This was breaking darwinmaster. --- darwinbuild/darwinbuild.common | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index f370723..b115e20 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -91,19 +91,6 @@ function GetBuildVersion() { echo $maxbuild } -### -### Trap calls to ditto since it is only available on Mac OS X -### Warning: only supports the directory-to-directory form -function ditto() { - local srcdir="$1" - local dstdir="$2" - if [ -x /usr/bin/ditto ]; then - /usr/bin/ditto "$srcdir" "$dstdir" - else - tar c -C "$srcdir" . | tar xf - -C "$dstdir" - fi -} - CURLARGS=${CURLARGS:-} ### From bd7707cfcaa550d389cb236eb953df28436dcb09 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sat, 26 Aug 2017 13:38:41 -0400 Subject: [PATCH 065/382] Speed up the darwinmaster pruning process --- darwinbuild/darwinmaster.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinmaster.in b/darwinbuild/darwinmaster.in index 5910576..22c26c9 100644 --- a/darwinbuild/darwinmaster.in +++ b/darwinbuild/darwinmaster.in @@ -182,7 +182,7 @@ done ### Remove extraneous files ### echo "Pruning ..." -find "$DESTDIR" -type f \( -name '*.[ch]' -or -name '*.cp' -or -name '*.cpp' \) -exec rm -f {} ';' +find "$DESTDIR" -type f \( -name '*.[ch]' -or -name '*.cp' -or -name '*.cpp' \) -print0 | xargs -0 rm -f rm -Rf "$DESTDIR/Applications/Xcode.app" rm -Rf "$DESTDIR/AppleInternal" rm -Rf "$DESTDIR/Developer" From 6af657d181789601f1eaea54629819f9cbbaa9bf Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 27 Aug 2017 17:52:30 -0400 Subject: [PATCH 066/382] Properly unmount all disk images Previously, one of the disk images involved in the creation of the ISO would be left mounted, and identically-named DMGs would pile up following multiple runs of darwinmaster. --- darwinbuild/darwinmaster.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/darwinbuild/darwinmaster.in b/darwinbuild/darwinmaster.in index 22c26c9..4b0accc 100644 --- a/darwinbuild/darwinmaster.in +++ b/darwinbuild/darwinmaster.in @@ -169,7 +169,7 @@ DESTDIR=$(hdiutil attach "$DMG" \ ### ### Copy roots necessary for booting / installation onto disk image ### -cd "$DESTDIR" || exit +pushd "$DESTDIR" > /dev/null || exit chown root:admin "$DESTDIR" chmod 1775 "$DESTDIR" @@ -288,3 +288,6 @@ elif [ "$ARCH" == "i386" -o -z "$ARCH" ]; then hdiutil eject "$DEV" mv "$ISO.dmg" "$ISO" fi + +popd > /dev/null +hdiutil eject "$DESTDIR" From e307b32a3d316a362038640d98f0a1d205ff36d1 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 27 Aug 2017 17:56:07 -0400 Subject: [PATCH 067/382] Remove ppc support from darwinmaster Since modern Mac tooling can no longer produce PowerPC binaries, there is no point in special-casing darwinmaster to build a PowerPC-based ISO. --- darwinbuild/darwinmaster.in | 143 +++++++++++++----------------------- 1 file changed, 52 insertions(+), 91 deletions(-) diff --git a/darwinbuild/darwinmaster.in b/darwinbuild/darwinmaster.in index 4b0accc..cff2570 100644 --- a/darwinbuild/darwinmaster.in +++ b/darwinbuild/darwinmaster.in @@ -39,18 +39,15 @@ # Chuck Remes function PrintUsage() { - cat 1>&2 <<- EOB -usage: $(basename "$0") [-arch=arch] - arch = {ppc, i386} + cat 1>&2 <<-EOB +usage: $(basename "$0") EOB exit 1 } for ARG in "$@"; do if [ "$VOLNAME" == "" ]; then - if [ "${ARG/=*/}" == "-arch" ]; then - ARCH="${ARCH/*=/}" - elif [ "${ARG:0:1}" != "-" ]; then + if [ "${ARG:0:1}" != "-" ]; then VOLNAME="$ARG" else PrintUsage "$0" @@ -60,8 +57,7 @@ for ARG in "$@"; do fi done -if [ "$ARCH" != "" -a "$ARCH" != "ppc" -a "$ARCH" != "i386" \ - -o "$VOLNAME" == "" ]; then +if [ "$VOLNAME" == "" ]; then PrintUsage "$0" fi @@ -88,11 +84,6 @@ CDR="/tmp/$VOLNAME.cdr" ISO="/tmp/$VOLNAME.iso" PKGDIR="$DARWIN_BUILDROOT/Packages" SIZE="650m" -if [ ! -z "$ARCH" ]; then - ARCHSFX="_$ARCH" -else - ARCHSFX="" -fi if [ -z "$MKISOFS" ]; then MKISOFS=$(which mkisofs) @@ -144,13 +135,6 @@ export DARWINBUILD_BUILD="$build" ### "$DATADIR/packageRoots" -### -### Update thin packages -### -if [ ! -z "$ARCH" ]; then - "$DATADIR/thinPackages" "$ARCH" -fi - ### ### Mount a disk image, create if necessary @@ -200,21 +184,21 @@ echo "(Not implemented, making no changes)" ### ### Copy installation packages ### -mkdir -p "$DESTDIR/System/Installation/BinaryDrivers${ARCHSFX}" +mkdir -p "$DESTDIR/System/Installation/BinaryDrivers" echo "Copying binary drivers ..." -for X in $DARWIN_BUILDROOT/BinaryDrivers${ARCHSFX}/*-*.tar.bz2 ; do - Y="$DESTDIR"/System/Installation/BinaryDrivers${ARCHSFX}/$(basename $X) +for X in $DARWIN_BUILDROOT/BinaryDrivers/*-*.tar.bz2 ; do + Y="$DESTDIR"/System/Installation/BinaryDrivers/$(basename $X) if [ $X -nt $Y ]; then cp $X $Y fi done echo "Copying packages ..." -mkdir -p "$DESTDIR"/System/Installation/Packages${ARCHSFX} -for X in $DARWIN_BUILDROOT/Packages${ARCHSFX}/*-*.tar.bz2 ; do +mkdir -p "$DESTDIR"/System/Installation/Packages +for X in $DARWIN_BUILDROOT/Packages/*-*.tar.bz2 ; do f=$(basename $X) if [ "${f/-*/}" != "DarwinInstaller" ]; then - Y="$DESTDIR"/System/Installation/Packages${ARCHSFX}/$(basename $X) + Y="$DESTDIR"/System/Installation/Packages/$(basename $X) if [ $X -nt $Y ]; then echo $f cp $X $Y @@ -223,71 +207,48 @@ for X in $DARWIN_BUILDROOT/Packages${ARCHSFX}/*-*.tar.bz2 ; do done ### -### Architecture-specific boot setup -### -if [ "$ARCH" == "ppc" ]; then - ### - ### Bless the volume for powerpc booting - ### - echo "Blessing Volume ..." - bless --verbose \ - --label "$VOLNAME" \ - --folder "$DESTDIR/System/Library/CoreServices" \ - --bootinfo "$DESTDIR/usr/standalone/ppc/bootx.bootinfo" - - ### Generate CDR image - rm -f "$CDR" - hdiutil convert \ - "$DMG" \ - -format UDTO \ - -o "$CDR" - - -elif [ "$ARCH" == "i386" -o -z "$ARCH" ]; then - ### - ### Create a bootable ISO filesystem - ### - ditto "$DESTDIR/usr/standalone/i386" /tmp/i386 - rm -f "$ISO.boot" - $MKISOFS -R \ - -V "$VOLNAME" \ - -no-emul-boot \ - -T \ - -J \ - -c boot.cat \ - -b cdboot \ - -hide-joliet-trans-tbl \ - -quiet \ - -o "$ISO.boot" \ - /tmp/i386 - SECTORS=$(du "$ISO.boot" | tail -1 | awk '{print $1}') - - ### - ### Create a hybrid image - ### - rm -f "$ISO.dmg" - hdiutil create "$ISO.dmg" -size "$SIZE" -layout NONE - DEV=$(hdid -nomount "$ISO.dmg" | tail -1 | awk '{print $1}') - RDEV=$(echo $DEV | sed s/disk/rdisk/) - - pdisk "$RDEV" -initialize - BLOCKS=$(pdisk "$RDEV" -dump | grep 2: | awk -F" " '{print $4}') - - pdisk "$RDEV" -createPartition "$VOLNAME" Apple_HFS $SECTORS $(($BLOCKS - $SECTORS)) - SLICE=$(pdisk "$RDEV" -dump | grep "$VOLNAME" | awk -F: '{print $1}' | awk -F" " '{print $1}') - - ### Copy ISO boot data onto the disk image - dd if="$ISO.boot" of="$RDEV" skip=64 seek=64 bs=512 - - newfs_hfs -v "$VOLNAME" "${RDEV}s${SLICE}" - mkdir -p /mnt - mount -t hfs -o perm "${DEV}s${SLICE}" /mnt - ditto -rsrc "$DESTDIR" /mnt - umount /mnt - rmdir /mnt - hdiutil eject "$DEV" - mv "$ISO.dmg" "$ISO" -fi +### Create a bootable ISO filesystem +### +ditto "$DESTDIR/usr/standalone/i386" /tmp/i386 +rm -f "$ISO.boot" +$MKISOFS -R \ + -V "$VOLNAME" \ + -no-emul-boot \ + -T \ + -J \ + -c boot.cat \ + -b cdboot \ + -hide-joliet-trans-tbl \ + -quiet \ + -o "$ISO.boot" \ + /tmp/i386 +SECTORS=$(du "$ISO.boot" | tail -1 | awk '{print $1}') + +### +### Create a hybrid image +### +rm -f "$ISO.dmg" +hdiutil create "$ISO.dmg" -size "$SIZE" -layout NONE +DEV=$(hdid -nomount "$ISO.dmg" | tail -1 | awk '{print $1}') +RDEV=$(echo $DEV | sed s/disk/rdisk/) + +pdisk "$RDEV" -initialize +BLOCKS=$(pdisk "$RDEV" -dump | grep 2: | awk -F" " '{print $4}') + +pdisk "$RDEV" -createPartition "$VOLNAME" Apple_HFS $SECTORS $(($BLOCKS - $SECTORS)) +SLICE=$(pdisk "$RDEV" -dump | grep "$VOLNAME" | awk -F: '{print $1}' | awk -F" " '{print $1}') + +### Copy ISO boot data onto the disk image +dd if="$ISO.boot" of="$RDEV" skip=64 seek=64 bs=512 + +newfs_hfs -v "$VOLNAME" "${RDEV}s${SLICE}" +mkdir -p /mnt +mount -t hfs -o perm "${DEV}s${SLICE}" /mnt +ditto -rsrc "$DESTDIR" /mnt +umount /mnt +rmdir /mnt +hdiutil eject "$DEV" +mv "$ISO.dmg" "$ISO" popd > /dev/null hdiutil eject "$DESTDIR" From d8dcc884c6bc3a5e400eedba18db76196444fc40 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 27 Aug 2017 17:57:15 -0400 Subject: [PATCH 068/382] Reindent --- darwinbuild/darwinmaster.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/darwinbuild/darwinmaster.in b/darwinbuild/darwinmaster.in index cff2570..4e242f6 100644 --- a/darwinbuild/darwinmaster.in +++ b/darwinbuild/darwinmaster.in @@ -198,11 +198,11 @@ mkdir -p "$DESTDIR"/System/Installation/Packages for X in $DARWIN_BUILDROOT/Packages/*-*.tar.bz2 ; do f=$(basename $X) if [ "${f/-*/}" != "DarwinInstaller" ]; then - Y="$DESTDIR"/System/Installation/Packages/$(basename $X) - if [ $X -nt $Y ]; then - echo $f - cp $X $Y - fi + Y="$DESTDIR"/System/Installation/Packages/$(basename $X) + if [ $X -nt $Y ]; then + echo $f + cp $X $Y + fi fi done From 67edf61339d5125e1c72d05d784471e41adee278 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 14 Nov 2017 14:34:51 -0500 Subject: [PATCH 069/382] Resolve Xcode 9 update warnings --- darwinbuild.xcodeproj/project.pbxproj | 60 +++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index b361e92..c30ed42 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -1912,6 +1912,7 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 0910; ORGANIZATIONNAME = "The DarwinBuild Project"; }; buildConfigurationList = 726DD14C10965C5700D5AEAB /* Build configuration list for PBXProject "darwinbuild" */; @@ -3483,11 +3484,29 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = c99; GCC_ENABLE_PASCAL_STRINGS = NO; GCC_MODEL_TUNING = ""; + GCC_NO_COMMON_BLOCKS = YES; GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -3503,6 +3522,7 @@ GCC_WARN_SIGN_COMPARE = NO; GCC_WARN_STRICT_SELECTOR_MATCH = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNKNOWN_PRAGMAS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_LABEL = YES; @@ -3630,11 +3650,30 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = c99; GCC_ENABLE_PASCAL_STRINGS = NO; GCC_MODEL_TUNING = ""; + GCC_NO_COMMON_BLOCKS = YES; GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -3650,12 +3689,14 @@ GCC_WARN_SIGN_COMPARE = NO; GCC_WARN_STRICT_SELECTOR_MATCH = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNKNOWN_PRAGMAS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; LD_OPENMP_FLAGS = ""; + ONLY_ACTIVE_ARCH = YES; STRIP_INSTALLED_PRODUCT = NO; STRIP_STYLE = "non-global"; WARNING_CFLAGS = "-Wall"; @@ -3666,11 +3707,29 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = c99; GCC_ENABLE_PASCAL_STRINGS = NO; GCC_MODEL_TUNING = ""; + GCC_NO_COMMON_BLOCKS = YES; GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -3686,6 +3745,7 @@ GCC_WARN_SIGN_COMPARE = NO; GCC_WARN_STRICT_SELECTOR_MATCH = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNKNOWN_PRAGMAS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_LABEL = YES; From 3054c624db96deb6a6eef030b1b5d563e1312f5d Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 14 Nov 2017 14:38:53 -0500 Subject: [PATCH 070/382] Fix compilation under Xcode 9 --- darwinbuild/manifest.c | 2 +- darwinup/Utils.cpp | 2 +- darwinxref/DBDataStore.h | 2 +- darwinxref/DBPlugin.h | 14 +++++++------- darwinxref/DBPluginPriv.h | 12 ++++++------ darwinxref/main.c | 6 +++--- darwinxref/plugins/register.c | 2 +- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/darwinbuild/manifest.c b/darwinbuild/manifest.c index 4e87a03..146a595 100644 --- a/darwinbuild/manifest.c +++ b/darwinbuild/manifest.c @@ -110,7 +110,7 @@ static size_t ent_filename(FTSENT* ent, char* filename, size_t bufsiz) { } strncat(filename, "/", bufsiz); bufsiz -= 1; - if (ent->fts_name) { + if (ent->fts_namelen != 0) { strncat(filename, ent->fts_name, bufsiz); bufsiz -= strlen(ent->fts_name); } diff --git a/darwinup/Utils.cpp b/darwinup/Utils.cpp index 20ef838..493875b 100644 --- a/darwinup/Utils.cpp +++ b/darwinup/Utils.cpp @@ -45,7 +45,7 @@ size_t ftsent_filename(FTSENT* ent, char* filename, size_t bufsiz) { } strlcat(filename, "/", bufsiz); bufsiz -= 1; - if (ent->fts_name) { + if (ent->fts_namelen != 0) { strlcat(filename, ent->fts_name, bufsiz); bufsiz -= strlen(ent->fts_name); } diff --git a/darwinxref/DBDataStore.h b/darwinxref/DBDataStore.h index 7e0f177..ded27a9 100644 --- a/darwinxref/DBDataStore.h +++ b/darwinxref/DBDataStore.h @@ -41,6 +41,6 @@ int SQL_CALLBACK(sqlite3_callback callback, void* context, const char* fmt, . void SQL_NOERR(char* sql); char* SQL_STRING(const char* fmt, ...); -void* _DBPluginGetDataStorePtr(); +void* _DBPluginGetDataStorePtr(void); #endif diff --git a/darwinxref/DBPlugin.h b/darwinxref/DBPlugin.h index 53053ca..67267e1 100644 --- a/darwinxref/DBPlugin.h +++ b/darwinxref/DBPlugin.h @@ -63,7 +63,7 @@ typedef int (*DBPluginRunFunc)(CFArrayRef argv); any callbacks from the plugin. @result The command line usage string. */ -typedef CFStringRef (*DBPluginUsageFunc)(); +typedef CFStringRef (*DBPluginUsageFunc)(void); /*! @@ -132,13 +132,13 @@ void DBPluginSetSubDictDataType(CFTypeID type); // default handlers int DBPluginPropertyDefaultRun(CFArrayRef argv); -CFStringRef DBPluginPropertyDefaultUsage(); +CFStringRef DBPluginPropertyDefaultUsage(void); // generally available routines -CFStringRef DBGetCurrentBuild(); +CFStringRef DBGetCurrentBuild(void); int DBHasBuild(CFStringRef build); -CFArrayRef DBCopyBuilds(); +CFArrayRef DBCopyBuilds(void); CFArrayRef DBCopyBuildInheritance(CFStringRef build); @@ -188,9 +188,9 @@ CFArrayRef DBCopyGroupNames(CFStringRef build); CFArrayRef DBCopyGroupMembers(CFStringRef build, CFStringRef group); int DBSetGroupMembers(CFStringRef build, CFStringRef group, CFArrayRef members); -int DBBeginTransaction(); -int DBCommitTransaction(); -int DBRollbackTransaction(); +int DBBeginTransaction(void); +int DBCommitTransaction(void); +int DBRollbackTransaction(void); #include "cfutils.h" diff --git a/darwinxref/DBPluginPriv.h b/darwinxref/DBPluginPriv.h index e3bcc9a..a533fa0 100644 --- a/darwinxref/DBPluginPriv.h +++ b/darwinxref/DBPluginPriv.h @@ -67,18 +67,18 @@ struct DBPlugin { // DBPluginSetPropFunc setprop; }; -void* _DBPluginGetDataStorePtr(); -DBPlugin* _DBPluginGetCurrentPlugin(); +void* _DBPluginGetDataStorePtr(void); +DBPlugin* _DBPluginGetCurrentPlugin(void); const DBPlugin* DBGetPluginWithName(CFStringRef name); -int DBBeginTransaction(); -int DBRollbackTransaction(); -int DBCommitTransaction(); +int DBBeginTransaction(void); +int DBRollbackTransaction(void); +int DBCommitTransaction(void); #if HAVE_TCL_PLUGINS int load_tcl_plugin(DBPlugin* plugin, const char* filename); -CFStringRef _DBPluginTclUsage(); +CFStringRef _DBPluginTclUsage(void); int _DBPluginTclRun(CFArrayRef args); #endif diff --git a/darwinxref/main.c b/darwinxref/main.c index e706001..9cfda30 100644 --- a/darwinxref/main.c +++ b/darwinxref/main.c @@ -44,8 +44,8 @@ // user environment global extern char** environ; -char* readBuildFile(); -char* determineHostBuildVersion(); +char* readBuildFile(void); +char* determineHostBuildVersion(void); int main(int argc, char* argv[]) { char* progname = argv[0]; @@ -130,7 +130,7 @@ char* determineHostBuildVersion() // Notice the careful dance around these symbols as they may // someday disappear entirely, in which case this program // will need to be revved. - CFDictionaryRef (*fptr)() = dlsym(RTLD_DEFAULT, "_CFCopySystemVersionDictionary"); + CFDictionaryRef (*fptr)(void) = dlsym(RTLD_DEFAULT, "_CFCopySystemVersionDictionary"); if (fptr) { CFDictionaryRef dict = fptr(); if (dict != NULL) { diff --git a/darwinxref/plugins/register.c b/darwinxref/plugins/register.c index 4eea2b7..7c99758 100644 --- a/darwinxref/plugins/register.c +++ b/darwinxref/plugins/register.c @@ -122,7 +122,7 @@ static size_t ent_filename(FTSENT* ent, char* filename, size_t bufsiz) { } strncat(filename, "/", bufsiz); bufsiz -= 1; - if (ent->fts_name) { + if (ent->fts_namelen != 0) { strncat(filename, ent->fts_name, bufsiz); bufsiz -= strlen(ent->fts_name); } From 889694c24472469d9b470d657dfc2f2c0805816b Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 14 Nov 2017 14:42:12 -0500 Subject: [PATCH 071/382] Only install Xcode into the chroot if one is being used --- darwinbuild/darwinbuild.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 882d3ba..96b2694 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -647,7 +647,7 @@ if [ "$NEED_ROOTS" == "YES" -a "$noload" != "YES" ]; then fi -if [ ! -f "$receipts/xcodebuild" ]; then +if [ ! -f "$receipts/xcodebuild" -a "$USE_CHROOT" = "YES" ]; then echo "*** Installing Xcode Tools ..." "$DATADIR/installXcode" "$BuildRoot" "$PWDP" touch "$receipts/xcodebuild" From e5bfaf7672efdd1a8da6fa10598ebc9d879addd4 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 14 Nov 2017 14:45:48 -0500 Subject: [PATCH 072/382] Move around chroot-related code in darwinbuild script --- darwinbuild/darwinbuild.in | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 96b2694..7d4597e 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -617,17 +617,12 @@ mkdir -p "$receipts" ### Also install CoreOSMakefiles and Perl for make based projects ### -NEED_ROOTS="YES" -if [ $USE_CHROOT == "NO" -a $INSTALL_XCODE == "NO" ]; then - NEED_ROOTS="NO" +if [ "$USE_CHROOT" = "YES" -a ! -f "$BuildRoot/usr/local/darwinbuild/receipts/.host-system-chroot" ]; then + echo "*** Creating chroot environment from host system, this may take a while ..." + $DATADIR/createChroot "$BuildRoot" fi -if [ "$NEED_ROOTS" == "YES" -a "$noload" != "YES" ]; then - if [ ! -f "$BuildRoot/usr/local/darwinbuild/receipts/.host-system-chroot" ]; then - echo "*** Creating chroot environment from host system, this may take a while ..." - $DATADIR/createChroot "$BuildRoot" - fi - +if [ "$noload" != "YES" ]; then echo "*** Installing Roots ..." deps=$($DARWINXREF dependencies -build "$projnam") @@ -765,7 +760,7 @@ if [ "$logdeps" == "YES" ]; then fi fi -if [ "$INSTALL_XCODE" == "YES" -a "$USE_CHROOT" == "NO" ]; then +if [ "$USE_CHROOT" == "NO" ]; then echo "*** Redirecting ..." echo "DARWINTRACE_REDIRECT=\"${BuildRoot}\"" echo "DARWINTRACE_LOG=\"${TRACELOG}\"" From c6cc0959201b6bbeb47839b73c041ebfee6b808b Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 14 Nov 2017 14:47:06 -0500 Subject: [PATCH 073/382] Reindent darwintrace.c I will be making significant changes to this file soon. Reindenting it now makes it easier to discern those changes. --- darwintrace/darwintrace.c | 935 +++++++++++++++++++------------------- 1 file changed, 467 insertions(+), 468 deletions(-) diff --git a/darwintrace/darwintrace.c b/darwintrace/darwintrace.c index 94f499b..ed62313 100644 --- a/darwintrace/darwintrace.c +++ b/darwintrace/darwintrace.c @@ -2,20 +2,20 @@ * Copyright (c) 2005-2012 Apple Inc. All rights reserved. * * @APPLE_BSD_LICENSE_HEADER_START@ - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. + * documentation and/or other materials provided with the distribution. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * + * from this software without specific prior written permission. + * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -26,7 +26,7 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * @APPLE_BSD_LICENSE_HEADER_END@ */ @@ -57,47 +57,46 @@ #define dprintf(...) #endif -#define LION_OR_LATER (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && \ -__MAC_OS_X_VERSION_MIN_REQUIRED >= 1070) +#define LION_OR_LATER (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070) #define DARWINTRACE_INTERPOSE(_replacement,_replacee) \ -__attribute__((used)) static struct { \ - const void* replacement; \ - const void* replacee; \ -} _interpose_##_replacee \ -__attribute__ ((section ("__DATA,__interpose"))) = { \ - (const void*)(unsigned long)&_replacement, \ - (const void*)(unsigned long)&_replacee \ -} + __attribute__((used)) static struct { \ + const void* replacement; \ + const void* replacee; \ + } _interpose_##_replacee \ + __attribute__ ((section ("__DATA,__interpose"))) = { \ + (const void*)(unsigned long)&_replacement, \ + (const void*)(unsigned long)&_replacee \ + } static int darwintrace_fd = -2; static char darwintrace_progname[DARWINTRACE_BUFFER_SIZE]; static pid_t darwintrace_pid = -1; /** - * Redirect file access + * Redirect file access */ static char *darwintrace_redirect = NULL; static char *darwintrace_buildroot = NULL; static const char *darwintrace_exceptions[] = { - "/Developer/Library/Private", - "/Developer/Library/Frameworks", - "/Developer/usr/bin/../../Library/Private", - "/Developer/usr/bin/../../Library/Frameworks", - "/Developer/Library/Xcode", - "/Developer/Platforms/", - "/Developer/usr/bin/xcode", - "/System/Library/Frameworks/Carbon", - "/Volumes/BuildRoot_", - "/usr/bin/xcrun", - "/usr/bin/xcode", - "/usr/local/share/darwin", - "/usr/share/xcode", - "/var/folders/", - "/var/tmp/", - "/.vol/", - "/tmp/", - "/dev/", + "/Developer/Library/Private", + "/Developer/Library/Frameworks", + "/Developer/usr/bin/../../Library/Private", + "/Developer/usr/bin/../../Library/Frameworks", + "/Developer/Library/Xcode", + "/Developer/Platforms/", + "/Developer/usr/bin/xcode", + "/System/Library/Frameworks/Carbon", + "/Volumes/BuildRoot_", + "/usr/bin/xcrun", + "/usr/bin/xcode", + "/usr/local/share/darwin", + "/usr/share/xcode", + "/var/folders/", + "/var/tmp/", + "/.vol/", + "/tmp/", + "/dev/", }; /* store root paths so we can ignore them when logging */ @@ -110,115 +109,115 @@ static char *darwintrace_log_path; /* check if str starts with one of the exceptions */ static inline bool darwintrace_except(const char *str) { - size_t c = sizeof(darwintrace_exceptions)/sizeof(*darwintrace_exceptions); - size_t i; - for (i = 0; i < c; i++) { - if (strncmp(darwintrace_exceptions[i], str, strlen(darwintrace_exceptions[i])) == 0) { - return true; - } - } - return false; + size_t c = sizeof(darwintrace_exceptions)/sizeof(*darwintrace_exceptions); + size_t i; + for (i = 0; i < c; i++) { + if (strncmp(darwintrace_exceptions[i], str, strlen(darwintrace_exceptions[i])) == 0) { + return true; + } + } + return false; } /* apply redirection heuristic to path */ static inline char* darwintrace_redirect_path(const char* path) { - if (!darwintrace_redirect) return (char*)path; - - char *redirpath; - redirpath = (char *)path; - if (path[0] == '/' - && !darwintrace_except(path) - && strncmp(darwintrace_buildroot, path, strlen(darwintrace_buildroot))!=0 - && strncmp(darwintrace_redirect, path, strlen(darwintrace_redirect))!=0 ) { - asprintf(&redirpath, "%s%s%s", darwintrace_redirect, (*path == '/' ? "" : "/"), path); - dprintf("darwintrace: redirect %s -> %s\n", path, redirpath); - } - - return redirpath; + if (!darwintrace_redirect) return (char*)path; + + char *redirpath; + redirpath = (char *)path; + if (path[0] == '/' + && !darwintrace_except(path) + && strncmp(darwintrace_buildroot, path, strlen(darwintrace_buildroot))!=0 + && strncmp(darwintrace_redirect, path, strlen(darwintrace_redirect))!=0 ) { + asprintf(&redirpath, "%s%s%s", darwintrace_redirect, (*path == '/' ? "" : "/"), path); + dprintf("darwintrace: redirect %s -> %s\n", path, redirpath); + } + + return redirpath; } /* free path if not the same as test */ static inline void darwintrace_free_path(char* path, const char* test) { - if (path != test) free(path); + if (path != test) free(path); } static void _darwintrace_setup(void) { - char* path = getenv("DARWINTRACE_LOG"); - if (path != NULL) { - int olderrno = errno; - int fd = open(path, - O_CREAT | O_WRONLY | O_APPEND, - DEFFILEMODE); - int newfd; - for(newfd = DARWINTRACE_START_FD; newfd < DARWINTRACE_STOP_FD; newfd++) { - if(-1 == write(newfd, "", 0) && errno == EBADF) { - if(-1 != dup2(fd, newfd)) darwintrace_fd = newfd; - close(fd); - fcntl(darwintrace_fd, F_SETFD, 1); /* close-on-exec */ - break; - } - } - darwintrace_log_path = strdup(path); - errno = olderrno; - } - - /* read env vars needed for redirection */ - darwintrace_redirect = getenv("DARWINTRACE_REDIRECT"); - darwintrace_buildroot = getenv("DARWIN_BUILDROOT"); - - darwintrace_pid = getpid(); - char** progname = _NSGetProgname(); - if (progname && *progname) { - if (strlcpy(darwintrace_progname, *progname, sizeof(darwintrace_progname)) >= sizeof(darwintrace_progname)) { - dprintf("darwintrace: progname too long to copy: %s\n", *progname); - } - } - - /* create ignores list from root env vars */ - if (getenv("DARWINTRACE_IGNORE_ROOTS")) { - darwintrace_ignores = (char**)calloc(4, sizeof(char*)); - darwintrace_ignore_lens = (size_t*)calloc(4, sizeof(size_t)); - if (darwintrace_ignores && darwintrace_ignore_lens) { - darwintrace_ignores[0] = getenv("OBJROOT"); - if (darwintrace_ignores[0]) - darwintrace_ignore_lens[0] = strlen(darwintrace_ignores[0]); - darwintrace_ignores[1] = getenv("SRCROOT"); - if (darwintrace_ignores[1]) - darwintrace_ignore_lens[1] = strlen(darwintrace_ignores[1]); - darwintrace_ignores[2] = getenv("DSTROOT"); - if (darwintrace_ignores[2]) - darwintrace_ignore_lens[2] = strlen(darwintrace_ignores[2]); - darwintrace_ignores[3] = getenv("SYMROOT"); - if (darwintrace_ignores[3]) - darwintrace_ignore_lens[3] = strlen(darwintrace_ignores[3]); - } else { - dprintf("unable to allocate memory for darwintrace_ignores"); - } - } - - /* find the install path of the darwintrace dylib for later use */ - path = getenv("DYLD_INSERT_LIBRARIES"); - if (path != NULL) { - char *ptr = strstr(path, "darwintrace.dylib"); - if (ptr) { - /* scan backward for : or start of string */ - while (ptr > path) { - if (*ptr == ':') { - ++ptr; - break; - } - --ptr; - } - - darwintrace_dylib_path = strdup(ptr); - - /* scan forward for : or end of string and terminate */ - ptr = strchr(darwintrace_dylib_path, ':'); - if (ptr) { - *ptr = 0; - } - } - } + char* path = getenv("DARWINTRACE_LOG"); + if (path != NULL) { + int olderrno = errno; + int fd = open(path, + O_CREAT | O_WRONLY | O_APPEND, + DEFFILEMODE); + int newfd; + for(newfd = DARWINTRACE_START_FD; newfd < DARWINTRACE_STOP_FD; newfd++) { + if(-1 == write(newfd, "", 0) && errno == EBADF) { + if(-1 != dup2(fd, newfd)) darwintrace_fd = newfd; + close(fd); + fcntl(darwintrace_fd, F_SETFD, 1); /* close-on-exec */ + break; + } + } + darwintrace_log_path = strdup(path); + errno = olderrno; + } + + /* read env vars needed for redirection */ + darwintrace_redirect = getenv("DARWINTRACE_REDIRECT"); + darwintrace_buildroot = getenv("DARWIN_BUILDROOT"); + + darwintrace_pid = getpid(); + char** progname = _NSGetProgname(); + if (progname && *progname) { + if (strlcpy(darwintrace_progname, *progname, sizeof(darwintrace_progname)) >= sizeof(darwintrace_progname)) { + dprintf("darwintrace: progname too long to copy: %s\n", *progname); + } + } + + /* create ignores list from root env vars */ + if (getenv("DARWINTRACE_IGNORE_ROOTS")) { + darwintrace_ignores = (char**)calloc(4, sizeof(char*)); + darwintrace_ignore_lens = (size_t*)calloc(4, sizeof(size_t)); + if (darwintrace_ignores && darwintrace_ignore_lens) { + darwintrace_ignores[0] = getenv("OBJROOT"); + if (darwintrace_ignores[0]) + darwintrace_ignore_lens[0] = strlen(darwintrace_ignores[0]); + darwintrace_ignores[1] = getenv("SRCROOT"); + if (darwintrace_ignores[1]) + darwintrace_ignore_lens[1] = strlen(darwintrace_ignores[1]); + darwintrace_ignores[2] = getenv("DSTROOT"); + if (darwintrace_ignores[2]) + darwintrace_ignore_lens[2] = strlen(darwintrace_ignores[2]); + darwintrace_ignores[3] = getenv("SYMROOT"); + if (darwintrace_ignores[3]) + darwintrace_ignore_lens[3] = strlen(darwintrace_ignores[3]); + } else { + dprintf("unable to allocate memory for darwintrace_ignores"); + } + } + + /* find the install path of the darwintrace dylib for later use */ + path = getenv("DYLD_INSERT_LIBRARIES"); + if (path != NULL) { + char *ptr = strstr(path, "darwintrace.dylib"); + if (ptr) { + /* scan backward for : or start of string */ + while (ptr > path) { + if (*ptr == ':') { + ++ptr; + break; + } + --ptr; + } + + darwintrace_dylib_path = strdup(ptr); + + /* scan forward for : or end of string and terminate */ + ptr = strchr(darwintrace_dylib_path, ':'); + if (ptr) { + *ptr = 0; + } + } + } } static inline void darwintrace_setup(void) { @@ -228,88 +227,88 @@ static inline void darwintrace_setup(void) { /* darwintrace_setup must have been called already */ static inline void darwintrace_logpath(int fd, const char *procname, char *tag, const char *path) { - if (darwintrace_ignores) { - for (int i=0; i < 4; i++) { - if (darwintrace_ignores[i] - && strncmp(darwintrace_ignores[i], path, darwintrace_ignore_lens[i]) == 0) { - return; - } - } - } - size_t size; - char pidstr_bytes[16]; - char *pidstr = &pidstr_bytes[sizeof(pidstr_bytes)-1]; - char darwintrace_buf[DARWINTRACE_BUFFER_SIZE]; - - pid_t pid = darwintrace_pid; - *pidstr = 0; - do { - --pidstr; - *pidstr = '0' + (pid % 10); - pid /= 10; - } while (pid > 0); - - /* "%s[%d]\t%s\t%s\n" */ - size = strlcpy(darwintrace_buf, procname ? procname : darwintrace_progname, sizeof(darwintrace_buf)); - size = strlcat(darwintrace_buf, "[", sizeof(darwintrace_buf)); - size = strlcat(darwintrace_buf, pidstr, sizeof(darwintrace_buf)); - size = strlcat(darwintrace_buf, "]\t", sizeof(darwintrace_buf)); - size = strlcat(darwintrace_buf, tag, sizeof(darwintrace_buf)); - size = strlcat(darwintrace_buf, "\t", sizeof(darwintrace_buf)); - size = strlcat(darwintrace_buf, path, sizeof(darwintrace_buf)); - size = strlcat(darwintrace_buf, "\n", sizeof(darwintrace_buf)); - write(fd, darwintrace_buf, size); + if (darwintrace_ignores) { + for (int i=0; i < 4; i++) { + if (darwintrace_ignores[i] + && strncmp(darwintrace_ignores[i], path, darwintrace_ignore_lens[i]) == 0) { + return; + } + } + } + size_t size; + char pidstr_bytes[16]; + char *pidstr = &pidstr_bytes[sizeof(pidstr_bytes)-1]; + char darwintrace_buf[DARWINTRACE_BUFFER_SIZE]; + + pid_t pid = darwintrace_pid; + *pidstr = 0; + do { + --pidstr; + *pidstr = '0' + (pid % 10); + pid /= 10; + } while (pid > 0); + + /* "%s[%d]\t%s\t%s\n" */ + size = strlcpy(darwintrace_buf, procname ? procname : darwintrace_progname, sizeof(darwintrace_buf)); + size = strlcat(darwintrace_buf, "[", sizeof(darwintrace_buf)); + size = strlcat(darwintrace_buf, pidstr, sizeof(darwintrace_buf)); + size = strlcat(darwintrace_buf, "]\t", sizeof(darwintrace_buf)); + size = strlcat(darwintrace_buf, tag, sizeof(darwintrace_buf)); + size = strlcat(darwintrace_buf, "\t", sizeof(darwintrace_buf)); + size = strlcat(darwintrace_buf, path, sizeof(darwintrace_buf)); + size = strlcat(darwintrace_buf, "\n", sizeof(darwintrace_buf)); + write(fd, darwintrace_buf, size); } /* remap resource fork access to the data fork. * do a partial realpath(3) to fix "foo//bar" to "foo/bar" */ static inline void darwintrace_cleanup_path(char *path) { - size_t pathlen, rsrclen; - size_t i, shiftamount; - enum { SAWSLASH, NOTHING } state = NOTHING; - - /* if this is a foo/..namedfork/rsrc, strip it off */ - pathlen = strlen(path); - rsrclen = strlen(_PATH_RSRCFORKSPEC); - if(pathlen > rsrclen - && 0 == strncmp(path + pathlen - rsrclen, - _PATH_RSRCFORKSPEC, rsrclen)) { - path[pathlen - rsrclen] = '\0'; - pathlen -= rsrclen; - } - - /* for each position in string (including - terminal \0), check if we're in a run of - multiple slashes, and only emit the - first one - */ - for(i=0, shiftamount=0; i <= pathlen; i++) { - if(state == SAWSLASH) { - if(path[i] == '/') { - /* consume it */ - shiftamount++; - } else { - state = NOTHING; - path[i - shiftamount] = path[i]; - } - } else { - if(path[i] == '/') { - state = SAWSLASH; - } - path[i - shiftamount] = path[i]; - } - } - - dprintf("darwintrace: cleanup resulted in %s\n", path); + size_t pathlen, rsrclen; + size_t i, shiftamount; + enum { SAWSLASH, NOTHING } state = NOTHING; + + /* if this is a foo/..namedfork/rsrc, strip it off */ + pathlen = strlen(path); + rsrclen = strlen(_PATH_RSRCFORKSPEC); + if(pathlen > rsrclen + && 0 == strncmp(path + pathlen - rsrclen, + _PATH_RSRCFORKSPEC, rsrclen)) { + path[pathlen - rsrclen] = '\0'; + pathlen -= rsrclen; + } + + /* for each position in string (including + terminal \0), check if we're in a run of + multiple slashes, and only emit the + first one + */ + for(i=0, shiftamount=0; i <= pathlen; i++) { + if(state == SAWSLASH) { + if(path[i] == '/') { + /* consume it */ + shiftamount++; + } else { + state = NOTHING; + path[i - shiftamount] = path[i]; + } + } else { + if(path[i] == '/') { + state = SAWSLASH; + } + path[i - shiftamount] = path[i]; + } + } + + dprintf("darwintrace: cleanup resulted in %s\n", path); } /* - Only logs files where the open succeeds. - Only logs files opened for read access, without the O_CREAT flag set. - The assumption is that any file that can be created isn't necessary - to build the project. -*/ + Only logs files where the open succeeds. + Only logs files opened for read access, without the O_CREAT flag set. + The assumption is that any file that can be created isn't necessary + to build the project. + */ int darwintrace_open(const char* path, int flags, ...) { mode_t mode; int result; @@ -322,41 +321,41 @@ int darwintrace_open(const char* path, int flags, ...) { va_end(args); result = open(redirpath, flags, mode); if (result >= 0 && (flags & (O_CREAT | O_WRONLY)) == 0 ) { - darwintrace_setup(); - if (darwintrace_fd >= 0) { - char realpath[MAXPATHLEN]; + darwintrace_setup(); + if (darwintrace_fd >= 0) { + char realpath[MAXPATHLEN]; #if DARWINTRACE_LOG_FULL_PATH - int usegetpath = 1; + int usegetpath = 1; #else - int usegetpath = 0; + int usegetpath = 0; #endif - dprintf("darwintrace: original open path is %s\n", redirpath); - - /* for volfs paths, we need to do a GETPATH anyway */ - if(!usegetpath && strncmp(redirpath, "/.vol/", 6) == 0) { - usegetpath = 1; - } - - if(usegetpath) { - if(0 == fcntl(result, F_GETPATH, realpath)) { - dprintf("darwintrace: resolved %s to %s\n", redirpath, realpath); - } else { - /* use original path */ - dprintf("darwintrace: failed to resolve %s\n", redirpath); - if (strlcpy(realpath, redirpath, sizeof(realpath)) >= sizeof(realpath)) { - dprintf("darwintrace: in open: original path too long to copy: %s\n", redirpath); - } - } - } else { - if (strlcpy(realpath, redirpath, sizeof(realpath)) >= sizeof(realpath)) { - dprintf("darwintrace: in open (without getpath): path too long to copy: %s\n", redirpath); - } - } - - darwintrace_cleanup_path(realpath); - darwintrace_logpath(darwintrace_fd, NULL, "open", realpath); - } + dprintf("darwintrace: original open path is %s\n", redirpath); + + /* for volfs paths, we need to do a GETPATH anyway */ + if(!usegetpath && strncmp(redirpath, "/.vol/", 6) == 0) { + usegetpath = 1; + } + + if(usegetpath) { + if(0 == fcntl(result, F_GETPATH, realpath)) { + dprintf("darwintrace: resolved %s to %s\n", redirpath, realpath); + } else { + /* use original path */ + dprintf("darwintrace: failed to resolve %s\n", redirpath); + if (strlcpy(realpath, redirpath, sizeof(realpath)) >= sizeof(realpath)) { + dprintf("darwintrace: in open: original path too long to copy: %s\n", redirpath); + } + } + } else { + if (strlcpy(realpath, redirpath, sizeof(realpath)) >= sizeof(realpath)) { + dprintf("darwintrace: in open (without getpath): path too long to copy: %s\n", redirpath); + } + } + + darwintrace_cleanup_path(realpath); + darwintrace_logpath(darwintrace_fd, NULL, "open", realpath); + } } darwintrace_free_path(redirpath, path); @@ -370,247 +369,247 @@ DARWINTRACE_INTERPOSE(darwintrace_open, __open_nocancel); /* - Only logs files where the readlink succeeds. -*/ + Only logs files where the readlink succeeds. + */ ssize_t darwintrace_readlink(const char * path, char * buf, size_t bufsiz) { ssize_t result; char* redirpath = darwintrace_redirect_path(path); result = readlink(redirpath, buf, bufsiz); if (result >= 0) { - darwintrace_setup(); - if (darwintrace_fd >= 0) { - char realpath[MAXPATHLEN]; - - dprintf("darwintrace: original readlink path is %s\n", redirpath); - - if (strlcpy(realpath, redirpath, sizeof(realpath)) >= sizeof(realpath)) { - dprintf("darwintrace: in readlink: path too long to copy: %s\n", redirpath); - } - - darwintrace_cleanup_path(realpath); - darwintrace_logpath(darwintrace_fd, NULL, "readlink", realpath); - } + darwintrace_setup(); + if (darwintrace_fd >= 0) { + char realpath[MAXPATHLEN]; + + dprintf("darwintrace: original readlink path is %s\n", redirpath); + + if (strlcpy(realpath, redirpath, sizeof(realpath)) >= sizeof(realpath)) { + dprintf("darwintrace: in readlink: path too long to copy: %s\n", redirpath); + } + + darwintrace_cleanup_path(realpath); + darwintrace_logpath(darwintrace_fd, NULL, "readlink", realpath); + } } - + darwintrace_free_path(redirpath, path); return result; } DARWINTRACE_INTERPOSE(darwintrace_readlink, readlink); static inline int has_prefix(const char *s, const char *p) { - return (strncmp(s, p, strlen(p)) == 0); + return (strncmp(s, p, strlen(p)) == 0); } /* force the values of several environment variables */ static char *const *darwintrace_make_environ(char *const envp[]) { - static const char *DARWINTRACE_IGNORE_ROOTS = "DARWINTRACE_IGNORE_ROOTS="; - static const char *DYLD_INSERT_LIBRARIES = "DYLD_INSERT_LIBRARIES="; - static const char *DARWINTRACE_LOG = "DARWINTRACE_LOG="; - static const char *DARWINTRACE_PLACEHOLDER = "__DARWINTRACE_PLACEHOLDER=UNUSED"; - - char **result = NULL; - char *libs = NULL; - int count = 0; - - /* count the environment variables */ - if (envp) { - while (envp[count] != NULL) { - if (has_prefix(envp[count], DYLD_INSERT_LIBRARIES)) { - libs = envp[count] + strlen(DYLD_INSERT_LIBRARIES); - } - ++count; - } - } - - /* allocate size of envp with enough space for three more values and NULL */ - result = (char **)calloc(count + 4, sizeof(char *)); - if (result != NULL) { - int i = 0; - - if (darwintrace_log_path) { - asprintf(&result[i], "%s%s", DARWINTRACE_LOG, darwintrace_log_path); - } else { - result[i] = strdup(DARWINTRACE_PLACEHOLDER); - } - ++i; - - if (darwintrace_ignores) { - asprintf(&result[i], "%s%s", DARWINTRACE_IGNORE_ROOTS, "1"); - } else { - result[i] = strdup(DARWINTRACE_PLACEHOLDER); - } - ++i; - - if (darwintrace_dylib_path) { - if (libs && strstr(libs, darwintrace_dylib_path)) { - /* inserted libraries already contain dylib */ - asprintf(&result[i], "%s%s", - DYLD_INSERT_LIBRARIES, libs); - } else { - /* otherwise set or insert the dylib path */ - asprintf(&result[i], "%s%s%s%s", - DYLD_INSERT_LIBRARIES, darwintrace_dylib_path, - libs ? ":" : "", libs ? libs : ""); - } - } else { - result[i] = strdup(DARWINTRACE_PLACEHOLDER); - } - ++i; - - if (envp) { - memcpy(&result[i], envp, count * sizeof(char *)); - } - - while (result[i] != NULL) { - if (has_prefix(result[i], DARWINTRACE_IGNORE_ROOTS) || - has_prefix(result[i], DYLD_INSERT_LIBRARIES) || - has_prefix(result[i], DARWINTRACE_LOG)) { - result[i] = (char *)DARWINTRACE_PLACEHOLDER; - } - ++i; - } - } - - return result; + static const char *DARWINTRACE_IGNORE_ROOTS = "DARWINTRACE_IGNORE_ROOTS="; + static const char *DYLD_INSERT_LIBRARIES = "DYLD_INSERT_LIBRARIES="; + static const char *DARWINTRACE_LOG = "DARWINTRACE_LOG="; + static const char *DARWINTRACE_PLACEHOLDER = "__DARWINTRACE_PLACEHOLDER=UNUSED"; + + char **result = NULL; + char *libs = NULL; + int count = 0; + + /* count the environment variables */ + if (envp) { + while (envp[count] != NULL) { + if (has_prefix(envp[count], DYLD_INSERT_LIBRARIES)) { + libs = envp[count] + strlen(DYLD_INSERT_LIBRARIES); + } + ++count; + } + } + + /* allocate size of envp with enough space for three more values and NULL */ + result = (char **)calloc(count + 4, sizeof(char *)); + if (result != NULL) { + int i = 0; + + if (darwintrace_log_path) { + asprintf(&result[i], "%s%s", DARWINTRACE_LOG, darwintrace_log_path); + } else { + result[i] = strdup(DARWINTRACE_PLACEHOLDER); + } + ++i; + + if (darwintrace_ignores) { + asprintf(&result[i], "%s%s", DARWINTRACE_IGNORE_ROOTS, "1"); + } else { + result[i] = strdup(DARWINTRACE_PLACEHOLDER); + } + ++i; + + if (darwintrace_dylib_path) { + if (libs && strstr(libs, darwintrace_dylib_path)) { + /* inserted libraries already contain dylib */ + asprintf(&result[i], "%s%s", + DYLD_INSERT_LIBRARIES, libs); + } else { + /* otherwise set or insert the dylib path */ + asprintf(&result[i], "%s%s%s%s", + DYLD_INSERT_LIBRARIES, darwintrace_dylib_path, + libs ? ":" : "", libs ? libs : ""); + } + } else { + result[i] = strdup(DARWINTRACE_PLACEHOLDER); + } + ++i; + + if (envp) { + memcpy(&result[i], envp, count * sizeof(char *)); + } + + while (result[i] != NULL) { + if (has_prefix(result[i], DARWINTRACE_IGNORE_ROOTS) || + has_prefix(result[i], DYLD_INSERT_LIBRARIES) || + has_prefix(result[i], DARWINTRACE_LOG)) { + result[i] = (char *)DARWINTRACE_PLACEHOLDER; + } + ++i; + } + } + + return result; } static void darwintrace_free_environ(char *const envp[]) { - free(envp[0]); - free(envp[1]); - free(envp[2]); - free((char*)envp); + free(envp[0]); + free(envp[1]); + free(envp[2]); + free((char*)envp); } static void darwintrace_log_exec(const char* redirpath, char* const argv[]) { darwintrace_setup(); if (darwintrace_fd >= 0) { - struct stat sb; - char realpath[MAXPATHLEN]; - int printorig = 0; - int printreal = 0; - int fd; + struct stat sb; + char realpath[MAXPATHLEN]; + int printorig = 0; + int printreal = 0; + int fd; #if DARWINTRACE_LOG_FULL_PATH - int usegetpath = 1; + int usegetpath = 1; #else - int usegetpath = 0; + int usegetpath = 0; #endif - dprintf("darwintrace: original execve path is %s\n", redirpath); - - /* for symlinks, we wan't to capture - * both the original path and the modified one, - * since for /usr/bin/gcc -> gcc-4.0, - * both "gcc_select" and "gcc" are contributors - */ - if (lstat(redirpath, &sb) == 0) { - if(redirpath[0] != '/') { - /* for relative paths, only print full path */ - printreal = 1; - printorig = 0; - } else if(S_ISLNK(sb.st_mode)) { - /* for symlinks, print both */ - printreal = 1; - printorig = 1; - } else { - /* for fully qualified paths, print real */ - printreal = 1; - printorig = 0; - } - - if(printorig) { - if (strlcpy(realpath, redirpath, sizeof(realpath)) >= sizeof(realpath)) { - dprintf("darwintrace: in execve: path too long to copy: %s\n", redirpath); - } - - darwintrace_cleanup_path(realpath); - darwintrace_logpath(darwintrace_fd, NULL, "execve", realpath); - } - - fd = open(redirpath, O_RDONLY, 0); - if (fd != -1) { - - char buffer[MAXPATHLEN]; - ssize_t bytes_read; - - /* once we have an open fd, if a full path was requested, do it */ - if(printreal) { - - if(usegetpath) { - if(0 == fcntl(fd, F_GETPATH, realpath)) { - dprintf("darwintrace: resolved execve path %s to %s\n", redirpath, realpath); - } else { - dprintf("darwintrace: failed to resolve %s\n", redirpath); - if (strlcpy(realpath, redirpath, sizeof(realpath)) >= sizeof(realpath)) { - dprintf("darwintrace: in execve: original path too long to copy: %s\n", redirpath); - } - } - } else { - if (strlcpy(realpath, redirpath, sizeof(realpath)) >= sizeof(realpath)) { - dprintf("darwintrace: in execve (without getpath): path too long to copy: %s\n", redirpath); - } - } - - darwintrace_cleanup_path(realpath); - darwintrace_logpath(darwintrace_fd, NULL, "execve", realpath); - } - - bzero(buffer, sizeof(buffer)); - - bytes_read = read(fd, buffer, MAXPATHLEN); - if (bytes_read > 2 && - buffer[0] == '#' && buffer[1] == '!') { - char* interp = &buffer[2]; - int i; - /* skip past leading whitespace */ - for (i = 2; i < bytes_read; ++i) { - if (buffer[i] != ' ' && buffer[i] != '\t') { - interp = &buffer[i]; - break; - } - } - /* found interpreter (or ran out of data) - skip until next whitespace, then terminate the string */ - for (; i < bytes_read; ++i) { - if (buffer[i] == ' ' || buffer[i] == '\t' || buffer[i] == '\n') { - buffer[i] = 0; - break; - } - } - /* we have liftoff */ - if (interp && interp[0] != '\0') { - const char* procname = NULL; - - /* look for slash to get the basename */ - procname = strrchr(argv[0], '/'); - if (procname == NULL) { - /* no slash found, so assume whole string is basename */ - procname = argv[0]; - } else { - /* advance pointer to just after slash */ - procname++; - } - - darwintrace_cleanup_path(interp); - darwintrace_logpath(darwintrace_fd, procname, "execve", interp); - } - } - - close(fd); - } - } + dprintf("darwintrace: original execve path is %s\n", redirpath); + + /* for symlinks, we wan't to capture + * both the original path and the modified one, + * since for /usr/bin/gcc -> gcc-4.0, + * both "gcc_select" and "gcc" are contributors + */ + if (lstat(redirpath, &sb) == 0) { + if(redirpath[0] != '/') { + /* for relative paths, only print full path */ + printreal = 1; + printorig = 0; + } else if(S_ISLNK(sb.st_mode)) { + /* for symlinks, print both */ + printreal = 1; + printorig = 1; + } else { + /* for fully qualified paths, print real */ + printreal = 1; + printorig = 0; + } + + if(printorig) { + if (strlcpy(realpath, redirpath, sizeof(realpath)) >= sizeof(realpath)) { + dprintf("darwintrace: in execve: path too long to copy: %s\n", redirpath); + } + + darwintrace_cleanup_path(realpath); + darwintrace_logpath(darwintrace_fd, NULL, "execve", realpath); + } + + fd = open(redirpath, O_RDONLY, 0); + if (fd != -1) { + + char buffer[MAXPATHLEN]; + ssize_t bytes_read; + + /* once we have an open fd, if a full path was requested, do it */ + if(printreal) { + + if(usegetpath) { + if(0 == fcntl(fd, F_GETPATH, realpath)) { + dprintf("darwintrace: resolved execve path %s to %s\n", redirpath, realpath); + } else { + dprintf("darwintrace: failed to resolve %s\n", redirpath); + if (strlcpy(realpath, redirpath, sizeof(realpath)) >= sizeof(realpath)) { + dprintf("darwintrace: in execve: original path too long to copy: %s\n", redirpath); + } + } + } else { + if (strlcpy(realpath, redirpath, sizeof(realpath)) >= sizeof(realpath)) { + dprintf("darwintrace: in execve (without getpath): path too long to copy: %s\n", redirpath); + } + } + + darwintrace_cleanup_path(realpath); + darwintrace_logpath(darwintrace_fd, NULL, "execve", realpath); + } + + bzero(buffer, sizeof(buffer)); + + bytes_read = read(fd, buffer, MAXPATHLEN); + if (bytes_read > 2 && + buffer[0] == '#' && buffer[1] == '!') { + char* interp = &buffer[2]; + int i; + /* skip past leading whitespace */ + for (i = 2; i < bytes_read; ++i) { + if (buffer[i] != ' ' && buffer[i] != '\t') { + interp = &buffer[i]; + break; + } + } + /* found interpreter (or ran out of data) + skip until next whitespace, then terminate the string */ + for (; i < bytes_read; ++i) { + if (buffer[i] == ' ' || buffer[i] == '\t' || buffer[i] == '\n') { + buffer[i] = 0; + break; + } + } + /* we have liftoff */ + if (interp && interp[0] != '\0') { + const char* procname = NULL; + + /* look for slash to get the basename */ + procname = strrchr(argv[0], '/'); + if (procname == NULL) { + /* no slash found, so assume whole string is basename */ + procname = argv[0]; + } else { + /* advance pointer to just after slash */ + procname++; + } + + darwintrace_cleanup_path(interp); + darwintrace_logpath(darwintrace_fd, procname, "execve", interp); + } + } + + close(fd); + } + } } } int darwintrace_execve(const char* path, char* const argv[], char* const envp[]) { - int result; - char* redirpath = darwintrace_redirect_path(path); - darwintrace_log_exec(redirpath, argv); - char *const *new_envp = darwintrace_make_environ(envp); - result = execve(redirpath, argv, new_envp); - darwintrace_free_environ(new_envp); - darwintrace_free_path(redirpath, path); - return result; + int result; + char* redirpath = darwintrace_redirect_path(path); + darwintrace_log_exec(redirpath, argv); + char *const *new_envp = darwintrace_make_environ(envp); + result = execve(redirpath, argv, new_envp); + darwintrace_free_environ(new_envp); + darwintrace_free_path(redirpath, path); + return result; } DARWINTRACE_INTERPOSE(darwintrace_execve, execve); @@ -618,37 +617,37 @@ DARWINTRACE_INTERPOSE(darwintrace_execve, execve); /* weak import __posix_spawn which only exists on 10.7 or later */ extern __attribute__((weak_import)) int __posix_spawn(pid_t * __restrict, const char * __restrict, - void *, - char *const argv[ __restrict], char *const envp[ __restrict]); + void *, + char *const argv[ __restrict], char *const envp[ __restrict]); int darwintrace_posix_spawn(pid_t * __restrict pid, - const char * __restrict path, - void * __restrict desc, - char *const argv[__restrict], - char *const envp[__restrict]) { - int result; - char* redirpath = darwintrace_redirect_path(path); - darwintrace_log_exec(redirpath, argv); - char *const *new_envp = darwintrace_make_environ(envp); - result = __posix_spawn(pid, redirpath, desc, argv, new_envp); - darwintrace_free_environ(new_envp); - darwintrace_free_path(redirpath, path); - return result; + const char * __restrict path, + void * __restrict desc, + char *const argv[__restrict], + char *const envp[__restrict]) { + int result; + char* redirpath = darwintrace_redirect_path(path); + darwintrace_log_exec(redirpath, argv); + char *const *new_envp = darwintrace_make_environ(envp); + result = __posix_spawn(pid, redirpath, desc, argv, new_envp); + darwintrace_free_environ(new_envp); + darwintrace_free_path(redirpath, path); + return result; } DARWINTRACE_INTERPOSE(darwintrace_posix_spawn, __posix_spawn); #endif /* - if darwintrace has been initialized, trap - attempts to close our file descriptor -*/ + if darwintrace has been initialized, trap + attempts to close our file descriptor + */ int darwintrace_close(int fd) { - if(darwintrace_fd != -2 && fd == darwintrace_fd) { - errno = EBADF; - return -1; - } + if(darwintrace_fd != -2 && fd == darwintrace_fd) { + errno = EBADF; + return -1; + } - return close(fd); + return close(fd); } DARWINTRACE_INTERPOSE(darwintrace_close, close); #if LION_OR_LATER From 2255d6960c7a6096cbb373e4b90b610ef97f96d8 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 14 Nov 2017 14:51:14 -0500 Subject: [PATCH 074/382] Add "overlay" functionality to darwintrace darwintrace now allows for paths that would normally be exempted from redirection to be redirected, but if and only if doing so would point to a file in the build root. If the file does not exist in the build root, its original location is returned instead. --- darwintrace/darwintrace.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/darwintrace/darwintrace.c b/darwintrace/darwintrace.c index ed62313..fd9fb3b 100644 --- a/darwintrace/darwintrace.c +++ b/darwintrace/darwintrace.c @@ -133,6 +133,14 @@ static inline char* darwintrace_redirect_path(const char* path) { dprintf("darwintrace: redirect %s -> %s\n", path, redirpath); } + if (path[0] == '/' && darwintrace_except(path)) { + asprintf(&redirpath, "%s%s%s", darwintrace_redirect, (*path == '/' ? "" : "/"), path); + if (access(redirpath, F_OK) != 0) { + free(redirpath); + redirpath = (char *)path; + } + } + return redirpath; } From 6db02c7b6a34a80f062730061507e89f2af1d0dd Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 14 Nov 2017 14:53:04 -0500 Subject: [PATCH 075/382] Modernize darwintrace redirection exemption path list --- darwintrace/darwintrace.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/darwintrace/darwintrace.c b/darwintrace/darwintrace.c index fd9fb3b..5e677f8 100644 --- a/darwintrace/darwintrace.c +++ b/darwintrace/darwintrace.c @@ -79,14 +79,7 @@ static pid_t darwintrace_pid = -1; static char *darwintrace_redirect = NULL; static char *darwintrace_buildroot = NULL; static const char *darwintrace_exceptions[] = { - "/Developer/Library/Private", - "/Developer/Library/Frameworks", - "/Developer/usr/bin/../../Library/Private", - "/Developer/usr/bin/../../Library/Frameworks", - "/Developer/Library/Xcode", - "/Developer/Platforms/", - "/Developer/usr/bin/xcode", - "/System/Library/Frameworks/Carbon", + "/Applications/Xcode.app/Contents/Developer", "/Volumes/BuildRoot_", "/usr/bin/xcrun", "/usr/bin/xcode", From 37fb4cb52144a9f552b76838927cf0e307e54164 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 14 Nov 2017 18:48:37 -0500 Subject: [PATCH 076/382] Add /System and /usr/lib to darwintrace redirection exception list --- darwintrace/darwintrace.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/darwintrace/darwintrace.c b/darwintrace/darwintrace.c index 5e677f8..7e7d90d 100644 --- a/darwintrace/darwintrace.c +++ b/darwintrace/darwintrace.c @@ -80,9 +80,11 @@ static char *darwintrace_redirect = NULL; static char *darwintrace_buildroot = NULL; static const char *darwintrace_exceptions[] = { "/Applications/Xcode.app/Contents/Developer", + "/System/Library", "/Volumes/BuildRoot_", "/usr/bin/xcrun", "/usr/bin/xcode", + "/usr/lib", "/usr/local/share/darwin", "/usr/share/xcode", "/var/folders/", From 71391379571733bf28b96bef6823ca3bfa8e38cc Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 14 Nov 2017 18:53:37 -0500 Subject: [PATCH 077/382] Install darwinup into /usr/local with the rest of darwinbuild --- darwinbuild.xcodeproj/project.pbxproj | 1 - 1 file changed, 1 deletion(-) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index c30ed42..be2bd7f 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -3794,7 +3794,6 @@ DEPLOYMENT_POSTPROCESSING = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; INSTALL_PATH = "$(BINDIR)"; - PREFIX = /usr; PRODUCT_NAME = darwinup; STRIP_INSTALLED_PRODUCT = YES; STRIP_STYLE = all; From f2f905f1e2e9b48d483e9d69f92b8c0d189efba2 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 14 Nov 2017 19:18:50 -0500 Subject: [PATCH 078/382] Move platform detection out of installXcode script This was breaking the build if -nochroot was passed. Now, platform detection will always be performed, chroot or no chroot. --- darwinbuild.xcodeproj/project.pbxproj | 4 +++ darwinbuild/darwinbuild.in | 5 ++++ darwinbuild/installXcode_Modern | 5 ---- darwinbuild/setXcodePlatform | 43 +++++++++++++++++++++++++++ 4 files changed, 52 insertions(+), 5 deletions(-) create mode 100755 darwinbuild/setXcodePlatform diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index be2bd7f..ef6f5f7 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -92,6 +92,7 @@ /* Begin PBXBuildFile section */ 1F514C441F4A5CDA008D9341 /* fetch-from-github in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1F514C431F4A5CC0008D9341 /* fetch-from-github */; }; 1FC854011ED462EE00EA2AF5 /* installXcode_Modern in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1FC854001ED462DF00EA2AF5 /* installXcode_Modern */; }; + 1FECB5DF1FBBBD41002EA059 /* setXcodePlatform in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1FECB5DE1FBBBC09002EA059 /* setXcodePlatform */; }; 3963011A1EAB4D60006081C7 /* source_sites.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86C0E10965EEA00C66E90 /* source_sites.c */; }; 396301211EAB4E01006081C7 /* patch_sites.c in Sources */ = {isa = PBXBuildFile; fileRef = 396301191EAB42B6006081C7 /* patch_sites.c */; }; 396301291EAB5DBC006081C7 /* patch_sites.tcl in CopyFiles */ = {isa = PBXBuildFile; fileRef = 396301281EAB5DB5006081C7 /* patch_sites.tcl */; }; @@ -633,6 +634,7 @@ files = ( 1F514C441F4A5CDA008D9341 /* fetch-from-github in CopyFiles */, 1FC854011ED462EE00EA2AF5 /* installXcode_Modern in CopyFiles */, + 1FECB5DF1FBBBD41002EA059 /* setXcodePlatform in CopyFiles */, 7227AD1C109A05FA00BE33D7 /* buildlist in CopyFiles */, 7227AD1D109A05FA00BE33D7 /* buildorder in CopyFiles */, 7227AD1E109A05FA00BE33D7 /* ditto in CopyFiles */, @@ -664,6 +666,7 @@ /* Begin PBXFileReference section */ 1F514C431F4A5CC0008D9341 /* fetch-from-github */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = "fetch-from-github"; path = "darwinbuild/fetch-from-github"; sourceTree = ""; }; 1FC854001ED462DF00EA2AF5 /* installXcode_Modern */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = installXcode_Modern; path = darwinbuild/installXcode_Modern; sourceTree = ""; }; + 1FECB5DE1FBBBC09002EA059 /* setXcodePlatform */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = setXcodePlatform; path = darwinbuild/setXcodePlatform; sourceTree = ""; }; 396301191EAB42B6006081C7 /* patch_sites.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = patch_sites.c; sourceTree = ""; }; 396301271EAB4E01006081C7 /* patch_sites.so */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.objfile"; includeInIndex = 0; path = patch_sites.so; sourceTree = BUILT_PRODUCTS_DIR; }; 396301281EAB5DB5006081C7 /* patch_sites.tcl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = patch_sites.tcl; sourceTree = ""; }; @@ -1080,6 +1083,7 @@ 72C86C2B1096600B00C66E90 /* installXcode31 */, 72C86C2C1096600B00C66E90 /* installXcode32.in */, 1FC854001ED462DF00EA2AF5 /* installXcode_Modern */, + 1FECB5DE1FBBBC09002EA059 /* setXcodePlatform */, 72C86C2E1096600B00C66E90 /* manifest.c */, 72C86C311096600B00C66E90 /* SDKSettings.plist */, ); diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 7d4597e..6690590 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -648,6 +648,11 @@ if [ ! -f "$receipts/xcodebuild" -a "$USE_CHROOT" = "YES" ]; then touch "$receipts/xcodebuild" fi +"$DATADIR/setXcodePlatform" "$PWDP" || { + echo Could not set Xcode platform, build cannot continue 1>&2 + exit 1 +} + ### ### Read in the environment ### diff --git a/darwinbuild/installXcode_Modern b/darwinbuild/installXcode_Modern index d856e51..7ae7b71 100755 --- a/darwinbuild/installXcode_Modern +++ b/darwinbuild/installXcode_Modern @@ -27,7 +27,6 @@ # POSSIBILITY OF SUCH DAMAGE. # - do_ditto () { local path=$1 echo ditto $path @@ -85,11 +84,7 @@ if [ "$HOST_DARWIN_VERSION" == "10.13" ]; then EOF codesign -s - -f --entitlements $BUILDROOT/private/tmp/empty.entitlements $BUILDROOT/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild - - echo macosx10.13 > $2/.build/platform elif [ "$HOST_DARWIN_VERSION" == "10.12" ]; then rm $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk mv $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk - - echo macosx10.12 > $2/.build/platform fi diff --git a/darwinbuild/setXcodePlatform b/darwinbuild/setXcodePlatform new file mode 100755 index 0000000..8802607 --- /dev/null +++ b/darwinbuild/setXcodePlatform @@ -0,0 +1,43 @@ +#!/bin/sh +# +# Copyright (c) 2017 William Kent. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of +# its contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY ITS CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +# Don't overwrite the platform if it already exists +[ -f $1/.build/platform ] && exit 0 + +set -e + +HOST_DARWIN_VERSION=$(sw_vers -productVersion | sed -Ee 's,(10\.[0-9]{2}).*,\1,') + +[ "$HOST_DARWIN_VERSION" = "10.13" ] && echo 'macosx10.13' > $1/.build/platform +[ "$HOST_DARWIN_VERSION" = "10.12" ] && echo 'macosx10.12' > $1/.build/platform + +if [ ! -f $1/.build/platform ]; then + echo Unrecognized macOS version 1>&2 + exit 1 +fi From e6c3dde03375a49ffe6e78864754d4589daf4a78 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 14 Nov 2017 19:19:33 -0500 Subject: [PATCH 079/382] Don't use the chroot as the default any more While building in the chroot currently works under macOS High Sierra, this isn't guaranteed to remain so for the foreseeable future, i.e. a future Xcode change may break it. The only surefire way around that is to eschew the chroot entirely. --- darwinbuild/darwinbuild.in | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 6690590..f2f00f1 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -100,7 +100,7 @@ target="" configuration="" version="" -USE_CHROOT="YES" +USE_CHROOT="NO" INSTALL_XCODE="NO" ### @@ -210,7 +210,7 @@ function PrintUsage() { usage: $(basename $0) [action] [options] [] actions: [-headers] [-fetch] [-source] [-load] [-loadonly] options: [-build=X] [-target=X] [-configuration=X] - [-logdeps] [-nochroot] [-nopatch] [-noload] + [-logdeps] [-chroot] [-nopatch] [-noload] [-depsbuild=X [-depsbuild=Y]] [-nosource] EOF @@ -286,8 +286,8 @@ fi ### -logdeps Do magic to log the build-time dependencies ### -nopatch Don't patch sources before building. ### -noload Don't load dependencies into the chroot. -### Has no effect if -nochroot is specified. -### -nochroot Do not chroot into the BuildRoot when building +### Has no effect unless -chroot is specified. +### -chroot chroot into the BuildRoot when building ### -target=X The makefile or xcode target to build ### -configuration=X Specify the build configuration to use ### -build=X Specify the darwin build number to buld, e.g. 8B15 @@ -323,9 +323,8 @@ for ARG in "$@"; do build="${ARG/*=/}" elif [ "${ARG/=*/}" == "-depsbuild" ]; then depsbuild="${depsbuild} ${ARG/*=/}" - elif [ "$ARG" == "-nochroot" ]; then - export INSTALL_XCODE="NO" - export USE_CHROOT="NO" + elif [ "$ARG" == "-chroot" ]; then + export USE_CHROOT="YES" elif [ "$ARG" == "-nopatch" ]; then nopatch="YES" elif [ "$ARG" == "-load" ]; then From b5d00607906b932c950b4649d737ddadc24ca674 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 14 Nov 2017 19:29:38 -0500 Subject: [PATCH 080/382] Add patch for dtrace_host This patch is required for xnu to build properly when not using a chroot. A follow-up patch for xnu will be added shortly. --- .../dtrace-209.50.12.host-install.p1.patch | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 patches/dtrace-209.50.12.host-install.p1.patch diff --git a/patches/dtrace-209.50.12.host-install.p1.patch b/patches/dtrace-209.50.12.host-install.p1.patch new file mode 100644 index 0000000..245c77a --- /dev/null +++ b/patches/dtrace-209.50.12.host-install.p1.patch @@ -0,0 +1,58 @@ +diff --git a/dtrace.xcodeproj/project.pbxproj b/dtrace.xcodeproj/project.pbxproj +index c97d7b6..1900353 100644 +--- a/dtrace.xcodeproj/project.pbxproj ++++ b/dtrace.xcodeproj/project.pbxproj +@@ -5792,7 +5792,7 @@ + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 0; +- INSTALL_PATH = "$(DT_TOOLCHAIN_DIR)/usr/local/bin"; ++ INSTALL_PATH = /usr/local/bin; + OTHER_CFLAGS = ( + "-D_INT64_TYPE", + "-D_LONGLONG_TYPE", +@@ -5822,7 +5822,7 @@ + ); + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_MODEL_TUNING = G5; +- INSTALL_PATH = "$(DT_TOOLCHAIN_DIR)/usr/local/bin"; ++ INSTALL_PATH = /usr/local/bin; + OTHER_CFLAGS = ( + "-D_INT64_TYPE", + "-D_LONGLONG_TYPE", +@@ -5854,7 +5854,7 @@ + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 0; +- INSTALL_PATH = "$(DT_TOOLCHAIN_DIR)/usr/local/bin"; ++ INSTALL_PATH = /usr/local/bin; + OTHER_CFLAGS = ( + "-D_INT64_TYPE", + "-D_LONGLONG_TYPE", +@@ -5883,7 +5883,7 @@ + ); + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_MODEL_TUNING = G5; +- INSTALL_PATH = "$(DT_TOOLCHAIN_DIR)/usr/local/bin"; ++ INSTALL_PATH = /usr/local/bin; + OTHER_CFLAGS = ( + "-D_INT64_TYPE", + "-D_LONGLONG_TYPE", +@@ -5949,7 +5949,7 @@ + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 0; +- INSTALL_PATH = "$(DT_TOOLCHAIN_DIR)/usr/local/bin"; ++ INSTALL_PATH = /usr/local/bin; + OTHER_CFLAGS = ( + "-D_INT64_TYPE", + "-D_LONGLONG_TYPE", +@@ -5979,7 +5979,7 @@ + ); + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_MODEL_TUNING = G5; +- INSTALL_PATH = "$(DT_TOOLCHAIN_DIR)/usr/local/bin"; ++ INSTALL_PATH = /usr/local/bin; + OTHER_CFLAGS = ( + "-D_INT64_TYPE", + "-D_LONGLONG_TYPE", From 91d01c6307ba965365ddeb6fda8e3d01ae9c2258 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 14 Nov 2017 20:20:46 -0500 Subject: [PATCH 081/382] darwinbuild now exports the RC_BuildRoot variable You use it by prepending '${RC_BuildRoot}' to paths to files installed by a darwinbuild root that were previously absolute. This environment variable, usable in both make-based build systems and Xcode project-based systems, is equivalent to the path to what would be the root of the chroot, if the chroot is not being used. If the chroot *is* being used, it will not be defined, therefore evaluate to an empty string, and previously-absolute paths would still be absolute. --- darwinbuild/darwinbuild.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index f2f00f1..ef6ee9b 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -813,6 +813,11 @@ for X in \ done IFS="$OLDIFS" +if [ "$USE_CHROOT" = "NO" ]; then + export RC_BuildRoot=$BuildRoot + build_string="$build_string \"RC_BuildRoot=$BuildRoot\"" +fi + cat <<-EOF >> $SCRIPT echo '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++' echo 'Environment variables:' From 60847a0c5128c4875b32c6d68366695b66223233 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 14 Nov 2017 20:25:48 -0500 Subject: [PATCH 082/382] Add xnu patch corresponding to b5d0060 Note that csekel/darwinbuild#16 will need to be merged before this patch will be usable. --- patches/xnu-3789.51.2.paths.p1.patch | 54 ++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 patches/xnu-3789.51.2.paths.p1.patch diff --git a/patches/xnu-3789.51.2.paths.p1.patch b/patches/xnu-3789.51.2.paths.p1.patch new file mode 100644 index 0000000..626e2d7 --- /dev/null +++ b/patches/xnu-3789.51.2.paths.p1.patch @@ -0,0 +1,54 @@ +diff --git a/bsd/sys/make_symbol_aliasing.sh b/bsd/sys/make_symbol_aliasing.sh +index bfddb2d..a1e694a 100755 +--- a/bsd/sys/make_symbol_aliasing.sh ++++ b/bsd/sys/make_symbol_aliasing.sh +@@ -34,8 +34,8 @@ fi + SDKROOT="$1" + OUTPUT="$2" + +-if [ ! -x "/usr/local/libexec/availability.pl" ] ; then +- echo "Unable to locate /usr/local/libexec/availability.pl (or not executable)" >&2 ++if [ ! -x "${RC_BuildRoot}/usr/local/libexec/availability.pl" ] ; then ++ echo "Unable to locate ${RC_BuildRoot}/usr/local/libexec/availability.pl (or not executable)" >&2 + exit 1 + fi + +@@ -74,7 +74,7 @@ cat < Date: Tue, 14 Nov 2017 20:34:15 -0500 Subject: [PATCH 083/382] Adjust libfirehose patches for RC_BuildRoot compatibility --- ...ibdispatch-703.50.37.libfirehose-install.p1.patch | 12 ++++++------ patches/libdispatch-703.50.37.libfirehose.p1.patch | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/patches/libdispatch-703.50.37.libfirehose-install.p1.patch b/patches/libdispatch-703.50.37.libfirehose-install.p1.patch index cb3c191..f20e1e6 100644 --- a/patches/libdispatch-703.50.37.libfirehose-install.p1.patch +++ b/patches/libdispatch-703.50.37.libfirehose-install.p1.patch @@ -6,9 +6,9 @@ index 5fa010b..ef132a5 100644 isa = XCBuildConfiguration; baseConfigurationReference = 6E040C721C499C3600411A2E /* libfirehose_kernel.xcconfig */; buildSettings = { -+ INSTALL_PATH = "$(SDKROOT)/usr/local/lib/kernel/"; -+ PRIVATE_HEADERS_FOLDER_PATH = "$(SDKROOT)/usr/local/include/kernel/os"; -+ PUBLIC_HEADERS_FOLDER_PATH = "$(SDKROOT)/usr/include/os"; ++ INSTALL_PATH = "/usr/local/lib/kernel/"; ++ PRIVATE_HEADERS_FOLDER_PATH = "/usr/local/include/kernel/os"; ++ PUBLIC_HEADERS_FOLDER_PATH = "/usr/include/os"; }; name = Release; }; @@ -16,9 +16,9 @@ index 5fa010b..ef132a5 100644 isa = XCBuildConfiguration; baseConfigurationReference = 6E040C721C499C3600411A2E /* libfirehose_kernel.xcconfig */; buildSettings = { -+ INSTALL_PATH = "$(SDKROOT)/usr/local/lib/kernel/"; -+ PRIVATE_HEADERS_FOLDER_PATH = "$(SDKROOT)/usr/local/include/kernel/os"; -+ PUBLIC_HEADERS_FOLDER_PATH = "$(SDKROOT)/usr/include/os"; ++ INSTALL_PATH = "/usr/local/lib/kernel/"; ++ PRIVATE_HEADERS_FOLDER_PATH = "/usr/local/include/kernel/os"; ++ PUBLIC_HEADERS_FOLDER_PATH = "/usr/include/os"; }; name = Debug; }; diff --git a/patches/libdispatch-703.50.37.libfirehose.p1.patch b/patches/libdispatch-703.50.37.libfirehose.p1.patch index 991ccff..a1663a6 100644 --- a/patches/libdispatch-703.50.37.libfirehose.p1.patch +++ b/patches/libdispatch-703.50.37.libfirehose.p1.patch @@ -7,7 +7,7 @@ index f6b2a99..ab26649 100644 SUPPORTED_PLATFORMS = macosx iphoneos appletvos watchos -HEADER_SEARCH_PATHS = $(PROJECT_DIR) $(SDKROOT)/System/Library/Frameworks/Kernel.framework/PrivateHeaders $(SDKROOT)/System/Library/Frameworks/Kernel.framework/Headers $(SDKROOT)/usr/local/include/os $(SDKROOT)/usr/local/include/firehose -+HEADER_SEARCH_PATHS = $(PROJECT_DIR) /System/Library/Frameworks/Kernel.framework/PrivateHeaders $(SDKROOT)/System/Library/Frameworks/Kernel.framework/Headers /usr/local/include/os /usr/local/include/firehose ++HEADER_SEARCH_PATHS = $(PROJECT_DIR) $(RC_BuildRoot)/System/Library/Frameworks/Kernel.framework/PrivateHeaders $(SDKROOT)/System/Library/Frameworks/Kernel.framework/Headers $(RC_BuildRoot)/usr/local/include/os $(RC_BuildRoot)/usr/local/include/firehose GCC_PREPROCESSOR_DEFINITIONS = $(inherited) KERNEL=1 DISPATCH_USE_DTRACE=0 From 3ede932bff7bf3478d817079068508af243faac7 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 14 Nov 2017 20:48:38 -0500 Subject: [PATCH 084/382] Fix erroneous substitution in xnu patch I wish I had caught this earlier, but it only manifested at the very last step of a xnu build cycle. Oh well! --- patches/xnu-3789.51.2.paths.p1.patch | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/patches/xnu-3789.51.2.paths.p1.patch b/patches/xnu-3789.51.2.paths.p1.patch index 626e2d7..10e8503 100644 --- a/patches/xnu-3789.51.2.paths.p1.patch +++ b/patches/xnu-3789.51.2.paths.p1.patch @@ -35,7 +35,7 @@ diff --git a/makedefs/MakeInc.cmd b/makedefs/MakeInc.cmd index 0619a33..b43f856 100644 --- a/makedefs/MakeInc.cmd +++ b/makedefs/MakeInc.cmd -@@ -103,13 +103,13 @@ ifeq ($(DSYMUTIL),) +@@ -103,8 +103,8 @@ ifeq ($(DSYMUTIL),) export DSYMUTIL := $(shell $(XCRUN) -sdk $(SDKROOT) -find dsymutil) endif ifeq ($(CTFCONVERT),) @@ -46,9 +46,3 @@ index 0619a33..b43f856 100644 - export CTFMERGE := $(shell $(XCRUN) -sdk $(SDKROOT) -find ctfmerge) + export CTFMERGE := $(RC_BuildRoot)/usr/local/bin/ctfmerge endif - ifeq ($(CTFINSERT),) -- export CTFINSERT := $(shell $(XCRUN) -sdk $(SDKROOT) -find ctf_insert) -+ export CTFINSERT := $(RC_BuildRoot)/usr/local/bin/ctf_insert - endif - ifeq ($(NMEDIT),) - export NMEDIT := $(shell $(XCRUN) -sdk $(SDKROOT) -find nmedit) From 9ce3a97b9c1be096a4466744fcc26fcb01d98f16 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 14 Nov 2017 20:55:27 -0500 Subject: [PATCH 085/382] Add accidentally omitted patch --- .../xnu-3789.51.2.firehose-buildroot.p1.patch | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 patches/xnu-3789.51.2.firehose-buildroot.p1.patch diff --git a/patches/xnu-3789.51.2.firehose-buildroot.p1.patch b/patches/xnu-3789.51.2.firehose-buildroot.p1.patch new file mode 100644 index 0000000..d685efd --- /dev/null +++ b/patches/xnu-3789.51.2.firehose-buildroot.p1.patch @@ -0,0 +1,22 @@ +diff --git a/makedefs/MakeInc.def b/makedefs/MakeInc.def +index 31825ce..de93142 100644 +--- a/makedefs/MakeInc.def ++++ b/makedefs/MakeInc.def +@@ -325,7 +325,7 @@ LDFLAGS_KERNEL_GEN = \ + -Wl,-function_starts \ + -Wl,-headerpad,152 + +-LDFLAGS_KERNEL_SDK = -L$(SDKROOT)/usr/local/lib/kernel -lfirehose_kernel ++LDFLAGS_KERNEL_SDK = -L$(RC_BuildRoot)/usr/local/lib/kernel -lfirehose_kernel + + LDFLAGS_KERNEL_RELEASE = + LDFLAGS_KERNEL_DEVELOPMENT = +@@ -420,7 +420,7 @@ INCFLAGS_IMPORT = $(patsubst %, -I$(OBJROOT)/EXPORT_HDRS/%, $(COMPONENT_IMPORT_L + INCFLAGS_EXTERN = -I$(SRCROOT)/EXTERNAL_HEADERS + INCFLAGS_GEN = -I$(SRCROOT)/$(COMPONENT) -I$(OBJROOT)/EXPORT_HDRS/$(COMPONENT) + INCFLAGS_LOCAL = -I. +-INCFLAGS_SDK = -I$(SDKROOT)/usr/local/include/kernel ++INCFLAGS_SDK = -I$(RC_BuildRoot)/usr/local/include/kernel + + INCFLAGS = $(INCFLAGS_LOCAL) $(INCFLAGS_GEN) $(INCFLAGS_IMPORT) $(INCFLAGS_EXTERN) $(INCFLAGS_MAKEFILE) $(INCFLAGS_SDK) + From 144d6cee59534cda8acd81c3174cc877350358e2 Mon Sep 17 00:00:00 2001 From: William Kent Date: Wed, 29 Nov 2017 20:36:50 -0500 Subject: [PATCH 086/382] Revert "Add "overlay" functionality to darwintrace" This code did not solve the problem I thought it would (minimizing path differences between the chroot and non-chroot environments). Therefore, it does nothing useful. This reverts commit 2255d6960c7a6096cbb373e4b90b610ef97f96d8. --- darwintrace/darwintrace.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/darwintrace/darwintrace.c b/darwintrace/darwintrace.c index 7e7d90d..53360d4 100644 --- a/darwintrace/darwintrace.c +++ b/darwintrace/darwintrace.c @@ -128,14 +128,6 @@ static inline char* darwintrace_redirect_path(const char* path) { dprintf("darwintrace: redirect %s -> %s\n", path, redirpath); } - if (path[0] == '/' && darwintrace_except(path)) { - asprintf(&redirpath, "%s%s%s", darwintrace_redirect, (*path == '/' ? "" : "/"), path); - if (access(redirpath, F_OK) != 0) { - free(redirpath); - redirpath = (char *)path; - } - } - return redirpath; } From abfd04d38afba3d65ddc2a42ade443adf9142046 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sat, 16 Dec 2017 22:30:19 -0500 Subject: [PATCH 087/382] Clean up version reporting in darwinbuild logs The "grep -v dwarf-version" code on the cctools version line is due to `as -v` printing an internal clang command line, which happens to include the word 'version' as part of a flag. This causes a false-positive that clutters the log. --- darwinbuild/darwinbuild.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index ef6ee9b..8ccc7c7 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -746,9 +746,9 @@ cat <<-EOF > $SCRIPT echo ' Build action: $action' echo " Build number: $build" echo " Host kernel version: \$(uname -v 2>/dev/null)" - echo " cc version: \$(gcc -v 2>&1 | tail -n 1 2>/dev/null)" + echo " cc version: \$(gcc -v 2>&1 | grep version 2>/dev/null)" # Panther cctools unlinks -o target, so don't use /dev/null - echo " cctools version: \$(as -v -o /.devnull < /dev/null 2>&1 | cut -c 22- 2>/dev/null)" + echo " cctools version: \$(as -v -o /.devnull < /dev/null 2>&1 | grep version | grep -v dwarf-version 2>/dev/null)" EOF if [ "$logdeps" == "YES" ]; then if [ "$USE_CHROOT" == "YES" ]; then @@ -777,7 +777,7 @@ fi if [ "$buildtool" == "xcodebuild" ]; then cat <<-EOF >> $SCRIPT - echo " xcode version: \$(sh -c \\\"$buildtool -version\\\")" + echo " xcode version: \$(sh -c \\\"$buildtool -version\\\" | head -1 2> /dev/null)" EOF else cat <<-EOF >> $SCRIPT From c3b8575084c468d75ea4dbf92435fd5eb8b31655 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sat, 16 Dec 2017 22:37:16 -0500 Subject: [PATCH 088/382] Use the physical path to the build root This results in much cleaner-looking paths in build logs and output. --- darwinbuild/darwinbuild.in | 1 + 1 file changed, 1 insertion(+) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 8ccc7c7..b2cd49c 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -222,6 +222,7 @@ EOF ### CheckDarwinBuildRoot BuildRoot="$DARWIN_BUILDROOT/BuildRoot" +BuildRoot=$(realpath $BuildRoot) export DARWINXREF_DB_FILE="$DARWIN_BUILDROOT/$XREFDB" ### From c3e7b9092bf42760fb4fdca67623ba24718b3b84 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sat, 16 Dec 2017 22:41:01 -0500 Subject: [PATCH 089/382] Add extra quoting for safety --- darwinbuild/darwinbuild.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index b2cd49c..291a36a 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -222,7 +222,7 @@ EOF ### CheckDarwinBuildRoot BuildRoot="$DARWIN_BUILDROOT/BuildRoot" -BuildRoot=$(realpath $BuildRoot) +BuildRoot=$(realpath "$BuildRoot") export DARWINXREF_DB_FILE="$DARWIN_BUILDROOT/$XREFDB" ### From d6234bda50a74a29e0b40d759a8b3c5a630c87e1 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 17 Dec 2017 16:40:08 -0500 Subject: [PATCH 090/382] Modify darwinbuild so that it can build as a non-root user This makes it possible for code signing to occur during the build, as if the user built the project using the Xcode user interface. If using the chroot, root privileges will still be required. Also removed NFS support, as not only does that require the use of the root account, it is also thoroughly deprecated. --- darwinbuild/darwinbuild.in | 53 +++++++++----------------------------- 1 file changed, 12 insertions(+), 41 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index ef6ee9b..c8ecd4b 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -33,8 +33,7 @@ ### This script sets up the proper environment to build Darwin projects ### ### Building takes place in the BuildRoot, which by default is backed by -### a sparse disk image, but can also be mounted over NFS loopback (see -### -init options). The BuildRoot location can by specified by +### a sparse disk image. The BuildRoot location can by specified by ### the DARWIN_BUILDROOT environment variable. If not set, it will default ### to the current working directory. However, if the current working directory ### does not contain a Sources, Roots, Logs, and other necessary directories @@ -78,7 +77,6 @@ PREFIX=%%PREFIX%% PWDP=$(pwd -P) XREFDB=.build/xref.db DMGFILE=.build/buildroot.sparsebundle -NFSDIR=.build/buildroot.nfs DARWINXREF=$PREFIX/bin/darwinxref DATADIR=$PREFIX/share/darwinbuild DIGEST=$DATADIR/digest @@ -111,14 +109,6 @@ INSTALL_XCODE="NO" shopt -s nullglob -### -### DarwinBuild must be run as root. Enforce this. -### -if [ "$EUID" != "0" ]; then - echo "Error: DarwinBuild must be run as root." 1>&2 - exit 1 -fi - ### ### The "-init" command sets up the build environment ### in the current working directory. @@ -126,14 +116,13 @@ fi ### if [ "$1" == "-init" ]; then if [ "$2" == "" ]; then - echo "usage: $(basename $0) -init [-nodmg | -nfs]" 1>&2 + echo "usage: $(basename $0) -init [-nodmg ]" 1>&2 echo "" 1>&2 echo "\t\t can be a standard build number or a path to a plist." 1>&2 echo "\t\t supported paths: /dir/file.plist, " 1>&2 echo "\t\t\t\t http://host/dir/file.plist, " 1>&2 echo "\t\t\t\t user@host:/dir/file.plist" 1>&2 echo "\t-nodmg \t do not use a sparse image for build root (use a regular directory)" 1>&2 - echo "\t-nfs \t use NFS over loopback to mount the build root (implies -nodmg)" 1>&2 exit 1 fi build="$2" @@ -166,25 +155,12 @@ if [ "$1" == "-init" ]; then ### Create the build root ### stamp=$(date +'%Y%m%d%H%M%S') - if [ "$3" == "-nfs" ]; then - mkdir -p $NFSDIR - mkdir -p BuildRoot - exportline="${PWDP}/${NFSDIR} -maproot=0:10" - grep "$exportline" /etc/exports >> /dev/null 2>&1 - if [ ! $? -eq 0 ]; then - echo "Adding build root to NFS exports file ..." - echo "# Added by darwinbuild on ${stamp}" >> /etc/exports - echo $exportline >> /etc/exports - fi - nfsd update - echo "Checking exports file ..." - nfsd checkexports - elif [ "$3" == "-nodmg" ]; then + if [ "$3" == "-nodmg" ]; then mkdir -p BuildRoot else echo "Creating build root disk image ..." DMGVOLUME="BuildRoot_${build}_${stamp}" - hdiutil create -size 1t -fs HFSX -quiet -uid 0 -gid 0 \ + hdiutil create -size 1t -fs HFSX -quiet -uid $(id -u) -gid $(id -g) \ -volname $DMGVOLUME \ $DMGFILE ln -s "/Volumes/${DMGVOLUME}" BuildRoot @@ -225,16 +201,9 @@ BuildRoot="$DARWIN_BUILDROOT/BuildRoot" export DARWINXREF_DB_FILE="$DARWIN_BUILDROOT/$XREFDB" ### -### See if we need to attach a disk image or mount an NFS share +### See if we need to attach a disk image ### -if [ ! -d "$BuildRoot/var" -a -d $NFSDIR ]; then - echo "*** Mounting build root over NFS loopback ..." - mount -t nfs localhost:${PWDP}/${NFSDIR} BuildRoot - if [ $? -ne 0 ]; then - echo "Error: Unable to mount build root"; - exit 72 - fi -elif [ -d $DMGFILE ]; then +if [ -d $DMGFILE ]; then stat -L $BuildRoot >> /dev/null 2>&1 if [ $? -eq 1 ]; then echo "*** Attaching build root disk image ..." @@ -505,13 +474,10 @@ REAL_DSTROOT="$BuildRoot/$vartmp/$projnam/$project.root" if [ "$nosource" != "YES" ]; then ### ### Remove any pre-existing directories that might be in the way - ### and create new directories in their place. Make sure the - ### directories have root:wheel ownership, otherwise things may - ### not build correctly. + ### and create new directories in their place. ### rm -Rf "$REAL_SRCROOT" "$REAL_OBJROOT" "$REAL_SYMROOT" "$REAL_DSTROOT" mkdir -p "$REAL_SRCROOT" "$REAL_OBJROOT" "$REAL_SYMROOT" "$REAL_DSTROOT" - chown root:wheel "$REAL_SRCROOT" "$REAL_OBJROOT" "$REAL_SYMROOT" "$REAL_DSTROOT" ### ### Install the sources and patches into the BuildRoot @@ -616,6 +582,11 @@ mkdir -p "$receipts" ### Also install CoreOSMakefiles and Perl for make based projects ### +if [ "$USE_CHROOT" = "YES" -a "$EUID" != "0" ]; then + echo "darwinbuild must be run as root if building in the chroot" 1>&2 + exit 1 +fi + if [ "$USE_CHROOT" = "YES" -a ! -f "$BuildRoot/usr/local/darwinbuild/receipts/.host-system-chroot" ]; then echo "*** Creating chroot environment from host system, this may take a while ..." $DATADIR/createChroot "$BuildRoot" From 9cda66ffe48fcb53bdfe1c03c38af94d3f01c675 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 17 Dec 2017 17:11:33 -0500 Subject: [PATCH 091/382] Add permissions fixup code to darwinmaster This is required because the contents of the install ISO must be owned by root/wheel. If darwinbuild is run as a non-root user, it will propagate that user's uid/gid to the build outputs it generates. --- darwinbuild/darwinmaster.in | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/darwinbuild/darwinmaster.in b/darwinbuild/darwinmaster.in index 4e242f6..703bc13 100644 --- a/darwinbuild/darwinmaster.in +++ b/darwinbuild/darwinmaster.in @@ -206,6 +206,14 @@ for X in $DARWIN_BUILDROOT/Packages/*-*.tar.bz2 ; do fi done +# Now chown to root:wheel, if possible. (Build invocations run as a +# non-privileged user will propagate that user's uid/gid to the build +# outputs it generates.) +if [ $InstallSelfBuiltRoots -eq 1 -a $EUID -eq 0 ]; then + echo "Setting file ownership to root/wheel ..." + chown -R root:wheel "$DESTDIR" +fi + ### ### Create a bootable ISO filesystem ### From 52146596fcf5add378debddeace4fda3057e4c87 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 17 Dec 2017 17:13:00 -0500 Subject: [PATCH 092/382] Fix conditional --- darwinbuild/darwinmaster.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinmaster.in b/darwinbuild/darwinmaster.in index 703bc13..ccdb796 100644 --- a/darwinbuild/darwinmaster.in +++ b/darwinbuild/darwinmaster.in @@ -209,7 +209,7 @@ done # Now chown to root:wheel, if possible. (Build invocations run as a # non-privileged user will propagate that user's uid/gid to the build # outputs it generates.) -if [ $InstallSelfBuiltRoots -eq 1 -a $EUID -eq 0 ]; then +if [ $EUID -eq 0 ]; then echo "Setting file ownership to root/wheel ..." chown -R root:wheel "$DESTDIR" fi From b337bde47b452636128f5a8617b543c357d823bc Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 18 Dec 2017 22:01:51 -0500 Subject: [PATCH 093/382] Update darwinbuild to handle https URLs This is required by a documentation change I will be committing in a moment. --- darwinbuild/darwinbuild.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 3ac69bc..e33d922 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -139,7 +139,7 @@ if [ "$1" == "-init" ]; then # user gave a local path to a plist # since we don't want to download this, copy it cp "$build" ".build/$filename" - elif [ $(echo $build | grep 'http://') ]; then + elif [ $(echo $build | grep 'http://') -o $(echo $build | grep 'https://') ]; then # user gave a URL to a webserver host=$(dirname $build) Download .build $filename $host From b27c1f5df8c197035b8594e56b3215772d66e64b Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 18 Dec 2017 22:01:55 -0500 Subject: [PATCH 094/382] Update README --- README | 171 +++++++++++++++------------------------------------------ 1 file changed, 44 insertions(+), 127 deletions(-) diff --git a/README b/README index ad0c328..593e548 100644 --- a/README +++ b/README @@ -1,8 +1,5 @@ Darwinbuild -Updated 2009-02-17 - -Kevin Van Vechten No longer @ @ppl3 -William Siegrist No longer @ @ppl3 +Updated 2017-12-19 1. Overview 1.1 Availability, Bug Reports, Contributions, and Discussion @@ -35,41 +32,31 @@ These tools will provide the proper build environment as well as help to resolve any necessary dependencies prior to building. [1] -[2] +[2] [3] 1.1 Availability, Bug Reports, Contributions, and Discussion -Due to the constant development of darwinbuild, the only version you should -be working with is trunk of the subversion repository[1]. Trunk should -always be stable enough for building projects. If you find a problem or have -a enhancement in mind, file a ticket at the website[2]. - -Discussion about darwinbuild, or building Darwin projects in -general, should take place on the darwinbuild-dev[3] mailing list. +Due to the constant development of darwinbuild, the only version you should +be working with is the master branch of the Git repository[1]. This should +always be stable enough for building projects. -[1] -[2] -[3] +[1] =============== 2. Installation =============== -You can install the latest version of darwinbuild using MacPorts. - - % port install darwinbuild - -Or, you can also install by checking out the source and building -darwinbuild yourself. The included Xcode project will compile the tools and install -them into the location specified by the PREFIX environment parameter. If the -PREFIX parameter is not specified, the files will be installed into /usr/local. +You can install by checking out the source and building darwinbuild yourself. +The included Xcode project will compile the tools and install them into the +location specified by the PREFIX environment parameter. If the PREFIX parameter +is not specified, the files will be installed into /usr/local. By default, darwinbuild will build for x86_64 and i386. You can override this with the ARCHS environment variable. However, building trunk for ppc is not supported since trunk is targeted for Darwin 10. The release branches for Darwin 8 and 9 do -support building for ppc. +support building for ppc. To build and install darwinbuild to the boot partition: @@ -78,30 +65,26 @@ To build and install darwinbuild to the boot partition: 2.1 Creating the Build Directory -After installation, you must initialize the build directory using darwinbuild. -Assuming you wanted to build projects from 9G55 in your home directory: +After installation, you must initialize the build directory using darwinbuild. +Assuming you wanted to build projects from the SUFuji16E195 plist[1] (which is +what most current development is targeting): - # mkdir ~/9G55 - # cd ~/9G55 - # sudo -s - # darwinbuild -init 9G55 + $ mkdir ~/SUFuji16E195 + $ cd ~/SUFuji16E195 + $ darwinbuild -init https://github.com/csekel/PureDarwin-System-Plist/raw/master/SUFuji16E195.plist Creating build root disk image ... - Attempting to download http://svn.macosforge.org/repository/darwinbuild/trunk/plists//9G55.plist ... - Download complete - Attempting to download http://svn.macosforge.org/repository/darwinbuild/trunk/plists//9F33.plist ... - Download complete - ... - Attempting to download http://svn.macosforge.org/repository/darwinbuild/trunk/plists//9A581.plist ... + Attempting to download https://github.com/csekel/PureDarwin-System-Plist/raw/master/SUFuji16E195.plist ... Download complete Initialization Complete - # ls + $ ls .build Headers Logs Roots Sources Symbols +[1] After initialization, the build directory will contain the following: .build contains private data for the darwinbuild system Headers contains the resulting header files from previous builds -Logs contains logs of previous build attempts +Logs contains logs of previous build attempts Roots contains the finished products of previous successful builds Sources contains sources downloaded from the web Symbols contains debug symbol versions of previous build products @@ -119,7 +102,7 @@ assume the current working directory is this build directory. To build a Darwin project, for example xnu, the darwinbuild script can be used in the following manner: - # darwinbuild xnu + $ darwinbuild xnu The darwinxref tool is consulted to find the version that corresponds to the build specified when the build directory was initialized. It is necessary @@ -127,22 +110,23 @@ to run the darwinbuild tool as root so that projects can set the proper ownership and permissions on the build results. darwinbuild first looks in the Sources directory for a directory containing -the sources to be built (Sources/xnu-517.11.1), or a .tar.gz archive -containing the sources (Sources/xnu-517.11.1.tar.gz). If neither is found, -darwinbuild will attempt to download the sources from the web. +the sources to be built (Sources/xnu-3789.51.2), or a .tar.gz archive +containing the sources (Sources/xnu-3789.51.2.tar.gz). If neither is found, +darwinbuild will attempt to download the sources from the web (including +from GitHub Releases). If it does not already exist, a BuildRoot directory will be created. This -is where the build will actually take place. During the build, darwinbuild -will change the root directory to BuildRoot (see the chroot(8) man page for -details). Darwinbuild is capable of copying the required tools, libraries -and headers from the Roots directory into the BuildRoot prior to building. -If a necessary dependency is not found in the Roots directory, it will be -downloaded from the web. +is where the build will actually take place. By default, darwinbuild does +not change the root directory to BuildRoot any more (see the chroot(8) man +page for details). This is because of incompatibilities between a chroot +environment and the current version of the Xcode build tools. Darwinbuild +can modify the tools to work correctly in a chroot, but *this is unsupported* +and may break at any time. The build output will be written to the console, and additionally logged into a file in the Logs directory. The above example produces the following file: - Logs/xnu/xnu-517.11.1.log~1 + Logs/xnu/xnu-3789.51.2.log~1 The ~1 indicates that this log file corresponds to the first attempt to build xnu version 517.11.1. Each subsequent attempt will add one to this @@ -150,7 +134,7 @@ build number. If the build succeeds, the finished product will be copied out of the BuildRoot directory and into the Roots directory: - Roots/xnu/xnu-517.11.1.root~1 + Roots/xnu/xnu-3789.51.2.root~1 After the copy, darwinbuild traverses the directory and records all files found in the darwinxref database. This makes it possible to query which project a file is produced by. When a Mach-O executable, library, or bundle @@ -180,7 +164,7 @@ the same style as the Roots directory for a regular build. For example: Passing the -logdeps flag to darwinbuild will build the specified project while recording the paths of all files openened and all executables invoked. These paths are written into the Logs directory, and if the build is -successful, will be imported into the darwinxref database. +successful, will be imported into the darwinxref database. ============================== @@ -212,7 +196,7 @@ that is being targeted, such as 10.2 or 10.3. 4.1 Build Aliases and Alternate Targets -Some projects may produce different results based on the contents of +Some projects may produce different results based on the contents of the RC_ProjectName variable. When the same source archive is used to create more than one component of Darwin, it's referred to as a build alias. Because of this, it is important to always provide accurrate @@ -224,71 +208,6 @@ to the make tool (gnumake or xcodebuild). However, some projects produce different results based on alternate targets. If the project in the property list contains a "target" attribute, that string will be passed instead. - -====================== -5. Tips and Techniques -====================== - - -5.1 Private Headers - -Many open source header files are not present in a standard macOS install. -These "private headers" are not needed by application developers, and are not -part of any SDK officially supported by Apple. However, Darwin projects are -part of the operating system itself and these headers are required. The -darwinbuildheaders command uses the darwinxref tool and darwinbuild -headers -commands to produce all header files for a given darwin release. - % bin/darwinbuildheaders - -The resulting header files from each project are placed into the Headers -directory. The headers can be subsequently installed into the BuildRoot -directory using the installheaders command. - % bin/installheaders - -By modifying the build plist file, it is possible to include these headers -instead of the default system headers, giving more accurate build results and -avoiding failures. Edit the RC_NONARCH_CFLAGS variable to provide the following -include paths to gcc (substituting the actual installation directory). - -I/usr/local/darwinbuild/BuildRoot/usr/include - -I/usr/local/darwinbuild/BuildRoot/usr/local/include - - -5.2 Build Tools - -In addition to private headers, there are numerous command line tools which -are used exclusively to build Darwin projects. These tools are placed in -/usr/local/bin. For example, building xnu requires kextsymboltool, -relpath, and decomment. - - -5.3 Static Libraries - -Several projects require static libraries from other projects. These libraries -are usually placed in /usr/local/lib/system. The most notable examples are -xnu's usage of libkld.a which is produced by cctools_ofiles, and Libsystem's -use of many static libraries from Libc, Libinfo, and more. - - -5.4 Alternate BuildRoot Storage - -By default, "darwinbuild -init" will setup your environment to use a HFSX -sparsebundle to host your BuildRoot. A sparsebundle is used to work around -problems with using xcodebuild inside of a chroot. There are two other -storage methods to choose from: NFS Loopback and Legacy Directory. - - 1. NFS Loopback (ex: darwinbuild -init 9G55 -nfs) - The NFS loopback method places a directory under .build and adds that - directory to /etc/exports. When you try to build a project, darwinbuild - will mount the NFS export on localhost. The NFS mount also works around - the xcodebuild problems. - - 2. Legacy Directory (ex: darwinbuild -init 9G55 -nodmg) - This is just the way darwinbuild worked before the sparsebundle and NFS - support was added. It just makes a directory for BuildRoot and builds - on whatever filesystem you are on at the time. If you are on HFS or ZFS, - this storage will cause problems for Xcode-based projects. - - ============= A. darwinxref ============= @@ -310,19 +229,19 @@ header file, sqlite3.h. [2] An example of downloading, installing, and querying a property list: - % curl http://svn.macosforge.org/repository/darwinbuild/trunk/plists/7U16.plist > \ - plists/7U16.plist - % bin/darwinxref loadIndex plists/7U16.plist + $ curl -L https://github.com/csekel/PureDarwin-System-Plist/raw/master/SUFuji16E195.plist > \ + plists/SUFuji16E195.plist + $ darwinxref loadIndex plists/SUFuji16E195.plist 268 of 268 projects loaded. - % bin/darwinxref -b 7U16 version xnu - xnu-517.11.1 + $ darwinxref -b SUFuji16E195 version xnu + xnu-3789.51.2 To list all projects in a build, use the special project name '*': - % bin/darwinxref -b 7U16 version '*' + $ darwinxref -b SUFuji16E195 version '*' To register the results of a previous build with the database use the register command. Note this is done automatically by darwinbuild: - % bin/darwinxref register adv_cmds 63 Roots/adv_cmds/adv_cmds-63.root~1 + $ darwinxref register adv_cmds 63 Roots/adv_cmds/adv_cmds-63.root~1 /bin /bin/ps /bin/stty @@ -330,8 +249,6 @@ register command. Note this is done automatically by darwinbuild: To find which project produces the 'whois' command by searching the list of previously registered files: - % bin/darwinxref findFile whois + $ bin/darwinxref findFile whois adv_cmds-63: /usr/bin/whois - - From c642a03961ccd8b4a5db75b7ccf1a3a9785b596a Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 18 Dec 2017 22:03:47 -0500 Subject: [PATCH 095/382] Fix conditional test --- darwinbuild/darwinbuild.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index e33d922..9aa88d9 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -139,7 +139,7 @@ if [ "$1" == "-init" ]; then # user gave a local path to a plist # since we don't want to download this, copy it cp "$build" ".build/$filename" - elif [ $(echo $build | grep 'http://') -o $(echo $build | grep 'https://') ]; then + elif [ $(echo $build | egrep 'https?://') ]; then # user gave a URL to a webserver host=$(dirname $build) Download .build $filename $host From 96e4ef6274eaf9ffddca4b1a9c59eb3047e26c08 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 26 Dec 2017 19:52:58 -0500 Subject: [PATCH 096/382] Fix path manipulation The previous algorithm would not work on a stock macOS system (it depended on coreutils, which I happened to have installed at the time), and it would also cause failures if the build root image was not mounted (which therefore broke mounting the image to begin with). Both problems should now be fixed. --- darwinbuild/darwinbuild.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 3ac69bc..6f4ce00 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -198,7 +198,6 @@ EOF ### CheckDarwinBuildRoot BuildRoot="$DARWIN_BUILDROOT/BuildRoot" -BuildRoot=$(realpath "$BuildRoot") export DARWINXREF_DB_FILE="$DARWIN_BUILDROOT/$XREFDB" ### @@ -214,6 +213,8 @@ if [ -d $DMGFILE ]; then exit 70 fi fi + + BuildRoot=$(cd "$BuildRoot" && pwd -P) fi ### From 0cd87b6736cd8f81aeb48caf85d92f1e6b4bfec7 Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 1 Feb 2018 18:21:37 -0500 Subject: [PATCH 097/382] Only create the build image if it doesn't already exist This stops duplicate broken BuildRoot symlinks from piling up in the root of the mounted build image. --- darwinbuild/darwinbuild.in | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index ce00bcd..56aad2d 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -158,12 +158,15 @@ if [ "$1" == "-init" ]; then if [ "$3" == "-nodmg" ]; then mkdir -p BuildRoot else - echo "Creating build root disk image ..." DMGVOLUME="BuildRoot_${build}_${stamp}" - hdiutil create -size 1t -fs HFSX -quiet -uid $(id -u) -gid $(id -g) \ - -volname $DMGVOLUME \ - $DMGFILE - ln -s "/Volumes/${DMGVOLUME}" BuildRoot + + if [ ! -f "$DMGFILE" ]; then + echo "Creating build root disk image ..." + hdiutil create -size 1t -fs HFSX -quiet -uid $(id -u) -gid $(id -g) \ + -volname $DMGVOLUME \ + $DMGFILE + ln -s "/Volumes/${DMGVOLUME}" BuildRoot + fi fi ### From 4a3b08af0cbf0f096a9165c16bc9b15c67ef86d5 Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 1 Feb 2018 18:23:14 -0500 Subject: [PATCH 098/382] Remove timestamp from disk image name by default This should no longer be as necessary, now that the disk image will not be (re)created as often. It will still be added if required to avoid a path collision, however. --- darwinbuild/darwinbuild.in | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 56aad2d..8989b75 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -154,11 +154,14 @@ if [ "$1" == "-init" ]; then ### ### Create the build root ### - stamp=$(date +'%Y%m%d%H%M%S') if [ "$3" == "-nodmg" ]; then mkdir -p BuildRoot else - DMGVOLUME="BuildRoot_${build}_${stamp}" + DMGVOLUME="BuildRoot_${build}" + if [ -d "$DMGVOLUME" ]; then + stamp=$(date +'%Y%m%d%H%M%S') + DMGVOLUME="BuildRoot_${build}_${stamp}" + fi if [ ! -f "$DMGFILE" ]; then echo "Creating build root disk image ..." From bfb88481939e03489b22b4284b3b11517d956fc6 Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 1 Feb 2018 18:28:33 -0500 Subject: [PATCH 099/382] Fix check for build image existence Since we are using a sparseimage here, this is a bundle and not a single file. Therefore, we need to use test -e instead of test -f. --- darwinbuild/darwinbuild.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 8989b75..048b2f5 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -163,7 +163,7 @@ if [ "$1" == "-init" ]; then DMGVOLUME="BuildRoot_${build}_${stamp}" fi - if [ ! -f "$DMGFILE" ]; then + if [ ! -e "$DMGFILE" ]; then echo "Creating build root disk image ..." hdiutil create -size 1t -fs HFSX -quiet -uid $(id -u) -gid $(id -g) \ -volname $DMGVOLUME \ From 6889253f25ad5a96534ea564f960c764d082588c Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 1 Feb 2018 18:32:52 -0500 Subject: [PATCH 100/382] Fix path name in check --- darwinbuild/darwinbuild.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 048b2f5..43eef48 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -158,7 +158,7 @@ if [ "$1" == "-init" ]; then mkdir -p BuildRoot else DMGVOLUME="BuildRoot_${build}" - if [ -d "$DMGVOLUME" ]; then + if [ -d "/Volumes/$DMGVOLUME" ]; then stamp=$(date +'%Y%m%d%H%M%S') DMGVOLUME="BuildRoot_${build}_${stamp}" fi From fa4255383d5eaa37bd8a6968748133f22167c354 Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 1 Feb 2018 18:45:06 -0500 Subject: [PATCH 101/382] Add the BuildRoot as an additional Xcode SDK Now the $(RC_BuildRoot) variable is no longer required for Xcode projects referencing private headers to build. It may still be needed for Make-based projects, however. --- darwinbuild/darwinbuild.in | 1 + 1 file changed, 1 insertion(+) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index ce00bcd..ba07f7b 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -684,6 +684,7 @@ fi build_string="" if [ "$buildtool" == "xcodebuild" -a $INSTALL_XCODE == "YES" ]; then build_string="-sdk $platform" + build_string="$build_string ADDITIONAL_SDKS=\"$BuildRoot\"" fi if [ "$buildtool" == "xcodebuild" -a "$target" != "" ]; then build_string="$build_string -target \"$target\"" From a9effd4e13181585cd576a833ef6446a25cb0dfd Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 1 Feb 2018 19:33:05 -0500 Subject: [PATCH 102/382] Resolve Xcode 9.3 beta upgrade warnings --- darwinbuild.xcodeproj/project.pbxproj | 128 +++++++++++++++++++++++++- 1 file changed, 127 insertions(+), 1 deletion(-) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index ef6f5f7..ed8306a 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -1916,7 +1916,7 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; - LastUpgradeCheck = 0910; + LastUpgradeCheck = 0930; ORGANIZATIONNAME = "The DarwinBuild Project"; }; buildConfigurationList = 726DD14C10965C5700D5AEAB /* Build configuration list for PBXProject "darwinbuild" */; @@ -2741,6 +2741,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; @@ -2749,6 +2750,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Public; @@ -2757,6 +2759,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; @@ -2765,6 +2768,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = digest; }; @@ -2774,6 +2778,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = digest; }; @@ -2783,6 +2788,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = digest; }; @@ -2792,6 +2798,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; PRODUCT_NAME = tcl_plugins; }; name = Debug; @@ -2800,6 +2807,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; PRODUCT_NAME = tcl_plugins; }; name = Public; @@ -2808,6 +2816,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; PRODUCT_NAME = tcl_plugins; }; name = Release; @@ -2816,6 +2825,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = manifest; }; @@ -2825,6 +2835,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = manifest; }; @@ -2834,6 +2845,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = manifest; }; @@ -2843,6 +2855,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; INSTALL_PATH = "$(BINDIR)"; PRODUCT_NAME = darwinmaster; }; @@ -2852,6 +2865,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; INSTALL_PATH = "$(BINDIR)"; PRODUCT_NAME = darwinmaster; }; @@ -2861,6 +2875,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; INSTALL_PATH = "$(BINDIR)"; PRODUCT_NAME = darwinmaster; }; @@ -2870,6 +2885,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = packageRoots; }; @@ -2879,6 +2895,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = packageRoots; }; @@ -2888,6 +2905,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = packageRoots; }; @@ -2897,6 +2915,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = thinPackages; }; @@ -2906,6 +2925,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = thinPackages; }; @@ -2915,6 +2935,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = thinPackages; }; @@ -2924,6 +2945,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = installXcode; }; @@ -2933,6 +2955,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = installXcode; }; @@ -2942,6 +2965,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = installXcode; }; @@ -2951,6 +2975,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = installXcode32; }; @@ -2960,6 +2985,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = installXcode32; }; @@ -2969,6 +2995,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = installXcode32; }; @@ -2978,6 +3005,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; PRODUCT_NAME = darwinbuild_scripts; }; name = Debug; @@ -2986,6 +3014,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; PRODUCT_NAME = darwinbuild_scripts; }; name = Public; @@ -2994,6 +3023,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; PRODUCT_NAME = darwinbuild_scripts; }; name = Release; @@ -3002,6 +3032,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Debug; }; @@ -3009,6 +3040,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Public; }; @@ -3016,6 +3048,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Release; }; @@ -3023,6 +3056,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Debug; }; @@ -3030,6 +3064,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Public; }; @@ -3037,6 +3072,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Release; }; @@ -3044,6 +3080,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Debug; }; @@ -3051,6 +3088,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Public; }; @@ -3058,6 +3096,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Release; }; @@ -3065,6 +3104,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Debug; }; @@ -3072,6 +3112,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Public; }; @@ -3079,6 +3120,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Release; }; @@ -3086,6 +3128,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Debug; }; @@ -3093,6 +3136,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Public; }; @@ -3100,6 +3144,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Release; }; @@ -3107,6 +3152,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Debug; }; @@ -3114,6 +3160,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Public; }; @@ -3121,6 +3168,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Release; }; @@ -3128,6 +3176,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Debug; }; @@ -3135,6 +3184,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Public; }; @@ -3142,6 +3192,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Release; }; @@ -3149,6 +3200,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Debug; }; @@ -3156,6 +3208,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Public; }; @@ -3163,6 +3216,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Release; }; @@ -3170,6 +3224,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Debug; }; @@ -3177,6 +3232,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Public; }; @@ -3184,6 +3240,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Release; }; @@ -3191,6 +3248,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Debug; }; @@ -3198,6 +3256,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Public; }; @@ -3205,6 +3264,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Release; }; @@ -3212,6 +3272,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Debug; }; @@ -3219,6 +3280,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Public; }; @@ -3226,6 +3288,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Release; }; @@ -3233,6 +3296,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Debug; }; @@ -3240,6 +3304,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Public; }; @@ -3247,6 +3312,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Release; }; @@ -3254,6 +3320,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Debug; }; @@ -3261,6 +3328,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Public; }; @@ -3268,6 +3336,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Release; }; @@ -3275,6 +3344,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Debug; }; @@ -3282,6 +3352,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Public; }; @@ -3289,6 +3360,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Release; }; @@ -3296,6 +3368,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Debug; }; @@ -3303,6 +3376,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Public; }; @@ -3310,6 +3384,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Release; }; @@ -3317,6 +3392,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Debug; }; @@ -3324,6 +3400,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Public; }; @@ -3331,6 +3408,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Release; }; @@ -3338,6 +3416,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Debug; }; @@ -3345,6 +3424,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Public; }; @@ -3352,6 +3432,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Release; }; @@ -3359,6 +3440,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Debug; }; @@ -3366,6 +3448,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Public; }; @@ -3373,6 +3456,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Release; }; @@ -3380,6 +3464,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Debug; }; @@ -3387,6 +3472,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Public; }; @@ -3394,6 +3480,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Release; }; @@ -3401,6 +3488,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Debug; }; @@ -3408,6 +3496,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Public; }; @@ -3415,6 +3504,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Release; }; @@ -3422,6 +3512,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Debug; }; @@ -3429,6 +3520,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Public; }; @@ -3436,6 +3528,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Release; }; @@ -3443,6 +3536,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Debug; }; @@ -3450,6 +3544,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Public; }; @@ -3457,6 +3552,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Release; }; @@ -3464,6 +3560,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; PRODUCT_NAME = darwinxref_plugins; }; name = Debug; @@ -3472,6 +3569,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; PRODUCT_NAME = darwinxref_plugins; }; name = Public; @@ -3480,6 +3578,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; PRODUCT_NAME = darwinxref_plugins; }; name = Release; @@ -3493,11 +3592,13 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; @@ -3543,6 +3644,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; PRODUCT_NAME = world; }; name = Public; @@ -3551,6 +3653,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; INSTALL_PATH = "$(BINDIR)"; PRODUCT_NAME = darwinbuild; }; @@ -3560,6 +3663,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; COPY_PHASE_STRIP = YES; DEPLOYMENT_POSTPROCESSING = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; @@ -3574,6 +3678,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; INSTALL_PATH = "$(DATDIR)/darwinbuild"; "INSTALL_PATH[sdk=iphonesimulator*]" = "$(SDKROOT)$(DATDIR)/darwinbuild"; LD_DYLIB_INSTALL_NAME = "$(DATDIR)/darwinbuild/darwintrace.dylib"; @@ -3585,6 +3690,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = "$(BINDIR)"; OTHER_CFLAGS = ( @@ -3601,6 +3707,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = "$(BINDIR)"; OTHER_CFLAGS = ( @@ -3617,6 +3724,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = "$(BINDIR)"; OTHER_CFLAGS = ( @@ -3633,6 +3741,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Debug; }; @@ -3640,6 +3749,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Public; }; @@ -3647,6 +3757,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Release; }; @@ -3659,11 +3770,13 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; @@ -3716,11 +3829,13 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; @@ -3766,6 +3881,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; INSTALL_PATH = "$(BINDIR)"; PRODUCT_NAME = darwinbuild; }; @@ -3775,6 +3891,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; INSTALL_PATH = "$(BINDIR)"; PRODUCT_NAME = darwinbuild; }; @@ -3784,6 +3901,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; INSTALL_PATH = "$(BINDIR)"; PRODUCT_NAME = darwinup; @@ -3794,6 +3912,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; COPY_PHASE_STRIP = YES; DEPLOYMENT_POSTPROCESSING = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; @@ -3808,6 +3927,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; INSTALL_PATH = "$(DATDIR)/darwinbuild"; "INSTALL_PATH[sdk=iphonesimulator*]" = "$(SDKROOT)$(DATDIR)/darwinbuild"; LD_DYLIB_INSTALL_NAME = "$(DATDIR)/darwinbuild/darwintrace.dylib"; @@ -3819,6 +3939,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; INSTALL_PATH = "$(DATDIR)/darwinbuild"; "INSTALL_PATH[sdk=iphonesimulator*]" = "$(SDKROOT)$(DATDIR)/darwinbuild"; LD_DYLIB_INSTALL_NAME = "$(DATDIR)/darwinbuild/darwintrace.dylib"; @@ -3830,6 +3951,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; PRODUCT_NAME = world; }; name = Debug; @@ -3838,6 +3960,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; PRODUCT_NAME = world; }; name = Release; @@ -3846,6 +3969,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Debug; }; @@ -3853,6 +3977,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Public; }; @@ -3860,6 +3985,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Release; }; From 90ecd3e4c8c347440fef5e191c896b6f46840b85 Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 1 Feb 2018 19:34:34 -0500 Subject: [PATCH 103/382] Fix build --- darwintrace/darwintrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwintrace/darwintrace.c b/darwintrace/darwintrace.c index 53360d4..138aa79 100644 --- a/darwintrace/darwintrace.c +++ b/darwintrace/darwintrace.c @@ -57,7 +57,7 @@ #define dprintf(...) #endif -#define LION_OR_LATER (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070) +#define LION_OR_LATER (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1070) #define DARWINTRACE_INTERPOSE(_replacement,_replacee) \ __attribute__((used)) static struct { \ From 0e97a272033a323053678f874179da5613cc7dcd Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 1 Feb 2018 19:36:42 -0500 Subject: [PATCH 104/382] Remove now-deprecated i386 architecture --- prefix.xcconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/prefix.xcconfig b/prefix.xcconfig index 51edead..0cf8dcc 100644 --- a/prefix.xcconfig +++ b/prefix.xcconfig @@ -35,4 +35,3 @@ DATDIR = $(PREFIX)/share INCDIR = $(PREFIX)/include DEPLOYMENT_LOCATION = YES DSTROOT = $(BUILT_PRODUCTS_DIR) -ARCHS = x86_64 i386 From 4a2368a26a97da80793d6419de8228ea09c11b64 Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 1 Feb 2018 19:42:33 -0500 Subject: [PATCH 105/382] Fix installation of darwinbuild For some reason, the old method of installing this file does not do anything under Xcode 9.3 beta. --- darwinbuild.xcodeproj/project.pbxproj | 94 ++++++++++++++++----------- 1 file changed, 57 insertions(+), 37 deletions(-) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index ed8306a..9797a13 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -22,7 +22,7 @@ isa = PBXAggregateTarget; buildConfigurationList = 7227AC451098DC9900BE33D7 /* Build configuration list for PBXAggregateTarget "darwinbuild_scripts" */; buildPhases = ( - 7227AD1B109A053900BE33D7 /* CopyFiles */, + 7227AD1B109A053900BE33D7 /* Copy Files */, ); dependencies = ( 720BE2F6120C90E500B3C4A5 /* PBXTargetDependency */, @@ -90,9 +90,9 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ - 1F514C441F4A5CDA008D9341 /* fetch-from-github in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1F514C431F4A5CC0008D9341 /* fetch-from-github */; }; - 1FC854011ED462EE00EA2AF5 /* installXcode_Modern in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1FC854001ED462DF00EA2AF5 /* installXcode_Modern */; }; - 1FECB5DF1FBBBD41002EA059 /* setXcodePlatform in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1FECB5DE1FBBBC09002EA059 /* setXcodePlatform */; }; + 1F514C441F4A5CDA008D9341 /* fetch-from-github in Copy Files */ = {isa = PBXBuildFile; fileRef = 1F514C431F4A5CC0008D9341 /* fetch-from-github */; }; + 1FC854011ED462EE00EA2AF5 /* installXcode_Modern in Copy Files */ = {isa = PBXBuildFile; fileRef = 1FC854001ED462DF00EA2AF5 /* installXcode_Modern */; }; + 1FECB5DF1FBBBD41002EA059 /* setXcodePlatform in Copy Files */ = {isa = PBXBuildFile; fileRef = 1FECB5DE1FBBBC09002EA059 /* setXcodePlatform */; }; 3963011A1EAB4D60006081C7 /* source_sites.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86C0E10965EEA00C66E90 /* source_sites.c */; }; 396301211EAB4E01006081C7 /* patch_sites.c in Sources */ = {isa = PBXBuildFile; fileRef = 396301191EAB42B6006081C7 /* patch_sites.c */; }; 396301291EAB5DBC006081C7 /* patch_sites.tcl in CopyFiles */ = {isa = PBXBuildFile; fileRef = 396301281EAB5DB5006081C7 /* patch_sites.tcl */; }; @@ -107,18 +107,18 @@ 7227AB67109899A600BE33D7 /* cfutils.h in Headers */ = {isa = PBXBuildFile; fileRef = 72C86BE910965E7500C66E90 /* cfutils.h */; settings = {ATTRIBUTES = (Public, ); }; }; 7227AB68109899A600BE33D7 /* DBPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 72C86BED10965E7500C66E90 /* DBPlugin.h */; settings = {ATTRIBUTES = (Public, ); }; }; 7227AB7510989F8D00BE33D7 /* manifest.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86C2E1096600B00C66E90 /* manifest.c */; }; - 7227AD1C109A05FA00BE33D7 /* buildlist in CopyFiles */ = {isa = PBXBuildFile; fileRef = 7227AB871098A7BF00BE33D7 /* buildlist */; }; - 7227AD1D109A05FA00BE33D7 /* buildorder in CopyFiles */ = {isa = PBXBuildFile; fileRef = 7227AB881098A7BF00BE33D7 /* buildorder */; }; - 7227AD1E109A05FA00BE33D7 /* ditto in CopyFiles */ = {isa = PBXBuildFile; fileRef = 7227AB891098A7BF00BE33D7 /* ditto */; }; - 7227AD1F109A05FA00BE33D7 /* synthfat in CopyFiles */ = {isa = PBXBuildFile; fileRef = 7227AB8B1098A7BF00BE33D7 /* synthfat */; }; - 7227AD20109A05FA00BE33D7 /* thinFile in CopyFiles */ = {isa = PBXBuildFile; fileRef = 7227AB8C1098A7BF00BE33D7 /* thinFile */; }; - 7227AD21109A05FA00BE33D7 /* createChroot in CopyFiles */ = {isa = PBXBuildFile; fileRef = 72C86C221096600B00C66E90 /* createChroot */; }; - 7227AD22109A05FA00BE33D7 /* darwinbuild.common in CopyFiles */ = {isa = PBXBuildFile; fileRef = 72C86C231096600B00C66E90 /* darwinbuild.common */; }; - 7227AD23109A05FA00BE33D7 /* Info.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = 72C86C271096600B00C66E90 /* Info.plist */; }; - 7227AD24109A05FA00BE33D7 /* installXcode2 in CopyFiles */ = {isa = PBXBuildFile; fileRef = 72C86C291096600B00C66E90 /* installXcode2 */; }; - 7227AD25109A05FA00BE33D7 /* installXcode3 in CopyFiles */ = {isa = PBXBuildFile; fileRef = 72C86C2A1096600B00C66E90 /* installXcode3 */; }; - 7227AD26109A05FA00BE33D7 /* installXcode31 in CopyFiles */ = {isa = PBXBuildFile; fileRef = 72C86C2B1096600B00C66E90 /* installXcode31 */; }; - 7227AD27109A05FA00BE33D7 /* SDKSettings.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = 72C86C311096600B00C66E90 /* SDKSettings.plist */; }; + 7227AD1C109A05FA00BE33D7 /* buildlist in Copy Files */ = {isa = PBXBuildFile; fileRef = 7227AB871098A7BF00BE33D7 /* buildlist */; }; + 7227AD1D109A05FA00BE33D7 /* buildorder in Copy Files */ = {isa = PBXBuildFile; fileRef = 7227AB881098A7BF00BE33D7 /* buildorder */; }; + 7227AD1E109A05FA00BE33D7 /* ditto in Copy Files */ = {isa = PBXBuildFile; fileRef = 7227AB891098A7BF00BE33D7 /* ditto */; }; + 7227AD1F109A05FA00BE33D7 /* synthfat in Copy Files */ = {isa = PBXBuildFile; fileRef = 7227AB8B1098A7BF00BE33D7 /* synthfat */; }; + 7227AD20109A05FA00BE33D7 /* thinFile in Copy Files */ = {isa = PBXBuildFile; fileRef = 7227AB8C1098A7BF00BE33D7 /* thinFile */; }; + 7227AD21109A05FA00BE33D7 /* createChroot in Copy Files */ = {isa = PBXBuildFile; fileRef = 72C86C221096600B00C66E90 /* createChroot */; }; + 7227AD22109A05FA00BE33D7 /* darwinbuild.common in Copy Files */ = {isa = PBXBuildFile; fileRef = 72C86C231096600B00C66E90 /* darwinbuild.common */; }; + 7227AD23109A05FA00BE33D7 /* Info.plist in Copy Files */ = {isa = PBXBuildFile; fileRef = 72C86C271096600B00C66E90 /* Info.plist */; }; + 7227AD24109A05FA00BE33D7 /* installXcode2 in Copy Files */ = {isa = PBXBuildFile; fileRef = 72C86C291096600B00C66E90 /* installXcode2 */; }; + 7227AD25109A05FA00BE33D7 /* installXcode3 in Copy Files */ = {isa = PBXBuildFile; fileRef = 72C86C2A1096600B00C66E90 /* installXcode3 */; }; + 7227AD26109A05FA00BE33D7 /* installXcode31 in Copy Files */ = {isa = PBXBuildFile; fileRef = 72C86C2B1096600B00C66E90 /* installXcode31 */; }; + 7227AD27109A05FA00BE33D7 /* SDKSettings.plist in Copy Files */ = {isa = PBXBuildFile; fileRef = 72C86C311096600B00C66E90 /* SDKSettings.plist */; }; 72573FF71097A601008AD4D7 /* dependencies.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BF810965EEA00C66E90 /* dependencies.c */; }; 72573FF81097A60C008AD4D7 /* diff.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BFA10965EEA00C66E90 /* diff.c */; }; 72573FF91097A64C008AD4D7 /* dot.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BFB10965EEA00C66E90 /* dot.c */; }; @@ -626,28 +626,29 @@ ); runOnlyForDeploymentPostprocessing = 1; }; - 7227AD1B109A053900BE33D7 /* CopyFiles */ = { + 7227AD1B109A053900BE33D7 /* Copy Files */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 8; dstPath = "$(DATDIR)/darwinbuild"; dstSubfolderSpec = 0; files = ( - 1F514C441F4A5CDA008D9341 /* fetch-from-github in CopyFiles */, - 1FC854011ED462EE00EA2AF5 /* installXcode_Modern in CopyFiles */, - 1FECB5DF1FBBBD41002EA059 /* setXcodePlatform in CopyFiles */, - 7227AD1C109A05FA00BE33D7 /* buildlist in CopyFiles */, - 7227AD1D109A05FA00BE33D7 /* buildorder in CopyFiles */, - 7227AD1E109A05FA00BE33D7 /* ditto in CopyFiles */, - 7227AD1F109A05FA00BE33D7 /* synthfat in CopyFiles */, - 7227AD20109A05FA00BE33D7 /* thinFile in CopyFiles */, - 7227AD21109A05FA00BE33D7 /* createChroot in CopyFiles */, - 7227AD22109A05FA00BE33D7 /* darwinbuild.common in CopyFiles */, - 7227AD23109A05FA00BE33D7 /* Info.plist in CopyFiles */, - 7227AD24109A05FA00BE33D7 /* installXcode2 in CopyFiles */, - 7227AD25109A05FA00BE33D7 /* installXcode3 in CopyFiles */, - 7227AD26109A05FA00BE33D7 /* installXcode31 in CopyFiles */, - 7227AD27109A05FA00BE33D7 /* SDKSettings.plist in CopyFiles */, - ); + 1F514C441F4A5CDA008D9341 /* fetch-from-github in Copy Files */, + 1FC854011ED462EE00EA2AF5 /* installXcode_Modern in Copy Files */, + 1FECB5DF1FBBBD41002EA059 /* setXcodePlatform in Copy Files */, + 7227AD1C109A05FA00BE33D7 /* buildlist in Copy Files */, + 7227AD1D109A05FA00BE33D7 /* buildorder in Copy Files */, + 7227AD1E109A05FA00BE33D7 /* ditto in Copy Files */, + 7227AD1F109A05FA00BE33D7 /* synthfat in Copy Files */, + 7227AD20109A05FA00BE33D7 /* thinFile in Copy Files */, + 7227AD21109A05FA00BE33D7 /* createChroot in Copy Files */, + 7227AD22109A05FA00BE33D7 /* darwinbuild.common in Copy Files */, + 7227AD23109A05FA00BE33D7 /* Info.plist in Copy Files */, + 7227AD24109A05FA00BE33D7 /* installXcode2 in Copy Files */, + 7227AD25109A05FA00BE33D7 /* installXcode3 in Copy Files */, + 7227AD26109A05FA00BE33D7 /* installXcode31 in Copy Files */, + 7227AD27109A05FA00BE33D7 /* SDKSettings.plist in Copy Files */, + ); + name = "Copy Files"; runOnlyForDeploymentPostprocessing = 1; }; DFCAA3C51178E10E008DCF37 /* Install Manpage */ = { @@ -1846,8 +1847,9 @@ isa = PBXNativeTarget; buildConfigurationList = 72C86C3D1096607A00C66E90 /* Build configuration list for PBXNativeTarget "darwinbuild" */; buildPhases = ( - 7227AB8F1098A89700BE33D7 /* ShellScript */, - 7227ABE61098D5E400BE33D7 /* ShellScript */, + 7227AB8F1098A89700BE33D7 /* Run Script */, + 7227ABE61098D5E400BE33D7 /* Run Script */, + 1F06C5B52023EB1D003EBE6C /* ShellScript */, ); buildRules = ( ); @@ -1979,7 +1981,23 @@ /* End PBXProject section */ /* Begin PBXShellScriptBuildPhase section */ - 7227AB8F1098A89700BE33D7 /* ShellScript */ = { + 1F06C5B52023EB1D003EBE6C /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 8; + files = ( + ); + inputPaths = ( + "$(BUILT_PRODUCT_SDIR)/darwinbuild", + ); + outputPaths = ( + "$(DSTROOT)/usr/local/bin/darwinbuild", + ); + runOnlyForDeploymentPostprocessing = 1; + shellPath = /bin/sh; + shellScript = "/bin/cp $BUILT_PRODUCTS_DIR/darwinbuild $DSTROOT/usr/local/bin"; + showEnvVarsInLog = 0; + }; + 7227AB8F1098A89700BE33D7 /* Run Script */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -1987,6 +2005,7 @@ inputPaths = ( "$(SRCROOT)/darwinbuild/darwinbuild.in", ); + name = "Run Script"; outputPaths = ( "$(DERIVED_FILE_DIR)/darwinbuild", ); @@ -1994,7 +2013,7 @@ shellPath = /bin/sh; shellScript = "/usr/bin/sed -e \"s,%%PREFIX%%,$PREFIX,\" $SRCROOT/darwinbuild/darwinbuild.in > $DERIVED_FILE_DIR/darwinbuild\n\n/bin/chmod 755 $DERIVED_FILE_DIR/darwinbuild\n\n"; }; - 7227ABE61098D5E400BE33D7 /* ShellScript */ = { + 7227ABE61098D5E400BE33D7 /* Run Script */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -2002,6 +2021,7 @@ inputPaths = ( "$(DERIVED_FILE_DIR)/darwinbuild", ); + name = "Run Script"; outputPaths = ( "$(BUILT_PRODUCTS_DIR)/darwinbuild", ); From f04ff8319d9d1e1660eff730d118d4d870126b74 Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 1 Feb 2018 20:33:55 -0500 Subject: [PATCH 106/382] Make darwinbuild -headers honor a custom target in the plist Previously, a custom target would only be used when doing a full build and install. --- darwinbuild/darwinbuild.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index eb096f5..27dbaa4 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -390,7 +390,7 @@ alias=$($DARWINXREF original "$projnam") # # Look for an alternate target in the database # -if [ "$target" == "" -a "$action" == "install" ]; then +if [ "$target" == "" ]; then target=$($DARWINXREF target "$projnam") fi From 35ddd5c37a4343542567523515723ab4f7de4802 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 11 Feb 2018 17:19:21 -0500 Subject: [PATCH 107/382] Fix installation of other shell scripts This commit applies the same fix as 4a2368a26a97, except it now affects all the shell-script tools in the project, not just darwinbuild itself. --- darwinbuild.xcodeproj/project.pbxproj | 85 +++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 9797a13..dcba19a 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -1361,6 +1361,7 @@ buildPhases = ( 7227AC001098D78C00BE33D7 /* ShellScript */, 7227AC011098D78C00BE33D7 /* ShellScript */, + 1F71A4FE2030F7A700020E2F /* ShellScript */, ); buildRules = ( ); @@ -1377,6 +1378,7 @@ buildPhases = ( 7227AC0D1098D84600BE33D7 /* ShellScript */, 7227AC0E1098D84600BE33D7 /* ShellScript */, + 1F71A4FF2030F81C00020E2F /* ShellScript */, ); buildRules = ( ); @@ -1393,6 +1395,7 @@ buildPhases = ( 7227AC161098D8DB00BE33D7 /* ShellScript */, 7227AC171098D8DB00BE33D7 /* ShellScript */, + 1F71A5002030F83D00020E2F /* ShellScript */, ); buildRules = ( ); @@ -1409,6 +1412,7 @@ buildPhases = ( 7227AC1F1098DB9200BE33D7 /* ShellScript */, 7227AC201098DB9200BE33D7 /* ShellScript */, + 1F71A5012030F86400020E2F /* ShellScript */, ); buildRules = ( ); @@ -1425,6 +1429,7 @@ buildPhases = ( 7227AC281098DBDF00BE33D7 /* ShellScript */, 7227AC291098DBDF00BE33D7 /* ShellScript */, + 1F71A5022030F88300020E2F /* ShellScript */, ); buildRules = ( ); @@ -1997,6 +2002,86 @@ shellScript = "/bin/cp $BUILT_PRODUCTS_DIR/darwinbuild $DSTROOT/usr/local/bin"; showEnvVarsInLog = 0; }; + 1F71A4FE2030F7A700020E2F /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 8; + files = ( + ); + inputPaths = ( + "$(BUILT_PRODUCTS_DIR)/darwinmaster", + ); + outputPaths = ( + "$(DSTROOT)/usr/local/bin/darwinmaster", + ); + runOnlyForDeploymentPostprocessing = 1; + shellPath = /bin/sh; + shellScript = "/bin/cp $BUILT_PRODUCTS_DIR/darwinmaster $DSTROOT/usr/local/bin/darwinmaster"; + showEnvVarsInLog = 0; + }; + 1F71A4FF2030F81C00020E2F /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 8; + files = ( + ); + inputPaths = ( + "$(BUILT_PRODUCTS_DIR)/packageRoots", + ); + outputPaths = ( + "$(DATDIR)/packageRoots", + ); + runOnlyForDeploymentPostprocessing = 1; + shellPath = /bin/sh; + shellScript = "/bin/cp $BUILT_PRODUCTS_DIR/packageRoots $DATDIR/packageRoots"; + showEnvVarsInLog = 0; + }; + 1F71A5002030F83D00020E2F /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 8; + files = ( + ); + inputPaths = ( + "$(BUILT_PRODUCTS_DIR)/thinPackages", + ); + outputPaths = ( + "$(DATDIR)/thinPackages", + ); + runOnlyForDeploymentPostprocessing = 1; + shellPath = /bin/sh; + shellScript = "/bin/cp $BUILT_PRODUCTS_DIR/thinPackages $DATDIR/thinPackages"; + showEnvVarsInLog = 0; + }; + 1F71A5012030F86400020E2F /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 8; + files = ( + ); + inputPaths = ( + "$(BUILT_PRODUCTS_DIR)/installXcode", + ); + outputPaths = ( + "$(DATDIR)/installXcode", + ); + runOnlyForDeploymentPostprocessing = 1; + shellPath = /bin/sh; + shellScript = "/bin/cp $BUILT_PRODUCTS_DIR/installXcode $DATDIR/installXcode"; + showEnvVarsInLog = 0; + }; + 1F71A5022030F88300020E2F /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 8; + files = ( + ); + inputPaths = ( + "$(BUILT_PRODUCTS_DIR)/installXcode32", + ); + outputPaths = ( + "$(DATDIR)/installXcode32", + ); + runOnlyForDeploymentPostprocessing = 1; + shellPath = /bin/sh; + shellScript = "mkdir -p $DATDIR\n/bin/cp $BUILT_PRODUCTS_DIR/installXcode32 $DATDIR/installXcode32"; + showEnvVarsInLog = 0; + }; 7227AB8F1098A89700BE33D7 /* Run Script */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; From 0ba53afd5011d8c56f92416def045f792436ce96 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 11 Feb 2018 17:20:10 -0500 Subject: [PATCH 108/382] Typo fix --- darwinbuild.xcodeproj/project.pbxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index dcba19a..52645f7 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -1992,7 +1992,7 @@ files = ( ); inputPaths = ( - "$(BUILT_PRODUCT_SDIR)/darwinbuild", + "$(BUILT_PRODUCTS_DIR)/darwinbuild", ); outputPaths = ( "$(DSTROOT)/usr/local/bin/darwinbuild", From 2605e8fad57248d4005556ac8ef3a62dec8a2085 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 11 Feb 2018 17:23:12 -0500 Subject: [PATCH 109/382] Install shell-script tools into the proper directories --- darwinbuild.xcodeproj/project.pbxproj | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 52645f7..c023baa 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -1999,7 +1999,7 @@ ); runOnlyForDeploymentPostprocessing = 1; shellPath = /bin/sh; - shellScript = "/bin/cp $BUILT_PRODUCTS_DIR/darwinbuild $DSTROOT/usr/local/bin"; + shellScript = "mkdir -p $DSTROOT/usr/local/bin\n/bin/cp $BUILT_PRODUCTS_DIR/darwinbuild $DSTROOT/usr/local/bin"; showEnvVarsInLog = 0; }; 1F71A4FE2030F7A700020E2F /* ShellScript */ = { @@ -2015,7 +2015,7 @@ ); runOnlyForDeploymentPostprocessing = 1; shellPath = /bin/sh; - shellScript = "/bin/cp $BUILT_PRODUCTS_DIR/darwinmaster $DSTROOT/usr/local/bin/darwinmaster"; + shellScript = "mkdir -p $DSTROOT/usr/local/bin\n/bin/cp $BUILT_PRODUCTS_DIR/darwinmaster $DSTROOT/usr/local/bin/darwinmaster"; showEnvVarsInLog = 0; }; 1F71A4FF2030F81C00020E2F /* ShellScript */ = { @@ -2027,11 +2027,11 @@ "$(BUILT_PRODUCTS_DIR)/packageRoots", ); outputPaths = ( - "$(DATDIR)/packageRoots", + "$(DSTROOT)/$(DATDIR)/darwinbuild/packageRoots", ); runOnlyForDeploymentPostprocessing = 1; shellPath = /bin/sh; - shellScript = "/bin/cp $BUILT_PRODUCTS_DIR/packageRoots $DATDIR/packageRoots"; + shellScript = "mkdir -p $DSTROOT/$DATDIR/darwinbuild\n/bin/cp $BUILT_PRODUCTS_DIR/packageRoots $DSTROOT/$DATDIR/darwinbuild/packageRoots"; showEnvVarsInLog = 0; }; 1F71A5002030F83D00020E2F /* ShellScript */ = { @@ -2043,11 +2043,11 @@ "$(BUILT_PRODUCTS_DIR)/thinPackages", ); outputPaths = ( - "$(DATDIR)/thinPackages", + "$(DSTROOT)/$(DATDIR)/darwinbuild/thinPackages", ); runOnlyForDeploymentPostprocessing = 1; shellPath = /bin/sh; - shellScript = "/bin/cp $BUILT_PRODUCTS_DIR/thinPackages $DATDIR/thinPackages"; + shellScript = "mkdir -p $DSTROOT/$DATDIR/darwinbuild\n/bin/cp $BUILT_PRODUCTS_DIR/thinPackages $DSTROOT/$DATDIR/darwinbuild/thinPackages"; showEnvVarsInLog = 0; }; 1F71A5012030F86400020E2F /* ShellScript */ = { @@ -2059,11 +2059,11 @@ "$(BUILT_PRODUCTS_DIR)/installXcode", ); outputPaths = ( - "$(DATDIR)/installXcode", + "$(DSTROOT)/$(DATDIR)/darwinbuild/installXcode", ); runOnlyForDeploymentPostprocessing = 1; shellPath = /bin/sh; - shellScript = "/bin/cp $BUILT_PRODUCTS_DIR/installXcode $DATDIR/installXcode"; + shellScript = "mkdir -p $DSTROOT/$DATDIR/darwinbuild\n/bin/cp $BUILT_PRODUCTS_DIR/installXcode $DSTROOT/$DATDIR/darwinbuild/installXcode"; showEnvVarsInLog = 0; }; 1F71A5022030F88300020E2F /* ShellScript */ = { @@ -2075,11 +2075,11 @@ "$(BUILT_PRODUCTS_DIR)/installXcode32", ); outputPaths = ( - "$(DATDIR)/installXcode32", + "$(DSTROOT)/$(DATDIR)/installXcode32", ); runOnlyForDeploymentPostprocessing = 1; shellPath = /bin/sh; - shellScript = "mkdir -p $DATDIR\n/bin/cp $BUILT_PRODUCTS_DIR/installXcode32 $DATDIR/installXcode32"; + shellScript = "mkdir -p $DSTROOT/$DATDIR/darwinbuild\n/bin/cp $BUILT_PRODUCTS_DIR/installXcode32 $DSTROOT/$DATDIR/darwinbuild/installXcode32"; showEnvVarsInLog = 0; }; 7227AB8F1098A89700BE33D7 /* Run Script */ = { From 32f71d70a9fa9736d7b8e9f0222eb56f949c5243 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 18 Feb 2018 22:03:25 -0500 Subject: [PATCH 110/382] Update installation instructions --- README | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/README b/README index 593e548..724f5e9 100644 --- a/README +++ b/README @@ -49,20 +49,27 @@ always be stable enough for building projects. =============== You can install by checking out the source and building darwinbuild yourself. -The included Xcode project will compile the tools and install them into the -location specified by the PREFIX environment parameter. If the PREFIX parameter -is not specified, the files will be installed into /usr/local. - -By default, darwinbuild will build for x86_64 and i386. You can override this with -the ARCHS environment variable. However, building trunk for ppc is not supported -since trunk is targeted for Darwin 10. The release branches for Darwin 8 and 9 do -support building for ppc. - -To build and install darwinbuild to the boot partition: +You would want to run the following two commands: % cd % sudo xcodebuild install DSTROOT=/ +This will install darwinbuild and its supporting tools into /usr/local/bin. + +If you want to manage darwinbuild with Homebrew, you can try this technique. +First, open Xcode and perform an archive. There is no good way of doing this +from the command line, unfortunately. Then export the generated archive bundle +(it should appear with the name "world", after the scheme that created it) to a +location such as the Desktop. (Really, anywhere would do.) Then run the following +commands: + + % mkdir -p /usr/local/Cellar/darwinbuild/HEAD + % cp -R /Products/usr/local/{bin,share} /usr/local/Cellar/darwinbuild/HEAD + % brew link darwinbuild + +You don't need to copy the include directory, and the rest of the exported archive +can be deleted afterwards. + 2.1 Creating the Build Directory After installation, you must initialize the build directory using darwinbuild. From cc4622794ee12a4fb832dda7f0a546d412d81e15 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 25 Feb 2018 21:18:52 -0500 Subject: [PATCH 111/382] Add xcbuild as submodule --- .gitmodules | 3 +++ xcbuild | 1 + 2 files changed, 4 insertions(+) create mode 100644 .gitmodules create mode 160000 xcbuild diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..ce5b6d2 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "xcbuild"] + path = xcbuild + url = git@github.com:Andromeda-OS/xcbuild diff --git a/xcbuild b/xcbuild new file mode 160000 index 0000000..eabcc8f --- /dev/null +++ b/xcbuild @@ -0,0 +1 @@ +Subproject commit eabcc8f0dcd678c4eb76d2b4e15d7ec1fac5973c From d7ff2cf39857bec3079d0f6393b3ec7d92281598 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 25 Feb 2018 21:23:53 -0500 Subject: [PATCH 112/382] Add a target to build and install xcbuild --- darwinbuild.xcodeproj/project.pbxproj | 100 ++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index c023baa..04ace91 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -7,6 +7,18 @@ objects = { /* Begin PBXAggregateTarget section */ + 1FAB24D32043A61B00329636 /* xcbuild */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 1FAB24D72043A61B00329636 /* Build configuration list for PBXAggregateTarget "xcbuild" */; + buildPhases = ( + 1FAB24D82043A61F00329636 /* Build */, + 1FAB24D92043A66800329636 /* Install */, + ); + dependencies = ( + ); + name = xcbuild; + productName = xcbuild; + }; 7227AB3D1098977C00BE33D7 /* tcl_plugins */ = { isa = PBXAggregateTarget; buildConfigurationList = 7227AB4A109897E500BE33D7 /* Build configuration list for PBXAggregateTarget "tcl_plugins" */; @@ -78,6 +90,7 @@ buildPhases = ( ); dependencies = ( + 1FAB24DB2043A6A900329636 /* PBXTargetDependency */, 72C86C5F1096617500C66E90 /* PBXTargetDependency */, 72C86C611096617500C66E90 /* PBXTargetDependency */, 725740971097B03D008AD4D7 /* PBXTargetDependency */, @@ -166,6 +179,13 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 1FAB24DA2043A6A900329636 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 726DD14910965C5700D5AEAB /* Project object */; + proxyType = 1; + remoteGlobalIDString = 1FAB24D32043A61B00329636; + remoteInfo = xcbuild; + }; 3963011E1EAB4E01006081C7 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 726DD14910965C5700D5AEAB /* Project object */; @@ -1925,6 +1945,13 @@ BuildIndependentTargetsInParallel = YES; LastUpgradeCheck = 0930; ORGANIZATIONNAME = "The DarwinBuild Project"; + TargetAttributes = { + 1FAB24D32043A61B00329636 = { + CreatedOnToolsVersion = 9.3; + DevelopmentTeam = 3P242C9ES5; + ProvisioningStyle = Automatic; + }; + }; }; buildConfigurationList = 726DD14C10965C5700D5AEAB /* Build configuration list for PBXProject "darwinbuild" */; compatibilityVersion = "Xcode 3.2"; @@ -1981,6 +2008,7 @@ 7227AC271098DBDF00BE33D7 /* installXcode32 */, 720BE2EA120C90A700B3C4A5 /* digest */, 3963011C1EAB4E01006081C7 /* patch_sites */, + 1FAB24D32043A61B00329636 /* xcbuild */, ); }; /* End PBXProject section */ @@ -2082,6 +2110,36 @@ shellScript = "mkdir -p $DSTROOT/$DATDIR/darwinbuild\n/bin/cp $BUILT_PRODUCTS_DIR/installXcode32 $DSTROOT/$DATDIR/darwinbuild/installXcode32"; showEnvVarsInLog = 0; }; + 1FAB24D82043A61F00329636 /* Build */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = Build; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "which -s cmake || {\n echo CMake is required. Try \\`brew install cmake\\` 1>&2\n exit 1\n}\n\nwhich -s ninja || {\n echo ninja is required. Try \\`brew install ninja\\` 1>&2\n exit 1\n}\n\nset -e\ncd \"${SRCROOT}/xcbuild\"\nmkdir -p $DERIVED_FILE_DIR\nmake all &> $DERIVED_FILE_DIR/xcbuild.log"; + showEnvVarsInLog = 0; + }; + 1FAB24D92043A66800329636 /* Install */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 8; + files = ( + ); + inputPaths = ( + ); + name = Install; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 1; + shellPath = /bin/sh; + shellScript = "cp -f \"${SRCROOT}/xcbuild/build/xcbuild\" $DSTROOT/$DATDIR/darwinbuild/xcbuild\n"; + showEnvVarsInLog = 0; + }; 7227AB8F1098A89700BE33D7 /* Run Script */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -2524,6 +2582,11 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 1FAB24DB2043A6A900329636 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 1FAB24D32043A61B00329636 /* xcbuild */; + targetProxy = 1FAB24DA2043A6A900329636 /* PBXContainerItemProxy */; + }; 3963011D1EAB4E01006081C7 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 7257499F1097697300B13BC3 /* darwinxref */; @@ -2842,6 +2905,33 @@ /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ + 1FAB24D42043A61B00329636 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 3P242C9ES5; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 1FAB24D52043A61B00329636 /* Public */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 3P242C9ES5; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Public; + }; + 1FAB24D62043A61B00329636 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 3P242C9ES5; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; 396301241EAB4E01006081C7 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; @@ -4097,6 +4187,16 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 1FAB24D72043A61B00329636 /* Build configuration list for PBXAggregateTarget "xcbuild" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1FAB24D42043A61B00329636 /* Debug */, + 1FAB24D52043A61B00329636 /* Public */, + 1FAB24D62043A61B00329636 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Public; + }; 396301231EAB4E01006081C7 /* Build configuration list for PBXNativeTarget "patch_sites" */ = { isa = XCConfigurationList; buildConfigurations = ( From 72b88fabf2f066e0bb88f74d3d841cdf5316f37f Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 25 Feb 2018 21:35:44 -0500 Subject: [PATCH 113/382] Fix host version comparison The old technique would only run as expected on macOS 10.13 only. 10.13.1 would not be detected correctly. This is now resolved. --- darwinbuild/installXcode_Modern | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/darwinbuild/installXcode_Modern b/darwinbuild/installXcode_Modern index 7ae7b71..5c15cb2 100755 --- a/darwinbuild/installXcode_Modern +++ b/darwinbuild/installXcode_Modern @@ -64,7 +64,7 @@ mkdir -p $BUILDROOT/$(getconf DARWIN_USER_DIR) mkdir -p $BUILDROOT/$(getconf DARWIN_USER_TEMP_DIR) mkdir -p $BUILDROOT/$(getconf DARWIN_USER_CACHE_DIR) -if [ "$HOST_DARWIN_VERSION" == "10.13" ]; then +if [[ "$HOST_DARWIN_VERSION" =~ ^10.13 ]]; then rm $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk mv $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk @@ -84,7 +84,7 @@ if [ "$HOST_DARWIN_VERSION" == "10.13" ]; then EOF codesign -s - -f --entitlements $BUILDROOT/private/tmp/empty.entitlements $BUILDROOT/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -elif [ "$HOST_DARWIN_VERSION" == "10.12" ]; then +elif [[ "$HOST_DARWIN_VERSION" =~ ^10.12 ]]; then rm $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk mv $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk fi From 89ab938c0a8bb723e5fefa4e61367983912aaf5c Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 25 Feb 2018 21:39:32 -0500 Subject: [PATCH 114/382] installXcode_Modern now installs xcbuild, if available --- darwinbuild/installXcode_Modern | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/darwinbuild/installXcode_Modern b/darwinbuild/installXcode_Modern index 5c15cb2..c075dfd 100755 --- a/darwinbuild/installXcode_Modern +++ b/darwinbuild/installXcode_Modern @@ -71,10 +71,15 @@ if [[ "$HOST_DARWIN_VERSION" =~ ^10.13 ]]; then mkdir -p $BUILDROOT/private/var/db ln -s /Applications/Xcode.app/Contents/Developer $BUILDROOT/private/var/db/xcode_select_link - # High Sierra does not allow processes with entitlements to run inside a chroot. - # Therefore, I must strip the entitlements and re-sign xcodebuild. - # Hopefully, this won't break anything. - cat < $BUILDROOT/private/tmp/empty.entitlements + if [ -x /usr/local/share/darwinbuild/xcbuild ]; then + # If it is available, overwrite Apple's xcodebuild with xcbuild. + # This helps avoid the issue described in the 'else' block below. + cp -f /usr/local/share/darwinbuild/xcbuild $BUILDROOT/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild + else + # High Sierra does not allow processes with entitlements to run inside a chroot. + # Therefore, I must strip the entitlements and re-sign xcodebuild. + # Hopefully, this won't break anything. + cat < $BUILDROOT/private/tmp/empty.entitlements @@ -83,7 +88,8 @@ if [[ "$HOST_DARWIN_VERSION" =~ ^10.13 ]]; then EOF - codesign -s - -f --entitlements $BUILDROOT/private/tmp/empty.entitlements $BUILDROOT/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild + codesign -s - -f --entitlements $BUILDROOT/private/tmp/empty.entitlements $BUILDROOT/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild + fi elif [[ "$HOST_DARWIN_VERSION" =~ ^10.12 ]]; then rm $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk mv $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk From 89eb54bde57ccc8ec3d1f3ea298ac733f30b417d Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 25 Feb 2018 21:42:56 -0500 Subject: [PATCH 115/382] Install xcbuild as "xcbuild.disabled" As of this commit, xcbuild is not a usable replacement for xcodebuild. It can be enabled by renaming it in-place to "xcbuild" (keep it in the same folder), and recreating the darwinbuild chroot. --- darwinbuild.xcodeproj/project.pbxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 04ace91..dc0c4d0 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -2137,7 +2137,7 @@ ); runOnlyForDeploymentPostprocessing = 1; shellPath = /bin/sh; - shellScript = "cp -f \"${SRCROOT}/xcbuild/build/xcbuild\" $DSTROOT/$DATDIR/darwinbuild/xcbuild\n"; + shellScript = "cp -f \"${SRCROOT}/xcbuild/build/xcbuild\" $DSTROOT/$DATDIR/darwinbuild/xcbuild.disabled\n"; showEnvVarsInLog = 0; }; 7227AB8F1098A89700BE33D7 /* Run Script */ = { From 55ee220a5d2ab20f129366f99950f591d6b2bb45 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 25 Feb 2018 21:44:09 -0500 Subject: [PATCH 116/382] Re-enable the chroot by default After some soul-searching, I have determined that the workaround I am using to make xcodebuild work in the chroot isn't actually that bad for the short-term. Long-term, I am working on bringing up xcbuild to where it is a usable replacement for xcodebuild that doesn't suffer from this issue. This reverts commit e6c3dde03375a49ffe6e78864754d4589daf4a78. --- darwinbuild/darwinbuild.in | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 27dbaa4..4c0f2d0 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -98,7 +98,7 @@ target="" configuration="" version="" -USE_CHROOT="NO" +USE_CHROOT="YES" INSTALL_XCODE="NO" ### @@ -192,7 +192,7 @@ function PrintUsage() { usage: $(basename $0) [action] [options] [] actions: [-headers] [-fetch] [-source] [-load] [-loadonly] options: [-build=X] [-target=X] [-configuration=X] - [-logdeps] [-chroot] [-nopatch] [-noload] + [-logdeps] [-nochroot] [-nopatch] [-noload] [-depsbuild=X [-depsbuild=Y]] [-nosource] EOF @@ -263,8 +263,8 @@ fi ### -logdeps Do magic to log the build-time dependencies ### -nopatch Don't patch sources before building. ### -noload Don't load dependencies into the chroot. -### Has no effect unless -chroot is specified. -### -chroot chroot into the BuildRoot when building +### Has no effect if -nochroot is specified. +### -nochroot Do not chroot into the BuildRoot when building ### -target=X The makefile or xcode target to build ### -configuration=X Specify the build configuration to use ### -build=X Specify the darwin build number to buld, e.g. 8B15 @@ -300,8 +300,9 @@ for ARG in "$@"; do build="${ARG/*=/}" elif [ "${ARG/=*/}" == "-depsbuild" ]; then depsbuild="${depsbuild} ${ARG/*=/}" - elif [ "$ARG" == "-chroot" ]; then - export USE_CHROOT="YES" + elif [ "$ARG" == "-nochroot" ]; then + export INSTALL_XCODE="NO" + export USE_CHROOT="NO" elif [ "$ARG" == "-nopatch" ]; then nopatch="YES" elif [ "$ARG" == "-load" ]; then From 309f1e4a13bb5d6cac0b1da7f400ab528b0c9467 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 26 Feb 2018 07:24:24 -0500 Subject: [PATCH 117/382] Make xcbuild CMake invocation more robust If xcbuild is not checked out at all, don't try to build it. If xcbuild is checked out but its submodules aren't, fail the build as CMake will not succeed. --- darwinbuild.xcodeproj/project.pbxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index dc0c4d0..94be15f 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -2122,7 +2122,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "which -s cmake || {\n echo CMake is required. Try \\`brew install cmake\\` 1>&2\n exit 1\n}\n\nwhich -s ninja || {\n echo ninja is required. Try \\`brew install ninja\\` 1>&2\n exit 1\n}\n\nset -e\ncd \"${SRCROOT}/xcbuild\"\nmkdir -p $DERIVED_FILE_DIR\nmake all &> $DERIVED_FILE_DIR/xcbuild.log"; + shellScript = "which -s cmake || {\n echo CMake is required. Try \\`brew install cmake\\` 1>&2\n exit 1\n}\n\nwhich -s ninja || {\n echo ninja is required. Try \\`brew install ninja\\` 1>&2\n exit 1\n}\n\nif [ ! -f \"${SRCROOT}/xcbuild/Makefile\" ]; then\n echo xcbuild submodule not checked out, not building\n exit 0\nfi\n\nif [ ! -f \"${SRCROOT}/xcbuild/ThirdParty/googletest/CMakeLists.txt\" -o ! -f \"${SRCROOT}/xcbuild/ThirdParty/linenoise/Makefile\" ]; then\n echo Submodules of xcbuild submodule not checked out, build will not succeed 1>&2\n echo Try \\`git submodule update --init --recursive\\` 1>&2\n exit 1\nfi\n\nset -e\ncd \"${SRCROOT}/xcbuild\"\nmkdir -p $DERIVED_FILE_DIR\nmake all &> $DERIVED_FILE_DIR/xcbuild.log"; showEnvVarsInLog = 0; }; 1FAB24D92043A66800329636 /* Install */ = { From 219da298015d0e282374d5985e64627565ee097b Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 26 Feb 2018 09:52:35 -0500 Subject: [PATCH 118/382] Don't install xcbuild if it wasn't built --- darwinbuild.xcodeproj/project.pbxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 94be15f..88fc498 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -2137,7 +2137,7 @@ ); runOnlyForDeploymentPostprocessing = 1; shellPath = /bin/sh; - shellScript = "cp -f \"${SRCROOT}/xcbuild/build/xcbuild\" $DSTROOT/$DATDIR/darwinbuild/xcbuild.disabled\n"; + shellScript = "if [ -f \"${SRCROOT}/xcbuild/build/xcbuild\" ]; then\n cp -f \"${SRCROOT}/xcbuild/build/xcbuild\" $DSTROOT/$DATDIR/darwinbuild/xcbuild.disabled\nfi\n"; showEnvVarsInLog = 0; }; 7227AB8F1098A89700BE33D7 /* Run Script */ = { From d69a43c6dcc1efb5b5d1149f6c4c73b4a0fcb7c8 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 3 Sep 2018 13:43:16 -0400 Subject: [PATCH 119/382] Update xcbuild submodule --- xcbuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xcbuild b/xcbuild index eabcc8f..b2304e2 160000 --- a/xcbuild +++ b/xcbuild @@ -1 +1 @@ -Subproject commit eabcc8f0dcd678c4eb76d2b4e15d7ec1fac5973c +Subproject commit b2304e27e3eed99a76897b390ef84cfbc115cead From b75005c5f977a60f5491e275755aac40cf28128d Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 3 Sep 2018 13:44:23 -0400 Subject: [PATCH 120/382] Remove darwinup This has moved to a separate repository. --- darwinbuild.xcodeproj/project.pbxproj | 186 --- darwinup/Archive.cpp | 358 ------ darwinup/Archive.h | 331 ------ darwinup/Column.cpp | 136 --- darwinup/Column.h | 89 -- darwinup/DB.cpp | 546 --------- darwinup/DB.h | 121 -- darwinup/Database.cpp | 962 --------------- darwinup/Database.h | 287 ----- darwinup/Depot.cpp | 1552 ------------------------- darwinup/Depot.h | 191 --- darwinup/Digest.cpp | 138 --- darwinup/Digest.h | 129 -- darwinup/File.cpp | 573 --------- darwinup/File.h | 255 ---- darwinup/SerialSet.cpp | 68 -- darwinup/SerialSet.h | 51 - darwinup/Table.cpp | 561 --------- darwinup/Table.h | 135 --- darwinup/Utils.cpp | 525 --------- darwinup/Utils.h | 100 -- darwinup/darwinup.1 | 251 ---- darwinup/main.cpp | 299 ----- 23 files changed, 7844 deletions(-) delete mode 100644 darwinup/Archive.cpp delete mode 100644 darwinup/Archive.h delete mode 100644 darwinup/Column.cpp delete mode 100644 darwinup/Column.h delete mode 100644 darwinup/DB.cpp delete mode 100644 darwinup/DB.h delete mode 100644 darwinup/Database.cpp delete mode 100644 darwinup/Database.h delete mode 100644 darwinup/Depot.cpp delete mode 100644 darwinup/Depot.h delete mode 100644 darwinup/Digest.cpp delete mode 100644 darwinup/Digest.h delete mode 100644 darwinup/File.cpp delete mode 100644 darwinup/File.h delete mode 100644 darwinup/SerialSet.cpp delete mode 100644 darwinup/SerialSet.h delete mode 100644 darwinup/Table.cpp delete mode 100644 darwinup/Table.h delete mode 100644 darwinup/Utils.cpp delete mode 100644 darwinup/Utils.h delete mode 100644 darwinup/darwinup.1 delete mode 100644 darwinup/main.cpp diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 88fc498..599d504 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -91,7 +91,6 @@ ); dependencies = ( 1FAB24DB2043A6A900329636 /* PBXTargetDependency */, - 72C86C5F1096617500C66E90 /* PBXTargetDependency */, 72C86C611096617500C66E90 /* PBXTargetDependency */, 725740971097B03D008AD4D7 /* PBXTargetDependency */, 7227AB101097BBA900BE33D7 /* PBXTargetDependency */, @@ -162,20 +161,7 @@ 72574A1510977FAD00B13BC3 /* libtcl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 72574A1410977FAD00B13BC3 /* libtcl.dylib */; }; 72574B5D1097A37600B13BC3 /* configuration.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BF510965EEA00C66E90 /* configuration.c */; }; 72C86C68109663D300C66E90 /* darwintrace.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BD910965E0A00C66E90 /* darwintrace.c */; }; - 72C86C99109745BC00C66E90 /* Archive.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BDA10965E4F00C66E90 /* Archive.cpp */; }; - 72C86C9A109745BC00C66E90 /* Depot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BDC10965E4F00C66E90 /* Depot.cpp */; }; - 72C86C9B109745BC00C66E90 /* Digest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BDE10965E4F00C66E90 /* Digest.cpp */; }; - 72C86C9C109745BC00C66E90 /* File.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BE010965E4F00C66E90 /* File.cpp */; }; - 72C86C9D109745BC00C66E90 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BE210965E4F00C66E90 /* main.cpp */; }; - 72C86C9E109745BC00C66E90 /* SerialSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BE410965E4F00C66E90 /* SerialSet.cpp */; }; - 72C86C9F109745BC00C66E90 /* Utils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BE610965E4F00C66E90 /* Utils.cpp */; }; - 72C86CE410974CC800C66E90 /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 72C86CE310974CC800C66E90 /* libsqlite3.dylib */; }; 72D05CB811D2680500B33EDD /* query.c in Sources */ = {isa = PBXBuildFile; fileRef = 72D05CA911D2678F00B33EDD /* query.c */; }; - DF12E2821119E2B0007587C1 /* DB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF12E2811119E2B0007587C1 /* DB.cpp */; }; - DFC9772D11138F9400CAE084 /* Column.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFC9772711138F9400CAE084 /* Column.cpp */; }; - DFC9772E11138F9400CAE084 /* Database.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFC9772911138F9400CAE084 /* Database.cpp */; }; - DFC9772F11138F9400CAE084 /* Table.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFC9772B11138F9400CAE084 /* Table.cpp */; }; - DFCAA3C61178E1A1008DCF37 /* darwinup.1 in Install Manpage */ = {isa = PBXBuildFile; fileRef = DFCAA39C1178E05B008DCF37 /* darwinup.1 */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -599,13 +585,6 @@ remoteGlobalIDString = 72574B581097A36300B13BC3; remoteInfo = configuration; }; - 72C86C5E1096617500C66E90 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 726DD14910965C5700D5AEAB /* Project object */; - proxyType = 1; - remoteGlobalIDString = 72C86C471096609500C66E90; - remoteInfo = darwinup; - }; 72C86C601096617500C66E90 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 726DD14910965C5700D5AEAB /* Project object */; @@ -671,17 +650,6 @@ name = "Copy Files"; runOnlyForDeploymentPostprocessing = 1; }; - DFCAA3C51178E10E008DCF37 /* Install Manpage */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 8; - dstPath = "$(DATDIR)/man/man1"; - dstSubfolderSpec = 0; - files = ( - DFCAA3C61178E1A1008DCF37 /* darwinup.1 in Install Manpage */, - ); - name = "Install Manpage"; - runOnlyForDeploymentPostprocessing = 1; - }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ @@ -736,19 +704,6 @@ 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = c_plugins.xcconfig; sourceTree = ""; }; 72574B591097A36300B13BC3 /* configuration.so */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.objfile"; includeInIndex = 0; path = configuration.so; sourceTree = BUILT_PRODUCTS_DIR; }; 72C86BD910965E0A00C66E90 /* darwintrace.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = darwintrace.c; path = darwintrace/darwintrace.c; sourceTree = ""; }; - 72C86BDA10965E4F00C66E90 /* Archive.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Archive.cpp; path = darwinup/Archive.cpp; sourceTree = ""; }; - 72C86BDB10965E4F00C66E90 /* Archive.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Archive.h; path = darwinup/Archive.h; sourceTree = ""; }; - 72C86BDC10965E4F00C66E90 /* Depot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Depot.cpp; path = darwinup/Depot.cpp; sourceTree = ""; }; - 72C86BDD10965E4F00C66E90 /* Depot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Depot.h; path = darwinup/Depot.h; sourceTree = ""; }; - 72C86BDE10965E4F00C66E90 /* Digest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Digest.cpp; path = darwinup/Digest.cpp; sourceTree = ""; }; - 72C86BDF10965E4F00C66E90 /* Digest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Digest.h; path = darwinup/Digest.h; sourceTree = ""; }; - 72C86BE010965E4F00C66E90 /* File.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = File.cpp; path = darwinup/File.cpp; sourceTree = ""; }; - 72C86BE110965E4F00C66E90 /* File.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = File.h; path = darwinup/File.h; sourceTree = ""; }; - 72C86BE210965E4F00C66E90 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = main.cpp; path = darwinup/main.cpp; sourceTree = ""; }; - 72C86BE410965E4F00C66E90 /* SerialSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SerialSet.cpp; path = darwinup/SerialSet.cpp; sourceTree = ""; }; - 72C86BE510965E4F00C66E90 /* SerialSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SerialSet.h; path = darwinup/SerialSet.h; sourceTree = ""; }; - 72C86BE610965E4F00C66E90 /* Utils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Utils.cpp; path = darwinup/Utils.cpp; sourceTree = ""; }; - 72C86BE710965E4F00C66E90 /* Utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Utils.h; path = darwinup/Utils.h; sourceTree = ""; }; 72C86BE810965E7500C66E90 /* cfutils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cfutils.c; path = darwinxref/cfutils.c; sourceTree = ""; }; 72C86BE910965E7500C66E90 /* cfutils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cfutils.h; path = darwinxref/cfutils.h; sourceTree = ""; }; 72C86BEA10965E7500C66E90 /* DBDataStore.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = DBDataStore.c; path = darwinxref/DBDataStore.c; sourceTree = ""; }; @@ -800,13 +755,10 @@ 72C86C2E1096600B00C66E90 /* manifest.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = manifest.c; path = darwinbuild/manifest.c; sourceTree = ""; }; 72C86C311096600B00C66E90 /* SDKSettings.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = SDKSettings.plist; path = darwinbuild/SDKSettings.plist; sourceTree = ""; }; 72C86C381096607900C66E90 /* darwinbuild */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = darwinbuild; sourceTree = BUILT_PRODUCTS_DIR; }; - 72C86C481096609500C66E90 /* darwinup */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = darwinup; sourceTree = BUILT_PRODUCTS_DIR; }; 72C86C52109660CA00C66E90 /* darwintrace.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = darwintrace.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; 72C86CE310974CC800C66E90 /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = /usr/lib/libsqlite3.dylib; sourceTree = ""; }; 72D05CA911D2678F00B33EDD /* query.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = query.c; sourceTree = ""; }; 72D05CB711D267C400B33EDD /* query.so */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.objfile"; includeInIndex = 0; path = query.so; sourceTree = BUILT_PRODUCTS_DIR; }; - DF12E2801119E2B0007587C1 /* DB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DB.h; path = darwinup/DB.h; sourceTree = ""; }; - DF12E2811119E2B0007587C1 /* DB.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DB.cpp; path = darwinup/DB.cpp; sourceTree = ""; }; DF6BE300132C5EBD00793781 /* close-test */ = {isa = PBXFileReference; lastKnownFileType = text; path = "close-test"; sourceTree = ""; }; DF6BE301132C5EBD00793781 /* exec */ = {isa = PBXFileReference; lastKnownFileType = text; path = exec; sourceTree = ""; }; DF6BE302132C5EBD00793781 /* realpath */ = {isa = PBXFileReference; lastKnownFileType = text; path = realpath; sourceTree = ""; }; @@ -838,13 +790,6 @@ DF6BE31D132C5EBD00793781 /* symlink_update.tar.gz */ = {isa = PBXFileReference; lastKnownFileType = archive.gzip; path = symlink_update.tar.gz; sourceTree = ""; }; DF6BE31E132C5EBD00793781 /* symlinks.tar.gz */ = {isa = PBXFileReference; lastKnownFileType = archive.gzip; path = symlinks.tar.gz; sourceTree = ""; }; DF6BE31F132C5EBD00793781 /* run-all-tests.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "run-all-tests.sh"; sourceTree = ""; }; - DFC9772711138F9400CAE084 /* Column.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Column.cpp; path = darwinup/Column.cpp; sourceTree = ""; }; - DFC9772811138F9400CAE084 /* Column.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Column.h; path = darwinup/Column.h; sourceTree = ""; }; - DFC9772911138F9400CAE084 /* Database.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Database.cpp; path = darwinup/Database.cpp; sourceTree = ""; }; - DFC9772A11138F9400CAE084 /* Database.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Database.h; path = darwinup/Database.h; sourceTree = ""; }; - DFC9772B11138F9400CAE084 /* Table.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Table.cpp; path = darwinup/Table.cpp; sourceTree = ""; }; - DFC9772C11138F9400CAE084 /* Table.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Table.h; path = darwinup/Table.h; sourceTree = ""; }; - DFCAA39C1178E05B008DCF37 /* darwinup.1 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.man; name = darwinup.1; path = darwinup/darwinup.1; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -1040,14 +985,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 72C86C461096609500C66E90 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 72C86CE410974CC800C66E90 /* libsqlite3.dylib in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 72C86C50109660CA00C66E90 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -1070,7 +1007,6 @@ children = ( DF6BE2FE132C5EBD00793781 /* testing */, 72C86BD810965DDF00C66E90 /* darwintrace */, - 72C86BD710965DD800C66E90 /* darwinup */, 72C86BD610965DD000C66E90 /* darwinxref */, 72C86BD510965DC900C66E90 /* darwinbuild */, 72C86C391096607900C66E90 /* Products */, @@ -1128,35 +1064,6 @@ name = darwinxref; sourceTree = ""; }; - 72C86BD710965DD800C66E90 /* darwinup */ = { - isa = PBXGroup; - children = ( - DFCAA39C1178E05B008DCF37 /* darwinup.1 */, - DFC9772711138F9400CAE084 /* Column.cpp */, - DFC9772811138F9400CAE084 /* Column.h */, - DFC9772911138F9400CAE084 /* Database.cpp */, - DFC9772A11138F9400CAE084 /* Database.h */, - DFC9772B11138F9400CAE084 /* Table.cpp */, - DFC9772C11138F9400CAE084 /* Table.h */, - 72C86BDA10965E4F00C66E90 /* Archive.cpp */, - 72C86BDB10965E4F00C66E90 /* Archive.h */, - 72C86BDC10965E4F00C66E90 /* Depot.cpp */, - 72C86BDD10965E4F00C66E90 /* Depot.h */, - 72C86BDE10965E4F00C66E90 /* Digest.cpp */, - 72C86BDF10965E4F00C66E90 /* Digest.h */, - 72C86BE010965E4F00C66E90 /* File.cpp */, - 72C86BE110965E4F00C66E90 /* File.h */, - 72C86BE210965E4F00C66E90 /* main.cpp */, - 72C86BE410965E4F00C66E90 /* SerialSet.cpp */, - 72C86BE510965E4F00C66E90 /* SerialSet.h */, - 72C86BE610965E4F00C66E90 /* Utils.cpp */, - 72C86BE710965E4F00C66E90 /* Utils.h */, - DF12E2801119E2B0007587C1 /* DB.h */, - DF12E2811119E2B0007587C1 /* DB.cpp */, - ); - name = darwinup; - sourceTree = ""; - }; 72C86BD810965DDF00C66E90 /* darwintrace */ = { isa = PBXGroup; children = ( @@ -1211,7 +1118,6 @@ isa = PBXGroup; children = ( 72C86C381096607900C66E90 /* darwinbuild */, - 72C86C481096609500C66E90 /* darwinup */, 72C86C52109660CA00C66E90 /* darwintrace.dylib */, 725749A01097697300B13BC3 /* darwinxref */, 72574B591097A36300B13BC3 /* configuration.so */, @@ -1885,23 +1791,6 @@ productReference = 72C86C381096607900C66E90 /* darwinbuild */; productType = "com.apple.product-type.tool"; }; - 72C86C471096609500C66E90 /* darwinup */ = { - isa = PBXNativeTarget; - buildConfigurationList = 72C86C4D109660B300C66E90 /* Build configuration list for PBXNativeTarget "darwinup" */; - buildPhases = ( - 72C86C451096609500C66E90 /* Sources */, - 72C86C461096609500C66E90 /* Frameworks */, - DFCAA3C51178E10E008DCF37 /* Install Manpage */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = darwinup; - productName = darwinup; - productReference = 72C86C481096609500C66E90 /* darwinup */; - productType = "com.apple.product-type.tool"; - }; 72C86C51109660CA00C66E90 /* darwintrace */ = { isa = PBXNativeTarget; buildConfigurationList = 72C86C55109660E900C66E90 /* Build configuration list for PBXNativeTarget "darwintrace" */; @@ -1971,7 +1860,6 @@ 72C86C561096614C00C66E90 /* world */, 7227AC311098DC4E00BE33D7 /* darwinbuild_scripts */, 725740981097B051008AD4D7 /* darwinxref_plugins */, - 72C86C471096609500C66E90 /* darwinup */, 72C86C51109660CA00C66E90 /* darwintrace */, 7257499F1097697300B13BC3 /* darwinxref */, 72574B581097A36300B13BC3 /* configuration */, @@ -2545,24 +2433,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 72C86C451096609500C66E90 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 72C86C99109745BC00C66E90 /* Archive.cpp in Sources */, - 72C86C9A109745BC00C66E90 /* Depot.cpp in Sources */, - 72C86C9B109745BC00C66E90 /* Digest.cpp in Sources */, - 72C86C9C109745BC00C66E90 /* File.cpp in Sources */, - 72C86C9D109745BC00C66E90 /* main.cpp in Sources */, - 72C86C9E109745BC00C66E90 /* SerialSet.cpp in Sources */, - 72C86C9F109745BC00C66E90 /* Utils.cpp in Sources */, - DFC9772D11138F9400CAE084 /* Column.cpp in Sources */, - DFC9772E11138F9400CAE084 /* Database.cpp in Sources */, - DFC9772F11138F9400CAE084 /* Table.cpp in Sources */, - DF12E2821119E2B0007587C1 /* DB.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 72C86C4F109660CA00C66E90 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -2882,11 +2752,6 @@ target = 72574B581097A36300B13BC3 /* configuration */; targetProxy = 725740CD1097B0AD008AD4D7 /* PBXContainerItemProxy */; }; - 72C86C5F1096617500C66E90 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 72C86C471096609500C66E90 /* darwinup */; - targetProxy = 72C86C5E1096617500C66E90 /* PBXContainerItemProxy */; - }; 72C86C611096617500C66E90 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 72C86C51109660CA00C66E90 /* darwintrace */; @@ -3854,21 +3719,6 @@ }; name = Public; }; - 7257498A1097633500B13BC3 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - COPY_PHASE_STRIP = YES; - DEPLOYMENT_POSTPROCESSING = YES; - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - INSTALL_PATH = "$(BINDIR)"; - PRODUCT_NAME = darwinup; - STRIP_INSTALLED_PRODUCT = YES; - STRIP_STYLE = all; - }; - name = Public; - }; 7257498B1097633500B13BC3 /* Public */ = { isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; @@ -4092,32 +3942,6 @@ }; name = Release; }; - 72C86C4A1096609500C66E90 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - INSTALL_PATH = "$(BINDIR)"; - PRODUCT_NAME = darwinup; - }; - name = Debug; - }; - 72C86C4B1096609500C66E90 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - COPY_PHASE_STRIP = YES; - DEPLOYMENT_POSTPROCESSING = YES; - GCC_GENERATE_DEBUGGING_SYMBOLS = YES; - INSTALL_PATH = "$(BINDIR)"; - PRODUCT_NAME = darwinup; - STRIP_INSTALLED_PRODUCT = YES; - STRIP_STYLE = all; - }; - name = Release; - }; 72C86C53109660CB00C66E90 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; @@ -4567,16 +4391,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Public; }; - 72C86C4D109660B300C66E90 /* Build configuration list for PBXNativeTarget "darwinup" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 72C86C4A1096609500C66E90 /* Debug */, - 7257498A1097633500B13BC3 /* Public */, - 72C86C4B1096609500C66E90 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; - }; 72C86C55109660E900C66E90 /* Build configuration list for PBXNativeTarget "darwintrace" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/darwinup/Archive.cpp b/darwinup/Archive.cpp deleted file mode 100644 index 718cc30..0000000 --- a/darwinup/Archive.cpp +++ /dev/null @@ -1,358 +0,0 @@ -/* - * Copyright (c) 2005-2010 Apple Computer, Inc. All rights reserved. - * - * @APPLE_BSD_LICENSE_HEADER_START@ - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @APPLE_BSD_LICENSE_HEADER_END@ - */ - -#include "Archive.h" -#include "Depot.h" -#include "File.h" -#include "Utils.h" - -#include -#include -#include -#include -#include -#include - -#if TARGET_OS_EMBEDDED -# define COMPACT_SUFFIX ".tar" -# define COMPACT_COMPRESSION "" -#else -# define COMPACT_SUFFIX ".tar.bz2" -# define COMPACT_COMPRESSION "j" -#endif - -extern char** environ; - -Archive::Archive(const char* path) { - m_serial = 0; - uuid_generate_random(m_uuid); - m_path = strdup(path); - m_name = strdup(basename(m_path)); - m_info = 0; - m_date_installed = time(NULL); - m_is_superseded = -1; // unknown -} - -Archive::Archive(uint64_t serial, uuid_t uuid, const char* name, const char* path, - uint64_t info, time_t date_installed, const char* build) { - m_serial = serial; - uuid_copy(m_uuid, uuid); - m_name = name ? strdup(name) : NULL; - m_path = path ? strdup(path) : NULL; - m_build = build ? strdup(build) : NULL; - m_info = info; - m_date_installed = date_installed; - m_is_superseded = -1; // unknown -} - - -Archive::~Archive() { - if (m_path) free(m_path); - if (m_name) free(m_name); - if (m_build) free(m_build); -} - -uint64_t Archive::serial() { return m_serial; } -uint8_t* Archive::uuid() { return m_uuid; } -const char* Archive::name() { return m_name; } -const char* Archive::path() { return m_path; } -const char* Archive::build() { return m_build; } -uint64_t Archive::info() { return m_info; } -time_t Archive::date_installed() { return m_date_installed; } - -char* Archive::directory_name(const char* prefix) { - char* path = NULL; - char uuidstr[37]; - uuid_unparse_upper(m_uuid, uuidstr); - asprintf(&path, "%s/%s", prefix, uuidstr); - if (path == NULL) { - fprintf(stderr, "%s:%d: out of memory\n", __FILE__, __LINE__); - } - return path; -} - -char* Archive::create_directory(const char* prefix) { - int res = 0; - char* path = this->directory_name(prefix); - if (path && res == 0) res = mkdir(path, 0777); - if (res != 0) { - fprintf(stderr, "%s:%d: could not create directory: %s: %s (%d)\n", __FILE__, __LINE__, path, strerror(errno), errno); - free(path); - path = NULL; - } - if (res == 0) res = chown(path, 0, 0); - return path; -} - -int Archive::compact_directory(const char* prefix) { - int res = 0; - char* tarpath = NULL; - char uuidstr[37]; - uuid_unparse_upper(m_uuid, uuidstr); - asprintf(&tarpath, "%s/%s" COMPACT_SUFFIX, prefix, uuidstr); - if (tarpath) { - const char* args[] = { - "/usr/bin/tar", - "cf" COMPACT_COMPRESSION, tarpath, - "-C", prefix, - uuidstr, - NULL - }; - res = exec_with_args(args); - free(tarpath); - } else { - fprintf(stderr, "%s:%d: out of memory\n", __FILE__, __LINE__); - res = -1; - } - return res; -} - -int Archive::expand_directory(const char* prefix) { - int res = 0; - char* tarpath = NULL; - char uuidstr[37]; - uuid_unparse_upper(m_uuid, uuidstr); - asprintf(&tarpath, "%s/%s" COMPACT_SUFFIX, prefix, uuidstr); - if (tarpath) { - const char* args[] = { - "/usr/bin/tar", - "xf" COMPACT_COMPRESSION, tarpath, - "-C", prefix, - "-p", // --preserve-permissions - NULL - }; - res = exec_with_args(args); - free(tarpath); - } else { - fprintf(stderr, "%s:%d: out of memory\n", __FILE__, __LINE__); - res = -1; - } - return res; -} - -int Archive::prune_compacted_archive(const char* prefix) { - int res = 0; - char* tarpath = NULL; - char uuidstr[37]; - uuid_unparse_upper(m_uuid, uuidstr); - asprintf(&tarpath, "%s/%s" COMPACT_SUFFIX, prefix, uuidstr); - if (tarpath) { - res = unlink(tarpath); - if (res) perror(tarpath); - free(tarpath); - } - return res; -} - -int Archive::extract(const char* destdir) { - // not implemented - return -1; -} - - - -RollbackArchive::RollbackArchive() : Archive("") { - m_info = ARCHIVE_INFO_ROLLBACK; -} - - - -DittoArchive::DittoArchive(const char* path) : Archive(path) {} - -int DittoArchive::extract(const char* destdir) { - const char* args[] = { - "/usr/bin/ditto", - m_path, destdir, - NULL - }; - return exec_with_args(args); -} - - -DittoXArchive::DittoXArchive(const char* path) : Archive(path) {} - -int DittoXArchive::extract(const char* destdir) { - const char* args[] = { - "/usr/bin/ditto", - "-x", m_path, - destdir, - NULL - }; - return exec_with_args(args); -} - -CpioArchive::CpioArchive(const char* path) : DittoXArchive(path) {} - -CpioGZArchive::CpioGZArchive(const char* path) : DittoXArchive(path) {} - -CpioBZ2Archive::CpioBZ2Archive(const char* path) : DittoXArchive(path) {} - -PaxArchive::PaxArchive(const char* path) : DittoXArchive(path) {} - -PaxGZArchive::PaxGZArchive(const char* path) : DittoXArchive(path) {} - -PaxBZ2Archive::PaxBZ2Archive(const char* path) : DittoXArchive(path) {} - - -TarArchive::TarArchive(const char* path) : Archive(path) {} - -int TarArchive::extract(const char* destdir) { - const char* args[] = { - "/usr/bin/tar", - "xf", m_path, - "-C", destdir, - NULL - }; - return exec_with_args(args); -} - - -TarGZArchive::TarGZArchive(const char* path) : Archive(path) {} - -int TarGZArchive::extract(const char* destdir) { - const char* args[] = { - "/usr/bin/tar", - "xzf", m_path, - "-C", destdir, - NULL - }; - return exec_with_args(args); -} - - -TarBZ2Archive::TarBZ2Archive(const char* path) : Archive(path) {} - -int TarBZ2Archive::extract(const char* destdir) { - const char* args[] = { - "/usr/bin/tar", - "xjf", m_path, - "-C", destdir, - NULL - }; - return exec_with_args(args); -} - -#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 -XarArchive::XarArchive(const char* path) : Archive(path) {} - -int XarArchive::extract(const char* destdir) { - const char* args[] = { - "/usr/bin/xar", - "-xf", m_path, - "-C", destdir, - NULL - }; - return exec_with_args(args); -} -#endif - -ZipArchive::ZipArchive(const char* path) : Archive(path) {} - -int ZipArchive::extract(const char* destdir) { - const char* args[] = { - "/usr/bin/ditto", - "-xk", m_path, - destdir, - NULL - }; - return exec_with_args(args); -} - - -Archive* ArchiveFactory(const char* path, const char* tmppath) { - Archive* archive = NULL; - - // actual path to archive - char* actpath = NULL; - - // fetch remote archives if needed - if (is_url_path(path)) { - actpath = fetch_url(path, tmppath); - if (!actpath) { - fprintf(stderr, "Error: could not fetch remote URL: %s \n", path); - return NULL; - } - } else if (is_userhost_path(path)) { - IF_DEBUG("fetching userhost path from: %s to: %s \n", path, tmppath); - actpath = fetch_userhost(path, tmppath); - IF_DEBUG("fetched %s \n", actpath); - if (!actpath) { - fprintf(stderr, "Error: could not fetch remote file from: %s \n", path); - return NULL; - } - } else { - actpath = (char *)path; - } - - // make sure the archive exists - struct stat sb; - int res = stat(actpath, &sb); - if (res == -1 && errno == ENOENT) { - return NULL; - } - - // use file extension to guess archive format - if (is_directory(actpath, true)) { - archive = new DittoArchive(actpath); - } else if (has_suffix(actpath, ".cpio")) { - archive = new CpioArchive(actpath); - } else if (has_suffix(actpath, ".cpio.gz") || has_suffix(actpath, ".cpgz")) { - archive = new CpioGZArchive(actpath); - } else if (has_suffix(actpath, ".cpio.bz2") || has_suffix(actpath, ".cpbz2")) { - archive = new CpioBZ2Archive(actpath); - } else if (has_suffix(actpath, ".pax")) { - archive = new PaxArchive(actpath); - } else if (has_suffix(actpath, ".pax.gz") || has_suffix(actpath, ".pgz")) { - archive = new PaxGZArchive(actpath); - } else if (has_suffix(actpath, ".pax.bz2") || has_suffix(actpath, ".pbz2")) { - archive = new PaxBZ2Archive(actpath); - } else if (has_suffix(actpath, ".tar")) { - archive = new TarArchive(actpath); - } else if (has_suffix(actpath, ".tar.gz") || has_suffix(actpath, ".tgz")) { - archive = new TarGZArchive(actpath); - } else if (has_suffix(actpath, ".tar.bz2") - || has_suffix(actpath, ".tbz2") - || has_suffix(actpath, ".tbz")) { - archive = new TarBZ2Archive(actpath); -#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 - } else if (has_suffix(actpath, ".xar")) { - archive = new XarArchive(actpath); -#endif - } else if (has_suffix(actpath, ".zip")) { - archive = new ZipArchive(actpath); - } else { - fprintf(stderr, "Error: unknown archive type: %s\n", path); - } - - if (actpath && actpath != path) free(actpath); - return archive; -} diff --git a/darwinup/Archive.h b/darwinup/Archive.h deleted file mode 100644 index 229b47c..0000000 --- a/darwinup/Archive.h +++ /dev/null @@ -1,331 +0,0 @@ -/* - * Copyright (c) 2005-2010 Apple Computer, Inc. All rights reserved. - * - * @APPLE_BSD_LICENSE_HEADER_START@ - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @APPLE_BSD_LICENSE_HEADER_END@ - */ - -#ifndef _ARCHIVE_H -#define _ARCHIVE_H - -#include -#include -#include -#include -#include -#include -#include - -typedef char* archive_name_t; - -enum archive_keyword_t { - DEPOT_ARCHIVE_NEWEST, - DEPOT_ARCHIVE_OLDEST -}; - - -// -// ARCHIVE_INFO flags stored in the database -// -const uint64_t ARCHIVE_INFO_ROLLBACK = 0x0001; - -struct Archive; -struct Depot; - -//// -// Archive -// -// Archive is the root class of all archive formats -// supported by darwinup. -// -// Conceptually it's an abstract class, although that -// hasn't been formalized. -// -// ArchiveFactory exists to return the correct -// concrete subclass for a given archive to be -// installed. Currently this is determined -// by the file's suffix. The tmppath parameter -// is the path where files can be stored during -// processing, such as fetching remote archives. -//// - -Archive* ArchiveFactory(const char* path, const char* tmppath); - -struct Archive { - Archive(const char* path); - virtual ~Archive(); - - //// - // Public Accessor functions - //// - - // Unique serial number for the archive (used by database). - virtual uint64_t serial(); - - // Universally unique identifier for the archive. - virtual uint8_t* uuid(); - - // The name of the archive as it was installed. - // Determined by basename(3). - // Do not modify or free(3). - virtual const char* name(); - - // The path to the archive as it was installed. - // Do not modify or free(3). - virtual const char* path(); - - // the OS build this archive was installed onto - virtual const char* build(); - - // ARCHIVE_INFO flags. - virtual uint64_t info(); - - // The epoch seconds when the archive was installed. - virtual time_t date_installed(); - - - //// - // Member functions - //// - - // Extracts the archive into the specified destination. - // Not implemented for Archive, expected to be implemented - // by concrete subclasses. - virtual int extract(const char* destdir); - - // Returns the backing-store directory name for the archive. - // This is prefix/uuid. - // The result should be released with free(3). - char* directory_name(const char* prefix); - - // Creates the backing-store directory for the archive. - // Same directory name as returned by directory_name(). - char* create_directory(const char* prefix); - - // Compacts the backing-store directory into a single file. - int compact_directory(const char* prefix); - - // Expands the backing-store directory from its single file. - int expand_directory(const char* prefix); - - // Removes the compacted backing-store file from disk. - int prune_compacted_archive(const char* prefix); - - protected: - - // Constructor for subclasses and Depot to use when - // unserializing an archive from the database. - Archive(uint64_t serial, uuid_t uuid, const char* name, const char* path, - uint64_t info, time_t date_installed, const char* build); - - uint64_t m_serial; - uuid_t m_uuid; - char* m_name; - char* m_path; - char* m_build; - uint64_t m_info; - time_t m_date_installed; - - // -1 unknown, 0 false, 1 true - int m_is_superseded; - - friend struct Depot; - friend struct DarwinupDatabase; -}; - - -//// -// RollbackArchive -// -// Not a file format. RollbackArchive is an internal representation -// of archives that are created to store the user-data that darwinup -// archives as part of installation. -//// -struct RollbackArchive : public Archive { - RollbackArchive(); -}; - - -//// -// DittoArchive -// -// Not a file format, but this allows a directory tree to be installed -// using the ditto(1) command line tool. This is useful for installing -// Darwin roots built with DarwinBuild. -//// -struct DittoArchive : public Archive { - DittoArchive(const char* path); - virtual int extract(const char* destdir); -}; - - -//// -// DittoXArchive -// -// Handles any file that `ditto -x` can handle. Intended to be the parent -// of suffix-specific archive objects. -//// -struct DittoXArchive : public Archive { - DittoXArchive(const char* path); - virtual int extract(const char* destdir); -}; - - -//// -// CpioArchive -// -// Corresponds to the cpio(1) file format. -// This installs archives using the ditto(1) command line tool with -// the -x option. -//// -struct CpioArchive : public DittoXArchive { - CpioArchive(const char* path); -}; - -//// -// CpioGZArchive -// -// Corresponds to the cpio(1) file format, compressed with gzip(1). -// This installs archives using the ditto(1) command line tool with -// the -x option. -//// -struct CpioGZArchive : public DittoXArchive { - CpioGZArchive(const char* path); -}; - -//// -// CpioBZ2Archive -// -// Corresponds to the cpio(1) file format, compressed with bzip2(1). -// This installs archives using the ditto(1) command line tool with -// the -x option. -//// -struct CpioBZ2Archive : public DittoXArchive { - CpioBZ2Archive(const char* path); -}; - - -//// -// PaxArchive -// -// Corresponds to the pax(1) file format. -// This installs archives using the ditto(1) command line tool with -// the -x option. -//// -struct PaxArchive : public DittoXArchive { - PaxArchive(const char* path); -}; - - -//// -// PaxGZArchive -// -// Corresponds to the pax(1) file format, compressed with gzip(1). -// This installs archives using the ditto(1) command line tool with -// the -x option. -//// -struct PaxGZArchive : public DittoXArchive { - PaxGZArchive(const char* path); -}; - - -//// -// PaxBZ2Archive -// -// Corresponds to the pax(1) file format, compressed with bzip2(1). -// This installs archives using the ditto(1) command line tool with -// the -x option. -//// -struct PaxBZ2Archive : public DittoXArchive { - PaxBZ2Archive(const char* path); -}; - - -//// -// TarArchive -// -// Corresponds to the tar(1) file format. This handles uncompressed tar -// archives by using the tar(1) command line tool. -//// -struct TarArchive : public Archive { - TarArchive(const char* path); - virtual int extract(const char* destdir); -}; - - -//// -// TarGZArchive -// -// Corresponds to the tar(1) file format, compressed with gzip(1). -// This installs archives using the tar(1) command line tool with -// the -z option. -//// -struct TarGZArchive : public Archive { - TarGZArchive(const char* path); - virtual int extract(const char* destdir); -}; - - -//// -// TarBZ2Archive -// -// Corresponds to the tar(1) file format, compressed with bzip2(1). -// This installs archives using the tar(1) command line tool with -// the -j option. -//// -struct TarBZ2Archive : public Archive { - TarBZ2Archive(const char* path); - virtual int extract(const char* destdir); -}; - -#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 -//// -// XarArchive -// -// Corresponds to the xar(1) file format. This handles uncompressed cpio -// archives by using the xar(1) command line tool. -//// -struct XarArchive : public Archive { - XarArchive(const char* path); - virtual int extract(const char* destdir); -}; -#endif - -//// -// ZipArchive -// -// Corresponds to a zip archive. We use the -k option to ditto(1) -// to handle it. -//// -struct ZipArchive : public Archive { - ZipArchive(const char* path); - virtual int extract(const char* destdir); -}; - -#endif - diff --git a/darwinup/Column.cpp b/darwinup/Column.cpp deleted file mode 100644 index 0decdbc..0000000 --- a/darwinup/Column.cpp +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (c) 2010 Apple Computer, Inc. All rights reserved. - * - * @APPLE_BSD_LICENSE_HEADER_START@ - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @APPLE_BSD_LICENSE_HEADER_END@ - */ - -#include -#include -#include - -#include "Column.h" - -Column::Column(const char* name, uint32_t type) { - m_name = strdup(name); - m_create_sql = NULL; - m_alter_sql = NULL; - m_type = type; - m_is_index = false; - m_is_pk = false; - m_is_unique = false; - m_version = 0; -} - -Column::Column(const char* name, uint32_t type, - bool is_index, bool is_pk, bool is_unique) { - m_name = strdup(name); - m_create_sql = NULL; - m_alter_sql = NULL; - m_type = type; - m_is_index = is_index; - m_is_pk = is_pk; - m_is_unique = is_unique; - m_version = 0; -} - -Column::~Column() { - free(m_name); - free(m_create_sql); - free(m_alter_sql); -} - -const char* Column::name() { - return m_name; -} - -uint32_t Column::type() { - return m_type; -} - -const bool Column::is_index() { - return m_is_index; -} - -const bool Column::is_pk() { - return m_is_pk; -} - -const bool Column::is_unique() { - return m_is_unique; -} - -uint32_t Column::version() { - return m_version; -} - -const char* Column::typestr() { - switch(m_type) { - case SQLITE_INTEGER: - return "INTEGER"; - break; - case SQLITE_TEXT: - return "TEXT"; - break; - case SQLITE_BLOB: - return "BLOB"; - break; - default: - fprintf(stderr, "Error: unknown column type: %d \n", m_type); - return "UNKNOWN"; - } -} - -uint32_t Column::size() { - // integers are stored inband in the record - if (m_type == SQLITE_INTEGER) return sizeof(uint64_t); - // everything else is stored out of band - return sizeof(void*); -} - -int Column::offset() { - return m_offset; -} - -const char* Column::create() { - if (!m_create_sql) { - asprintf(&m_create_sql, "%s %s%s%s", m_name, this->typestr(), - (this->is_pk() ? " PRIMARY KEY AUTOINCREMENT" : ""), - (this->is_unique() ? " UNIQUE" : "")); - } - return (const char*)m_create_sql; -} - -const char* Column::alter(const char* table_name) { - if (!m_alter_sql) { - asprintf(&m_alter_sql, "ALTER TABLE %s ADD COLUMN %s;", - table_name, this->create()); - } - return (const char*)m_alter_sql; -} - diff --git a/darwinup/Column.h b/darwinup/Column.h deleted file mode 100644 index 9b669bd..0000000 --- a/darwinup/Column.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2010 Apple Computer, Inc. All rights reserved. - * - * @APPLE_BSD_LICENSE_HEADER_START@ - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @APPLE_BSD_LICENSE_HEADER_END@ - */ - -#ifndef _COLUMN_H -#define _COLUMN_H - -#include -#include - -#include "Utils.h" - -/** - * Column objects represent a column in a database table. They store - * type information and chunks of sql for their Table to build - * queries with. - */ -struct Column { - Column(const char* name, uint32_t type); - Column(const char* name, uint32_t type, - bool is_index, bool is_pk, bool is_unique); - virtual ~Column(); - - const char* name(); - uint32_t type(); - const bool is_index(); - const bool is_pk(); - const bool is_unique(); - - uint32_t version(); - - // return size of this column when packed into a result record - uint32_t size(); - -protected: - // return a string representation of this columns type suitable - // for sql queries - const char* typestr(); - - // return the offset of this column in the Table's result record - int offset(); - - // generate the sql needed to create this column - const char* create(); - // generate alter table sql for this column for table named table_name - const char* alter(const char* table_name); - - char* m_name; - uint32_t m_version; // schema version this was added - char* m_create_sql; // sql fragment for use in CREATE TABLE - char* m_alter_sql; // entire ALTER TABLE ADD COLUMN sql - uint32_t m_type; // SQLITE_* type definition - bool m_is_index; - bool m_is_pk; - bool m_is_unique; - int m_offset; - - friend struct Table; -}; - -#endif diff --git a/darwinup/DB.cpp b/darwinup/DB.cpp deleted file mode 100644 index 5f466f2..0000000 --- a/darwinup/DB.cpp +++ /dev/null @@ -1,546 +0,0 @@ -/* - * Copyright (c) 2010 Apple Computer, Inc. All rights reserved. - * - * @APPLE_BSD_LICENSE_HEADER_START@ - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @APPLE_BSD_LICENSE_HEADER_END@ - */ - -#include "DB.h" - - -DarwinupDatabase::DarwinupDatabase(const char* path) : Database(path) { - this->connect(); - this->last_archive = NULL; -} - -DarwinupDatabase::~DarwinupDatabase() { - // parent automatically deallocates schema objects - - if (this->last_archive) delete this->last_archive; -} - -int DarwinupDatabase::init_schema() { - - - SCHEMA_VERSION(0); - - this->m_archives_table = new Table("archives"); - ADD_TABLE(this->m_archives_table); - ADD_PK(m_archives_table, "serial"); - ADD_INDEX(m_archives_table, "uuid", TYPE_BLOB, true); - ADD_TEXT(m_archives_table, "name"); - ADD_INTEGER(m_archives_table, "date_added"); - ADD_INTEGER(m_archives_table, "active"); - ADD_INTEGER(m_archives_table, "info"); - - - this->m_files_table = new Table("files"); - ADD_TABLE(this->m_files_table); - ADD_PK(m_files_table, "serial"); - ADD_INDEX(m_files_table, "archive", TYPE_INTEGER, false); - ADD_INTEGER(m_files_table, "info"); - ADD_INTEGER(m_files_table, "mode"); - ADD_INTEGER(m_files_table, "uid"); - ADD_INTEGER(m_files_table, "gid"); - ADD_INTEGER(m_files_table, "size"); - ADD_BLOB(m_files_table, "digest"); - ADD_INDEX(m_files_table, "path", TYPE_TEXT, false); - - // custom index to protect from duplicate files - assert(this->m_files_table->set_custom_create("CREATE UNIQUE INDEX files_archive_path " - "ON files (archive, path);") == 0); - - - SCHEMA_VERSION(1); - - ADD_TEXT(m_archives_table, "osbuild"); - - return 0; -} - -int DarwinupDatabase::activate_archive(uint64_t serial) { - uint64_t active = 1; - return this->set_archive_active(serial, &active); -} - -int DarwinupDatabase::deactivate_archive(uint64_t serial) { - uint64_t active = 0; - return this->set_archive_active(serial, &active); -} - -int DarwinupDatabase::set_archive_active(uint64_t serial, uint64_t* active) { - this->clear_last_archive(); - return this->update_value("activate_archive", - this->m_archives_table, - this->m_archives_table->column(4), // active - (void**)active, - 1, // number of where conditions - this->m_archives_table->column(0), // serial - '=', serial); -} - -int DarwinupDatabase::update_archive(uint64_t serial, uuid_t uuid, const char* name, - time_t date_added, uint32_t active, uint64_t info, - const char* build) { - this->clear_last_archive(); - return this->update(this->m_archives_table, serial, - (uint8_t*)uuid, - (uint32_t)sizeof(uuid_t), - name, - (uint64_t)date_added, - (uint64_t)active, - (uint64_t)info, - build); -} - -uint64_t DarwinupDatabase::insert_archive(uuid_t uuid, uint64_t info, const char* name, - time_t date_added, const char* build) { - - int res = this->insert(this->m_archives_table, - (uint8_t*)uuid, - (uint32_t)sizeof(uuid_t), - name, - (uint64_t)date_added, - (uint64_t)0, - (uint64_t)info, - build); - if (res != SQLITE_OK) { - fprintf(stderr, "Error: unable to insert archive %s: %s \n", - name, this->error()); - return 0; - } - - return this->last_insert_id(); -} - -File* DarwinupDatabase::make_file(uint8_t* data) { - // XXX do this with a for loop and column->type() - uint64_t serial; - memcpy(&serial, &data[this->file_offset(0)], sizeof(uint64_t)); - uint64_t archive_serial; - memcpy(&archive_serial, &data[this->file_offset(1)], sizeof(uint64_t)); - uint64_t info; - memcpy(&info, &data[this->file_offset(2)], sizeof(uint64_t)); - uint64_t mode; - memcpy(&mode, &data[this->file_offset(3)], sizeof(uint64_t)); - uint64_t uid; - memcpy(&uid, &data[this->file_offset(4)], sizeof(uint64_t)); - uint64_t gid; - memcpy(&gid, &data[this->file_offset(5)], sizeof(uint64_t)); - uint64_t size; - memcpy(&size, &data[this->file_offset(6)], sizeof(uint64_t)); - - SHA1Digest* digest = NULL; - uint8_t* dp; - memcpy(&dp, (uint8_t**)&data[this->file_offset(7)], sizeof(uint8_t*)); - if (dp) { - digest = new SHA1Digest(); - digest->m_size = CC_SHA1_DIGEST_LENGTH; - memcpy(digest->m_data, dp, CC_SHA1_DIGEST_LENGTH); - } - - char* path; - memcpy(&path, &data[this->file_offset(8)], sizeof(char*)); - - // get archive, which may be stored in last_archive - int res = DB_OK; - bool cached = false; - Archive* archive = this->get_last_archive(archive_serial); - if (archive) { - cached = true; - } else { - uint8_t* archive_data; - res = this->get_archive(&archive_data, archive_serial); - this->set_last_archive(archive_data); - archive = this->last_archive; - } - if (!archive) { - fprintf(stderr, "Error: DB::make_file could not find the archive for file: %s: %d \n", path, res); - return NULL; - } - - File* result = FileFactory(serial, archive, (uint32_t)info, (const char*)path, mode, (uid_t)uid, (gid_t)gid, size, digest); - this->m_files_table->free_result(data); - - return result; -} - - - -int DarwinupDatabase::get_next_file(uint8_t** data, File* file, file_starseded_t star) { - int res = SQLITE_OK; - - char comp = '<'; - const char* name = "file_preceded"; - int order = ORDER_BY_DESC; - if (star == FILE_SUPERSEDED) { - comp = '>'; - name = "file_superseded"; - order = ORDER_BY_ASC; - } - res = this->get_row_ordered(name, - data, - this->m_files_table, - this->m_files_table->column(1), // order by archive - order, - 2, - this->m_files_table->column(1), // archive - comp, file->archive()->serial(), - this->m_files_table->column(8), // path - '=', file->path()); - - if (res == SQLITE_ROW) return (DB_FOUND | DB_OK); - if (res == SQLITE_DONE) return DB_OK; - return DB_ERROR; -} - -int DarwinupDatabase::get_file_serial_from_archive(Archive* archive, const char* path, uint64_t** serial) { - int res = this->get_value("file_serial__archive_path", - (void**)serial, - this->m_files_table, - this->m_files_table->column(0), // serial - 2, // number of where conditions - this->m_files_table->column(1), // archive - '=', (uint64_t)archive->serial(), - this->m_files_table->column(8), // path - '=', path); - - if (res == SQLITE_ROW) return (DB_FOUND | DB_OK); - if (res == SQLITE_DONE) return DB_OK; - return DB_ERROR; -} - -int DarwinupDatabase::update_file(uint64_t serial, Archive* archive, uint64_t info, mode_t mode, - uid_t uid, gid_t gid, Digest* digest, const char* path) { - - int res = SQLITE_OK; - - // update the information - res = this->update(this->m_files_table, serial, - (uint64_t)archive->serial(), - (uint64_t)info, - (uint64_t)mode, - (uint64_t)uid, - (uint64_t)gid, - (uint64_t)0, - (uint8_t*)(digest ? digest->data() : NULL), - (uint32_t)(digest ? digest->size() : 0), - path); - - if (res != SQLITE_OK) { - fprintf(stderr, "Error: unable to update file with serial %llu and path %s: %s \n", - serial, path, this->error()); - } - - return res; -} - -uint64_t DarwinupDatabase::insert_file(uint64_t info, mode_t mode, uid_t uid, gid_t gid, - Digest* digest, Archive* archive, const char* path) { - - int res = this->insert(this->m_files_table, - (uint64_t)archive->serial(), - (uint64_t)info, - (uint64_t)mode, - (uint64_t)uid, - (uint64_t)gid, - (uint64_t)0, - (uint8_t*)(digest ? digest->data() : NULL), - (uint32_t)(digest ? digest->size() : 0), - path); - if (res != SQLITE_OK) { - fprintf(stderr, "Error: unable to insert file at %s: %s \n", - path, this->error()); - return 0; - } - - return this->last_insert_id(); -} - -uint64_t DarwinupDatabase::count_files(Archive* archive, const char* path) { - int res = SQLITE_OK; - uint64_t* c; - res = this->count("count_files", - (void**)&c, - this->m_files_table, - 2, // number of where conditions - this->m_files_table->column(1), // archive - '=', (uint64_t)archive->serial(), - this->m_files_table->column(8), // path - '=', path); - if (res != SQLITE_ROW) { - fprintf(stderr, "Error: unable to count files: %d \n", res); - return 0; - } - return *c; -} - -uint64_t DarwinupDatabase::count_archives(bool include_rollbacks) { - int res = SQLITE_OK; - uint64_t* c; - if (include_rollbacks) { - res = this->count("count_archives", - (void**)&c, - this->m_archives_table, 0); - } else { - res = this->count("count_archives_norollback", - (void**)&c, - this->m_archives_table, - 1, - this->m_archives_table->column(2), // name - '!', ""); - } - if (res != SQLITE_ROW) { - fprintf(stderr, "Error: unable to count archives: %d \n", res); - return 0; - } - return *c; -} - -int DarwinupDatabase::delete_archive(Archive* archive) { - int res = this->del(this->m_archives_table, archive->serial()); - if (res != SQLITE_OK) return DB_ERROR; - return DB_OK; -} - -int DarwinupDatabase::delete_archive(uint64_t serial) { - int res = this->del(this->m_archives_table, serial); - if (res != SQLITE_OK) return DB_ERROR; - return DB_OK; -} - -int DarwinupDatabase::delete_empty_archives() { - int res = this->sql("delete_empty_archives", - "DELETE FROM archives " - "WHERE serial IN " - " (SELECT serial FROM archives " - " WHERE serial NOT IN " - " (SELECT DISTINCT archive FROM files));"); - if (res != SQLITE_OK) return DB_ERROR; - return DB_OK; -} - -int DarwinupDatabase::free_archive(uint8_t* data) { - return this->m_archives_table->free_result(data); -} - -int DarwinupDatabase::delete_file(File* file) { - int res = this->del(this->m_files_table, file->serial()); - if (res != SQLITE_OK) return DB_ERROR; - return DB_OK; -} - -int DarwinupDatabase::delete_file(uint64_t serial) { - int res = this->del(this->m_files_table, serial); - if (res != SQLITE_OK) return DB_ERROR; - return DB_OK; -} - -int DarwinupDatabase::delete_files(Archive* archive) { - int res = this->del("delete_files__archive", - this->m_files_table, - 1, // number of where conditions - this->m_files_table->column(1), // archive - '=', (uint64_t)archive->serial()); - if (res != SQLITE_OK) return DB_ERROR; - return DB_OK; -} - -int DarwinupDatabase::free_file(uint8_t* data) { - return this->m_files_table->free_result(data); -} - -int DarwinupDatabase::get_inactive_archive_serials(uint64_t** serials, uint32_t* count) { - int res = this->get_column("inactive_archive_serials", - (void**)serials, count, - this->m_archives_table, - this->m_archives_table->column(0), // serial - 1, - this->m_archives_table->column(4), // active - '=', (uint64_t)0); - if (res == SQLITE_DONE && *count) return (DB_OK | DB_FOUND); - if (res == SQLITE_DONE) return DB_OK; - return DB_ERROR; -} - -int DarwinupDatabase::get_files(uint8_t*** data, uint32_t* count, Archive* archive, bool reverse) { - int order = ORDER_BY_ASC; - const char* name = "files_archive"; - if (reverse) { - order = ORDER_BY_DESC; - name = "files_archive_reverse"; - } - int res = this->get_all_ordered(name, - data, count, - this->m_files_table, - this->m_files_table->column(8), // order by path - order, - 1, - this->m_files_table->column(1), - '=', archive->serial()); - - if ((res == SQLITE_DONE) && *count) return (DB_OK | DB_FOUND); - if (res == SQLITE_DONE) return DB_OK; - return DB_ERROR; -} - -int DarwinupDatabase::get_file_serials(uint64_t** serials, uint32_t* count) { - int res = this->get_column("file_serials", (void**)serials, count, - this->m_files_table, - this->m_files_table->column(0), - 0); - if (res == SQLITE_DONE && *count) return (DB_OK | DB_FOUND); - if (res == SQLITE_DONE) return DB_OK; - return DB_ERROR; -} - - -Archive* DarwinupDatabase::make_archive(uint8_t* data) { - // XXX do this with a for loop and column->type() - uint64_t serial; - memcpy(&serial, &data[this->archive_offset(0)], sizeof(uint64_t)); - uuid_t* uuid; - memcpy(&uuid, &data[this->archive_offset(1)], sizeof(uuid_t*)); - char* name; - memcpy(&name, &data[this->archive_offset(2)], sizeof(char*)); - time_t date_added; - memcpy(&date_added, &data[this->archive_offset(3)], sizeof(time_t)); - uint64_t info; - memcpy(&info, &data[this->archive_offset(5)], sizeof(uint64_t)); - char* build; - memcpy(&build, &data[this->archive_offset(6)], sizeof(char*)); - - Archive* archive = new Archive(serial, *uuid, name, NULL, info, date_added, build); - this->m_archives_table->free_result(data); - - return archive; -} - -int DarwinupDatabase::get_archives(uint8_t*** data, uint32_t* count, bool include_rollbacks) { - int res = this->get_all_ordered("get_archives", - data, count, - this->m_archives_table, - this->m_archives_table->column(0), // order by serial - ORDER_BY_DESC, - 1, - this->m_archives_table->column(2), // name - '!', (include_rollbacks ? "" : "")); - - if ((res == SQLITE_DONE) && *count) return (DB_OK | DB_FOUND); - if (res == SQLITE_DONE) return DB_OK; - return DB_ERROR; -} - -int DarwinupDatabase::get_archive(uint8_t** data, uuid_t uuid) { - int res = this->get_row("archive__uuid", - data, - this->m_archives_table, - 1, - this->m_archives_table->column(1), // uuid - '=', uuid, sizeof(uuid_t)); - if (res == SQLITE_ROW) return (DB_FOUND | DB_OK); - if (res == SQLITE_DONE) return DB_OK; - return DB_ERROR; -} - -int DarwinupDatabase::get_archive(uint8_t** data, uint64_t serial) { - int res = this->get_row("archive__serial", - data, - this->m_archives_table, - 1, - this->m_archives_table->column(0), // serial - '=', serial); - if (res == SQLITE_ROW) { - return (DB_FOUND | DB_OK); - } - if (res == SQLITE_DONE) return DB_OK; - return DB_ERROR; -} - -int DarwinupDatabase::get_archive(uint8_t** data, const char* name) { - int res = this->get_row("archive__name", - data, - this->m_archives_table, - 1, - this->m_archives_table->column(2), // name - '=', name); - if (res == SQLITE_ROW) return (DB_FOUND | DB_OK); - if (res == SQLITE_DONE) return DB_OK; - return DB_ERROR; -} - -int DarwinupDatabase::get_archive(uint8_t** data, archive_keyword_t keyword) { - int res = SQLITE_OK; - int order = ORDER_BY_DESC; - const char* name = "archive_newest"; - - if (keyword == DEPOT_ARCHIVE_OLDEST) { - order = ORDER_BY_ASC; - name = "archive_oldest"; - } - - res = this->get_row_ordered(name, - data, - this->m_archives_table, - this->m_archives_table->column(3), // order by date_added - order, - 1, - this->m_archives_table->column(2), // name - '!', ""); - - if (res == SQLITE_ROW) return (DB_FOUND | DB_OK); - if (res == SQLITE_DONE) return DB_OK; - return DB_ERROR; -} - -int DarwinupDatabase::archive_offset(int column) { - return this->m_archives_table->offset(column); -} - -int DarwinupDatabase::file_offset(int column) { - return this->m_files_table->offset(column); -} - -Archive* DarwinupDatabase::get_last_archive(uint64_t serial) { - if (this->last_archive && this->last_archive->serial() == serial) { - return this->last_archive; - } - return NULL; -} - -int DarwinupDatabase::clear_last_archive() { - delete this->last_archive; - this->last_archive = NULL; - return 0; -} - -int DarwinupDatabase::set_last_archive(uint8_t* data) { - this->last_archive = this->make_archive(data); - if (this->last_archive) return 0; - return 1; -} diff --git a/darwinup/DB.h b/darwinup/DB.h deleted file mode 100644 index 16fae9d..0000000 --- a/darwinup/DB.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) 2010 Apple Computer, Inc. All rights reserved. - * - * @APPLE_BSD_LICENSE_HEADER_START@ - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @APPLE_BSD_LICENSE_HEADER_END@ - */ - -#ifndef _DB_H -#define _DB_H - -#include -#include -#include -#include - -#include "Database.h" -#include "Table.h" -#include "Archive.h" -#include "Digest.h" -#include "File.h" - - -/** - * - * Darwinup database abstraction. This class is responsible - * for generating the Table and Column objects that make - * up the darwinup database schema, but the parent handles - * deallocation. - * - */ -struct DarwinupDatabase : Database { - DarwinupDatabase(const char* path); - virtual ~DarwinupDatabase(); - int init_schema(); - - uint64_t count_files(Archive* archive, const char* path); - uint64_t count_archives(bool include_rollbacks); - - // Archives - Archive* make_archive(uint8_t* data); - int get_archives(uint8_t*** data, uint32_t* count, bool include_rollbacks); - int get_archive(uint8_t** data, uuid_t uuid); - int get_archive(uint8_t** data, uint64_t serial); - int get_archive(uint8_t** data, const char* name); - int get_archive(uint8_t** data, archive_keyword_t keyword); - int get_inactive_archive_serials(uint64_t** serials, uint32_t* count); - int archive_offset(int column); - int activate_archive(uint64_t serial); - int deactivate_archive(uint64_t serial); - int update_archive(uint64_t serial, uuid_t uuid, const char* name, - time_t date_added, uint32_t active, uint64_t info, - const char* build); - uint64_t insert_archive(uuid_t uuid, uint64_t info, const char* name, - time_t date, const char* build); - int delete_empty_archives(); - int delete_archive(Archive* archive); - int delete_archive(uint64_t serial); - int free_archive(uint8_t* data); - - // Files - File* make_file(uint8_t* data); - int get_next_file(uint8_t** data, File* file, file_starseded_t star); - int get_file_serials(uint64_t** serials, uint32_t* count); - int get_file_serial_from_archive(Archive* archive, const char* path, - uint64_t** serial); - int get_files(uint8_t*** data, uint32_t* count, Archive* archive, bool reverse); - int file_offset(int column); - int update_file(uint64_t serial, Archive* archive, uint64_t info, mode_t mode, - uid_t uid, gid_t gid, Digest* digest, const char* path); - uint64_t insert_file(uint64_t info, mode_t mode, uid_t uid, gid_t gid, - Digest* digest, Archive* archive, const char* path); - int delete_file(uint64_t serial); - int delete_file(File* file); - int delete_files(Archive* archive); - int free_file(uint8_t* data); - - // memoization - Archive* get_last_archive(uint64_t serial); - int clear_last_archive(); - int set_last_archive(uint8_t* data); - - -protected: - - int set_archive_active(uint64_t serial, uint64_t* active); - - Table* m_archives_table; - Table* m_files_table; - - // memoize some get_archive calls - Archive* last_archive; - -}; - -#endif - diff --git a/darwinup/Database.cpp b/darwinup/Database.cpp deleted file mode 100644 index ec2bead..0000000 --- a/darwinup/Database.cpp +++ /dev/null @@ -1,962 +0,0 @@ -/* - * Copyright (c) 2010 Apple Computer, Inc. All rights reserved. - * - * @APPLE_BSD_LICENSE_HEADER_START@ - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @APPLE_BSD_LICENSE_HEADER_END@ - */ - -#include "Database.h" - -/* -* sqlite3_trace_v2 callback for debugging -*/ - static int dbtrace(unsigned, void*, void *p, void*) { - sqlite3_stmt *stmt = (sqlite3_stmt*)p; - char *sql = sqlite3_expanded_sql(stmt); - fprintf(stderr, "[SQL] %s\n", sql); - sqlite3_free(sql); - return 0; -} - -Database::Database() { - m_schema_version = 0; - m_table_max = 2; - m_table_count = 0; - m_tables = (Table**)malloc(sizeof(Table*) * m_table_max); - this->init_cache(); - m_db = NULL; - m_path = NULL; - m_error_size = ERROR_BUF_SIZE; - m_error = (char*)malloc(m_error_size); -} - -Database::Database(const char* path) { - m_schema_version = 0; - m_table_max = 2; - m_table_count = 0; - m_tables = (Table**)malloc(sizeof(Table*) * m_table_max); - this->init_cache(); - m_db = NULL; - m_path = strdup(path); - if (!m_path) { - fprintf(stderr, "Error: ran out of memory when constructing " - "database object.\n"); - } - m_error_size = ERROR_BUF_SIZE; - m_error = (char*)malloc(m_error_size); -} - -Database::~Database() { - for (uint32_t i = 0; i < m_table_count; i++) { - delete m_tables[i]; - } - this->destroy_cache(); - - sqlite3_finalize(m_begin_transaction); - sqlite3_finalize(m_rollback_transaction); - sqlite3_finalize(m_commit_transaction); - - free(m_tables); - free(m_path); - free(m_error); -} - -uint32_t Database::schema_version() { - return this->m_schema_version; -} - -void Database::schema_version(uint32_t v) { - this->m_schema_version = v; -} - -int Database::init_schema() { - // do nothing... children should implement this - return DB_OK; -} - -int Database::post_table_creation() { - // clients can implement this - return DB_OK; -} - -const char* Database::path() { - return m_path; -} - -const char* Database::error() { - return m_error; -} - -int Database::connect() { - int res = DB_OK; - - if (!m_path) { - fprintf(stderr, "Error: need to specify a path to Database.\n"); - return -1; - } - - res = this->pre_connect(); - if (res) { - fprintf(stderr, "Error: pre-connection failed.\n"); - return res; - } - - // test our access level - int exists = is_regular_file(m_path); - bool readonly = false; - if (!exists && access(dirname(m_path), W_OK | X_OK)) { - // does not exist and we cannot write to the directory - fprintf(stderr, - "Error: Unable to create new darwinup database. " - "Try running as root."); - return DB_ERROR; - } - if (exists && access(m_path, W_OK)) { - // db exists already but we cannot write to it - readonly = true; - } - - res = sqlite3_open(m_path, &m_db); - if (res) { - sqlite3_close(m_db); - m_db = NULL; - fprintf(stderr, "Error: unable to connect to database at: %s \n", - m_path); - return res; - } - - res = this->post_connect(); - if (res) { - fprintf(stderr, "Error: post-connection failed.\n"); - return res; - } - - if (!exists) { - // create schema since it is empty - assert(this->create_tables() == 0); - assert(this->set_schema_version(this->m_schema_version) == 0); - } else { - // test schema versions - uint32_t version = 0; - if (this->has_information_table()) { - version = this->get_schema_version(); - } - - if (version < this->m_schema_version) { - if (readonly) { - fprintf(stderr, - "Error: the darwinup database needs to be upgraded " - "but darwinup cannot write to database. " - "Try running as root.\n"); - sqlite3_close(m_db); - m_db = NULL; - return DB_ERROR; - } - IF_DEBUG("Upgrading schema from %u to %u \n", version, this->m_schema_version); - assert(this->upgrade_schema(version) == 0); - assert(this->set_schema_version(this->m_schema_version) == 0); - } - if (version > this->m_schema_version) { - fprintf(stderr, "Error: this client is too old!\n"); - sqlite3_close(m_db); - m_db = NULL; - return DB_ERROR; - } - } - - return res; -} - -int Database::pre_connect() { - int res = DB_OK; - res = this->init_internal_schema(); - res = this->init_schema(); - return res; -} - -int Database::post_connect() { - int res = DB_OK; - - // prepare transaction statements - if (res == DB_OK) - res = sqlite3_prepare_v2(m_db, "BEGIN TRANSACTION", 18, - &m_begin_transaction, NULL); - if (res == DB_OK) - res = sqlite3_prepare_v2(m_db, "ROLLBACK TRANSACTION", 21, - &m_rollback_transaction, NULL); - if (res == DB_OK) - res = sqlite3_prepare_v2(m_db, "COMMIT TRANSACTION", 19, - &m_commit_transaction, NULL); - - // debug settings - extern uint32_t verbosity; - if (verbosity & VERBOSE_SQL) { - sqlite3_trace_v2(m_db, SQLITE_TRACE_STMT, dbtrace, NULL); - } - - return res; -} - -int Database::connect(const char* path) { - this->m_path = strdup(path); - if (!m_path) { - fprintf(stderr, "Error: ran out of memory when trying to connect to " - "database.\n"); - return 1; - } - return this->connect(); -} - -bool Database::is_connected() { - return m_db != NULL; -} - -int Database::begin_transaction() { - return this->execute(m_begin_transaction); -} - -int Database::rollback_transaction() { - return this->execute(m_rollback_transaction); -} - -int Database::commit_transaction() { - return this->execute(m_commit_transaction); -} - -int Database::bind_all_columns(sqlite3_stmt* stmt, Table* table, va_list args) { - int res = DB_OK; - int param = 1; - for (uint32_t i=0; icolumn_count(); i++) { - Column* col = table->column(i); - if (col->is_pk()) continue; - uint8_t* bdata = NULL; - uint32_t bsize = 0; - switch(col->type()) { - case TYPE_INTEGER: - res = sqlite3_bind_int64(stmt, param++, va_arg(args, uint64_t)); - break; - case TYPE_TEXT: - res = sqlite3_bind_text(stmt, param++, va_arg(args, char*), - -1, SQLITE_STATIC); - break; - case TYPE_BLOB: - bdata = va_arg(args, uint8_t*); - bsize = va_arg(args, uint32_t); - res = sqlite3_bind_blob(stmt, param++, - bdata, - bsize, - SQLITE_STATIC); - break; - } - if (res != SQLITE_OK) { - fprintf(stderr, "Error: failed to bind parameter #%d with column #%d" - "of type %d table %s \n", - param, i, col->type(), table->name()); - return res; - } - } - return res; -} - -int Database::bind_va_columns(sqlite3_stmt* stmt, uint32_t count, va_list args) { - return this->bind_columns(stmt, count, 1, args); -} - -int Database::bind_columns(sqlite3_stmt* stmt, uint32_t count, int param, - va_list args) { - int res = DB_OK; - for (uint32_t i=0; itype()) { - case TYPE_INTEGER: - res = sqlite3_bind_int64(stmt, param++, va_arg(args, uint64_t)); - break; - case TYPE_TEXT: - tval = va_arg(args, char*); - res = sqlite3_bind_text(stmt, param++, tval, -1, SQLITE_STATIC); - break; - case TYPE_BLOB: - bdata = va_arg(args, uint8_t*); - bsize = va_arg(args, uint32_t); - res = sqlite3_bind_blob(stmt, param++, - bdata, - bsize, - SQLITE_STATIC); - break; - } - if (res != SQLITE_OK) { - fprintf(stderr, "Error: failed to bind parameter #%d with column #%d " - "of type %d res %d: %s \n", - param-1, i, col->type(), res, - sqlite3_errmsg(m_db)); - return res; - } - } - return res; -} - -#define __get_stmt(expr) \ - sqlite3_stmt* stmt; \ - sqlite3_stmt** pps; \ - char* key = strdup(name); \ - cache_get_and_retain(m_statement_cache, key, (void**)&pps); \ - if (!pps) { \ - va_list args; \ - va_start(args, count); \ - pps = expr; \ - va_end(args); \ - cache_set_and_retain(m_statement_cache, key, pps, 0); \ - } \ - stmt = *pps; \ - free(key); - -int Database::count(const char* name, void** output, Table* table, - uint32_t count, ...) { - va_list args; - va_start(args, count); - __get_stmt(table->count(m_db, count, args)); - int res = SQLITE_OK; - res = this->bind_va_columns(stmt, count, args); - *output = malloc(sizeof(uint64_t)); - assert(*output); - res = this->step_once(stmt, *(uint8_t**)output, NULL); - sqlite3_reset(stmt); - cache_release_value(m_statement_cache, pps); - va_end(args); - return res; -} - -int Database::get_value(const char* name, void** output, Table* table, - Column* value_column, uint32_t count, ...) { - va_list args; - va_start(args, count); - __get_stmt(table->get_column(m_db, value_column, count, args)); - int res = SQLITE_OK; - this->bind_va_columns(stmt, count, args); - uint32_t size = value_column->size(); - *output = malloc(size); - assert(*output); - res = this->step_once(stmt, (uint8_t*)*output, NULL); - sqlite3_reset(stmt); - cache_release_value(m_statement_cache, pps); - va_end(args); - return res; -} - -int Database::get_column(const char* name, void** output, uint32_t* result_count, - Table* table, Column* column, uint32_t count, ...) { - va_list args; - va_start(args, count); - __get_stmt(table->get_column(m_db, column, count, args)); - int res = SQLITE_OK; - this->bind_va_columns(stmt, count, args); - uint32_t size = INITIAL_ROWS * column->size(); - *output = malloc(size); - res = this->step_all(stmt, output, size, result_count); - sqlite3_reset(stmt); - cache_release_value(m_statement_cache, pps); - va_end(args); - return res; -} - -int Database::get_row(const char* name, uint8_t** output, Table* table, - uint32_t count, ...) { - va_list args; - va_start(args, count); - __get_stmt(table->get_row(m_db, count, args)); - int res = SQLITE_OK; - this->bind_va_columns(stmt, count, args); - *output = table->alloc_result(); - res = this->step_once(stmt, *output, NULL); - sqlite3_reset(stmt); - cache_release_value(m_statement_cache, pps); - va_end(args); - return res; -} - -int Database::get_row_ordered(const char* name, uint8_t** output, Table* table, - Column* order_by, int order, uint32_t count, ...) { - va_list args; - va_start(args, count); - __get_stmt(table->get_row_ordered(m_db, order_by, order, count, args)); - int res = SQLITE_OK; - this->bind_va_columns(stmt, count, args); - *output = table->alloc_result(); - res = this->step_once(stmt, *output, NULL); - sqlite3_reset(stmt); - cache_release_value(m_statement_cache, pps); - va_end(args); - return res; -} - -int Database::get_all_ordered(const char* name, uint8_t*** output, - uint32_t* result_count, Table* table, - Column* order_by, int order, uint32_t count, ...) { - va_list args; - va_start(args, count); - __get_stmt(table->get_row_ordered(m_db, order_by, order, count, args)); - int res = SQLITE_OK; - this->bind_va_columns(stmt, count, args); - uint8_t* current = NULL; - *result_count = 0; - uint32_t output_max = INITIAL_ROWS; - *output = (uint8_t**)calloc(output_max, sizeof(uint8_t*)); - - res = SQLITE_ROW; - while (res == SQLITE_ROW) { - if ((*result_count) >= output_max) { - output_max *= REALLOC_FACTOR; - *output = (uint8_t**)realloc((*output), output_max * sizeof(uint8_t*)); - if (!(*output)) { - fprintf(stderr, "Error: ran out of memory trying to realloc output" - "in get_all_ordered.\n"); - return DB_ERROR; - } - } - current = table->alloc_result(); - res = this->step_once(stmt, current, NULL); - if (res == SQLITE_ROW) { - (*output)[(*result_count)] = current; - (*result_count)++; - } else { - table->free_result(current); - } - } - - sqlite3_reset(stmt); - cache_release_value(m_statement_cache, pps); - va_end(args); - return res; -} - -int Database::update_value(const char* name, Table* table, Column* value_column, - void** value, uint32_t count, ...) { - va_list args; - va_start(args, count); - __get_stmt(table->update_value(m_db, value_column, count, args)); - int param = 1; - int res = SQLITE_OK; - switch(value_column->type()) { - case TYPE_INTEGER: - res = sqlite3_bind_int64(stmt, param++, (uint64_t)*value); - break; - case TYPE_TEXT: - res = sqlite3_bind_text(stmt, param++, (char*)*value, -1, SQLITE_STATIC); - break; - // XXX: support blob columns here - case TYPE_BLOB: - fprintf(stderr, "Error: Database::update_value() not implemented for " - "BLOB columns.\n"); - assert(false); - } - if (res != SQLITE_OK) { - fprintf(stderr, "Error: update_value failed to bind value with value_column " - "type %d in table %s. \n", - value_column->type(), table->name()); - return res; - } - this->bind_columns(stmt, count, param, args); - res = sqlite3_step(stmt); - sqlite3_reset(stmt); - cache_release_value(m_statement_cache, pps); - va_end(args); - return (res == SQLITE_DONE ? SQLITE_OK : res); -} - -int Database::del(const char* name, Table* table, uint32_t count, ...) { - va_list args; - va_start(args, count); - __get_stmt(table->del(m_db, count, args)); - int res = SQLITE_OK; - this->bind_va_columns(stmt, count, args); - if (res == SQLITE_OK) res = this->execute(stmt); - va_end(args); - return res; - -} - -/** - * Given a table and an arg list in the same order as Table::add_column() calls, - * binds and executes a sql update. The Table is responsible for preparing the - * statement in Table::update() - * - * All integer args must be cast to uint64_t - * All blob columns must provide 2 args in the list. The first arg is a uint8_t* - * of data and then the uint32_t value for size of the data. - * - */ -int Database::update(Table* table, uint64_t pkvalue, ...) { - va_list args; - va_start(args, pkvalue); - - int res = SQLITE_OK; - - // get the prepared statement - sqlite3_stmt* stmt = table->update(m_db); - if (!stmt) { - fprintf(stderr, "Error: %s table gave a NULL statement when trying to " - "update.\n", table->name()); - return 1; - } - - this->bind_all_columns(stmt, table, args); - - // bind the primary key in the WHERE clause - // bind_all_columns already bound the first n'th params, where n in the - // table's column count, so we provide that count as the parameter value - if (res==SQLITE_OK) res = sqlite3_bind_int64(stmt, table->column_count(), - pkvalue); - if (res==SQLITE_OK) res = this->execute(stmt); - va_end(args); - return res; -} - -int Database::insert(Table* table, ...) { - va_list args; - va_start(args, table); - - int res = SQLITE_OK; - // get the prepared statement - sqlite3_stmt* stmt = table->insert(m_db); - if (!stmt) { - fprintf(stderr, "Error: %s table gave a NULL statement when trying to " - "insert.\n", table->name()); - return 1; - } - this->bind_all_columns(stmt, table, args); - if (res == SQLITE_OK) res = this->execute(stmt); - va_end(args); - return res; -} - -#undef __get_stmt - -int Database::del(Table* table, uint64_t serial) { - int res = SQLITE_OK; - sqlite3_stmt* stmt = table->del(m_db); - if (!stmt) { - fprintf(stderr, "Error: %s table gave a NULL statement when trying to " - "delete.\n", table->name()); - return res; - } - if (res == SQLITE_OK) res = sqlite3_bind_int64(stmt, 1, serial); - if (res == SQLITE_OK) res = this->execute(stmt); - return res; -} - -uint64_t Database::last_insert_id() { - return (uint64_t)sqlite3_last_insert_rowid(m_db); -} - - - -int Database::sql_once(const char* fmt, ...) { - int res = 0; - va_list args; - va_start(args, fmt); - char* error = NULL; - if (this->m_db) { - char *query = sqlite3_vmprintf(fmt, args); - res = sqlite3_exec(this->m_db, query, NULL, NULL, &error); - sqlite3_free(query); - } else { - fprintf(stderr, "Error: database not open.\n"); - res = SQLITE_ERROR; - } - va_end(args); - if (error) { - strlcpy(m_error, error, m_error_size); - fprintf(stderr, "Error: sql_once(): %s \n", m_error); - fprintf(stderr, "Error: fmt: %s \n", fmt); - sqlite3_free(error); - } - return res; -} - -int Database::sql(const char* name, const char* fmt, ...) { - sqlite3_stmt* stmt; - char* key = strdup(name); - cache_get_and_retain(m_statement_cache, key, (void**)&stmt); - if (!stmt) { - va_list args; - va_start(args, fmt); - char* query = sqlite3_vmprintf(fmt, args); - int res = sqlite3_prepare_v2(m_db, query, (int)strlen(query), &stmt, NULL); - va_end(args); - if (res != SQLITE_OK) { - fprintf(stderr, "Error: unable to prepare statement for query: %s\n" - "Error: %s\n", - query, sqlite3_errmsg(m_db)); - free(key); - return res; - } - cache_set_and_retain(m_statement_cache, key, stmt, 0); \ - free(key); - } - return this->execute(stmt); -} - -int Database::execute(sqlite3_stmt* stmt) { - int res = SQLITE_OK; - res = sqlite3_step(stmt); - if (res == SQLITE_DONE) { - res = SQLITE_OK; - } else { - strlcpy(m_error, sqlite3_errmsg(m_db), m_error_size); - fprintf(stderr, "Error: execute() error: %s \n", m_error); - } - res = sqlite3_reset(stmt); - return res; -} - -int Database::add_table(Table* t) { - if (m_table_count >= m_table_max) { - m_tables = (Table**)realloc(m_tables, - m_table_max*sizeof(Table*)*REALLOC_FACTOR); - if (!m_tables) { - fprintf(stderr, "Error: unable to reallocate memory to add a " - "table\n"); - return 1; - } - m_table_max *= REALLOC_FACTOR; - } - m_tables[m_table_count++] = t; - t->m_version = this->m_schema_version; - - return 0; -} - -/** - * get a row count of the first table to detect if the schema - * needs to be initialized - */ -bool Database::is_empty() { - if (!m_tables[0]) { - fprintf(stderr, "Warning: Database has not had a schema initialized.\n"); - return false; - } - int res = SQLITE_OK; - char* query; - asprintf(&query, "SELECT count(*) FROM %s;", m_tables[0]->name()); - res = sqlite3_exec(this->m_db, query, NULL, NULL, NULL); - free(query); - return res != SQLITE_OK; -} - -int Database::create_table(Table* table) { - int res = this->sql_once(table->create()); - if (res != DB_OK) { - fprintf(stderr, "Error: sql error trying to create" - " table: %s: %s\n", - table->name(), m_error); - } - return res; -} - -int Database::create_tables() { - int res = SQLITE_OK; - for (uint32_t i=0; isql_once(m_tables[i]->create()); - if (res!=SQLITE_OK) { - fprintf(stderr, "Error: sql error trying to create table: %s: %s\n", - m_tables[i]->name(), m_error); - return res; - } - } - if (res == DB_OK) res = this->initial_data(); - if (res == DB_OK) res = this->post_table_creation(); - return res; -} - -int Database::upgrade_schema(uint32_t version) { - int res = DB_OK; - this->begin_transaction(); - - res = this->upgrade_internal_schema(version); - if (res != DB_OK) { - fprintf(stderr, "Error: unable to upgrade internal schema.\n"); - this->rollback_transaction(); - return res; - } - - for (uint32_t ti = 0; res == DB_OK && ti < m_table_count; ti++) { - if (m_tables[ti]->version() > version) { - // entire table is new - res = this->create_table(m_tables[ti]); - } else { - // table is same version, so check for new columns - for (uint32_t ci = 0; res == DB_OK && ci < m_tables[ti]->column_count(); ci++) { - if (m_tables[ti]->column(ci)->version() < version) { - // this should never happen - fprintf(stderr, "Error: internal error with schema versioning." - " Column %s is older than its table %s. \n", - m_tables[ti]->column(ci)->name(), m_tables[ti]->name()); - } - if (m_tables[ti]->column(ci)->version() > version) { - // column is new - res = this->sql_once(m_tables[ti]->alter_add_column(ci)); - if (res != DB_OK) { - fprintf(stderr, "Error: sql error trying to upgrade (alter)" - " table: %s column: %s : %s\n", - m_tables[ti]->name(), m_tables[ti]->column(ci)->name(), - m_error); - } - } - } - } - } - - if (res == DB_OK) { - this->commit_transaction(); - } else { - this->rollback_transaction(); - } - - return res; -} - -int Database::upgrade_internal_schema(uint32_t version) { - int res = DB_OK; - - if (version == 0) { - res = this->sql_once(this->m_information_table->create()); - } - - return res; -} - -int Database::init_internal_schema() { - this->m_information_table = new Table("database_information"); - ADD_TABLE(this->m_information_table); - ADD_PK(m_information_table, "id"); - ADD_INDEX(m_information_table, "variable", TYPE_TEXT, true); - ADD_TEXT(m_information_table, "value"); - return DB_OK; -} - -int Database::initial_data() { - // load our initial config data - return this->insert(m_information_table, "schema_version", "0"); -} - -int Database::get_information_value(const char* variable, char*** value) { - return this->get_value("get_information_value", - (void**)value, - this->m_information_table, - this->m_information_table->column(2), // value - 1, - this->m_information_table->column(1), // variable - '=', variable); -} - -int Database::update_information_value(const char* variable, const char* value) { - int res = SQLITE_OK; - uint64_t* c; - res = this->count("count_info_var", - (void**)&c, - this->m_information_table, - 1, - this->m_information_table->column(1), // variable - '=', variable); - - if (*c > 0) { - res = this->update_value("update_information_value", - this->m_information_table, - this->m_information_table->column(2), // value - (void**)&value, - 1, - this->m_information_table->column(1), // variable - '=', variable); - } else { - res = this->insert(m_information_table, variable, value); - } - - return res; -} - -bool Database::has_information_table() { - int res = SQLITE_OK; - res = sqlite3_exec(this->m_db, - "SELECT count(*) FROM database_information;", - NULL, NULL, NULL); - return res == SQLITE_OK; -} - -uint32_t Database::get_schema_version() { - int res = SQLITE_OK; - char** vertxt = NULL; - res = this->get_information_value("schema_version", &vertxt); - if (res == SQLITE_ROW) { - uint32_t version = (uint32_t)strtoul(*vertxt, NULL, 10); - free(*vertxt); - return version; - } else { - // lack of information table/value means we are - // upgrading an old database - return 0; - } -} - -int Database::set_schema_version(uint32_t version) { - IF_DEBUG("set_schema_version %u \n", version); - int res = DB_OK; - char* vertxt; - asprintf(&vertxt, "%u", version); - if (!vertxt) return DB_ERROR; - res = this->update_information_value("schema_version", vertxt); - free(vertxt); - return res; -} - -size_t Database::store_column(sqlite3_stmt* stmt, int column, uint8_t* output) { - size_t used; - int type = sqlite3_column_type(stmt, column); - const void* blob; - int blobsize; - switch(type) { - case SQLITE_INTEGER: - *(uint64_t*)output = (uint64_t)sqlite3_column_int64(stmt, column); - used = sizeof(uint64_t); - break; - case SQLITE_TEXT: - *(const char**)output = strdup((const char*)sqlite3_column_text(stmt, - column)); - used = sizeof(char*); - break; - case SQLITE_BLOB: - blob = sqlite3_column_blob(stmt, column); - blobsize = sqlite3_column_bytes(stmt, column); - *(void**)output = malloc(blobsize); - if (*(void**)output && blobsize) { - memcpy(*(void**)output, blob, blobsize); - } else { - fprintf(stderr, "Error: unable to get blob from database stmt.\n"); - } - used = sizeof(void*); - break; - case SQLITE_NULL: - // result row has a NULL value which is okay - *(const char**)output = NULL; - used = sizeof(char*); - break; - default: - fprintf(stderr, "Error: unhandled column type in " - "Database::store_column(): %d \n", - type); - return 0; - } - - return used; -} - -/** - * will not realloc memory for output since caller should know how - * much to alloc in the first place. Sets used to be how many bytes - * were written to output - */ -int Database::step_once(sqlite3_stmt* stmt, uint8_t* output, uint32_t* used) { - int res = SQLITE_OK; - res = sqlite3_step(stmt); - uint8_t* current = output; - if (used) *used = 0; - if (res == SQLITE_ROW) { - int count = sqlite3_column_count(stmt); - for (int i = 0; i < count; i++) { - current += this->store_column(stmt, i, current); - } - if (used) { - *used = (uint32_t)(current - output); - } - } - - return res; -} - -int Database::step_all(sqlite3_stmt* stmt, void** output, uint32_t size, - uint32_t* count) { - uint32_t used = 0; - uint32_t total_used = used; - uint32_t rowsize = size / INITIAL_ROWS; - uint8_t* current = *(uint8_t**)output; - *count = 0; - int res = SQLITE_ROW; - while (res == SQLITE_ROW) { - current = *(uint8_t**)output + total_used; - res = this->step_once(stmt, current, &used); - if (res == SQLITE_ROW) (*count)++; - total_used += used; - if (total_used >= (size - rowsize)) { - size *= REALLOC_FACTOR; - *output = realloc(*output, size); - if (!*output) { - fprintf(stderr, "Error: ran out of memory in Database::step_all \n"); - return SQLITE_ERROR; - } - } - } - sqlite3_reset(stmt); - return res; -} - - -/** - * - * libcache - * - */ -void Database::init_cache() { - cache_attributes_t attrs; - attrs.version = CACHE_ATTRIBUTES_VERSION_2; - attrs.key_hash_cb = cache_key_hash_cb_cstring; - attrs.key_is_equal_cb = cache_key_is_equal_cb_cstring; - attrs.key_retain_cb = cache_key_retain; - attrs.key_release_cb = cache_release_cb_free; - attrs.value_release_cb = cache_statement_release; - attrs.value_retain_cb = NULL; - attrs.value_make_purgeable_cb = NULL; - attrs.value_make_nonpurgeable_cb = NULL; - attrs.user_data = NULL; - cache_create("org.macosforge.darwinbuild.darwinup.statements", - &attrs, &m_statement_cache); -} - -void Database::destroy_cache() { - cache_destroy(m_statement_cache); -} - -void cache_key_retain(void* key_in, void** key_out, void* user_data) { - *key_out = strdup((char*)key_in); -} - -void cache_statement_release(void* value, void* user_data) { - sqlite3_finalize(*(sqlite3_stmt**)value); -} diff --git a/darwinup/Database.h b/darwinup/Database.h deleted file mode 100644 index 0dc0e83..0000000 --- a/darwinup/Database.h +++ /dev/null @@ -1,287 +0,0 @@ -/* - * Copyright (c) 2010 Apple Computer, Inc. All rights reserved. - * - * @APPLE_BSD_LICENSE_HEADER_START@ - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @APPLE_BSD_LICENSE_HEADER_END@ - */ - -#ifndef _DATABASE_H -#define _DATABASE_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "Table.h" -#include "Digest.h" -#include "Archive.h" - -// flag for generating queries with ORDER BY clauses -#define ORDER_BY_DESC 0 -#define ORDER_BY_ASC 1 - -// initial number of rows we allocate for when querying -#define INITIAL_ROWS 8 - -// how much we grow by when we need more space -#define REALLOC_FACTOR 4 -#define ERROR_BUF_SIZE 1024 - -// return code bits -#define DB_OK 0x0000 -#define DB_ERROR 0x0001 -#define DB_FOUND 0x0010 - -// test return code to see if actual results were found -#define FOUND(x) ((x & DB_FOUND) && !(x & DB_ERROR)) - -// Schema creation macros -#define SCHEMA_VERSION(v) this->schema_version(v); -#define ADD_TABLE(t) assert(this->add_table(t)==0); -#define ADD_COLUMN(table, name, type, index, pk, unique) \ - assert(table->add_column(new Column(name, type, index, pk, unique), this->schema_version())==0); -#define ADD_INDEX(table, name, type, unique) \ - assert(table->add_column(new Column(name, type, true, false, unique), this->schema_version())==0); -#define ADD_PK(table, name) \ - assert(table->add_column(new Column(name, TYPE_INTEGER, \ - false, true, false), this->schema_version())==0); -#define ADD_TEXT(table, name) \ - assert(table->add_column(new Column(name, TYPE_TEXT), this->schema_version())==0); -#define ADD_INTEGER(table, name) \ - assert(table->add_column(new Column(name, TYPE_INTEGER), this->schema_version())==0); -#define ADD_BLOB(table, name) \ - assert(table->add_column(new Column(name, TYPE_BLOB), this->schema_version())==0); - -// retry an operation a few times if we hit a lock -#define __retry_if_locked(operation) \ - do { \ - extern uint32_t verbosity; \ - fprintf(stderr, "retry: verbosity %u \n", verbosity); \ - res = operation; \ - fprintf(stderr, "retry: initial res %d \n", res); \ - if (res == 5 || res == 6) { \ - fprintf(stderr, "retry: locked \n"); \ - int _num_tries = 3; \ - while (_num_tries--) { \ - fprintf(stderr, "retry: tries left %d \n", _num_tries); \ - if (verbosity) fprintf(stdout, "Database is locked, " \ - "trying again in 1 second...\n"); \ - sleep(1); \ - res = operation; \ - fprintf(stderr, "retry: res %d \n", res); \ - } \ - if (verbosity) fprintf(stdout, "Database is still locked, giving up.\n"); \ - } \ - } while (0); - - -/** - * - * Generic sqlite abstraction - * - */ -struct Database { - Database(); - Database(const char* path); - virtual ~Database(); - - // public setter/getter of class attr - uint32_t schema_version(); - void schema_version(uint32_t v); - - /** - * init_schema is called during db connection. - * Projects implementing a Database derived class - * should use Table::add_column() or the ADD_* - * macros in their init_schema() to define their schema - */ - virtual int init_schema(); - - // called after tables are created so clients can load - // initial sets of data - virtual int post_table_creation(); - - const char* path(); - const char* error(); - int connect(); - int connect(const char* path); - bool is_connected(); - - int begin_transaction(); - int rollback_transaction(); - int commit_transaction(); - - /** - * statement caching and execution - * - * - name is a string key that labels the query for caching purposes - * - output is where we will store the value requested - * - count is the number of sets of parameters - * - va_list should have sets of 3 (integer and text) or 4 (blob) - * parameters for WHERE clause like Column*, char, value(s) - * - Column* is the column to match against - * - char is how to compare, one of '=', '!', '>', or '<' - * - value(s) is the value to match - * - text columns require a char* arg - * - integer columns require a uint64_t arg - * - blob columns require 2 args in the list: - * - first is a uint8_t* of data - * - second is a uint32_t value for size of the data - * - */ - int count(const char* name, void** output, Table* table, uint32_t count, ...); - int get_value(const char* name, void** output, Table* table, Column* value_column, - uint32_t count, ...); - int get_column(const char* name, void** output, uint32_t* result_count, - Table* table, Column* column, uint32_t count, ...); - int get_row(const char* name, uint8_t** output, Table* table, uint32_t count, ...); - int get_row_ordered(const char* name, uint8_t** output, Table* table, Column* order_by, - int order, uint32_t count, ...); - int get_all_ordered(const char* name, uint8_t*** output, uint32_t* result_count, - Table* table, Column* order_by, int order, uint32_t count, ...); - int update_value(const char* name, Table* table, Column* value_column, void** value, - uint32_t count, ...); - int del(const char* name, Table* table, uint32_t count, ...); - - /** - * update/insert whole rows - * - * Given a table and a va_list in the same order as Table::add_column() - * calls, minus any primary key columns, bind and executes a sql query - * for insert or update. - * - * The Table is responsible for preparing the statement - * - * text columns require char* args - * integer columns require uint64_t args - * blob columns require 2 args in the list: - * - first is a uint8_t* of data - * - second is a uint32_t value for size of the data - * - */ - int update(Table* table, uint64_t pkvalue, ...); - int insert(Table* table, ...); - - // delete row with primary key equal to serial - int del(Table* table, uint64_t serial); - - uint64_t last_insert_id(); - - -protected: - - // pre- and post- connection work - int pre_connect(); - int post_connect(); - - int upgrade_schema(uint32_t version); - int upgrade_internal_schema(uint32_t version); - int init_internal_schema(); - int initial_data(); - - int get_information_value(const char* variable, char*** value); - int update_information_value(const char* variable, const char* value); - - // get and set version info in actual database - bool has_information_table(); - uint32_t get_schema_version(); - int set_schema_version(uint32_t version); - - // execute query with printf-style format, does not cache statement - int sql_once(const char* fmt, ...); - // cache statement with name, execute query with printf-style format - int sql(const char* name, const char* fmt, ...); - int execute(sqlite3_stmt* stmt); - - int add_table(Table*); - - // test if database has had its tables created - bool is_empty(); - // create tables for the client - int create_table(Table* table); - int create_tables(); - // create tables for ourselves - int create_internal_tables(); - - // bind all table columns from va_list - int bind_all_columns(sqlite3_stmt* stmt, Table* table, va_list args); - // bind each set of parameters from va_list - int bind_va_columns(sqlite3_stmt* stmt, uint32_t count, va_list args); - // bind parameters from va_list, starting with the param'th parameter in stmt - int bind_columns(sqlite3_stmt* stmt, uint32_t count, int param, - va_list args); - - /** - * step and store functions - */ - size_t store_column(sqlite3_stmt* stmt, int column, uint8_t* output); - int step_once(sqlite3_stmt* stmt, uint8_t* output, uint32_t* used); - int step_all(sqlite3_stmt* stmt, void** output, uint32_t size, uint32_t* count); - - // libcache - void init_cache(); - void destroy_cache(); - - char* m_path; - sqlite3* m_db; - - uint32_t m_schema_version; - Table* m_information_table; - sqlite3_stmt* m_get_information_value; - - Table** m_tables; - uint32_t m_table_count; - uint32_t m_table_max; - - cache_t* m_statement_cache; - - sqlite3_stmt* m_begin_transaction; - sqlite3_stmt* m_rollback_transaction; - sqlite3_stmt* m_commit_transaction; - - char* m_error; - size_t m_error_size; - - static const int TYPE_INTEGER = SQLITE_INTEGER; - static const int TYPE_TEXT = SQLITE3_TEXT; - static const int TYPE_BLOB = SQLITE_BLOB; - -}; - -// libcache callbacks -void cache_key_retain(void* key_in, void** key_out, void* user_data); -void cache_statement_retain(void* value, void* user_data); -void cache_statement_release(void* value, void* user_data); - -#endif diff --git a/darwinup/Depot.cpp b/darwinup/Depot.cpp deleted file mode 100644 index 7dad40e..0000000 --- a/darwinup/Depot.cpp +++ /dev/null @@ -1,1552 +0,0 @@ -/* - * Copyright (c) 2005-2010 Apple Computer, Inc. All rights reserved. - * - * @APPLE_BSD_LICENSE_HEADER_START@ - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @APPLE_BSD_LICENSE_HEADER_END@ - */ - -#include "Archive.h" -#include "Depot.h" -#include "File.h" -#include "SerialSet.h" -#include "Utils.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -Depot::Depot() { - m_prefix = NULL; - m_depot_path = NULL; - m_database_path = NULL; - m_archives_path = NULL; - m_downloads_path = NULL; - m_build = NULL; - m_db = NULL; - m_lock_fd = -1; - m_is_locked = 0; - m_depot_mode = 0750; - m_is_dirty = false; - m_modified_extensions = false; - m_modified_xpc_services = false; -} - -Depot::Depot(const char* prefix) { - m_lock_fd = -1; - m_is_locked = 0; - m_depot_mode = 0750; - m_build = NULL; - m_is_dirty = false; - m_modified_extensions = false; - m_modified_xpc_services = false; - - asprintf(&m_prefix, "%s", prefix); - join_path(&m_depot_path, m_prefix, "/.DarwinDepot"); - join_path(&m_database_path, m_depot_path, "/Database-V100"); - join_path(&m_archives_path, m_depot_path, "/Archives"); - join_path(&m_downloads_path, m_depot_path, "/Downloads"); -} - -Depot::~Depot() { - - // XXX: this is expensive, but is it necessary? - //this->check_consistency(); - - if (m_lock_fd != -1) this->unlock(); - delete m_db; - if (m_prefix) free(m_prefix); - if (m_depot_path) free(m_depot_path); - if (m_database_path) free(m_database_path); - if (m_archives_path) free(m_archives_path); - if (m_downloads_path) free(m_downloads_path); -} - -const char* Depot::archives_path() { return m_archives_path; } -const char* Depot::downloads_path() { return m_downloads_path; } -const char* Depot::prefix() { return m_prefix; } -bool Depot::is_dirty() { return m_is_dirty; } -bool Depot::has_modified_extensions() { return m_modified_extensions; } -bool Depot::has_modified_xpc_services(){ return m_modified_xpc_services; } - -int Depot::connect() { - m_db = new DarwinupDatabase(m_database_path); - if (!m_db || !m_db->is_connected()) { - fprintf(stderr, "Error: unable to connect to database.\n"); - return DB_ERROR; - } - return DB_OK; -} - -int Depot::create_storage() { - uid_t uid = getuid(); - gid_t gid = 0; - struct group *gs = getgrnam("admin"); - if (gs) { - gid = gs->gr_gid; - } - - int res = mkdir(m_depot_path, m_depot_mode); - if (res && errno != EEXIST) { - perror(m_depot_path); - return res; - } - - res = chmod(m_depot_path, m_depot_mode); - res = chown(m_depot_path, uid, gid); - if (res && errno != EEXIST) { - perror(m_depot_path); - return res; - } - res = mkdir(m_archives_path, m_depot_mode); - res = chmod(m_archives_path, m_depot_mode); - res = chown(m_archives_path, uid, gid); - if (res && errno != EEXIST) { - perror(m_archives_path); - return res; - } - - res = mkdir(m_downloads_path, m_depot_mode); - res = chmod(m_downloads_path, m_depot_mode); - res = chown(m_downloads_path, uid, gid); - if (res && errno != EEXIST) { - perror(m_downloads_path); - return res; - } - return DEPOT_OK; -} - -// Initialize the depot -int Depot::initialize(bool writable) { - int res = 0; - - // initialization requires all these paths to be set - if (!(m_prefix && m_depot_path && m_database_path && - m_archives_path && m_downloads_path)) { - return DEPOT_ERROR; - } - - if (writable) { - uid_t uid = getuid(); - if (uid) { - fprintf(stdout, "You must be root to perform that operation.\n"); - exit(3); - } - - res = this->create_storage(); - if (res) return res; -#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 - build_number_for_path(&m_build, m_prefix); -#else - m_build = (char*)calloc(1, 2); - snprintf(m_build, 2, " "); -#endif - } - - struct stat sb; - res = stat(m_database_path, &sb); - if (!writable && res == -1 && (errno == ENOENT || errno == ENOTDIR)) { - // depot does not exist - return DEPOT_NOT_EXIST; - } - if (!writable && res == -1 && errno == EACCES) { - // permission denied - return DEPOT_PERM_DENIED; - } - - // take an exclusive lock - res = this->lock(LOCK_EX); - if (res) return res; - m_is_locked = 1; - - res = this->connect(); - - return res; -} - -int Depot::is_initialized() { - return (m_db != NULL); -} - -// Unserialize an archive from the database. -// Find the archive by UUID. -Archive* Depot::archive(uuid_t uuid) { - int res = 0; - Archive* archive = NULL; - uint8_t* data; - - res = this->m_db->get_archive(&data, uuid); - if (FOUND(res)) archive = this->m_db->make_archive(data); - return archive; -} - -// Unserialize an archive from the database. -// Find the archive by serial. -Archive* Depot::archive(uint64_t serial) { - int res = 0; - Archive* archive = NULL; - uint8_t* data; - - res = this->m_db->get_archive(&data, serial); - if (FOUND(res)) archive = this->m_db->make_archive(data); - - return archive; -} - -// Unserialize an archive from the database. -// Find the last archive installed with this name -Archive* Depot::archive(archive_name_t name) { - int res = 0; - Archive* archive = NULL; - uint8_t* data; - - res = this->m_db->get_archive(&data, name); - if (FOUND(res)) archive = this->m_db->make_archive(data); - return archive; -} - -Archive* Depot::archive(archive_keyword_t keyword) { - int res = 0; - Archive* archive = NULL; - uint8_t* data; - - res = this->m_db->get_archive(&data, keyword); - if (FOUND(res)) archive = this->m_db->make_archive(data); - return archive; -} - -// Return Archive from database matching arg, which is one of: -// -// uuid (ex: 22969F32-9C4F-4370-82C8-DD3609736D8D) -// serial (ex: 12) -// name (ex root.tar.gz) -// keyword (either "newest" for the most recent root installed -// or "oldest" for the oldest installed root) -// -Archive* Depot::get_archive(const char* arg) { - - // test for arg being a uuid - uuid_t uuid; - if (uuid_parse(arg, uuid) == 0) { - return Depot::archive(uuid); - } - - // test for arg being a serial number - uint64_t serial; - char* endptr = NULL; - serial = strtoull(arg, &endptr, 0); - if (serial && (*arg != '\0') && (*endptr == '\0')) { - return Depot::archive(serial); - } - - // test for keywords - if (strncasecmp("oldest", arg, 6) == 0) { - return Depot::archive(DEPOT_ARCHIVE_OLDEST); - } - if (strncasecmp("newest", arg, 6) == 0) { - return Depot::archive(DEPOT_ARCHIVE_NEWEST); - } - - // if nothing else, must be an archive name - return Depot::archive((archive_name_t)arg); -} - -Archive** Depot::get_all_archives(uint32_t* count) { - extern uint32_t verbosity; - int res = DB_OK; - uint8_t** archlist; - res = this->m_db->get_archives(&archlist, count, verbosity & VERBOSE_DEBUG); - - Archive** list = (Archive**)malloc(sizeof(Archive*) * (*count)); - if (!list) { - fprintf(stderr, "Error: ran out of memory in Depot::get_all_archives\n"); - return NULL; - } - if (FOUND(res)) { - for (uint32_t i=0; i < *count; i++) { - Archive* archive = this->m_db->make_archive(archlist[i]); - if (archive) { - list[i] = archive; - } else { - fprintf(stderr, "%s:%d: DB::make_archive returned NULL\n", - __FILE__, __LINE__); - res = -1; - break; - } - } - } - - return list; -} - -Archive** Depot::get_superseded_archives(uint32_t* count) { - int res = DB_OK; - uint8_t** archlist; - res = this->m_db->get_archives(&archlist, count, false); // rollbacks cannot be superseded - - Archive** list = (Archive**)malloc(sizeof(Archive*) * (*count)); - if (!list) { - fprintf(stderr, "Error: ran out of memory in Depot::get_superseded_archives\n"); - return NULL; - } - - uint32_t i = 0; - uint32_t cur = i; - if (FOUND(res)) { - while (i < *count) { - Archive* archive = this->m_db->make_archive(archlist[i++]); - if (archive && this->is_superseded(archive)) { - list[cur++] = archive; - } else if (!archive) { - fprintf(stderr, "%s:%d: DB::make_archive returned NULL\n", - __FILE__, __LINE__); - res = -1; - break; - } - } - } - // adjust count based on our is_superseded filtering - *count = cur; - return list; -} - -uint64_t Depot::count_archives() { - extern uint32_t verbosity; - uint64_t c = this->m_db->count_archives((bool)(verbosity & VERBOSE_DEBUG)); - return c; -} - -struct InstallContext { - InstallContext(Depot* d, Archive* a) { - depot = d; - archive = a; - files_modified = 0; - files_added = 0; - files_removed = 0; - files_to_remove = new SerialSet(); - reverse_files = false; - } - - ~InstallContext() { - delete files_to_remove; - } - - Depot* depot; - Archive* archive; - uint64_t files_modified; - uint64_t files_added; - uint64_t files_removed; - SerialSet* files_to_remove; // for uninstall - bool reverse_files; // for uninstall -}; - -int Depot::iterate_archives(ArchiveIteratorFunc func, void* context) { - int res = 0; - uint32_t count = 0; - Archive** list = this->get_all_archives(&count); - for (uint32_t i = 0; i < count; i++) { - if (list[i]) { - res = func(list[i], context); - delete list[i]; - } - } - return res; -} - -int Depot::iterate_files(Archive* archive, FileIteratorFunc func, void* context) { - int res = DB_OK; - uint8_t** filelist; - uint32_t count; - bool reverse = false; - if (context) reverse = ((InstallContext*)context)->reverse_files; - res = this->m_db->get_files(&filelist, &count, archive, reverse); - if (FOUND(res)) { - for (uint32_t i=0; i < count; i++) { - File* file = this->m_db->make_file(filelist[i]); - if (file) { - res = func(file, context); - delete file; - } else { - fprintf(stderr, "%s:%d: DB::make_file returned NULL\n", __FILE__, __LINE__); - res = -1; - break; - } - } - } - - return res; -} - -int Depot::analyze_stage(const char* path, Archive* archive, Archive* rollback, - int* rollback_files) { - extern uint32_t force; - extern uint32_t dryrun; - int res = 0; - assert(archive != NULL); - assert(rollback != NULL); - assert(rollback_files != NULL); - - *rollback_files = 0; - - const char* path_argv[] = { path, NULL }; - - IF_DEBUG("[analyze] analyzing path: %s\n", path); - - FTS* fts = fts_open((char**)path_argv, FTS_PHYSICAL | FTS_COMFOLLOW | FTS_XDEV, fts_compare); - FTSENT* ent = fts_read(fts); // throw away the entry for path itself - while (res != -1 && (ent = fts_read(fts)) != NULL) { - File* file = FileFactory(archive, ent); - if (file) { - char state = '?'; - - IF_DEBUG("[analyze] %s\n", file->path()); - - if (strcasestr(file->path(), ".DarwinDepot")) { - fprintf(stderr, "Error: Root contains a .DarwinDepot, " - "aborting to avoid damaging darwinup metadata.\n"); - return DEPOT_ERROR; - } - - // Perform a three-way-diff between the file to be installed (file), - // the file we last installed in this location (preceding), - // and the file that actually exists in this location (actual). - - char* actpath; - join_path(&actpath, this->prefix(), file->path()); - File* actual = FileFactory(actpath); - File* preceding = this->file_preceded_by(file); - - if (actual == NULL) { - // No actual file exists already, so we create a placeholder. - actual = new NoEntry(file->path()); - IF_DEBUG("[analyze] actual == NULL\n"); - } - - if (preceding == NULL) { - // Nothing is known about this file. - // We'll insert this file into the rollback archive as a - // base system file. Back up its data (if not a directory). - actual->info_set(FILE_INFO_BASE_SYSTEM); - IF_DEBUG("[analyze] base system\n"); - if (!S_ISDIR(actual->mode()) && !INFO_TEST(actual->info(), FILE_INFO_NO_ENTRY)) { - IF_DEBUG("[analyze] needs base system backup, and installation\n"); - actual->info_set(FILE_INFO_ROLLBACK_DATA); - file->info_set(FILE_INFO_INSTALL_DATA); - } - // if actual is a dir and file is not, recurse to save its children - if (S_ISDIR(actual->mode()) && !S_ISDIR(file->mode())) { - IF_DEBUG("[analyze] directory being replaced by file, save children\n"); - const char* sub_argv[] = { actual->path(), NULL }; - FTS* subfts = fts_open((char**)sub_argv, - FTS_PHYSICAL | FTS_COMFOLLOW | FTS_XDEV, - fts_compare); - FTSENT* subent = fts_read(subfts); // throw away actual - while ((subent = fts_read(subfts)) != NULL) { - IF_DEBUG("saving child: %s\n", subent->fts_path); - // skip post-order visits - if (subent->fts_info == FTS_DP) { - continue; - } - File* subact = FileFactory(subent->fts_path); - subact->info_set(FILE_INFO_BASE_SYSTEM); - if (subent->fts_info != FTS_D) { - IF_DEBUG("saving file data\n"); - subact->info_set(FILE_INFO_ROLLBACK_DATA); - } - if (!dryrun) { - res = this->insert(rollback, subact); - } - *rollback_files += 1; - } - } - preceding = actual; - } - - uint32_t actual_flags = File::compare(file, actual); - uint32_t preceding_flags = File::compare(actual, preceding); - - // If file == actual && actual == preceding then nothing needs to be done. - if (actual_flags == FILE_INFO_IDENTICAL && preceding_flags == FILE_INFO_IDENTICAL) { - state = ' '; - IF_DEBUG("[analyze] no changes\n"); - } - - // If file != actual, but actual == preceding, then install file - // but we don't need to save actual, since it's already saved by preceding. - // i.e. no user changes since last installation - // If file != actual, and actual != preceding, then install file - // after saving actual in the rollback archive. - // i.e. user changes since last installation - if (actual_flags != FILE_INFO_IDENTICAL) { - this->m_is_dirty = true; - if (INFO_TEST(actual->info(), FILE_INFO_NO_ENTRY)) { - state = 'A'; - } else { - if (INFO_TEST(actual_flags, FILE_INFO_TYPE_DIFFERS) && !force) { - // the existing file on disk is a different type than what - // we are trying to install, so require the force option, - // otherwise print an error and bail - mode_t file_type = file->mode() & S_IFMT; - mode_t actual_type = actual->mode() & S_IFMT; - fprintf(stderr, FILE_OBJ_CHANGE_ERROR, actual->path(), - FILE_TYPE_STRING(file_type), - FILE_TYPE_STRING(actual_type)); - return DEPOT_OBJ_CHANGE; - } - state = 'U'; - } - - - - if (INFO_TEST(actual_flags, FILE_INFO_TYPE_DIFFERS) || - INFO_TEST(actual_flags, FILE_INFO_DATA_DIFFERS)) { - IF_DEBUG("[analyze] needs installation\n"); - file->info_set(FILE_INFO_INSTALL_DATA); - - if ((INFO_TEST(preceding_flags, FILE_INFO_TYPE_DIFFERS) || - INFO_TEST(preceding_flags, FILE_INFO_DATA_DIFFERS)) && - !INFO_TEST(actual->info(), FILE_INFO_NO_ENTRY)) { - IF_DEBUG("[analyze] needs user data backup\n"); - actual->info_set(FILE_INFO_ROLLBACK_DATA); - } - } - - if (!this->m_modified_extensions && - (strncmp(file->path(), "/System/Library/Extensions", 26) == 0)) { - IF_DEBUG("[analyze] kernel extension detected\n"); - this->m_modified_extensions = true; - } - - if (!this->m_modified_xpc_services) { - if ((strstr(file->path(), ".xpc/") != NULL) && has_suffix(file->path(), "Info.plist")) { - IF_DEBUG("[analyze] xpc service detected\n"); - this->m_modified_xpc_services = true; - } - - if ((strncmp(file->path(), "/System/Library/Sandbox/Profiles", 32) == 0) || - (has_suffix(file->path(), "framework.sb"))) { - IF_DEBUG("[analyze] profile modification detected\n"); - this->m_modified_xpc_services = true; - } - } - } - - // if file == actual, but actual != preceding, then an external - // process changed actual to be the same as what we are installing - // now (OS upgrade?). We do not need to save actual, but make - // a special state so the user knows what happened and does not - // get a ?. - if (actual_flags == FILE_INFO_IDENTICAL && preceding_flags != FILE_INFO_IDENTICAL) { - IF_DEBUG("[analyze] external changes but file same as actual\n"); - state = 'E'; - } - - if ((state != ' ' && preceding_flags != FILE_INFO_IDENTICAL) || - INFO_TEST(actual->info(), FILE_INFO_BASE_SYSTEM | FILE_INFO_ROLLBACK_DATA)) { - *rollback_files += 1; - if (!this->has_file(rollback, actual)) { - IF_DEBUG("[analyze] insert rollback\n"); - if (!dryrun) res = this->insert(rollback, actual); - } - assert(res == 0); - - if (!INFO_TEST(actual->info(), FILE_INFO_NO_ENTRY)) { - // need to save parent directories as well - FTSENT *pent = ent->fts_parent; - - // while we have a valid path that is below the prefix - while (pent && pent->fts_level > 0) { - File* parent = FileFactory(rollback, pent); - - // if parent dir does not exist, we are - // generating a rollback of base system - // which does not have matching directories, - // so we can just move on. - if (!parent) { - IF_DEBUG("[analyze] parent path not found, skipping parents\n"); - break; - } - - if (!this->has_file(rollback, parent)) { - IF_DEBUG("[analyze] adding parent to rollback: %s \n", - parent->path()); - if (!dryrun) res = this->insert(rollback, parent); - } - assert(res == 0); - pent = pent->fts_parent; - } - } - } - - fprintf(stdout, "%c %s\n", state, file->path()); - if (!dryrun) res = this->insert(archive, file); - assert(res == 0); - if (preceding && preceding != actual) delete preceding; - if (actual) delete actual; - free(actpath); - delete file; - } - } - if (fts) fts_close(fts); - return res; -} - -int Depot::backup_file(File* file, void* ctx) { - InstallContext* context = (InstallContext*)ctx; - int res = 0; - - IF_DEBUG("[backup] backup_file: %s , %s \n", file->path(), context->archive->m_name); - - if (INFO_TEST(file->info(), FILE_INFO_ROLLBACK_DATA)) { - char *path; // the file's path - char *dstpath; // the path inside the archives - char *relpath; // the file's path minus the destination prefix - char *uuidpath; // archives path plus the uuid - char uuidstr[37]; - - // If we're going to need to squirrel away data, create - // the directory hierarchy now. - char backup_path[PATH_MAX]; - char* backup_dirpath; - - // we need the path minus our destination prefix for moving to the archive - IF_DEBUG("[backup] file->path() = %s \n", file->path()); - strlcpy(backup_path, file->path(), sizeof(backup_path)); - IF_DEBUG("[backup] backup_path = %s \n", backup_path); - - const char* dir = dirname(backup_path); - assert(dir != NULL); - IF_DEBUG("[backup] dir = %s \n", dir); - - uuid_unparse_upper(context->archive->uuid(), uuidstr); - asprintf(&uuidpath, "%s/%s", context->depot->m_archives_path, uuidstr); - assert(uuidpath != NULL); - IF_DEBUG("[backup] uuidpath = %s \n", uuidpath); - join_path(&backup_dirpath, uuidpath, dir); - assert(backup_dirpath != NULL); - - IF_DEBUG("mkdir_p: %s\n", backup_dirpath); - res = mkdir_p(backup_dirpath); - if (res != 0 && errno != EEXIST) { - fprintf(stderr, "%s:%d: %s: %s (%d)\n", - __FILE__, __LINE__, backup_dirpath, strerror(errno), errno); - } else { - res = 0; - } - - // we need the path minus our destination path for moving to the archive - size_t prefixlen = strlen(context->depot->m_prefix); - if (strncmp(context->archive->m_name, "", strlen("")) == 0) { - join_path(&path, context->depot->m_prefix, file->path()); - } else { - asprintf(&path, "%s", file->path()); - } - relpath = path; - if (strncmp(path, context->depot->m_prefix, prefixlen) == 0) { - relpath += prefixlen - 1; - } - - join_path(&dstpath, uuidpath, relpath); - assert(dstpath != NULL); - - IF_DEBUG("[backup] path = %s \n", path); - IF_DEBUG("[backup] relpath = %s \n", relpath); - IF_DEBUG("[backup] dstpath = %s \n", dstpath); - - - ++context->files_modified; - - // XXX: res = file->backup() - IF_DEBUG("[backup] copyfile(%s, %s)\n", path, dstpath); - res = copyfile(path, dstpath, NULL, COPYFILE_ALL|COPYFILE_NOFOLLOW); - - if (res != 0) fprintf(stderr, "%s:%d: backup failed: %s: %s (%d)\n", - __FILE__, __LINE__, dstpath, strerror(errno), errno); - - // XXX: we cant propagate error from callback, but its safe to die here - assert(res == 0); - - free(path); - free(dstpath); - free(uuidpath); - free(backup_dirpath); - } - return res; -} - - -int Depot::install_file(File* file, void* ctx) { - InstallContext* context = (InstallContext*)ctx; - int res = 0; - - // Strip the quarantine xattr off all files to avoid them being rendered useless. - if (file->unquarantine(context->depot->m_archives_path) != 0) { - fprintf(stderr, "Error: unable to unquarantine file in staging area.\n"); - return DEPOT_ERROR; - } - - if (INFO_TEST(file->info(), FILE_INFO_INSTALL_DATA)) { - ++context->files_modified; - - res = file->install(context->depot->m_archives_path, - context->depot->m_prefix, - context->reverse_files); - } else { - res = file->install_info(context->depot->m_prefix); - } - if (res != 0) fprintf(stderr, "%s:%d: install failed: %s: %s (%d)\n", - __FILE__, __LINE__, file->path(), strerror(errno), errno); - return res; -} - - -int Depot::install(const char* path) { - int res = 0; - char uuid[37]; - Archive* archive = ArchiveFactory(path, this->downloads_path()); - if (archive) { - res = this->install(archive); - if (res == 0) { - fprintf(stdout, "Installed archive: %llu %s \n", - archive->serial(), archive->name()); - uuid_unparse_upper(archive->uuid(), uuid); - fprintf(stdout, "%s\n", uuid); - } else { - fprintf(stderr, "Error: Install failed.\n"); - if (res != DEPOT_OBJ_CHANGE && res != DEPOT_PREINSTALL_ERR) { - // object change errors come from analyze stage, - // and pre-install errors happen early, - // so there is no installation to roll back - fprintf(stderr, "Rolling back installation.\n"); - res = this->uninstall(archive); - if (res) { - fprintf(stderr, "Error: Unable to rollback installation. " - "Your system is in an inconsistent state! File a bug!\n"); - } else { - fprintf(stdout, "Rollback successful.\n"); - } - } - res = DEPOT_ERROR; - } - } else { - fprintf(stdout, "Error: unable to load \"%s\". Either the path is missing, invalid or" - " the file is in an unknown format.\n", path); - return DEPOT_ERROR; - } - - return res; -} - - -int Depot::install(Archive* archive) { - extern uint32_t dryrun; - int res = 0; - Archive* rollback = new RollbackArchive(); - - if (this->m_build) { - rollback->m_build = strdup(this->m_build); - archive->m_build = strdup(this->m_build); - } - - assert(rollback != NULL); - assert(archive != NULL); - - if (res != 0) return res; - - // - // The fun starts here - // - if (!dryrun && res == 0) res = this->begin_transaction(); - - // - // Insert the rollback archive before the new archive to install, thus keeping - // the chronology of the serial numbers correct. We may later choose to delete - // the rollback archive if we determine that it was not necessary. - // - if (!dryrun && res == 0) res = this->insert(rollback); - if (!dryrun && res == 0) res = this->insert(archive); - - // - // Create the stage directory and rollback backing store directories - // - char* archive_path = archive->create_directory(m_archives_path); - assert(archive_path != NULL); - char* rollback_path = rollback->create_directory(m_archives_path); - assert(rollback_path != NULL); - - // Extract the archive into its backing store directory - if (res == 0) res = archive->extract(archive_path); - - // Analyze the files in the archive backing store directory - // Inserts new file records into the database for both the new archive being - // installed and the rollback archive. - int rollback_files = 0; - if (res == 0) res = this->analyze_stage(archive_path, archive, rollback, &rollback_files); - - // we can stop now if analyze failed or this is a dry run - if (res || dryrun) { - remove_directory(archive_path); - remove_directory(rollback_path); - free(rollback_path); - free(archive_path); - if (!dryrun && res) { - this->rollback_transaction(); - return DEPOT_PREINSTALL_ERR; - } - return res; - } - - // If no files were added to the rollback archive, delete the rollback archive. - if (res == 0 && rollback_files == 0) { - res = this->remove(rollback); - } - - // Commit the archive and its list of files to the database. - // Note that the archive's "active" flag is still not set. - if (res == 0) { - res = this->commit_transaction(); - } else { - this->rollback_transaction(); - } - - // Save a copy of the backing store directory now, we will soon - // be moving the files into place. - if (res == 0) res = archive->compact_directory(m_archives_path); - - // - // Move files from the root file system to the rollback archive's backing store, - // then move files from the archive backing directory to the root filesystem - // - InstallContext rollback_context(this, rollback); - if (res == 0) res = this->iterate_files(rollback, &Depot::backup_file, &rollback_context); - - // compact the rollback archive (if we actually added any files) - if (rollback_context.files_modified > 0) { - if (res == 0) res = rollback->compact_directory(m_archives_path); - } - - InstallContext install_context(this, archive); - if (res == 0) res = this->iterate_files(archive, &Depot::install_file, &install_context); - - // Installation is complete. Activate the archive in the database. - if (res == 0) res = this->begin_transaction(); - if (res == 0) { - res = this->m_db->activate_archive(rollback->serial()); - if (res) this->rollback_transaction(); - } - if (res == 0) { - res = this->m_db->activate_archive(archive->serial()); - if (res) this->rollback_transaction(); - } - if (res == 0) res = this->commit_transaction(); - - // Remove the stage and rollback directories (save disk space) - remove_directory(archive_path); - remove_directory(rollback_path); - free(rollback_path); - free(archive_path); - - return res; -} - -// deletes expanded backing store directories in m_archives_path -int Depot::prune_directories() { - int res = 0; - - const char* path_argv[] = { m_archives_path, NULL }; - - FTS* fts = fts_open((char**)path_argv, FTS_PHYSICAL | FTS_COMFOLLOW | FTS_XDEV, fts_compare); - FTSENT* ent = fts_read(fts); // get the entry for m_archives_path itself - ent = fts_children(fts, 0); - while (res != -1 && ent != NULL) { - if (ent->fts_info == FTS_D) { - char path[PATH_MAX]; - snprintf(path, PATH_MAX, "%s/%s", m_archives_path, ent->fts_name); - res = remove_directory(path); - } - ent = ent->fts_link; - } - if (fts) fts_close(fts); - return res; -} - -// delete the unexpanded tarball from archives storage -int Depot::prune_archive(Archive* archive) { - int res = 0; - - // clean up database - res = this->m_db->delete_empty_archives(); - if (res) { - fprintf(stderr, "Error: unable to prune archives from database.\n"); - return res; - } - - // clean up disk - res = archive->prune_compacted_archive(m_archives_path); - return res; -} - -int Depot::uninstall_file(File* file, void* ctx) { - extern uint32_t dryrun; - InstallContext* context = (InstallContext*)ctx; - int res = 0; - char state = ' '; - - IF_DEBUG("[uninstall] %s\n", file->path()); - - // We never uninstall a file that was part of the base system - if (INFO_TEST(file->info(), FILE_INFO_BASE_SYSTEM)) { - IF_DEBUG("[uninstall] base system; skipping\n"); - return DEPOT_OK; - } - - char* actpath; - join_path(&actpath, context->depot->m_prefix, file->path()); - IF_DEBUG("[uninstall] actual path is %s\n", actpath); - File* actual = FileFactory(actpath); - uint32_t flags = File::compare(file, actual); - - if (actual == NULL) { - IF_DEBUG("[uninstall] actual file missing, " - "possibly due to parent being removed already\n"); - state = '!'; - } else if (flags != FILE_INFO_IDENTICAL) { - IF_DEBUG("[uninstall] changes since install; skipping\n"); - } else { - File* superseded = context->depot->file_superseded_by(file); - if (superseded == NULL) { - // no one's using this file anymore - File* preceding = context->depot->file_preceded_by(file); - assert(preceding != NULL); - if (INFO_TEST(preceding->info(), FILE_INFO_NO_ENTRY)) { - context->depot->m_is_dirty = true; - state = 'R'; - IF_DEBUG("[uninstall] removing file\n"); - if (!dryrun && actual && res == 0) res = actual->remove(); - } else { - // copy the preceding file back out to the system - // if it's different from what's already there - uint32_t flags = File::compare(file, preceding); - if (INFO_TEST(flags, FILE_INFO_DATA_DIFFERS)) { - context->depot->m_is_dirty = true; - state = 'U'; - IF_DEBUG("[uninstall] restoring\n"); - if (!dryrun && res == 0) { - if (INFO_TEST(flags, FILE_INFO_TYPE_DIFFERS) && - S_ISDIR(preceding->mode())) { - // use rename instead of mkdir so children are restored - res = preceding->dirrename(context->depot->m_archives_path, - context->depot->m_prefix, - context->reverse_files); - - } else { - res = preceding->install(context->depot->m_archives_path, - context->depot->m_prefix, - context->reverse_files); - } - } - } else if (INFO_TEST(flags, FILE_INFO_MODE_DIFFERS) || - INFO_TEST(flags, FILE_INFO_GID_DIFFERS) || - INFO_TEST(flags, FILE_INFO_UID_DIFFERS)) { - context->depot->m_is_dirty = true; - state = 'M'; - if (!dryrun && res == 0) { - res = preceding->install_info(context->depot->m_prefix); - } - } else { - IF_DEBUG("[uninstall] no changes; leaving in place\n"); - } - if (!context->depot->m_modified_extensions && - (strncmp(file->path(), "/System/Library/Extensions", 26) == 0)) { - IF_DEBUG("[uninstall] kernel extension detected\n"); - context->depot->m_modified_extensions = true; - } - } - uint64_t info = preceding->info(); - if (INFO_TEST(info, FILE_INFO_NO_ENTRY | FILE_INFO_ROLLBACK_DATA) && - !INFO_TEST(info, FILE_INFO_BASE_SYSTEM)) { - if (!dryrun && res == 0) { - res = context->files_to_remove->add(preceding->serial()); - } - } - delete preceding; - } else { - IF_DEBUG("[uninstall] in use by newer installation; leaving in place\n"); - delete superseded; - } - } - - fprintf(stdout, "%c %s\n", state, file->path()); - - if (res != 0) fprintf(stderr, "%s:%d: uninstall failed: %s\n", - __FILE__, __LINE__, file->path()); - - free(actpath); - return res; -} - -int Depot::uninstall(Archive* archive) { - extern uint32_t verbosity; - extern uint32_t force; - extern uint32_t dryrun; - int res = 0; - - assert(archive != NULL); - uint64_t serial = archive->serial(); - - if (INFO_TEST(archive->info(), ARCHIVE_INFO_ROLLBACK)) { - // if in debug mode, get_all_archives returns rollbacks too, so just ignore - if (verbosity & VERBOSE_DEBUG) { - fprintf(stderr, "[uninstall] skipping uninstall since archive is a rollback.\n"); - return DEPOT_OK; - } - fprintf(stderr, "%s:%d: cannot uninstall a rollback archive.\n", __FILE__, __LINE__); - return DEPOT_ERROR; - } - - /** - * require -f to force uninstalling an archive installed on top of an older - * base system since the rollback archive we'll use will potentially damage - * the base system. - */ - if (!force && - this->m_build && - archive->build() && - (strcmp(this->m_build, archive->build()) != 0) && - !this->is_superseded(archive) - ) { - fprintf(stderr, - "-------------------------------------------------------------------------------\n" - "The %s root was installed on a different base OS build (%s). The current \n" - "OS build is %s. Uninstalling a root that was installed on a different OS \n" - "build has the potential to damage your OS install due to the fact that the \n" - "rollback data is from the wrong OS version.\n\n" - " You must use the force (-f) option to make this potentially unsafe operation \n" - "happen.\n" - "-------------------------------------------------------------------------------\n", - archive->name(), archive->build(), m_build); - return DEPOT_BUILD_MISMATCH; - } - - if (res != 0) return res; - - if (!dryrun) { - // XXX: this may be superfluous - // uninstall_file should be smart enough to do a mtime check... - if (res == 0) res = this->prune_directories(); - - // We do this here to get an exclusive lock on the database. - if (res == 0) res = this->begin_transaction(); - if (res == 0) res = m_db->deactivate_archive(serial); - if (res == 0) res = this->commit_transaction(); - } - - InstallContext context(this, archive); - context.reverse_files = true; // uninstall children before parents - if (res == 0) res = this->iterate_files(archive, &Depot::uninstall_file, &context); - - if (!dryrun) { - if (res == 0) res = this->begin_transaction(); - uint32_t i; - for (i = 0; i < context.files_to_remove->count; ++i) { - uint64_t serial = context.files_to_remove->values[i]; - if (res == 0) res = m_db->delete_file(serial); - } - if (res == 0) res = this->commit_transaction(); - - if (res == 0) res = this->begin_transaction(); - if (res == 0) res = this->remove(archive); - if (res == 0) res = this->commit_transaction(); - - // delete all of the expanded archive backing stores to save disk space - if (res == 0) res = this->prune_directories(); - - if (res == 0) res = this->prune_archive(archive); - } - - if (res == 0) fprintf(stdout, "Uninstalled archive: %llu %s \n", - archive->serial(), archive->name()); - - return res; -} - -int Depot::verify_file(File* file, void* context) { - File* actual = FileFactory(file->path()); - if (actual) { - uint32_t flags = File::compare(file, actual); - - if (flags != FILE_INFO_IDENTICAL) { - fprintf(stdout, "M "); - } else { - fprintf(stdout, " "); - } - } else { - fprintf(stdout, "R "); - } - file->print(stdout); - return DEPOT_OK; -} - -void Depot::archive_header() { - fprintf(stdout, "%-6s %-36s %-12s %-7s %s\n", - "Serial", "UUID", "Date", "Build", "Name"); - fprintf(stdout, "====== ==================================== " - "============ ======= =================\n"); -} - -int Depot::verify(Archive* archive) { - int res = 0; - this->archive_header(); - list_archive(archive, stdout); - hr(); - if (res == 0) res = this->iterate_files(archive, &Depot::verify_file, NULL); - hr(); - fprintf(stdout, "\n"); - return res; -} - -int Depot::list_archive(Archive* archive, void* context) { - uint64_t serial = archive->serial(); - - char uuid[37]; - uuid_unparse_upper(archive->uuid(), uuid); - - char date[100]; - struct tm local; - time_t seconds = archive->date_installed(); - localtime_r(&seconds, &local); - strftime(date, sizeof(date), "%b %e %H:%M", &local); - - fprintf((FILE*)context, "%-6llu %-36s %-12s %-7s %s\n", - serial, uuid, date, (archive->build()?archive->build():""), archive->name()); - - return DEPOT_OK; -} - -int Depot::list() { - return this->list(0, NULL); -} - -int Depot::list(int count, char** args) { - int res = 0; - - this->archive_header(); - - // handle the default case of "all" - if (count == 0) return this->iterate_archives(&Depot::list_archive, stdout); - - Archive** list; - Archive* archive; - uint32_t archcnt; - for (int i = 0; res == 0 && i < count; i++) { - list = NULL; - archive = NULL; - archcnt = 0; - // check for special keywords - if (strncasecmp(args[i], "all", 3) == 0 && strlen(args[i]) == 3) { - list = this->get_all_archives(&archcnt); - } else if (strncasecmp(args[i], "superseded", 10) == 0 && strlen(args[i]) == 10) { - list = this->get_superseded_archives(&archcnt); - } - if (archcnt) { - // loop over special keyword results - for (uint32_t j = 0; res == 0 && j < archcnt; j++) { - res = this->list_archive(list[j], stdout); - } - } else { - // arg is a single-archive specifier - archive = this->get_archive(args[i]); - if (archive) res = this->list_archive(archive, stdout); - } - } - - return res; -} - -int Depot::print_file(File* file, void* context) { - extern uint32_t verbosity; - if (verbosity & VERBOSE_DEBUG) fprintf((FILE*)context, "%04llx ", file->info()); - file->print((FILE*)context); - return DEPOT_OK; -} - -int Depot::files(Archive* archive) { - int res = 0; - this->archive_header(); - list_archive(archive, stdout); - hr(); - if (res == 0) res = this->iterate_files(archive, &Depot::print_file, stdout); - hr(); - fprintf(stdout, "\n"); - return res; -} - -int Depot::dump_archive(Archive* archive, void* context) { - Depot* depot = (Depot*)context; - int res = 0; - list_archive(archive, stdout); - hr(); - if (res == 0) res = depot->iterate_files(archive, &Depot::print_file, stdout); - hr(); - fprintf(stdout, "\n"); - return res; -} - -int Depot::dump() { - extern uint32_t verbosity; - verbosity = 0xFFFFFFFF; // dump is intrinsically a debug command - int res = 0; - this->archive_header(); - if (res == 0) res = this->iterate_archives(&Depot::dump_archive, this); - return res; -} - - -File* Depot::file_superseded_by(File* file) { - uint8_t* data; - int res = this->m_db->get_next_file(&data, file, FILE_SUPERSEDED); - if (FOUND(res)) return this->m_db->make_file(data); - return NULL; -} - -File* Depot::file_preceded_by(File* file) { - uint8_t* data; - int res = this->m_db->get_next_file(&data, file, FILE_PRECEDED); - if (FOUND(res)) return this->m_db->make_file(data); - return NULL; -} - -int Depot::check_consistency() { - int res = 0; - - SerialSet* inactive = new SerialSet(); - assert(inactive != NULL); - - // get inactive archives serials from the database - uint64_t* serials; - uint32_t count; - this->m_db->get_inactive_archive_serials(&serials, &count); - for (uint32_t i=0; i < count; i++) { - inactive->add(serials[i]); - } - free(serials); - - // print a list of inactive archives - if (res == 0 && inactive && inactive->count > 0) { - fprintf(stderr, "The following archive%s in an inconsistent state and must be uninstalled " - "before proceeding:\n\n", inactive->count > 1 ? "s are" : " is"); - uint32_t i; - this->archive_header(); - for (i = 0; i < inactive->count; ++i) { - Archive* archive = this->archive(inactive->values[i]); - if (archive) { - list_archive(archive, stdout); - delete archive; - } - } - fprintf(stderr, "\nWould you like to uninstall %s now? [y/n] ", - inactive->count > 1 ? "them" : "it"); - int c = getchar(); - fprintf(stderr, "\n"); - if (c == 'y' || c == 'Y') { - for (i = 0; i < inactive->count; ++i) { - Archive* archive = this->archive(inactive->values[i]); - if (archive) { - res = this->uninstall(archive); - delete archive; - } - if (res != 0) break; - } - } - } - - return res; -} - - -int Depot::begin_transaction() { - return this->m_db->begin_transaction(); -} - -int Depot::rollback_transaction() { - return this->m_db->rollback_transaction(); -} - -int Depot::commit_transaction() { - return this->m_db->commit_transaction(); -} - -int Depot::is_locked() { return m_is_locked; } - -bool Depot::is_superseded(Archive* archive) { - // return early if already known - if (archive->m_is_superseded != -1) { - return (archive->m_is_superseded == 1); - } - - // need to find out if superseded - int res = DB_OK; - uint8_t** filelist; - uint8_t* data; - uint32_t count; - res = this->m_db->get_files(&filelist, &count, archive, false); - if (FOUND(res)) { - for (uint32_t i=0; i < count; i++) { - File* file = this->m_db->make_file(filelist[i]); - - // check for being superseded by a root - res = this->m_db->get_next_file(&data, file, FILE_SUPERSEDED); - this->m_db->free_file(data); - if (FOUND(res)) continue; - - // check for being superseded by external changes - char* actpath; - join_path(&actpath, this->prefix(), file->path()); - File* actual = FileFactory(actpath); - free(actpath); - uint32_t flags = File::compare(file, actual); - - // not found in database and no changes on disk, - // so file is the current version of actual - if (flags == FILE_INFO_IDENTICAL) { - archive->m_is_superseded = 0; - return false; - } - - // something external changed contents of actual, - // so we consider this file superseded (by OS upgrade?) - } - } - archive->m_is_superseded = 1; - return true; -} - -int Depot::lock(int operation) { - int res = 0; - if (m_lock_fd == -1) { - m_lock_fd = open(m_depot_path, O_RDONLY); - if (m_lock_fd == -1) { - perror(m_depot_path); - res = m_lock_fd; - } - } - if (res) return res; - res = flock(m_lock_fd, operation); - if (res == -1) { - perror(m_depot_path); - } - return res; -} - -int Depot::unlock(void) { - int res = 0; - res = flock(m_lock_fd, LOCK_UN); - if (res == -1) { - perror(m_depot_path); - } - close(m_lock_fd); - m_lock_fd = -1; - return res; -} - -int Depot::insert(Archive* archive) { - // Don't insert an archive that is already in the database - assert(archive->serial() == 0); - archive->m_serial = m_db->insert_archive(archive->uuid(), - archive->info(), - archive->name(), - archive->date_installed(), - archive->build()); - return archive->m_serial == 0; -} - -int Depot::insert(Archive* archive, File* file) { - // check for the destination prefix in file's path, remove if found - char *path, *relpath; - size_t prefixlen = strlen(this->prefix()); - asprintf(&path, "%s", file->path()); - relpath = path; - if (strncmp(file->path(), this->prefix(), prefixlen) == 0) { - relpath += prefixlen - 1; - } - - file->m_serial = m_db->insert_file(file->info(), file->mode(), file->uid(), file->gid(), - file->digest(), archive, relpath); - if (!file->m_serial) { - fprintf(stderr, "Error: unable to insert file at path %s for archive %s \n", - relpath, archive->name()); - return DB_ERROR; - } - - free(path); - return DEPOT_OK; -} - -int Depot::has_file(Archive* archive, File* file) { - // check for the destination prefix in file's path, remove if found - char *path, *relpath; - size_t prefixlen = strlen(this->prefix()); - asprintf(&path, "%s", file->path()); - relpath = path; - if (strncmp(file->path(), this->prefix(), prefixlen) == 0) { - relpath += prefixlen - 1; - } - - uint64_t count = m_db->count_files(archive, relpath); - - free(path); - return count > 0; -} - - -int Depot::remove(Archive* archive) { - int res = 0; - res = m_db->delete_files(archive); - if (res) { - fprintf(stderr, "Error: unable to delete files for archive %llu \n", archive->serial()); - return res; - } - res = m_db->delete_archive(archive); - if (res) { - fprintf(stderr, "Error: unable to delete archive %llu \n", archive->serial()); - return res; - } - return res; -} - -int Depot::remove(File* file) { - return m_db->delete_file(file); -} - -// helper to dispatch the actual command for process_archive() -int Depot::dispatch_command(Archive* archive, const char* command) { - int res = 0; - - if (strncasecmp((char*)command, "files", 5) == 0) { - res = this->files(archive); - } else if (strncasecmp((char*)command, "uninstall", 9) == 0) { - res = this->uninstall(archive); - } else if (strncasecmp((char*)command, "verify", 6) == 0) { - res = this->verify(archive); - } else { - fprintf(stderr, "Error: unknown command given to dispatch_command.\n"); - } - if (res != 0) { - fprintf(stdout, "An error occurred.\n"); - } - return res; -} - -// perform a command on an archive specification -int Depot::process_archive(const char* command, const char* archspec) { - extern uint32_t verbosity; - int res = 0; - uint32_t count = 0; - Archive** list = NULL; - - if (strncasecmp(archspec, "all", 3) == 0 && strlen(archspec) == 3) { - list = this->get_all_archives(&count); - } else if (strncasecmp(archspec, "superseded", 10) == 0 && strlen(archspec) == 10) { - list = this->get_superseded_archives(&count); - } else { - // make a list of 1 Archive - list = (Archive**)malloc(sizeof(Archive*)); - list[0] = this->get_archive(archspec); - count = 1; - } - - for (size_t i = 0; i < count; i++) { - if (!list[i]) { - fprintf(stdout, "Archive not found: %s\n", archspec); - return DEPOT_ERROR; - } - if (verbosity & VERBOSE_DEBUG) { - char uuid[37]; - uuid_unparse_upper(list[i]->uuid(), uuid); - fprintf(stdout, "Found archive: %s\n", uuid); - } - res = this->dispatch_command(list[i], command); - delete list[i]; - } - free(list); - return res; -} - -int Depot::rename_archive(const char* archspec, const char* name) { - extern uint32_t verbosity; - int res = 0; - - if ((strncasecmp(archspec, "all", 3) == 0 && strlen(archspec) == 3) || - (strncasecmp(archspec, "superseded", 10) == 0 && strlen(archspec) == 10)) { - fprintf(stderr, "Error: keywords 'all' and 'superseded' cannot be used with the" - " rename command.\n"); - return DEPOT_USAGE_ERROR; - } - - Archive* archive = this->get_archive(archspec); - if (!archive) { - fprintf(stdout, "Archive not found: %s\n", archspec); - return DEPOT_NOT_EXIST; - } - - char uuid[37]; - uuid_unparse_upper(archive->uuid(), uuid); - if (verbosity & VERBOSE_DEBUG) { - fprintf(stdout, "Found archive: %s\n", uuid); - } - - if (!name || strlen(name) == 0) { - fprintf(stderr, "Error: invalid name: '%s'\n", name); - return DEPOT_ERROR; - } - - free(archive->m_name); - archive->m_name = strdup(name); - - res = m_db->update_archive(archive->serial(), - archive->uuid(), - archive->name(), - archive->date_installed(), - 1, - archive->info(), - archive->build()); - - if (res == 0) fprintf(stdout, "Renamed archive %s to '%s'.\n", - uuid, archive->name()); - - delete archive; - return res; -} diff --git a/darwinup/Depot.h b/darwinup/Depot.h deleted file mode 100644 index e6805be..0000000 --- a/darwinup/Depot.h +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Copyright (c) 2005-2010 Apple Computer, Inc. All rights reserved. - * - * @APPLE_BSD_LICENSE_HEADER_START@ - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @APPLE_BSD_LICENSE_HEADER_END@ - */ - -#ifndef _DEPOT_H -#define _DEPOT_H - -#include -#include -#include -#include "DB.h" -#include "Archive.h" - -#define DEPOT_OK 0 -#define DEPOT_ERROR -1 -#define DEPOT_NOT_EXIST -2 -#define DEPOT_PERM_DENIED -3 -#define DEPOT_OBJ_CHANGE -4 -#define DEPOT_BUILD_MISMATCH -5 -#define DEPOT_USAGE_ERROR -6 -#define DEPOT_PREINSTALL_ERR -7 - - -struct Archive; -struct File; -struct DarwinupDatabase; - -typedef int (*ArchiveIteratorFunc)(Archive* archive, void* context); -typedef int (*FileIteratorFunc)(File* file, void* context); - -struct Depot { - Depot(); - Depot(const char* prefix); - - virtual ~Depot(); - - // establish database connection - int connect(); - - // create directories we need for storage - int create_storage(); - - // use initialize() to connect to database - // and (optionally) create the storage directories - int initialize(bool writable); - int is_initialized(); - - const char* prefix(); - const char* database_path(); - const char* archives_path(); - const char* downloads_path(); - - virtual int begin_transaction(); - virtual int commit_transaction(); - virtual int rollback_transaction(); - - Archive* archive(uint64_t serial); - Archive* archive(uuid_t uuid); - Archive* archive(archive_name_t name); - Archive* archive(archive_keyword_t keyword); - Archive* get_archive(const char* arg); - - // returns a list of Archive*. Caller must free the list. - Archive** get_all_archives(uint32_t *count); - Archive** get_superseded_archives(uint32_t *count); - uint64_t count_archives(); - - int dump(); - static int dump_archive(Archive* archive, void* context); - - int list(); - int list(int count, char** args); - static int list_archive(Archive* archive, void* context); - - int install(const char* path); - int install(Archive* archive); - static int install_file(File* file, void* context); - static int backup_file(File* file, void* context); - - int uninstall(Archive* archive); - static int uninstall_file(File* file, void* context); - - int verify(Archive* archive); - static int verify_file(File* file, void* context); - - int files(Archive* archive); - static int print_file(File* file, void* context); - - int iterate_files(Archive* archive, FileIteratorFunc func, void* context); - int iterate_archives(ArchiveIteratorFunc func, void* context); - - // processes an archive according to command - // arg is an archive identifier, such as serial or uuid - int dispatch_command(Archive* archive, const char* command); - int process_archive(const char* command, const char* archspec); - - int rename_archive(const char* archspec, const char* name); - - // test if the depot is currently locked - int is_locked(); - - bool is_superseded(Archive* archive); - - void archive_header(); - - bool is_dirty(); - bool has_modified_extensions(); - bool has_modified_xpc_services(); - -protected: - - // Serialize access to the Depot via flock(2). - int lock(int operation); - int unlock(void); - - // Inserts an Archive into the database. - // This modifies the Archive's serial number. - // If the Archive already has a serial number, it cannot be inserted. - int insert(Archive* archive); - - // Inserts a File into the database, as part of the specified Archive. - // This modifies the File's serial number. - // This modifies the File's Archive pointer. - // If the File already has a serial number, it cannot be inserted. - int insert(Archive* archive, File* file); - - int has_file(Archive* archive, File* file); - - // Removes an Archive from the database. - int remove(Archive* archive); - - // Removes a File from the database. - int remove(File* file); - - int analyze_stage(const char* path, Archive* archive, Archive* rollback, int* rollback_files); - - // removes expand and unexpanded files from archives path - int prune_directories(); - int prune_archive(Archive* archive); - - File* file_superseded_by(File* file); - File* file_preceded_by(File* file); - - int check_consistency(); - - DarwinupDatabase* m_db; - - mode_t m_depot_mode; - char* m_prefix; - char* m_depot_path; - char* m_database_path; - char* m_archives_path; - char* m_downloads_path; - char* m_build; - int m_lock_fd; - int m_is_locked; - bool m_is_dirty; // track if we need to update dyld cache - bool m_modified_extensions; // track if we need to touch /S/L/E - bool m_modified_xpc_services; // track if we need to run xpchelper - -}; - -#endif diff --git a/darwinup/Digest.cpp b/darwinup/Digest.cpp deleted file mode 100644 index e55eb26..0000000 --- a/darwinup/Digest.cpp +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (c) 2005-2010 Apple Computer, Inc. All rights reserved. - * - * @APPLE_BSD_LICENSE_HEADER_START@ - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @APPLE_BSD_LICENSE_HEADER_END@ - */ - -#include "Digest.h" - -#include -#include -#include -#include -#include -#include -#include - -uint8_t* Digest::data() { return m_data; } -uint32_t Digest::size() { return m_size; } - -Digest::~Digest() { - -} - -char* Digest::string() { - static const char* hexabet = "0123456789abcdef"; - char* result = (char*)malloc(2*m_size+1); - uint32_t i, j; - - for (i = 0, j = 0; i < m_size; ++i) { - result[j++] = hexabet[(m_data[i] & 0xF0) >> 4]; - result[j++] = hexabet[(m_data[i] & 0x0F)]; - } - result[j] = 0; - - return result; -} - -int Digest::equal(Digest* a, Digest* b) { - if (a == b) return 1; - if (a == NULL) return 0; - if (b == NULL) return 0; - uint32_t a_size = a->size(); - if (a_size != b->size()) { - return 0; - } - return (memcmp(a->data(), b->data(), a_size) == 0); -} - -SHA1Digest::SHA1Digest() { - m_size = CC_SHA1_DIGEST_LENGTH; -} - -SHA1Digest::SHA1Digest(int fd) { - m_size = CC_SHA1_DIGEST_LENGTH; - digest(m_data, fd); -} - -SHA1Digest::SHA1Digest(const char* filename) { - m_size = CC_SHA1_DIGEST_LENGTH; - int fd = open(filename, O_RDONLY); - digest(m_data, fd); -} - -SHA1Digest::SHA1Digest(uint8_t* data, uint32_t size) { - m_size = CC_SHA1_DIGEST_LENGTH; - digest(m_data, data, size); -} - -SHA1Digest::~SHA1Digest() { - -} - -void SHA1Digest::digest(unsigned char* md, int fd) { - CC_SHA1_CTX c; - CC_SHA1_Init(&c); - - ssize_t len; - const unsigned int blocklen = 8192; - static uint8_t* block = NULL; - if (block == NULL) { - block = (uint8_t*)malloc(blocklen); - } - while(1) { - len = read(fd, block, blocklen); - if (len == 0) { close(fd); break; } - if ((len < 0) && (errno == EINTR)) continue; - if (len < 0) { close(fd); return; } - CC_SHA1_Update(&c, block, (CC_LONG)len); - } - if (len >= 0) { - CC_SHA1_Final(md, &c); - } -} - -void SHA1Digest::digest(unsigned char* md, uint8_t* data, uint32_t size) { - CC_SHA1((const void*)data, (CC_LONG)size, md); -} - -SHA1DigestSymlink::SHA1DigestSymlink(const char* filename) { - char link[PATH_MAX]; - ssize_t res = readlink(filename, link, PATH_MAX); - if (res == -1) { - fprintf(stderr, "%s:%d: readlink: %s: %s (%d)\n", __FILE__, __LINE__, filename, strerror(errno), errno); - } else { - digest(m_data, (uint8_t*)link, (uint32_t)res); - } -} - -SHA1DigestSymlink::~SHA1DigestSymlink() { - -} - diff --git a/darwinup/Digest.h b/darwinup/Digest.h deleted file mode 100644 index f14912c..0000000 --- a/darwinup/Digest.h +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (c) 2005-2010 Apple Computer, Inc. All rights reserved. - * - * @APPLE_BSD_LICENSE_HEADER_START@ - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @APPLE_BSD_LICENSE_HEADER_END@ - */ - -#ifndef _DIGEST_H -#define _DIGEST_H - -#include -#include -#include - -#include "Utils.h" - -//// -// Digest -// -// Digest is the abstract root class for all message digest algorithms -// supported by darwinup. Subclasses must implement the constructors -// and digest() APIs. -// -// SHA1Digest is the only concrete subclass. There are two -// subclasses of SHA1Digest which add convenience functions -// for digesting a canonicalized Mach-O binary, and the -// target of a symlink obtained by readlink(2). -// -//// - -struct Digest { - - //// - // Accessor functions - //// - - // Returns the raw digest. - virtual uint8_t* data(); - - // Returns the size of the raw digest. - virtual uint32_t size(); - - // Returns the digest as an ASCII string, represented in hexidecimal. - virtual char* string(); - - virtual ~Digest(); - - //// - // Class functions - //// - - // Compares two digest objects for equality. - // Returns 1 if equal, 0 if not. - static int equal(Digest* a, Digest* b); - - - protected: - - virtual void digest(unsigned char* md, int fd) = 0; - virtual void digest(unsigned char* md, uint8_t* data, uint32_t size) = 0; - - unsigned char m_data[CC_SHA512_DIGEST_LENGTH]; // support up to 64 bytes - uint32_t m_size; - - friend struct Depot; - friend struct DarwinupDatabase; -}; - -//// -// SHA1Digest -//// -struct SHA1Digest : Digest { - // Creates an empty digest. - SHA1Digest(); - - // Computes the SHA-1 digest of data read from the stream. - SHA1Digest(int fd); - - // Computes the SHA-1 digest of data in the file. - SHA1Digest(const char* filename); - - // Computes the SHA-1 digest of the block of memory. - SHA1Digest(uint8_t* data, uint32_t size); - - ~SHA1Digest(); - - void digest(unsigned char* md, int fd); - void digest(unsigned char* md, uint8_t* data, uint32_t size); - -}; - -//// -// SHA1DigestSymlink -// Digests of the target of a symlink. -//// -struct SHA1DigestSymlink : SHA1Digest { - // Computes the SHA-1 digest of the target of the symlink. - // The target is obtained via readlink(2). - SHA1DigestSymlink(const char* filename); - ~SHA1DigestSymlink(); -}; - -#endif - diff --git a/darwinup/File.cpp b/darwinup/File.cpp deleted file mode 100644 index 5918abf..0000000 --- a/darwinup/File.cpp +++ /dev/null @@ -1,573 +0,0 @@ -/* - * Copyright (c) 2005-2010 Apple Computer, Inc. All rights reserved. - * - * @APPLE_BSD_LICENSE_HEADER_START@ - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @APPLE_BSD_LICENSE_HEADER_END@ - */ - -#include "Archive.h" -#include "File.h" -#include "Utils.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -File::File() { - m_serial = 0; - m_archive = NULL; - m_info = FILE_INFO_NONE; - m_path = NULL; - m_mode = 0; - m_uid = 0; - m_gid = 0; - m_size = 0; - m_digest = NULL; -} - -File::File(const char* path) { - m_serial = 0; - m_archive = NULL; - m_info = FILE_INFO_NONE; - m_mode = 0; - m_uid = 0; - m_gid = 0; - m_size = 0; - m_digest = NULL; - if (path) m_path = strdup(path); -} - -File::File(Archive* archive, FTSENT* ent) { - char path[PATH_MAX]; - path[0] = 0; - ftsent_filename(ent, path, PATH_MAX); - m_path = strdup(path); - m_archive = archive; - m_info = FILE_INFO_NONE; - m_mode = ent->fts_statp->st_mode; - m_uid = ent->fts_statp->st_uid; - m_gid = ent->fts_statp->st_gid; - m_size = ent->fts_statp->st_size; - - m_digest = NULL; -} - -File::File(uint64_t serial, Archive* archive, uint32_t info, const char* path, - mode_t mode, uid_t uid, gid_t gid, off_t size, Digest* digest) { - m_serial = serial; - m_archive = archive; - m_info = info; - m_path = strdup(path); - m_mode = mode; - m_uid = uid; - m_gid = gid; - m_size = size; - m_digest = digest; -} - - -File::~File() { - if (m_path) free(m_path); - if (m_digest) delete m_digest; -} - -uint64_t File::serial() { return m_serial; } -Archive* File::archive() { return m_archive; } -uint64_t File::info() { return m_info; } -const char* File::path() { return m_path; } -mode_t File::mode() { return m_mode; } -uid_t File::uid() { return m_uid; } -gid_t File::gid() { return m_gid; } -off_t File::size() { return m_size; } -Digest* File::digest() { return m_digest; } - -void File::info_set(uint64_t flag) { m_info = INFO_SET(m_info, flag); } -void File::info_clr(uint64_t flag) { m_info = INFO_CLR(m_info, flag); } -void File::archive(Archive* archive) { m_archive = archive; } - -uint32_t File::compare(File* a, File* b) { - if (a == b) return FILE_INFO_IDENTICAL; // identity - // existent and nonexistent file are infinitely different - if (a == NULL) return 0xFFFFFFFF; - if (b == NULL) return 0xFFFFFFFF; - - uint32_t result = FILE_INFO_IDENTICAL; - if (a->m_uid != b->m_uid) result |= FILE_INFO_UID_DIFFERS; - if (a->m_gid != b->m_gid) result |= FILE_INFO_GID_DIFFERS; - if (a->m_mode != b->m_mode) result |= FILE_INFO_MODE_DIFFERS; - if ((a->m_mode & S_IFMT) != (b->m_mode & S_IFMT)) - result |= FILE_INFO_TYPE_DIFFERS; - if ((a->m_mode & ALLPERMS) != (b->m_mode & ALLPERMS)) - result |= FILE_INFO_PERM_DIFFERS; - //if (a->m_size != b->m_size) result |= FILE_INFO_SIZE_DIFFERS; - if (Digest::equal(a->m_digest, b->m_digest) == 0) - result |= FILE_INFO_DATA_DIFFERS; - return result; -} - - -void File::print(FILE* stream) { - char* dig = m_digest ? m_digest->string() : - strdup(" "); - - char mode_str[12]; - strmode(m_mode, mode_str); - - fprintf(stream, "%s % 4d % 4d %s %s\n", mode_str, m_uid, m_gid, dig, m_path); - free(dig); -} - -int File::install(const char* prefix, const char* dest, bool uninstall) { - extern uint32_t force; - int res = 0; - Archive* archive = this->archive(); - assert(archive != NULL); - char* dirpath = archive->directory_name(prefix); - IF_DEBUG("[install] dirpath is %s\n", dirpath); - - char srcpath[PATH_MAX]; - const char* path = this->path(); - char* dstpath; - join_path(&dstpath, dest, path); - - // object changes are expected for some uninstall operations, - // otherwise require force flag - bool allow_change = (uninstall || force); - - if (dirpath) { - ssize_t len = snprintf(srcpath, sizeof(srcpath), "%s/%s", dirpath, path); - if ((size_t)len > sizeof(srcpath)) { - fprintf(stderr, "ERROR: [install] path too long: %s/%s\n", - dirpath, path); - return -1; - } - IF_DEBUG("[install] rename(%s, %s)\n", srcpath, dstpath); - res = rename(srcpath, dstpath); - if (res == -1) { - if (errno == ENOENT) { - // the file wasn't found, try to do on-demand - // expansion of the archive that contains it. - if (is_directory(dirpath) == 0) { - IF_DEBUG("[install] File::install on-demand archive expansion\n"); - res = archive->expand_directory(prefix); - if (res == 0) res = this->install(prefix, dest, uninstall); - } else { - // archive was already expanded, so - // the file is truly missing (worry). - IF_DEBUG("[install] File::install missing file in archive \n"); - fprintf(stderr, "%s:%d: %s: %s (%d)\n", - __FILE__, __LINE__, srcpath, strerror(errno), errno); - } - } else if (allow_change && errno == ENOTDIR) { - // a) some part of destination path does not exist - // b) from is a directory, but to is not - IF_DEBUG("[install] File::install ENOTDIR\n"); - fprintf(stderr, "%s:%d: %s: %s (%d)\n", - __FILE__, __LINE__, dstpath, strerror(errno), errno); - } else if (allow_change && errno == EISDIR) { - // to is a directory, but from is not - IF_DEBUG("[install] replacing directory with a file\n"); - IF_DEBUG("[install] removefile(%s)\n", dstpath); - removefile_state_t rmstate; - rmstate = removefile_state_alloc(); - res = removefile(dstpath, rmstate, REMOVEFILE_RECURSIVE); - removefile_state_free(rmstate); - if (res == -1) fprintf(stderr, "%s:%d: %s: %s (%d)\n", - __FILE__, __LINE__, dstpath, strerror(errno), - errno); - IF_DEBUG("[install] rename(%s, %s)\n", srcpath, dstpath); - res = rename(srcpath, dstpath); - if (res == -1) fprintf(stderr, "%s:%d: %s: %s (%d)\n", - __FILE__, __LINE__, dstpath, strerror(errno), - errno); - } else if (allow_change && errno == ENOTEMPTY) { - // to is a directory and is not empty - IF_DEBUG("[install] File::install ENOTEMPTY\n"); - fprintf(stderr, "%s:%d: %s: %s (%d)\n", - __FILE__, __LINE__, dstpath, strerror(errno), errno); - } else { - fprintf(stderr, "%s:%d: %s: %s (%d)\n", - __FILE__, __LINE__, dstpath, strerror(errno), errno); - fprintf(stderr, "ERROR: fatal error during File::install. " \ - "Cannot continue.\n"); - } - } else { - IF_DEBUG("[install] rename(%s, %s)\n", srcpath, dstpath); - } - free(dirpath); - } else { - res = -1; - } - free(dstpath); - return res; -} - -int File::dirrename(const char* prefix, const char* dest, bool uninstall) { - // only used for directories - assert(0); -} - -int File::remove() { - // not implemented - fprintf(stderr, "%s:%d: call to abstract function File::remove\n", - __FILE__, __LINE__); - return -1; -} - -int File::unquarantine(const char *prefix) { - int res = 0; - Archive *archive = this->archive(); - const char *srcpath = archive->directory_name(prefix); - char path[PATH_MAX]; - snprintf(path, sizeof(path), "%s/%s", srcpath, this->path()); - - res = removexattr(path, "com.apple.quarantine", XATTR_NOFOLLOW); - IF_DEBUG("[unquarantine] removexattr %s\n", path); - if (res == -1 && errno == ENOATTR) { - // Safely ignore ENOATTR, we didn't have the quarantine - // xattr set on this file. - res = 0; - } else if (res != 0) { - fprintf(stderr, "%s:%d: %s: %s (%d)\n", - __FILE__, __LINE__, m_path, strerror(errno), errno); - } - return res; -} - -int File::install_info(const char* dest) { - int res = 0; - char* path; - join_path(&path, dest, this->path()); - uid_t uid = this->uid(); - gid_t gid = this->gid(); - mode_t mode = this->mode() & ALLPERMS; - - IF_DEBUG("[install] chown(%s, %d, %d)\n", path, uid, gid); - if (res == 0) res = chown(path, uid, gid); - IF_DEBUG("[install] chmod(%s, %04o)\n", path, mode); - if (res == 0) res = chmod(path, mode); - - free(path); - return res; -} - -NoEntry::NoEntry(const char* path) : File(path) { - m_info = INFO_SET(m_info, FILE_INFO_NO_ENTRY); -} - -NoEntry::NoEntry(uint64_t serial, Archive* archive, uint32_t info, const char* path, - mode_t mode, uid_t uid, gid_t gid, off_t size, Digest* digest) -: File(serial, archive, info, path, mode, uid, gid, size, digest) {} - -Regular::Regular(Archive* archive, FTSENT* ent) : File(archive, ent) { - m_digest = new SHA1Digest(ent->fts_accpath); -} - -Regular::Regular(uint64_t serial, Archive* archive, uint32_t info, const char* path, - mode_t mode, uid_t uid, gid_t gid, off_t size, Digest* digest) -: File(serial, archive, info, path, mode, uid, gid, size, digest) { - if (digest == NULL || serial == 0) { - m_digest = new SHA1Digest(path); - } -} - -int Regular::remove() { - int res = 0; - const char* path = this->path(); - res = unlink(path); - IF_DEBUG("[remove] unlink %s\n", path); - if (res == -1 && errno == ENOENT) { - // We can safely ignore this because we were going to - // remove the file anyway - res = 0; - } else if (res != 0) { - fprintf(stderr, "%s:%d: %s: %s (%d)\n", - __FILE__, __LINE__, m_path, strerror(errno), errno); - } - return res; -} - -Symlink::Symlink(Archive* archive, FTSENT* ent) : File(archive, ent) { - m_digest = new SHA1DigestSymlink(ent->fts_accpath); -} - -Symlink::Symlink(uint64_t serial, Archive* archive, uint32_t info, const char* path, - mode_t mode, uid_t uid, gid_t gid, off_t size, Digest* digest) -: File(serial, archive, info, path, mode, uid, gid, size, digest) { - if (digest == NULL || serial == 0) { - m_digest = new SHA1DigestSymlink(path); - } -} - -int Symlink::remove() { - int res = 0; - const char* path = this->path(); - res = unlink(path); - IF_DEBUG("[remove] unlink %s", path); - if (res == -1 && errno == ENOENT) { - // We can safely ignore this because we were going to - // remove the file anyway - res = 0; - } else if (res == -1) { - fprintf(stderr, "%s:%d: %s (%d)\n", - __FILE__, __LINE__, strerror(errno), errno); - } - return res; -} - -int Symlink::install_info(const char* dest) { - int res = 0; - char* path; - join_path(&path, dest, this->path()); - //mode_t mode = this->mode() & ALLPERMS; - uid_t uid = this->uid(); - gid_t gid = this->gid(); - IF_DEBUG("[install] lchown(%d, %d)\n", uid, gid); - if (res == 0) res = lchown(path, uid, gid); - if (res == -1) fprintf(stderr, "%s:%d: %s: %s (%d)\n", - __FILE__, __LINE__, path, strerror(errno), errno); - //IF_DEBUG("[install] lchmod(%o)\n", mode); - //if (res == 0) res = lchmod(path, mode); - free(path); - return res; -} - -Directory::Directory(Archive* archive, FTSENT* ent) : File(archive, ent) {} - -Directory::Directory(uint64_t serial, Archive* archive, uint32_t info, - const char* path, mode_t mode, uid_t uid, gid_t gid, off_t size, - Digest* digest) -: File(serial, archive, info, path, mode, uid, gid, size, digest) {}; - -int Directory::install(const char* prefix, const char* dest, bool uninstall) { - return this->_install(prefix, dest, uninstall, false); -} - -int Directory::dirrename(const char* prefix, const char* dest, bool uninstall) { - return this->_install(prefix, dest, uninstall, true); -} - -int Directory::_install(const char* prefix, const char* dest, bool uninstall, bool use_rename) { - // We create a new directory instead of renaming the - // existing one, since that would move the entire - // sub-tree, and lead to a lot of ENOENT errors. - int res = 0; - extern uint32_t force; - char* dstpath; - join_path(&dstpath, dest, this->path()); - - // object changes are expected for some uninstall operations, - // otherwise require force flag - bool allow_change = (uninstall || force); - - mode_t mode = this->mode() & ALLPERMS; - uid_t uid = this->uid(); - gid_t gid = this->gid(); - - if (use_rename) { - // determine source path under archives directory for rename - char srcpath[PATH_MAX]; - const char* path = this->path(); - Archive* archive = this->archive(); - char* dirpath = archive->directory_name(prefix); - IF_DEBUG("[install] dirpath is %s\n", dirpath); - if (is_directory(dirpath) == 0) { - IF_DEBUG("[install] expanding archive for directory rename\n"); - res = archive->expand_directory(prefix); - } - if (res == 0 && dirpath) { - ssize_t len = snprintf(srcpath, sizeof(srcpath), "%s/%s", dirpath, path); - if ((size_t)len > sizeof(srcpath)) { - fprintf(stderr, "ERROR: [install] path too long: %s/%s\n", - dirpath, path); - return -1; - } - } - if (is_regular_file(dstpath)) unlink(dstpath); - if (res == 0) IF_DEBUG("[install] rename(%s, %s)\n", srcpath, dstpath); - if (res == 0) res = rename(srcpath, dstpath); - } else { - IF_DEBUG("[install] mkdir(%s, %04o)\n", dstpath, mode); - res = mkdir(dstpath, mode); - // mkdir is limited by umask, so ensure mode is set - if (res == 0) res = chmod(dstpath, mode); - } - - if (res && errno == EEXIST) { - if (is_directory(dstpath)) { - // this is expected in normal cases, so no need to force - IF_DEBUG("[install] directory already exists, setting mode \n"); - res = chmod(dstpath, mode); - if (res == -1) fprintf(stderr, "%s:%d: %s: %s (%d)\n", - __FILE__, __LINE__, dstpath, strerror(errno), - errno); - } else if (allow_change) { - // this could be bad, so require the force option - IF_DEBUG("[install] original node is a file, we need to replace " \ - "with a directory \n"); - IF_DEBUG("[install] unlink(%s)\n", dstpath); - res = unlink(dstpath); - IF_DEBUG("[install] mkdir(%s, %04o)\n", dstpath, mode); - res = mkdir(dstpath, mode); - if (res == -1) fprintf(stderr, "%s:%d: %s: %s (%d)\n", - __FILE__, __LINE__, dstpath, strerror(errno), - errno); - } - } else if (allow_change && res == -1 && errno == ENOTDIR) { - // some part of destination path is not a directory - IF_DEBUG("[install] Directory::install ENOTDIR \n"); - } else if (res == -1) { - fprintf(stderr, "ERROR: %s:%d: %s: %s (%d)\n", - __FILE__, __LINE__, dstpath, strerror(errno), errno); - fprintf(stderr, "ERROR: unable to create %s \n", dstpath); - } - - if (res == 0) { - res = chown(dstpath, uid, gid); - if (res != 0) { - fprintf(stderr, "ERROR: %s:%d: %s: %s (%d)\n", - __FILE__, __LINE__, dstpath, strerror(errno), errno); - fprintf(stderr, "ERROR: unable to change ownership of %s \n", dstpath); - } - } - - free(dstpath); - return res; -} - -int Directory::remove() { - int res = 0; - const char* path = this->path(); - res = rmdir(path); - IF_DEBUG("[remove] rmdir %s\n", path); - if (res == -1 && errno == ENOENT) { - // We can safely ignore this because we were going to - // remove the directory anyway - res = 0; - } else if (res == -1 && errno == ENOTEMPTY) { - res = remove_directory(path); - } else if (res == -1) { - fprintf(stderr, "%s:%d: %s (%d)\n", - __FILE__, __LINE__, strerror(errno), errno); - } - return res; -} - - -File* FileFactory(uint64_t serial, Archive* archive, uint32_t info, const char* path, - mode_t mode, uid_t uid, gid_t gid, off_t size, Digest* digest) { - File* file = NULL; - switch (mode & S_IFMT) { - case S_IFDIR: - file = new Directory(serial, archive, info, path, mode, uid, gid, size, - digest); - break; - case S_IFREG: - file = new Regular(serial, archive, info, path, mode, uid, gid, size, - digest); - break; - case S_IFLNK: - file = new Symlink(serial, archive, info, path, mode, uid, gid, size, - digest); - break; - case 0: - if (INFO_TEST(info, FILE_INFO_NO_ENTRY)) { - file = new NoEntry(serial, archive, info, path, mode, uid, gid, size, - digest); - break; - } - default: - fprintf(stderr, "%s:%d: unexpected file type %o\n", - __FILE__, __LINE__, mode & S_IFMT); - break; - } - return file; -} - -File* FileFactory(Archive* archive, FTSENT* ent) { - File* file = NULL; - switch (ent->fts_info) { - case FTS_D: - file = new Directory(archive, ent); - break; - case FTS_F: - file = new Regular(archive, ent); - break; - case FTS_SL: - case FTS_SLNONE: - file = new Symlink(archive, ent); - break; - case FTS_DP: - break; - case FTS_DEFAULT: - case FTS_DNR: - fprintf(stderr, "%s:%d: could not read directory. Run as root.\n", - __FILE__, __LINE__); - break; - default: - fprintf(stderr, "%s:%d: unexpected fts_info type %d\n", - __FILE__, __LINE__, ent->fts_info); - break; - } - return file; -} - -File* FileFactory(const char* path) { - File* file = NULL; - struct stat sb; - int res = 0; - extern uint32_t force; - - res = lstat(path, &sb); - if (res == -1 && errno == ENOENT) { - // destination does not have a matching node - return NULL; - } else if (force && res == -1 && errno == ENOTDIR) { - // some part of destination path does not exist - // or is a file. This gets handled by Directory::install - // eventually - IF_DEBUG("[factory] parents do not exist or contain a file\n"); - return NULL; - } - if (res == -1) { - fprintf(stderr, "%s:%d: %s: %s (%d)\n", - __FILE__, __LINE__, path, strerror(errno), errno); - fprintf(stderr, "ERROR: unable to stat %s \n", path); - return NULL; - } - - file = FileFactory(0, NULL, FILE_INFO_NONE, path, sb.st_mode, sb.st_uid, - sb.st_gid, sb.st_size, NULL); - return file; -} diff --git a/darwinup/File.h b/darwinup/File.h deleted file mode 100644 index 6129579..0000000 --- a/darwinup/File.h +++ /dev/null @@ -1,255 +0,0 @@ -/* - * Copyright (c) 2005-2010 Apple Computer, Inc. All rights reserved. - * - * @APPLE_BSD_LICENSE_HEADER_START@ - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @APPLE_BSD_LICENSE_HEADER_END@ - */ - -#ifndef _FILE_H -#define _FILE_H - -#include "Digest.h" - -#include -#include -#include - -#define FILE_OBJ_CHANGE_ERROR \ -"-----------------------------------------------------------------------------\n" \ -"Potentially unsafe mismatch between the root and destination: \n\n" \ -"%s\n\n" \ -"You seem to be trying to install a %s over a %s. \n" \ -"Darwinup will not install this root by default since it could cause damage \n" \ -"to your system. You can use the force (-f) option to allow darwinup to \n" \ -"attempt the install anyway. \n" \ -"-----------------------------------------------------------------------------\n" - -#define FILE_TYPE_STRING(type) \ -(type == S_IFIFO ? "named pipe" : \ -(type == S_IFCHR ? "character special" : \ -(type == S_IFDIR ? "directory" : \ -(type == S_IFBLK ? "block special" : \ -(type == S_IFREG ? "file" : \ -(type == S_IFLNK ? "symbolic link" : \ -(type == S_IFSOCK ? "socket" : \ -(type == S_IFWHT ? "whiteout" : \ -"unknown")))))))) - - -enum file_starseded_t { - FILE_SUPERSEDED, - FILE_PRECEDED -}; - -// -// FILE_INFO flags stored in the database -// -const uint32_t FILE_INFO_NONE = 0x0000; -const uint32_t FILE_INFO_BASE_SYSTEM = 0x0001; // file was part of base system, cannot uninstall -const uint32_t FILE_INFO_NO_ENTRY = 0x0002; // placeholder in the database for non-existent file -const uint32_t FILE_INFO_INSTALL_DATA = 0x0010; // actually install the file -const uint32_t FILE_INFO_ROLLBACK_DATA = 0x0020; // file exists in rollback archive - -// -// FILE_INFO flags returned by File::compare() -// -const uint32_t FILE_INFO_IDENTICAL = 0x00000000; - -const uint32_t FILE_INFO_GID_DIFFERS = 0x00100000; -const uint32_t FILE_INFO_UID_DIFFERS = 0x00200000; - -const uint32_t FILE_INFO_MODE_DIFFERS = 0x01000000; // mode differs overall -const uint32_t FILE_INFO_TYPE_DIFFERS = 0x02000000; // S_IFMT differs -const uint32_t FILE_INFO_PERM_DIFFERS = 0x04000000; // ALLPERMS differs - -const uint32_t FILE_INFO_SIZE_DIFFERS = 0x10000000; -const uint32_t FILE_INFO_DATA_DIFFERS = 0x20000000; - - -struct Archive; -struct File; - -//// -// File -// -// File is the root class for all filesystem objects. -// Conceptually it's an abstract class, although that -// hasn't been formalized. -// -// Concrete subclasses exist for specific file types: -// Regular, Symlink, Directory, and NoEntry, indicating -// that the given path does not exist. -// -// FileFactory functions exist to return the correct -// concrete subclass for a given filesystem object. -//// - -File* FileFactory(uint64_t serial, Archive* archive, uint32_t info, const char* path, mode_t mode, uid_t uid, gid_t gid, off_t size, Digest* digest); -File* FileFactory(const char* path); -File* FileFactory(Archive* archive, FTSENT* ent); - - -struct File { - File(); - File(File*); - File(const char* path); - File(Archive* archive, FTSENT* ent); - File(uint64_t serial, Archive* archive, uint32_t info, const char* path, mode_t mode, uid_t uid, gid_t gid, off_t size, Digest* digest); - virtual ~File(); - - //// - // Public Accessor functions - //// - - // Unique serial number for the file (used by database). - virtual uint64_t serial(); - - // FILE_INFO flags. - virtual uint64_t info(); - virtual void info_set(uint64_t); - virtual void info_clr(uint64_t); - - // Pointer to the Archive this file belongs to. - virtual Archive* archive(); - virtual void archive(Archive* archive); - - // Path of the file on disk (absolute path). - // Do not modify or free(3). - virtual const char* path(); - - // Mode of the file, including the file type. - virtual mode_t mode(); - - // Uid of the file. - virtual uid_t uid(); - - // Gid of the file. - virtual gid_t gid(); - - // Size of the file. - virtual off_t size(); - - // Digest of the file's data. - virtual Digest* digest(); - - //// - // Class functions - //// - - // Compare two files, setting the appropriate - // FILE_INFO bits in the return value. - static uint32_t compare(File* a, File* b); - - //// - // Member functions - //// - - // Installs the file from the archive into the prefix - // i.e., for regular files: - // rename(prefix + this->archive()->uuid() + this->path(), dest + this->path()); - virtual int install(const char* prefix, const char* dest, bool uninstall); - // only used for directories - virtual int dirrename(const char* prefix, const char* dest, bool uninstall); - - // Sets the mode, uid, and gid of the file in the dest path - // XXX: rename as repair()? - virtual int install_info(const char* dest); - - // Removes the file - virtual int remove(); - - // Removes any quarantine xattrs present - int unquarantine(const char *prefix); - - // Prints one line to the output stream indicating - // the file mode, ownership, digest and name. - virtual void print(FILE* stream); - - protected: - - uint64_t m_serial; - uint64_t m_info; - Archive* m_archive; - char* m_path; - mode_t m_mode; - uid_t m_uid; - gid_t m_gid; - off_t m_size; - Digest* m_digest; - - friend struct Depot; -}; - - -//// -// Placeholder for rollback archives in the database. -// Indicates that the given path had no entry at the time that -// the archive was created. -//// - -struct NoEntry : File { - NoEntry(const char* path); - NoEntry(uint64_t serial, Archive* archive, uint32_t info, const char* path, mode_t mode, uid_t uid, gid_t gid, off_t size, Digest* digest); -}; - -//// -// A regular file. -// Digest is of the data fork of the file. -// NOTE: Extended attributes are not detected or preserved. -//// -struct Regular : File { - Regular(Archive* archive, FTSENT* ent); - Regular(uint64_t serial, Archive* archive, uint32_t info, const char* path, mode_t mode, uid_t uid, gid_t gid, off_t size, Digest* digest); - virtual int remove(); -}; - -//// -// A symbolic link. -// Digest is of the target obtained via readlink(2). -//// -struct Symlink : File { - Symlink(Archive* archive, FTSENT* ent); - Symlink(uint64_t serial, Archive* archive, uint32_t info, const char* path, mode_t mode, uid_t uid, gid_t gid, off_t size, Digest* digest); - virtual int install_info(const char* dest); - virtual int remove(); -}; - -//// -// A directory. -// Digest is null. -//// -struct Directory : File { - Directory(Archive* archive, FTSENT* ent); - Directory(uint64_t serial, Archive* archive, uint32_t info, const char* path, mode_t mode, uid_t uid, gid_t gid, off_t size, Digest* digest); - virtual int install(const char* prefix, const char* dest, bool uninstall); - virtual int dirrename(const char* prefix, const char* dest, bool uninstall); - int _install(const char* prefix, const char* dest, bool uninstall, bool use_rename); - virtual int remove(); -}; - -#endif diff --git a/darwinup/SerialSet.cpp b/darwinup/SerialSet.cpp deleted file mode 100644 index 68046da..0000000 --- a/darwinup/SerialSet.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2005-2010 Apple Computer, Inc. All rights reserved. - * - * @APPLE_BSD_LICENSE_HEADER_START@ - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @APPLE_BSD_LICENSE_HEADER_END@ - */ - -#include "SerialSet.h" - -#include -#include -#include - -SerialSet::SerialSet() { - capacity = 0; - count = 0; - values = (uint64_t*)malloc(0); -} - -SerialSet::~SerialSet() { - if (values) free(values); -} - -int SerialSet::add(uint64_t value) { - // If the serial already exists in the set, then there's nothing to be done - uint32_t i; - for (i = 0; i < this->count; ++i) { - if (this->values[i] == value) { - return 0; - } - } - - // Otherwise, append it to the end of the set - this->count++; - if (this->count > this->capacity) { - this->capacity += 10; - this->values = (uint64_t*)realloc(this->values, this->capacity * sizeof(uint64_t)); - assert(this->values != NULL); - } - this->values[this->count-1] = value; - - return 0; -} diff --git a/darwinup/SerialSet.h b/darwinup/SerialSet.h deleted file mode 100644 index b6abb5a..0000000 --- a/darwinup/SerialSet.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2005-2010 Apple Computer, Inc. All rights reserved. - * - * @APPLE_BSD_LICENSE_HEADER_START@ - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @APPLE_BSD_LICENSE_HEADER_END@ - */ - -#ifndef _SERIALSET_H -#define _SERIALSET_H - -#include -#include - -// a variably lengthed set of serial numbers from the database -struct SerialSet { - SerialSet(); - ~SerialSet(); - - int add(uint64_t value); - - uint32_t capacity; - uint32_t count; - uint64_t* values; -}; - -#endif diff --git a/darwinup/Table.cpp b/darwinup/Table.cpp deleted file mode 100644 index 818f2fb..0000000 --- a/darwinup/Table.cpp +++ /dev/null @@ -1,561 +0,0 @@ -/* - * Copyright (c) 2010 Apple Computer, Inc. All rights reserved. - * - * @APPLE_BSD_LICENSE_HEADER_START@ - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @APPLE_BSD_LICENSE_HEADER_END@ - */ - -#include -#include -#include - -#include "Table.h" -#include "Database.h" - - -Table::Table(const char* name) { - m_column_max = 2; - m_column_count = 0; - m_columns = (Column**)malloc(sizeof(Column*) * m_column_max); - m_columns_size = 0; - m_result_max = 1; - m_result_count = 0; - m_results = (uint8_t**)malloc(sizeof(uint8_t*) * m_result_max); - m_name = strdup(name); - m_create_sql = NULL; - m_custom_create_sql = NULL; - m_insert_sql = NULL; - m_update_sql = NULL; - m_delete_sql = NULL; - m_prepared_insert = NULL; - m_prepared_update = NULL; - m_prepared_delete = NULL; - m_version = 0; -} - -Table::~Table() { - for (uint32_t i = 0; i < m_column_count; i++) { - delete m_columns[i]; - } - free(m_columns); - - - for (uint32_t i=0; i < m_result_count; i++) { - if (m_results[i]) { - this->free_result(m_results[i]); - } - } - free(m_results); - - free(m_name); - - free(m_create_sql); - free(m_custom_create_sql); - free(m_insert_sql); - free(m_update_sql); - free(m_delete_sql); - - sqlite3_finalize(m_prepared_insert); - sqlite3_finalize(m_prepared_update); - sqlite3_finalize(m_prepared_delete); - -} - -const char* Table::name() { - return m_name; -} - -uint32_t Table::version() { - return m_version; -} - -int Table::set_custom_create(const char* sql) { - this->m_custom_create_sql = strdup(sql); - return this->m_custom_create_sql == 0; -} - -int Table::add_column(Column* c, uint32_t schema_version) { - // accumulate offsets for columns in m_columns_size - c->m_offset = this->m_columns_size; - this->m_columns_size += c->size(); - - // reallocate if needed - if (m_column_count >= m_column_max) { - m_columns = (Column**)realloc(m_columns, m_column_max * sizeof(Column*) * REALLOC_FACTOR); - if (!m_columns) { - fprintf(stderr, "Error: unable to reallocate memory to add a column\n"); - return 1; - } - m_column_max *= REALLOC_FACTOR; - } - m_columns[m_column_count++] = c; - c->m_version = schema_version; - return 0; -} - -Column* Table::column(uint32_t index) { - if (index < m_column_count) { - return this->m_columns[index]; - } else { - return NULL; - } -} - -int Table::offset(uint32_t index) { - return this->m_columns[index]->offset(); -} - -uint32_t Table::row_size() { - return m_columns_size; -} - -uint8_t* Table::alloc_result() { - if (m_result_count >= m_result_max) { - m_results = (uint8_t**)realloc(m_results, m_result_max * sizeof(uint8_t*) * REALLOC_FACTOR); - if (!m_results) { - fprintf(stderr, "Error: unable to reallocate memory to add a result row\n"); - return NULL; - } - m_result_max *= REALLOC_FACTOR; - } - m_result_count++; - m_results[m_result_count-1] = (uint8_t*)calloc(1, this->row_size()); - return m_results[m_result_count-1]; -} - -int Table::free_result(uint8_t* result) { - for (uint32_t i=0; i < m_result_count; i++) { - // look for matching result - if (result == m_results[i]) { - this->free_row((uint8_t*)m_results[i]); - free(m_results[i]); - m_results[i] = NULL; - // if we did not free the last result, - // move last result to the empty slot - if (i != (m_result_count - 1)) { - m_results[i] = m_results[m_result_count-1]; - m_results[m_result_count-1] = NULL; - } - m_result_count--; - } - } - return 0; -} - -sqlite3_stmt* Table::count(sqlite3* db) { - sqlite3_stmt* stmt = (sqlite3_stmt*)malloc(sizeof(sqlite3_stmt*)); - char* query; - int size = asprintf(&query, "SELECT count(*) FROM %s ;", m_name) + 1; - int res = sqlite3_prepare_v2(db, query, size, &stmt, NULL); \ - free(query); \ - if (res != SQLITE_OK) { \ - fprintf(stderr, "Error: unable to prepare statement: %s\n", \ - sqlite3_errmsg(db)); \ - return NULL; \ - } - return stmt; -} - -/** - * Prepare and cache the update statement. - * Assumes table only has 1 primary key - */ -sqlite3_stmt* Table::update(sqlite3* db) { - // we only need to prepare once, return if we already have it - if (m_prepared_update) { - return m_prepared_update; - } - uint32_t i = 0; - bool comma = false; // flag we set to start adding commas - - // calculate the length of the sql statement - size_t size = 28 + 5*m_column_count + strlen(m_name); - for (i=0; iname()); - } - - // generate the sql query - m_update_sql = (char*)malloc(size); - strlcpy(m_update_sql, "UPDATE ", size); - strlcat(m_update_sql, m_name, size); - strlcat(m_update_sql, " SET ", size); - for (i=0; iis_pk()) { - strlcat(m_update_sql, m_columns[i]->name(), size); - strlcat(m_update_sql, "=?", size); - comma = true; - } - } - - // WHERE statement using primary keys - strlcat(m_update_sql, " WHERE ", size); - for (i=0; iis_pk()) { - strlcat(m_update_sql, m_columns[i]->name(), size); - strlcat(m_update_sql, "=?", size); - break; - } - } - strlcat(m_update_sql, ";", size); - - // prepare - int res = sqlite3_prepare_v2(db, m_update_sql, (int)strlen(m_update_sql), &m_prepared_update, NULL); - if (res != SQLITE_OK) { - fprintf(stderr, "Error: unable to prepare update statement for table: %s \n", m_name); - return NULL; - } - return m_prepared_update; -} - - -sqlite3_stmt* Table::insert(sqlite3* db) { - // we only need to prepare once, return if we already have it - if (m_prepared_insert) { - return m_prepared_insert; - } - - uint32_t i = 0; - bool comma = false; // flag we set to start adding commas - - // calculate the length of the sql statement - size_t size = 28 + 5*m_column_count + strlen(m_name); - for (i=0; iname()); - } - - // generate the sql query - m_insert_sql = (char*)malloc(size); - strlcpy(m_insert_sql, "INSERT INTO ", size); - strlcat(m_insert_sql, m_name, size); - strlcat(m_insert_sql, " (", size); - for (i=0; iis_pk()) { - strlcat(m_insert_sql, m_columns[i]->name(), size); - comma = true; - } - } - comma = false; - strlcat(m_insert_sql, ") VALUES (", size); - for (i=0; iis_pk()) { - strlcat(m_insert_sql, "?", size); - comma = true; - } - } - strlcat(m_insert_sql, ");", size); - - IF_SQL("insert sql: %s \n", m_insert_sql); - - // prepare - int res = sqlite3_prepare_v2(db, m_insert_sql, (int)strlen(m_insert_sql), &m_prepared_insert, NULL); - if (res != SQLITE_OK) { - fprintf(stderr, "Error: unable to prepare insert statement for table: %s \n", m_name); - return NULL; - } - return m_prepared_insert; -} - -sqlite3_stmt* Table::del(sqlite3* db) { - // we only need to prepare once, return if we already have it - if (m_prepared_delete) return m_prepared_delete; - - uint32_t i = 0; - - // generate the sql query - size_t size = 22 + strlen(m_name); - for (i=0; iis_pk()) { - size += strlen(m_columns[i]->name()) + 2; - break; - } - } - m_delete_sql = (char*)malloc(size); - strlcpy(m_delete_sql, "DELETE FROM ", size); - strlcat(m_delete_sql, m_name, size); - - // WHERE statement using primary keys - strlcat(m_delete_sql, " WHERE ", size); - for (i=0; iis_pk()) { - strlcat(m_delete_sql, m_columns[i]->name(), size); - strlcat(m_delete_sql, "=?", size); - break; - } - } - strlcat(m_delete_sql, ";", size); - - // prepare - int res = sqlite3_prepare_v2(db, m_delete_sql, (int)strlen(m_delete_sql), &m_prepared_delete, NULL); - if (res != SQLITE_OK) { - fprintf(stderr, "Error: unable to prepare delete statement for table: %s \n", m_name); - return NULL; - } - return m_prepared_delete; - -} - -#define __alloc_stmt_query \ - size_t size = 256; \ - size_t used = 0; \ - char* query = (char*)malloc(size); \ - sqlite3_stmt** pps = (sqlite3_stmt**)malloc(sizeof(sqlite3_stmt*)); - -#define __check_and_cat(text) \ - used = strlcat(query, text, size); \ - if (used >= size-1) { \ - size *= 4; \ - query = (char*)realloc(query, size); \ - if (!query) { \ - fprintf(stderr, "Error: ran out of memory!\n"); \ - return NULL; \ - } \ - used = strlcat(query, text, size); \ - } - -#define __prepare_stmt \ - int res = sqlite3_prepare_v2(db, query, (int)size, pps, NULL); \ - free(query); \ - if (res != SQLITE_OK) { \ - fprintf(stderr, "Error: unable to prepare statement: %s\n", \ - sqlite3_errmsg(db)); \ - return NULL; \ - } - -sqlite3_stmt** Table::count(sqlite3* db, uint32_t count, va_list args) { - __alloc_stmt_query; - strlcpy(query, "SELECT count(*) FROM ", size); - __check_and_cat(m_name); - __check_and_cat(" WHERE 1"); - this->where_va_columns(count, query, size, &used, args); - strlcat(query, ";", size); - __prepare_stmt; - - return pps; -} - -sqlite3_stmt** Table::get_column(sqlite3* db, Column* value_column, uint32_t count, va_list args) { - __alloc_stmt_query; - strlcpy(query, "SELECT ", size); - __check_and_cat(value_column->name()); - __check_and_cat(" FROM "); - __check_and_cat(m_name); - __check_and_cat(" WHERE 1"); - this->where_va_columns(count, query, size, &used, args); - strlcat(query, ";", size); - __prepare_stmt; - - return pps; -} - -sqlite3_stmt** Table::get_row(sqlite3* db, uint32_t count, va_list args) { - __alloc_stmt_query; - strlcpy(query, "SELECT * FROM ", size); - __check_and_cat(m_name); - __check_and_cat(" WHERE 1"); - this->where_va_columns(count, query, size, &used, args); - strlcat(query, ";", size); - __prepare_stmt; - - return pps; -} - -sqlite3_stmt** Table::get_row_ordered(sqlite3* db, Column* order_by, int order, - uint32_t count, va_list args) { - __alloc_stmt_query; - strlcpy(query, "SELECT * FROM ", size); - __check_and_cat(m_name); - __check_and_cat(" WHERE 1"); - this->where_va_columns(count, query, size, &used, args); - __check_and_cat(" ORDER BY "); - __check_and_cat(order_by->name()); - __check_and_cat((order == ORDER_BY_DESC ? " DESC" : " ASC")); - strlcat(query, ";", size); - __prepare_stmt; - - return pps; -} - -sqlite3_stmt** Table::update_value(sqlite3* db, Column* value_column, uint32_t count, va_list args) { - __alloc_stmt_query; - strlcpy(query, "UPDATE ", size); - __check_and_cat(m_name); - __check_and_cat(" SET "); - __check_and_cat(value_column->name()); - __check_and_cat("=? WHERE 1"); - this->where_va_columns(count, query, size, &used, args); - strlcat(query, ";", size); - __prepare_stmt; - - return pps; -} - -sqlite3_stmt** Table::del(sqlite3* db, uint32_t count, va_list args) { - __alloc_stmt_query; - strlcpy(query, "DELETE FROM ", size); - __check_and_cat(m_name); - __check_and_cat(" WHERE 1"); - this->where_va_columns(count, query, size, &used, args); - strlcat(query, ";", size); - __prepare_stmt; - - return pps; -} - -const char* Table::create() { - size_t size = 0; - if (!m_create_sql) { - uint32_t i = 0; - - // size of "create table ( );" plus table name, plus 1 for each column to separate - size = strlen(m_name) + 22 + m_column_count; - for (i=0; icreate()); - // size for create index query - size += 26 + 2*strlen(m_columns[i]->name()) + 2*strlen(m_name); - // custom sql - if (m_custom_create_sql) size += strlen(m_custom_create_sql); - } - - // create creation sql - m_create_sql = (char*)malloc(size); - strlcpy(m_create_sql, "CREATE TABLE ", size); - strlcat(m_create_sql, m_name, size); - strlcat(m_create_sql, " (", size); - // get creation sql for each column - for (i=0; icreate(), size); - } - strlcat(m_create_sql, "); ", size); - - for (i=0; iis_index()) { - char* buf; - asprintf(&buf, "CREATE INDEX %s_%s ON %s (%s);", - m_name, m_columns[i]->name(), m_name, m_columns[i]->name()); - strlcat(m_create_sql, buf, size); - free(buf); - } - } - if (m_custom_create_sql) strlcat(m_create_sql, m_custom_create_sql, size); - } - - return (const char*)m_create_sql; -} - -const char* Table::alter_add_column(uint32_t index) { - if (m_columns[index]) return m_columns[index]->alter(m_name); - return NULL; -} - -int Table::where_va_columns(uint32_t count, char* query, size_t size, - size_t* used, va_list args) { - char tmpstr[256]; - char tmp_op = '='; - char op = '='; - char not_op = ' '; - int len; - for (uint32_t i=0; i < count; i++) { - Column* col = va_arg(args, Column*); - tmp_op = va_arg(args, int); - if (tmp_op == '!') { - not_op = tmp_op; - } else { - op = tmp_op; - } - if (col->type() == SQLITE_TEXT) va_arg(args, char*); - if (col->type() == SQLITE_INTEGER) va_arg(args, uint64_t); - if (col->type() == SQLITE_BLOB) { - va_arg(args, char*); - va_arg(args, uint32_t); - } - len = snprintf(tmpstr, 256, " AND %s%c%c?", col->name(), not_op, op); - if (len >= 255) { - fprintf(stderr, "Error: column name is too big (limit: 248): %s\n", - col->name()); - return NULL; - } - *used = strlcat(query, tmpstr, size); - if (*used >= size-1) { - size *= 4; - query = (char*)realloc(query, size); - if (!query) { - fprintf(stderr, "Error: ran out of memory!\n"); - return -1; - } - *used = strlcat(query, tmpstr, size); - } - } - - return 0; -} - -const Column** Table::columns() { - return (const Column**)m_columns; -} - -uint32_t Table::column_count() { - return this->m_column_count; -} - -int Table::free_row(uint8_t* row) { - uint8_t* current = row; - void* ptr; - for (uint32_t i=0; i < m_column_count; i++) { - switch (m_columns[i]->type()) { - case SQLITE_INTEGER: - current += sizeof(uint64_t); - // nothing to free - break; - default: - memcpy(&ptr, current, sizeof(void*)); - free(ptr); - current += sizeof(void*); - } - } - return 0; -} - -void Table::dump_results(FILE* f) { - fprintf(f, "====================================================================\n"); - for (uint32_t i=0; i < m_result_count; i++) { - fprintf(f, "%p %u:\n", m_results[i], i); - __data_hex(f, m_results[i], 48); - } - fprintf(f, "====================================================================\n"); -} diff --git a/darwinup/Table.h b/darwinup/Table.h deleted file mode 100644 index ca18ff4..0000000 --- a/darwinup/Table.h +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c) 2010 Apple Computer, Inc. All rights reserved. - * - * @APPLE_BSD_LICENSE_HEADER_START@ - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @APPLE_BSD_LICENSE_HEADER_END@ - */ - -#ifndef _TABLE_H -#define _TABLE_H - -#include -#include - -#include "Column.h" - - -struct Table { - Table(const char* name); - virtual ~Table(); - - const char* name(); - uint32_t version(); - - // Add custom SQL to table initialization - int set_custom_create(const char* sql); - - // Column handling - int add_column(Column*, uint32_t schema_version); - Column* column(uint32_t index); - // get the result record offset for column at index - int offset(uint32_t index); - // get total size of result record - uint32_t row_size(); - - // Result record handling - uint8_t* alloc_result(); - int free_result(uint8_t* result); - - /** - * sql statement generators (cached on Table) - */ - sqlite3_stmt* count(sqlite3* db); - sqlite3_stmt* update(sqlite3* db); - sqlite3_stmt* insert(sqlite3* db); - sqlite3_stmt* del(sqlite3* db); - - /** - * sql statement generators (cached by Database & libcache) - * - * - order is either ORDER_BY_ASC or ORDER_BY_DESC - * - count parameters should be the number of items in the va_list - * - args should have sets of 3 (integer and text) or 4 (blob) - * parameters for WHERE clause like Column*, char, value - * - Column* is the column to match against - * - char is how to compare, one of '=', '!', '>', or '<' - * - value is the value to match (1 for integer and text, 2 for blobs) - * which is ignored by these API since they leave placeholders - * instead - * - */ - sqlite3_stmt** count(sqlite3* db, uint32_t count, va_list args); - sqlite3_stmt** get_column(sqlite3* db, Column* value_column, - uint32_t count, va_list args); - sqlite3_stmt** get_row(sqlite3* db, uint32_t count, va_list args); - sqlite3_stmt** get_row_ordered(sqlite3* db, Column* order_by, int order, - uint32_t count, va_list args); - sqlite3_stmt** update_value(sqlite3* db, Column* value_column, - uint32_t count, va_list args); - sqlite3_stmt** del(sqlite3* db, uint32_t count, va_list args); - -protected: - - const char* create(); - const char* alter_add_column(uint32_t index); - - int where_va_columns(uint32_t count, char* query, size_t size, - size_t* used, va_list args); - const Column** columns(); - uint32_t column_count(); - - // free the out-of-band columns (text, blob) from a result record - int free_row(uint8_t* row); - void dump_results(FILE* f); - - char* m_name; - uint32_t m_version; // schema version this was added - - char* m_create_sql; - char* m_custom_create_sql; - char* m_insert_sql; - char* m_update_sql; - char* m_delete_sql; - - Column** m_columns; - uint32_t m_column_count; - uint32_t m_column_max; - int m_columns_size; - - sqlite3_stmt* m_prepared_insert; - sqlite3_stmt* m_prepared_update; - sqlite3_stmt* m_prepared_delete; - - uint8_t** m_results; - uint32_t m_result_count; - uint32_t m_result_max; - - friend struct Database; -}; - -#endif diff --git a/darwinup/Utils.cpp b/darwinup/Utils.cpp deleted file mode 100644 index 493875b..0000000 --- a/darwinup/Utils.cpp +++ /dev/null @@ -1,525 +0,0 @@ -/* - * Copyright (c) 2005-2010 Apple Computer, Inc. All rights reserved. - * - * @APPLE_BSD_LICENSE_HEADER_START@ - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @APPLE_BSD_LICENSE_HEADER_END@ - */ - -#include "Utils.h" - -extern char** environ; - -int fts_compare(const FTSENT **a, const FTSENT **b) { - return strcmp((*a)->fts_name, (*b)->fts_name); -} - -size_t ftsent_filename(FTSENT* ent, char* filename, size_t bufsiz) { - if (ent == NULL) return 0; - if (ent->fts_level > 1) { - bufsiz = ftsent_filename(ent->fts_parent, filename, bufsiz); - } - strlcat(filename, "/", bufsiz); - bufsiz -= 1; - if (ent->fts_namelen != 0) { - strlcat(filename, ent->fts_name, bufsiz); - bufsiz -= strlen(ent->fts_name); - } - return bufsiz; -} - -int mkdir_p(const char* path) { - int res; - - for (;;) { - // Use 0777, let the umask decide. - res = mkdir(path, 0777); - - if (res != 0 && errno == ENOENT) { - char tmp[PATH_MAX]; - strlcpy(tmp, path, PATH_MAX); - char* slash = strrchr(tmp, '/'); - if (slash) { *slash = 0; } - res = mkdir_p(tmp); - if (res != 0) { - break; - } - } else { - break; - } - } - return res; -} - -int remove_directory(const char* directory) { - int res = 0; - const char* path_argv[] = { directory, NULL }; - FTS* fts = fts_open((char**)path_argv, FTS_PHYSICAL | FTS_COMFOLLOW | FTS_XDEV, fts_compare); - FTSENT* ent = fts_read(fts); // throw away the entry for the DSTROOT itself - while (res == 0 && (ent = fts_read(fts)) != NULL) { - switch (ent->fts_info) { - case FTS_D: - break; - case FTS_F: - case FTS_SL: - case FTS_SLNONE: - case FTS_DEFAULT: - res = unlink(ent->fts_accpath); - break; - case FTS_DP: - res = rmdir(ent->fts_accpath); - break; - default: - fprintf(stderr, "%s:%d: unexpected fts_info type %d\n", __FILE__, __LINE__, ent->fts_info); - break; - } - } - fts_close(fts); - return res; -} - -int is_directory(const char* path) { - return is_directory(path, false); -} - -int is_directory(const char* path, bool followlinks) { - struct stat sb; - int res = 0; - if (followlinks) { - res = stat(path, &sb); - } else { - res = lstat(path, &sb); - } - return (res == 0 && S_ISDIR(sb.st_mode)); -} - -int is_regular_file(const char* path) { - struct stat sb; - int res = stat(path, &sb); - return (res == 0 && S_ISREG(sb.st_mode)); -} - -int is_url_path(const char* path) { - if (strncmp("http://", path, 7) == 0) { - return 1; - } - if (strncmp("https://", path, 8) == 0) { - return 1; - } - return 0; -} - -int is_userhost_path(const char* path) { - // look for user@host:path - const char *at = strchr(path, '@'); - const char *colon = strchr(path, ':'); - return at && colon && at < colon; -} - -int has_suffix(const char* str, const char* sfx) { - const char *tmp = str + (strlen(str) - strlen(sfx)); - if (tmp > str) { - return (strcmp(tmp, sfx) == 0); - } - return false; -} - -int exec_with_args(const char** args) { - return exec_with_args_fa(args, NULL); -} - -int exec_with_args_pipe(const char** args, int fd) { - int res = 0; - posix_spawn_file_actions_t fa; - - res = posix_spawn_file_actions_init(&fa); - if (res) { - fprintf(stderr, "Error: unable to initialize file actions: %d \n", res); - return res; - } - - res = posix_spawn_file_actions_adddup2(&fa, fd, 1); // pipe stdout - if (res) { - fprintf(stderr, "Error: (%d) unable to add dup2 for %d \n", res, fd); - return res; - } - - res = posix_spawn_file_actions_addclose(&fa, 2); // close stderr - if (res) { - fprintf(stderr, "Error: (%d) unable to add close for stderr.\n", res); - return res; - } - - res = posix_spawn_file_actions_addclose(&fa, 0); // close stdin - if (res) { - fprintf(stderr, "Error: (%d) unable to add close for stdin.\n", res); - return res; - } - - res = exec_with_args_fa(args, &fa); - posix_spawn_file_actions_destroy(&fa); - - return res; -} - -int exec_with_args_fa(const char** args, posix_spawn_file_actions_t* fa) { - int res = 0; - pid_t pid; - int status; - - IF_DEBUG("Spawn: %s \n", args[0]); - - res = posix_spawn(&pid, args[0], fa, NULL, (char**)args, environ); - if (res != 0) fprintf(stderr, "Error: Failed to spawn %s: %s (%d)\n", args[0], strerror(res), res); - - IF_DEBUG("Running: %s on pid %d \n", args[0], (int)pid); - - do { - res = waitpid(pid, &status, 0); - } while (res == -1 && errno == EINTR); - if (res != -1) { - if (WIFEXITED(status)) { - res = WEXITSTATUS(status); - } else { - res = -1; - } - } - - IF_DEBUG("Done: %s \n", args[0]); - - return res; -} - -#define compact_slashes(buf, count) do { memmove(buf - count + 1, buf, strlen(buf) + 1); buf -= count; } while (0) - -/** - * join_path joins two paths and removes any extra slashes, - * even internal ones in p1 or p2. It allocates memory - * for the string and the caller is responsible for freeing. - */ -int join_path(char **out, const char *p1, const char *p2) { - asprintf(out, "%s/%s", p1, p2); - if (!out) { - fprintf(stderr, "Error: join_path is out of memory!\n"); - return -1; - } - - int slashes = 0; - char *cur = *out; - while (*cur != '\0') { - if (*cur == '/') { - slashes++; - } else { - // we found the next non-slash - if (slashes > 1) { - compact_slashes(cur, slashes); - } - slashes = 0; - } - cur++; - } - // see if we had extra slashes at the very end of p2 - if (slashes > 1) { - compact_slashes(cur, slashes); - } - return 0; -} - -char* fetch_url(const char* srcpath, const char* dstpath) { - extern uint32_t verbosity; - char* localfile; - int res = join_path(&localfile, dstpath, basename((char*)srcpath)); - if (res || !localfile) return NULL; - - const char* args[] = { - "/usr/bin/curl", - (verbosity ? "-v" : "-s"), - "-L", srcpath, - "-o", localfile, - NULL - }; - if (res == 0) res = exec_with_args(args); - if (res == 0) return localfile; - return NULL; -} - -char* fetch_userhost(const char* srcpath, const char* dstpath) { - extern uint32_t verbosity; - int res = 0; - - // clean up srcpath by adding trailing slash - char* cleansrc; - res = join_path(&cleansrc, srcpath, "/"); - if (res != 0) return NULL; - - // make sure dstpath ends in basename of cleansrc for consistent rsync behavior - char* cleandst; - char* srccopy = strdup(cleansrc); // basename might modify input, so make a copy - res = join_path(&cleandst, dstpath, basename(srccopy)); - if (res != 0) return NULL; - - IF_DEBUG("rsync -a --delete %s %s %s \n", - (verbosity ? "-v" : "-q"), cleansrc, cleandst); - - const char* args[] = { - "/usr/bin/rsync", - (verbosity ? "-v" : "-q"), - "-a", "--delete", - cleansrc, - cleandst, - NULL - }; - - if (res == 0) res = exec_with_args(args); - free(srccopy); - free(cleansrc); - if (res == 0) return cleandst; - return NULL; -} - -int find_base_system_path(char** output, const char* path) { - // find the first /System as we walk up path - char system[PATH_MAX]; - char parent[PATH_MAX]; - strlcpy(parent, path, PATH_MAX); - int res = -1; - struct stat sb; - while (res) { - // walk up path - snprintf(system, PATH_MAX, "%s%sSystem", - parent, (parent[1] == '\0' ? "" : "/")); - res = stat(system, &sb); - if (parent[1] == '\0') { - // we hit the top of the filesystem - break; - } - if (res) snprintf(parent, PATH_MAX, "%s", dirname(parent)); - } - if (res) { - fprintf(stderr, "Error: (%d) unable to find base system path.\n", res); - return res; - } - - asprintf(output, "%s", parent); - return 0; -} - -int update_dyld_shared_cache(const char* path) { - extern uint32_t verbosity; - int res; - char* base; - res = find_base_system_path(&base, path); - if (res) return res; - - if (verbosity) { - fprintf(stdout, "Updating dyld shared cache for %s ... ", base); - fflush(stdout); - } - - // exec the tool from our target system - char* toolpath; - join_path(&toolpath, base, "/usr/bin/update_dyld_shared_cache"); - - struct stat sb; - res = stat(toolpath, &sb); - if (res) { - return 1; - } - - const char* args[] = { - toolpath, - "-root", base, - NULL - }; - res = exec_with_args(args); - - if (verbosity) fprintf(stdout, "Done updating dyld shared cache\n"); - - free(toolpath); - free(base); - return res; -} - -int update_xpc_services_cache(const char* path) { - extern uint32_t verbosity; - int res; - char* base; - res = find_base_system_path(&base, path); - if (res) return res; - - char* toolpath; - join_path(&toolpath, base, "/usr/libexec/xpchelper"); - - struct stat sb; - res = stat(toolpath, &sb); - if (res || ((sb.st_mode & S_IXUSR) == 0)) { - // no xpchelper - char* cachedir; - join_path(&cachedir, base, "/System/Library/Caches/com.apple.xpcd"); - - res = mkdir_p(cachedir); - if (!res || errno == EEXIST) { - char* cachepath; - join_path(&cachepath, cachedir, "xpcd_cache.dylib"); - - res = open(cachepath, O_APPEND | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); - if (res >= 0) { - close(res); - res = 0; - } else { - fprintf(stderr, "Error: (%d) failed to touch cache file.\n", errno); - res = errno; - } - free(cachepath); - } else { - res = errno; - fprintf(stderr, "Error: (%d) failed to mkdir_p cache directory.\n", res); - } - if (verbosity) fprintf(stdout, "Touched xpc cache file.\n"); - free(cachedir); - } else { - // xpchelper expects the --root value to *not* end in a slash. - if (has_suffix(base, "/")) { - char *ptr = strrchr(base, '/'); - if (ptr) { - *ptr = '\0'; - } - } - - if (verbosity) { - fprintf(stdout, "Updating xpc services cache for %s ...", base); - fflush(stdout); - } - - const char* args[] = { - toolpath, - "--rebuild-cache", - "--root", base, - NULL - }; - res = exec_with_args(args); - - if (verbosity) fprintf(stdout, "Done updating xpc cache\n"); - } - - free(toolpath); - free(base); - return res; -} - -#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 -int build_number_for_path(char** build, const char* path) { - ssize_t res = 0; - char system[PATH_MAX]; - char* base; - - *build = (char*)calloc(1, 16); - - // find the version plist for our target path - find_base_system_path(&base, path); - if (!base) return 1; - snprintf(system, PATH_MAX, "%s/System/Library/CoreServices/SystemVersion.plist", base); - free(base); - - struct stat sb; - res = stat(system, &sb); - if (res) { - snprintf(*build, 16, " "); - return 1; - } - - // read version plist to get build number - const char* args[] = { - "/usr/libexec/PlistBuddy", - "-c", "Print ProductBuildVersion", - system, - NULL - }; - int pfd[2]; - res = pipe(pfd); - if (res) { - fprintf(stderr, "Error: (%ld) failed to create pipe.\n", res); - return (int)res; - } - exec_with_args_pipe(args, pfd[1]); - - // read from the pipe - close(pfd[1]); - res = 1; - while (res > 0 && res < 15) { - res = read(pfd[0], *build, 15); - // strip newline - if (res > 1 && (*build)[res-1] == '\n') (*build)[res-1] = '\0'; - } - close(pfd[0]); - - if (res == 0) return (int)res; // success - - if (res == -1) { - fprintf(stderr, "Error: failed to read build from plist.\n"); - return (int)res; - } - - return -1; -} - -int tell_finder_to_restart() { - int res = 0; - - const char *args[] = { - "/usr/bin/osascript", "-e", - "tell app \"Finder\" to restart", - NULL, - }; - - res = exec_with_args(args); - - return res; -} -#endif - -void __data_hex(FILE* f, uint8_t* data, uint32_t size) { - if (!size) return; - for (uint32_t i=0; i < size; i++) { - if (!(i%8)) { - if (i<10) fprintf(f, " "); - fprintf(f, "%d", i); - } else { - fprintf(f, " "); - } - } - fprintf(f, "\n"); - for (uint32_t i=0; i < size; i++) { - fprintf(f, "%02x", data[i]); - } - fprintf(f, "\n"); -} - -void hr() { - fprintf(stdout, "==============================================" - "=======================================\n"); -} diff --git a/darwinup/Utils.h b/darwinup/Utils.h deleted file mode 100644 index c5bd7a2..0000000 --- a/darwinup/Utils.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2005-2010 Apple Computer, Inc. All rights reserved. - * - * @APPLE_BSD_LICENSE_HEADER_START@ - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @APPLE_BSD_LICENSE_HEADER_END@ - */ - -#ifndef _UTILS_H -#define _UTILS_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -const uint32_t VERBOSE = 0x1; -const uint32_t VERBOSE_DEBUG = 0x2; -const uint32_t VERBOSE_SQL = 0x4; - -#define IF_DEBUG(...) do { extern uint32_t verbosity; if (verbosity & VERBOSE_DEBUG) fprintf(stderr, "DEBUG: " __VA_ARGS__); } while (0) -#define IF_SQL(...) do { extern uint32_t verbosity; if (verbosity & VERBOSE_SQL) fprintf(stderr, "DEBUG: " __VA_ARGS__); } while (0) - -int fts_compare(const FTSENT **a, const FTSENT **b); -size_t ftsent_filename(FTSENT* ent, char* filename, size_t bufsiz); -int mkdir_p(const char* path); -int remove_directory(const char* path); -int is_directory(const char* path); -int is_directory(const char* path, bool followlinks); -int is_regular_file(const char* path); -int is_url_path(const char* path); -int is_userhost_path(const char* path); -int has_suffix(const char* str, const char* sfx); - -int exec_with_args(const char** args); -int exec_with_args_pipe(const char** args, int fd); -int exec_with_args_fa(const char** args, posix_spawn_file_actions_t* fa); - -int join_path(char** out, const char* p1, const char* p2); -int compact_slashes(char* orig, int slashes); - -char* fetch_url(const char* srcpath, const char* dstpath); -char* fetch_userhost(const char* srcpath, const char* dstpath); - -int find_base_system_path(char** output, const char* path); -int update_dyld_shared_cache(const char* path); -int update_xpc_services_cache(const char* path); - -#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 -int build_number_for_path(char** build, const char* path); -int tell_finder_to_restart(); -#endif - -void __data_hex(FILE* f, uint8_t* data, uint32_t size); - -// print a horizontal line to stdout -void hr(); - -inline bool INFO_TEST(uint64_t word, uint64_t flag) { return ((word & flag) != 0); } -inline uint64_t INFO_SET(uint64_t word, uint64_t flag) { return (word | flag); } -inline uint64_t INFO_CLR(uint64_t word, uint64_t flag) { return (word & (~flag)); } - -#endif diff --git a/darwinup/darwinup.1 b/darwinup/darwinup.1 deleted file mode 100644 index b5e9820..0000000 --- a/darwinup/darwinup.1 +++ /dev/null @@ -1,251 +0,0 @@ -.ig -Copyright (c) 2010 Apple Inc. All rights reserved. -@APPLE_BSD_LICENSE_HEADER_START@ -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -@APPLE_BSD_LICENSE_HEADER_END@ -.. -.Dd 16 Apr, 2010 -.Dt darwinup 1 -.Os Darwin -.Sh NAME -.Nm darwinup -.Nd Install, uninstall, and manage roots -.Sh SYNOPSIS -.Nm -.Op Fl dfnv -.Op Fl p Ar path -.Ar subcommand -.Op Ar arguments ... -.Sh DESCRIPTION -.Nm -allows you to manage roots, or -archives, of files that replace parts of your system. This is useful -for installing a new version of a library or tool on your system while -allowing you to uninstall the files and revert back to the originals -safely and easily. -.Sh OPTIONS -.Bl -tag -width -indent -.It \-d -Do not run helpful automation. See HELPFUL AUTOMATION below. -.It \-f -Force. Some operations will fail gracefully due to potentially unsafe -situations, such as a root that installs a file where a directory is. -In order to have darwinup continue through such a situation, you can -pass the -f option. -.It \-n -Dry run. Darwinup will go through an operation, including analyzing -the root(s) and printing the state/change symbol, but no files will -be modified on your system and no records will be added to the depot. -This option implies -d. -.It \-p Op Ar path -Prefix path. Normally, darwinup will operate on the boot partition. You -can use the -p option to have darwinup work on another partition. You -can provide any arbitrary path, it does not need to be a mount point. -.It \-r -Restart. Gracefully restart after all operations are complete by telling -Finder to restart. -.It \-v -Verbose. This option causes darwinup to print extra information. You can -pass 2 or 3 v's for even more information, but that is usually only needed -for development and debugging of darwinup itself. -.El -.Sh SUBCOMMANDS -Note that the -.Ar path -and -.Ar archive -options listed below support globbing and multiple items. See the EXAMPLES -section below for more details. -.Bl -tag -width -indent -.It files Ar archives -List the files and directories in the -.Ar archive . -.It install Ar path -Install the root at -.Ar path . -.It list Op Ar archive -List archives that are installed. You may optionally provide an -archive specification to limit which archives get listed. -.It rename Ar archive Ar name -Rename an archive. -.It uninstall Ar archives -Uninstall the specified archive. -.It upgrade Ar path -Find the last archive that was installed with the same name (basename of -path), and replace it with the root at -.Ar path . -.It verify Ar archive -List all of the information about -.Ar archive . -This includes status letters -detailing how the archive differs from whats on disk -.El -.Sh STATE/CHANGE SYMBOLS -.Bl -tag -width -indent -.It ? -Unknown state. Probably a bug. -.It ! -Missing file during uninstall. Darwinup expected a file or directory to -exist, but it did not. This could be a bug in darwinup, but most likely -another tool or software update removed a file that darwinup had been -tracking. It can also be caused by an installation failing due to an -object changing type (see FORCING OPERATIONS below), and the subsequent -rollback finding the root only partially installed. Since these all -happen during uninstall, they are typically safe to ignore, since darwinup -was going to delete the object anyway. -.It A -Added. No previous file or directory existed so the file or directory was -added to your system. -.It E -External change. The file you are installing is different than the -last file you installed, but it is identical to what was actually found -on disk. This probably means something manually installed a root or software -update without darwinup knowing about it. This is usually harmless. -.It M -Mode change. Only changes to permission or ownership were needed to -uninstall the file or directory. -.It R -Removed. No previous file or directory existed, so the uninstall process -removed the file. -.It U -Updated. During installation, the file or directory replaces an existing -object at the same path. During uninstallation, the previous version of -the file was restored. -.El -.Sh SUPPORTED PATHS -.Bl -tag -width -indent -.It /path/to/file-or-directory -You can install archive files or directories by specifying a relative or -absolute path. If the path is a directory, all files below it will be -installed as a single root. If the path points to a file, it must be one of -the suported archive file types as described in the usage statement. -.It user@host:/path/to/file-or-directory -You can install files or directories from another host via rsync/ssh. -The files/directories will be downloaded to your machine and then installed -like any other root. -.It http[s]://host/path/to/file -You can install files from an archive hosted on an HTTP/HTTPS server. The -archive file will be downloaded using curl to your machine and then -installed like any other archive file. You can not point darwinup at a -directory hosted via HTTP or HTTPS, only archive files such as tarballs. -.El -.Sh ARCHIVE SPECIFICATIONS -When running a subcommand which takes an -.Ar archive -argument, you can use one or more of the following items to specify which -archive to operate on. You can mix and match any of them as needed. -You can use the list subcommand with these specifications to see what will -match. -.Bl -tag -width -indent -.It Ar serial -You can specify an archive with its serial number, which can be found using -the list subcommand. -.It Ar uuid -You can specify an archive with its UUID, which can be found using the -list subcommand. -.It Ar name -You can specify an archive with its name, which can be found using the -list subcommand. -.It newest -The newest keyword will match the one archive which was most recently -installed. This should always be the first archive listed. -.It oldest -The oldest keyword will match the one archive which was installed the -longest time ago. This should always be the last archive listed. -.It superseded -The superseded keyword will match zero or more archives. An archive is -superseded if every file it contains is contained in an archive that was -(and still is) installed after it. A file in an archive can also be superseded -by external changes, such as operating system updates. When uninstalling a -superseded archive, you should never see any status symbols, since being -superseded means there is a newer file on disk. -.It all -The all keyword will match all archives. If you specify extra verbosity -with -vv, then rollback archives will also be matched by the all keyword. This -means that -.Nm darwinup -vv uninstall all -will attempt to uninstall rollback archives, which will print a message -about not being able to uninstall rollback archives. This is normal and -not a problem. -.El -.Sh FORCING OPERATIONS -There are 2 cases where darwinup will require you to pass the force (-f) -option before proceeding with an operation. -.Bl -tag -width -indent -.It Object Type Change -If you install an archive which contains a file with the same path as a -directory on your system, or vice versa, darwinup will give you a error -about not doing that unless you really want to force it. If you do force -the operation, darwinup will delete the existing object and replace it with -the object from the root. This can happen when a directory full of files -gets packaged up in some opaque file, like xibs/nibs. If you expect this -"type change", then it is probably safe to force the operation. -.It Uninstall a root from an older base system -Darwinup remembers the version (build) of the operating system when a root -is installed. The reason for this is darwinup saves the old (replaced) -files during the installation procedure. Those backups may have come from -the older operating system, and thus are not necessarily compatible with -the current build of the operating system. So if you try to uninstall an -archive that had been installed on a different version of the operating -system, darwinup will stop and provide a message asking you to force the -operation if you really want to. If the files you are uninstalling are all -superseded, then you should not get this error as the backup copies will -not be used anyway. -.El -.Sh HELPFUL AUTOMATION -Darwinup tries to detect common situations and run external tools that you -would otherwise have to remember to run yourself. The "dry run" (-n) and -"disable automation" (-d) options prevent any of the following from -happening. -.Bl -tag -width -indent -.It Dyld Cache -If a root modifies any file, then darwinup will run -update_dyld_shared_cache unless the -d option is specified. -.It Kernel Extensions -If a root modifies a file under /System/Library/Extensions, then darwinup -will update the mtime of /System/Library/Extensions to ensure that the -kext cache is updated during the next boot. -.El -.Sh EXAMPLES -.Bl -tag -width -indent -.It Install files from a tarball -$ darwinup install library-1.2.3.tar.gz -.It Install several directories from /tmp/ -$ darwinup install /tmp/*/*~dst/ -.It Uninstall everything -$ darwinup uninstall all -.It See what archives have been superseded and then uninstall them -$ darwinup list superseded -$ darwinup uninstall superseded -.It Uninstall several archives by serial, the oldest one, and one named myroot -$ darwinup uninstall 9 16 myroot oldest -.It Install a root from src.macosforge.org -$ darwinup install http://src.macosforge.org/Roots/10D573/zlib.root.tar.gz -.El -.Sh SEE ALSO -.Xr rsync 1 , -.Xr curl 1 , -.Xr tar 1 , -.Xr gzip 1 , -.Xr ditto 1 , -.Xr update_dyld_shared_cache 1 \ No newline at end of file diff --git a/darwinup/main.cpp b/darwinup/main.cpp deleted file mode 100644 index e2a18d8..0000000 --- a/darwinup/main.cpp +++ /dev/null @@ -1,299 +0,0 @@ -/* - * Copyright (c) 2005-2010 Apple Computer, Inc. All rights reserved. - * - * @APPLE_BSD_LICENSE_HEADER_START@ - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @APPLE_BSD_LICENSE_HEADER_END@ - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "Archive.h" -#include "Depot.h" -#include "Utils.h" -#include "DB.h" - - -void usage(char* progname) { - fprintf(stderr, "usage: %s [-v] [-p DIR] [command] [args] \n", progname); - fprintf(stderr, "version: 36 \n"); - fprintf(stderr, " \n"); - fprintf(stderr, "options: \n"); -#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 - fprintf(stderr, " -d disable helpful automation \n"); -#endif - fprintf(stderr, " -f force operation to succeed at all costs \n"); - fprintf(stderr, " -n dry run \n"); - fprintf(stderr, " -p DIR operate on roots under DIR (default: /) \n"); -#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 - fprintf(stderr, " -r gracefully restart when finished \n"); -#endif - fprintf(stderr, " -v verbose (use -vv for extra verbosity) \n"); - fprintf(stderr, " \n"); - fprintf(stderr, "commands: \n"); - fprintf(stderr, " files \n"); - fprintf(stderr, " install \n"); - fprintf(stderr, " list [archive] \n"); - fprintf(stderr, " rename \n"); - fprintf(stderr, " uninstall \n"); - fprintf(stderr, " upgrade \n"); - fprintf(stderr, " verify \n"); - fprintf(stderr, " \n"); - fprintf(stderr, " is one of: \n"); - fprintf(stderr, " /path/to/local/dir-or-file \n"); - fprintf(stderr, " user@host:/path/to/remote/dir-or-file \n"); - fprintf(stderr, " http[s]://host/path/to/remote/file \n"); - fprintf(stderr, " \n"); - fprintf(stderr, "Files must be in one of the supported archive formats: \n"); - fprintf(stderr, " cpio, cpio.gz, cpio.bz2 \n"); - fprintf(stderr, " pax, pax.gz, pax.bz2 \n"); - fprintf(stderr, " tar, tar.gz, tar.bz2 \n"); -#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 - fprintf(stderr, " xar, zip \n"); -#else - fprintf(stderr, " zip \n"); -#endif - fprintf(stderr, " \n"); - fprintf(stderr, "archive is one of: \n"); - fprintf(stderr, " the Serial number \n"); - fprintf(stderr, " the UUID \n"); - fprintf(stderr, " the last root installed with that name \n"); - fprintf(stderr, " newest the newest (last) root installed \n"); - fprintf(stderr, " oldest the oldest root installed \n"); - fprintf(stderr, " superseded all roots that have been fully replaced \n"); - fprintf(stderr, " by newer roots \n"); - fprintf(stderr, " all all installed roots \n"); - fprintf(stderr, " \n"); - exit(1); -} - -// our globals -uint32_t verbosity; -uint32_t force; -uint32_t dryrun; - - -int main(int argc, char* argv[]) { - char* progname = strdup(basename(argv[0])); - char* path = NULL; - bool disable_automation = false; -#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 - bool restart = false; -#endif - - int ch; -#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 - while ((ch = getopt(argc, argv, "dfnp:rvh")) != -1) { -#else - while ((ch = getopt(argc, argv, "dfnp:vh")) != -1) { -#endif - switch (ch) { - case 'd': - disable_automation = true; - break; - case 'f': - force = 1; - break; - case 'n': - dryrun = 1; - disable_automation = true; - break; - case 'p': - if (optarg[0] != '/') { - fprintf(stderr, "Error: -p option must be an absolute path\n"); - exit(4); - } - if (strlen(optarg) > (PATH_MAX - 1)) { - fprintf(stderr, "Error: -p option value is too long \n"); - exit(4); - } - join_path(&path, optarg, "/"); - break; -#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 - case 'r': - restart = true; - break; -#endif - case 'v': - verbosity <<= 1; - verbosity |= VERBOSE; - break; - case '?': - case 'h': - default: - usage(progname); - } - } - argc -= optind; - argv += optind; - if (argc == 0) usage(progname); - - int res = 0; - - if (dryrun) IF_DEBUG("option: dry run\n"); - if (force) IF_DEBUG("option: forcing operations\n"); - if (disable_automation) IF_DEBUG("option: helpful automation disabled\n"); -#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 - if (restart) IF_DEBUG("option: restart when finished\n"); -#endif - - if (!path) { - asprintf(&path, "/"); - } else { - IF_DEBUG("option: path is %s\n", path); - } - - Depot* depot = new Depot(path); - - // list handles args optional and in special ways - if (strcmp(argv[0], "list") == 0) { - res = depot->initialize(false); - if (res == DEPOT_NOT_EXIST) { - // we are not asking to write, - // but no depot exists yet either, - // so print an empty list - depot->archive_header(); - exit(0); - } - if (res == DEPOT_PERM_DENIED) { - // permission denied when trying to read - // the depot - fprintf(stderr, "Permission denied when trying to read the database.\n"); - exit(6); - } - if (res == 0) depot->list(argc-1, (char**)(argv+1)); - } else if (argc == 1) { - // other commands which take no arguments - if (strcmp(argv[0], "dump") == 0) { - if (depot->initialize(false)) exit(11); - depot->dump(); - } else { - fprintf(stderr, "Error: unknown command: '%s' \n", argv[0]); - usage(progname); - } - } else { - // loop over arguments - for (int i = 1; i < argc && res == 0; i++) { - if (strcmp(argv[0], "install") == 0) { - if (i==1 && depot->initialize(true)) exit(13); - // gaurd against installing paths ontop of themselves - if (strncmp(path, argv[i], strlen(argv[i])) == 0 - && (strlen(path) == strlen(argv[i]) - || strlen(path) - 1 == strlen(argv[i]))) { - if (strncmp(path, "/", 1) == 0 && strlen(path) == 1) { - fprintf(stderr, "Error: You provided '/' as a path to a root. " - "If you meant to specify a destination of '/', then you " - "just need to remove the '/' argument as the destination " - "defaults to '/'. Use the -p option to specify another " - "destination.\n"); - } else { - fprintf(stderr, "Error: You cannot install the root at '%s' onto" - " itself.\n", path); - } - res = DEPOT_ERROR; - } - if (res == 0) res = depot->install(argv[i]); - } else if (strcmp(argv[0], "upgrade") == 0) { - if (i==1 && depot->initialize(true)) exit(14); - // find most recent matching archive by name - Archive* old = depot->get_archive(basename(argv[i])); - if (!old) { - fprintf(stderr, "Error: unable to find a matching root to upgrade.\n"); - res = 5; - } - // install new archive - if (res == 0) res = depot->install(argv[i]); - // uninstall old archive - if (res == 0) res = depot->uninstall(old); - } else if (strcmp(argv[0], "files") == 0) { - if (i==1 && depot->initialize(false)) exit(12); - res = depot->process_archive(argv[0], argv[i]); - } else if (strcmp(argv[0], "uninstall") == 0) { - if (i==1 && depot->initialize(true)) exit(15); - res = depot->process_archive(argv[0], argv[i]); - } else if (strcmp(argv[0], "verify") == 0) { - if (i==1 && depot->initialize(true)) exit(16); - res = depot->process_archive(argv[0], argv[i]); - } else if (strcmp(argv[0], "rename") == 0) { - if (i==1 && depot->initialize(true)) exit(17); - if ((i+1) >= argc) { - fprintf(stderr, - "Error: rename command for '%s' takes 2 arguments.\n", - argv[i]); - exit(18); - } - res = depot->rename_archive(argv[i], argv[i+1]); - i++; - } else { - fprintf(stderr, "Error: unknown command: '%s' \n", argv[0]); - usage(progname); - } - } -#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 - if (!disable_automation && depot->is_dirty() && res == 0) { - res = update_dyld_shared_cache(path); - if (res) fprintf(stderr, "Warning: could not update dyld cache.\n"); - res = 0; - } - if (!disable_automation && depot->has_modified_extensions() && res == 0) { - char *sle_path; - res = join_path(&sle_path, depot->prefix(), "/System/Library/Extensions"); - IF_DEBUG("Touching /System/Library/Extensions\n"); - if (res == 0) res = utimes(sle_path, NULL); - if (res) { - fprintf(stderr, "Warning: unable to touch %s \n", sle_path); - res = 0; - } - free(sle_path); - } -#endif - if (!disable_automation && depot->has_modified_xpc_services() && res == 0) { - res = update_xpc_services_cache(path); - if (res) fprintf(stderr, "Warning: could not update xpc services cache.\n"); - res = 0; - } -#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 - if (restart && res == 0) { - res = tell_finder_to_restart(); - if (res) fprintf(stderr, "Warning: tried to tell Finder to restart" - "but failed.\n"); - res = 0; - } -#endif - } - - free(path); - exit(res); - return res; -} From d91369da1f0e200f10c02fddc1d6530a3c13934b Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 3 Sep 2018 13:44:54 -0400 Subject: [PATCH 121/382] Remove tests for darwinup --- darwinbuild.xcodeproj/project.pbxproj | 58 --- testing/darwinup/300dirs.tbz2 | Bin 2456 -> 0 bytes testing/darwinup/300files.tbz2 | Bin 1012 -> 0 bytes testing/darwinup/corrupt.tgz | 2 - testing/darwinup/deep-rollback-2.xar | Bin 1015 -> 0 bytes testing/darwinup/deep-rollback.cpgz | Bin 207 -> 0 bytes testing/darwinup/depotroot.tar.gz | Bin 337 -> 0 bytes testing/darwinup/dest.tar.gz | Bin 608 -> 0 bytes testing/darwinup/extension.tar.bz2 | Bin 246 -> 0 bytes testing/darwinup/rep_dir_file.tar.gz | Bin 279 -> 0 bytes testing/darwinup/rep_dir_link.tar.gz | Bin 236 -> 0 bytes testing/darwinup/rep_file_dir.tar.gz | Bin 346 -> 0 bytes testing/darwinup/rep_file_link.tar.gz | Bin 269 -> 0 bytes testing/darwinup/rep_flink_dir.tar.gz | Bin 284 -> 0 bytes testing/darwinup/rep_flink_file.tar.gz | Bin 264 -> 0 bytes testing/darwinup/rep_link_dir.tar.gz | Bin 296 -> 0 bytes testing/darwinup/rep_link_file.tar.gz | Bin 253 -> 0 bytes testing/darwinup/root.tar.gz | Bin 307 -> 0 bytes testing/darwinup/root2.tar.gz | Bin 368 -> 0 bytes testing/darwinup/root3.tar.gz | Bin 176 -> 0 bytes testing/darwinup/root5.tar.gz | Bin 184 -> 0 bytes testing/darwinup/root6.tar.gz | Bin 184 -> 0 bytes testing/darwinup/root7.tar.gz | Bin 184 -> 0 bytes testing/darwinup/run-tests.sh | 571 ------------------------- testing/darwinup/symlink_update.tar.gz | Bin 318 -> 0 bytes testing/darwinup/symlinks.tar.gz | Bin 316 -> 0 bytes 26 files changed, 631 deletions(-) delete mode 100644 testing/darwinup/300dirs.tbz2 delete mode 100644 testing/darwinup/300files.tbz2 delete mode 100644 testing/darwinup/corrupt.tgz delete mode 100644 testing/darwinup/deep-rollback-2.xar delete mode 100644 testing/darwinup/deep-rollback.cpgz delete mode 100644 testing/darwinup/depotroot.tar.gz delete mode 100644 testing/darwinup/dest.tar.gz delete mode 100644 testing/darwinup/extension.tar.bz2 delete mode 100644 testing/darwinup/rep_dir_file.tar.gz delete mode 100644 testing/darwinup/rep_dir_link.tar.gz delete mode 100644 testing/darwinup/rep_file_dir.tar.gz delete mode 100644 testing/darwinup/rep_file_link.tar.gz delete mode 100644 testing/darwinup/rep_flink_dir.tar.gz delete mode 100644 testing/darwinup/rep_flink_file.tar.gz delete mode 100644 testing/darwinup/rep_link_dir.tar.gz delete mode 100644 testing/darwinup/rep_link_file.tar.gz delete mode 100644 testing/darwinup/root.tar.gz delete mode 100644 testing/darwinup/root2.tar.gz delete mode 100644 testing/darwinup/root3.tar.gz delete mode 100644 testing/darwinup/root5.tar.gz delete mode 100644 testing/darwinup/root6.tar.gz delete mode 100644 testing/darwinup/root7.tar.gz delete mode 100644 testing/darwinup/run-tests.sh delete mode 100644 testing/darwinup/symlink_update.tar.gz delete mode 100644 testing/darwinup/symlinks.tar.gz diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 599d504..a59a771 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -764,31 +764,6 @@ DF6BE302132C5EBD00793781 /* realpath */ = {isa = PBXFileReference; lastKnownFileType = text; path = realpath; sourceTree = ""; }; DF6BE303132C5EBD00793781 /* redirection-test */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "redirection-test"; sourceTree = ""; }; DF6BE304132C5EBD00793781 /* run-tests.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "run-tests.sh"; sourceTree = ""; }; - DF6BE306132C5EBD00793781 /* 300dirs.tbz2 */ = {isa = PBXFileReference; lastKnownFileType = file; path = 300dirs.tbz2; sourceTree = ""; }; - DF6BE307132C5EBD00793781 /* 300files.tbz2 */ = {isa = PBXFileReference; lastKnownFileType = file; path = 300files.tbz2; sourceTree = ""; }; - DF6BE308132C5EBD00793781 /* corrupt.tgz */ = {isa = PBXFileReference; lastKnownFileType = text; path = corrupt.tgz; sourceTree = ""; }; - DF6BE309132C5EBD00793781 /* deep-rollback-2.xar */ = {isa = PBXFileReference; lastKnownFileType = file; path = "deep-rollback-2.xar"; sourceTree = ""; }; - DF6BE30A132C5EBD00793781 /* deep-rollback.cpgz */ = {isa = PBXFileReference; lastKnownFileType = file; path = "deep-rollback.cpgz"; sourceTree = ""; }; - DF6BE30B132C5EBD00793781 /* depotroot.tar.gz */ = {isa = PBXFileReference; lastKnownFileType = archive.gzip; path = depotroot.tar.gz; sourceTree = ""; }; - DF6BE30C132C5EBD00793781 /* dest.tar.gz */ = {isa = PBXFileReference; lastKnownFileType = archive.gzip; path = dest.tar.gz; sourceTree = ""; }; - DF6BE30D132C5EBD00793781 /* extension.tar.bz2 */ = {isa = PBXFileReference; lastKnownFileType = file; path = extension.tar.bz2; sourceTree = ""; }; - DF6BE30E132C5EBD00793781 /* rep_dir_file.tar.gz */ = {isa = PBXFileReference; lastKnownFileType = archive.gzip; path = rep_dir_file.tar.gz; sourceTree = ""; }; - DF6BE30F132C5EBD00793781 /* rep_dir_link.tar.gz */ = {isa = PBXFileReference; lastKnownFileType = archive.gzip; path = rep_dir_link.tar.gz; sourceTree = ""; }; - DF6BE310132C5EBD00793781 /* rep_file_dir.tar.gz */ = {isa = PBXFileReference; lastKnownFileType = archive.gzip; path = rep_file_dir.tar.gz; sourceTree = ""; }; - DF6BE311132C5EBD00793781 /* rep_file_link.tar.gz */ = {isa = PBXFileReference; lastKnownFileType = archive.gzip; path = rep_file_link.tar.gz; sourceTree = ""; }; - DF6BE312132C5EBD00793781 /* rep_flink_dir.tar.gz */ = {isa = PBXFileReference; lastKnownFileType = archive.gzip; path = rep_flink_dir.tar.gz; sourceTree = ""; }; - DF6BE313132C5EBD00793781 /* rep_flink_file.tar.gz */ = {isa = PBXFileReference; lastKnownFileType = archive.gzip; path = rep_flink_file.tar.gz; sourceTree = ""; }; - DF6BE314132C5EBD00793781 /* rep_link_dir.tar.gz */ = {isa = PBXFileReference; lastKnownFileType = archive.gzip; path = rep_link_dir.tar.gz; sourceTree = ""; }; - DF6BE315132C5EBD00793781 /* rep_link_file.tar.gz */ = {isa = PBXFileReference; lastKnownFileType = archive.gzip; path = rep_link_file.tar.gz; sourceTree = ""; }; - DF6BE316132C5EBD00793781 /* root.tar.gz */ = {isa = PBXFileReference; lastKnownFileType = archive.gzip; path = root.tar.gz; sourceTree = ""; }; - DF6BE317132C5EBD00793781 /* root2.tar.gz */ = {isa = PBXFileReference; lastKnownFileType = archive.gzip; path = root2.tar.gz; sourceTree = ""; }; - DF6BE318132C5EBD00793781 /* root3.tar.gz */ = {isa = PBXFileReference; lastKnownFileType = archive.gzip; path = root3.tar.gz; sourceTree = ""; }; - DF6BE319132C5EBD00793781 /* root5.tar.gz */ = {isa = PBXFileReference; lastKnownFileType = archive.gzip; path = root5.tar.gz; sourceTree = ""; }; - DF6BE31A132C5EBD00793781 /* root6.tar.gz */ = {isa = PBXFileReference; lastKnownFileType = archive.gzip; path = root6.tar.gz; sourceTree = ""; }; - DF6BE31B132C5EBD00793781 /* root7.tar.gz */ = {isa = PBXFileReference; lastKnownFileType = archive.gzip; path = root7.tar.gz; sourceTree = ""; }; - DF6BE31C132C5EBD00793781 /* run-tests.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "run-tests.sh"; sourceTree = ""; }; - DF6BE31D132C5EBD00793781 /* symlink_update.tar.gz */ = {isa = PBXFileReference; lastKnownFileType = archive.gzip; path = symlink_update.tar.gz; sourceTree = ""; }; - DF6BE31E132C5EBD00793781 /* symlinks.tar.gz */ = {isa = PBXFileReference; lastKnownFileType = archive.gzip; path = symlinks.tar.gz; sourceTree = ""; }; DF6BE31F132C5EBD00793781 /* run-all-tests.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "run-all-tests.sh"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -1160,7 +1135,6 @@ isa = PBXGroup; children = ( DF6BE2FF132C5EBD00793781 /* darwintrace */, - DF6BE305132C5EBD00793781 /* darwinup */, DF6BE31F132C5EBD00793781 /* run-all-tests.sh */, ); path = testing; @@ -1178,38 +1152,6 @@ path = darwintrace; sourceTree = ""; }; - DF6BE305132C5EBD00793781 /* darwinup */ = { - isa = PBXGroup; - children = ( - DF6BE306132C5EBD00793781 /* 300dirs.tbz2 */, - DF6BE307132C5EBD00793781 /* 300files.tbz2 */, - DF6BE308132C5EBD00793781 /* corrupt.tgz */, - DF6BE309132C5EBD00793781 /* deep-rollback-2.xar */, - DF6BE30A132C5EBD00793781 /* deep-rollback.cpgz */, - DF6BE30B132C5EBD00793781 /* depotroot.tar.gz */, - DF6BE30C132C5EBD00793781 /* dest.tar.gz */, - DF6BE30D132C5EBD00793781 /* extension.tar.bz2 */, - DF6BE30E132C5EBD00793781 /* rep_dir_file.tar.gz */, - DF6BE30F132C5EBD00793781 /* rep_dir_link.tar.gz */, - DF6BE310132C5EBD00793781 /* rep_file_dir.tar.gz */, - DF6BE311132C5EBD00793781 /* rep_file_link.tar.gz */, - DF6BE312132C5EBD00793781 /* rep_flink_dir.tar.gz */, - DF6BE313132C5EBD00793781 /* rep_flink_file.tar.gz */, - DF6BE314132C5EBD00793781 /* rep_link_dir.tar.gz */, - DF6BE315132C5EBD00793781 /* rep_link_file.tar.gz */, - DF6BE316132C5EBD00793781 /* root.tar.gz */, - DF6BE317132C5EBD00793781 /* root2.tar.gz */, - DF6BE318132C5EBD00793781 /* root3.tar.gz */, - DF6BE319132C5EBD00793781 /* root5.tar.gz */, - DF6BE31A132C5EBD00793781 /* root6.tar.gz */, - DF6BE31B132C5EBD00793781 /* root7.tar.gz */, - DF6BE31C132C5EBD00793781 /* run-tests.sh */, - DF6BE31D132C5EBD00793781 /* symlink_update.tar.gz */, - DF6BE31E132C5EBD00793781 /* symlinks.tar.gz */, - ); - path = darwinup; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ diff --git a/testing/darwinup/300dirs.tbz2 b/testing/darwinup/300dirs.tbz2 deleted file mode 100644 index cdb2bb9e1017ce3fc49df0e0b7c86f4cd28a7802..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2456 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

E1`E{RSLZomRc;lz)LT_5o0tX zT$nLYBX*}`4Q^P6XiQo zMpdGvDic={cLti%j!pv(DMa(&gMjxSaOod{)Q5gwVTwzd$1aLRx4!F+o`-Q&~vcna2PC0nvZ} l5I_JUWt0FQ03sRy&_K{M91)j2o22)Pxgwk>NF;5{$nIN?gq&NskpbF2` zgMxsYI?dGF6r?$eX{?R1f{@E5NrvziCbA&Iar*^_8Sb9d0Ds_uEce}GI~K>Zx38kU z9ybpz;)_$`>x}C9w(45%57qIqY`f;%Tr0nr*PeWbFya%Fm)@7_?QT=%d7k}K+ySdv JxBmbH008gFVj%zk diff --git a/testing/darwinup/depotroot.tar.gz b/testing/darwinup/depotroot.tar.gz deleted file mode 100644 index 4b2e72d1d04c9147ac7acb6e5f4a5f0a074da15e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 337 zcmV-X0j~ZZiwFQ<1IA1M1MQdHPJ=KQhPf230Q=u#6HZJ#GrIs77@IIKrBmnCTTn+9 z-AuJKF?pYpCP32Cr|-u{(>@N)4uiYOR)Y|trOfA1y^oZUdHf`&R46J46z5{v}s3%Sq&Qd<*=ae*bSxZ7X|-Sq6ggPp1A)F@pM^gtPuTQy1>V z#h4=~|FeJX+W_Q01!w;MuI={0Jhfw#G7!}N$*KR>Tngkr1wZ-UY;MZJ?@&>{vfs`T jlKOV00000000000RF-om4l5f04M+eUi_wq diff --git a/testing/darwinup/dest.tar.gz b/testing/darwinup/dest.tar.gz deleted file mode 100644 index 1ad0730bb6147c3ec2547a1280511594a1cac048..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 608 zcmV-m0-yaKiwFR8%Ip+-ery%IR{e=2+ z=%0dK|E7MmRkS|l=`Vz!W~l#?O0Pe!>dHnN)d2K&o88*|a`F1`_d`qhK!3)^{`d1` zMQFSs-C4N)mA#UEd9+#f(IWvLLGb^vtX?Db@t*q64G;Cd^FQ~_e6bM=Q^&&nAM|hR z>A5JISSfJk{!eouxS+!8FC;a{e<`@>-z@@>`j}k*ISc!LA(f<@2K}|f`k#WQL)jAl z$wLZQBL*ytyZ_^bfSL8bd;Z6TG~WM880y#m$aN{OaR1-*kC*}H>VL2QiiyAaN6aMw z=HOx%#uMC9WpU&lOT{f7qQP?)S-(-65}DY)ej! zZEbVuPL#)@vDKPjBk?u(SN-?Rf2{T4*^jL0KkKS*SzfF8~1~f0WRG0Kh;2|B?d)C?Iohp5O!k5C8xOFaY+p z(9txEiKa{w1j1kl!4)L+GBO650MVe+LqH^vL6NdR82|&)GgG2mmd+XjB?0(W7=Tui zH9{blCKOWw1i~s2KxJ@;=~{}=@PQd$CQcj=j(7-jz(K~9Bo*CfK2^+;r0Goq5hQD3 zkR>I9A~hV~&<9ly#6^N@7(t*I3l0!y3?PVw4hNK$reQSZ4i>a<3xecH7=Zdyf<1+8 wq{3LigFAl%Dn&h|;i)7KgY_**Qe;FjnlD9W3IQ})kRQd|kxmpODiHX~z}UuHMF0Q* diff --git a/testing/darwinup/rep_dir_file.tar.gz b/testing/darwinup/rep_dir_file.tar.gz deleted file mode 100644 index fb54e8c8a3f84dbf6d08f1d3708fc470138e97e2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 279 zcmV+y0qFi8iwFR9PmW9g1MSw|YJ)Ho25_(Y6z2)LB<9cc-eLD8)(pckEzu78_ET%i zwhqT2Zft%(grg|r=f5JoMTk1DEeh0Ql_sZPlKlu77@fzRx|2ya3FvBwvQ*%rGmyTAR de*gdg0000000000008(uUI7$O93lWH004p~{MWtYVn$@f-TKeUfn1ISu0QQK zjxXHsIL=JxbM~Z}MjMw|qlb$EqeDnA!lESv-64iIs4nc zmc17Aww$>CLG8aKul`JxX6X@o_jv8p=liW^b?wwnE&VXt;7^(Jhd}+``}ajw^jSWy k-~HcI{qEfV>n!8{tM*QPU(bL7e(>{8oBZ@Wg9ZZw0CsG0r~m)} diff --git a/testing/darwinup/rep_file_dir.tar.gz b/testing/darwinup/rep_file_dir.tar.gz deleted file mode 100644 index 9eda32729b53906719a859ba69633295d4ef0ba6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 346 zcmV-g0j2&QiwFR)waH8X1MQgGYQ!KAhW9#8;S;puI8LtH7g@42p$k2cWZOP|HG7~5 z-9y1OwEW-A7!;i3bBx&5Z_8%=R4*Ua?d{?^5K-y98KQ0@v25cGW37l2(K58jI`MvC z{FU+(FE0xt7!l|9?g6aA|a{O4fge>Jy% zDCf45mBJP-WJKgar4&n5il;Hdu? z6U`C6hl-r@&t>@OGg*oLmBRm@63u@S_&;9%A*5IdXZ_nr{WB>E{O6!DQEySqod=kQ z$@zb1t`g62w*FZs=YLPmq5g9ag`4}Lc(2=T{rY00h|HZ8$i?LTXJ}S8{b!$Wj?3$R sfB)mvDe6B5{bN0x0LxsEa;Ki&u_nH94oNrEJ|4l3Xk6WvQtnr-?77dacSY56{qH^QhVTE{a+`m)j9bT3$Uo?Re;j$;+x0NaJ^5$mq5m~ol?aMk#&iEX|1NLw zou;R}J{0>(aN2owRWOyu|3821X3e>YH^=b)H;OF!e+tbe7k&@;x^Dp*{SN>D00000 T000000PwjkJ>t6n04M+e&NhJ_ diff --git a/testing/darwinup/rep_flink_dir.tar.gz b/testing/darwinup/rep_flink_dir.tar.gz deleted file mode 100644 index ef481e6a3d62f7500066fd9e434755fd5de32dff..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 284 zcmV+%0ptE3iwFR)waH8X1MSw~YQiuO2XH_86nO%7m)s>UvhPySvZ9XBPJDe+D}t`J z4r9i)|Bu2ET4>sT(@VYjn3tRCeLY`R^~>Zbh$yIhrcpTo%dkLB?%VKjff%HMMA i0LVXwZr_J(9{>OV000000002MUvdDB$stAnC;$MD@RQB} diff --git a/testing/darwinup/rep_flink_file.tar.gz b/testing/darwinup/rep_flink_file.tar.gz deleted file mode 100644 index 88e6095203cdff84e30fa0af290ae269600b14fc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 264 zcmV+j0r&nNiwFQ>nvzTa1MSq&PJ=KM2H;)qDb5pUPw8o|eFyKCZgiosG6T%#w?$pz zGSLf$S^U3{lm?O>_-{n%$VdvAtd%k{-?Zoqs?>LP&qWhYEnbxtJcOU#V|H>Gr9OwMSI*a_5 za3TM4GwT}pe^_HC^4ENxzbpN(X075I|2+T4CiavsPbK!d_4=<1f<;~G|1zC(jUW5p z$f^Iet8)Ka7DoRs;bH818X7-P-yDvqrpCVp+J?~PL!oR1oCyE`000000000000000 OH{cDpl;L0iC;$M~QG_o5 diff --git a/testing/darwinup/rep_link_dir.tar.gz b/testing/darwinup/rep_link_dir.tar.gz deleted file mode 100644 index 871f0919475d411cebe2584874d8000aa72fc010..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 296 zcmV+@0oVQ?iwFR-BF{_!1MSxBZh|lr24H@B6}JKtkbd>G9S3de`i?>zBr_ig^%`Ge&f+?OS5qw*w)i)=F!~$_bLnkSv6m zX*}N?+e7KYP(EJU(fh(}bv<%@c#l*2OZcz($IcA%;GX=+#{7+Bi~MuA$iHrORpMua z?_sqb$)DwU{!FS6lz1Fh{qy{vHcczSQHmJ+apyl9ZvZ#`|E;ntnYmm4 zj`9D`;d=h%{_U`-e4<+5uKc_D&uQh5e-5MhC#nS|_x~Y(R*J*UAM-cF*#C2wT>ryq udwhO)HcaL(&+=zhMkD_m`nnHg9{>OV000000002MU-AhbKOI^CC;$M+Et#eO diff --git a/testing/darwinup/rep_link_file.tar.gz b/testing/darwinup/rep_link_file.tar.gz deleted file mode 100644 index f2ca25e7cdfb62a0005e8203a8f8606940fcc388..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 253 zcmVMg95av+u=({s3vzt3xuIDT3%q02w) z|27)@ diff --git a/testing/darwinup/root.tar.gz b/testing/darwinup/root.tar.gz deleted file mode 100644 index b543bbcd370a0920c7706bc80368d3d0b5a657bf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 307 zcmV-30nGj%iwFP=qRL4C1MSvLZo)7S1z^@bg-_6WCbqL~FH!~M3Z#fg!7V+0ZHG{b zsyYTAkG_G{;+e*gZbMe?=7LzsgtAmofkNAf~Rn(fqe=FJCvU z6JqX4U=D}*A76o&Wu|+a^#9NEpY7TFudLz1{eP$PKL#(Kg?M-UZqse07SY^QK`Dpx zf9n4x(=p)J{r}ki;MXqg|MKZL0u1^e0000000000007{+eFE>*HtYZ> F004HUq8I=G diff --git a/testing/darwinup/root2.tar.gz b/testing/darwinup/root2.tar.gz deleted file mode 100644 index 07ec8cc2b849233570b5ee7ee103d554b77e5cbb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 368 zcmV-$0gwJ4iwFRAz{*Jg1MQjLZh|lrhq>-k^a))5_j*hA90sL}CPos(xyN5igCSht zbZKGp_i54?NjUKJoE}P3*R6OdlEN6XTGKFk#$)`!IX6N}W2~Tz3n67eb=t5Z=TloY zK9t7ah^gZ)JLe7)|Bo;3kI;1f%cL{lF8@jg|4PGu7NY;n^873K&q4IRUA146SN|*g z{V+;R_~&BeUkYXm%92Gi;K}_T-GzSa4~~$zBLQ;|^S@e7{Wmh!e}np;gXrHa$G?s1 zzY*}CgWkVOI0b(0U-=_L{!1p2|5+ILck8Nb%LJX^?fy?*^WTc#U;8imzZ|@i{(}ba z8R`4KDq#zFU;o!V|1o7z|8p?#U!|G@5BN6>{a+UP{lBmWu->FO$IbO$nDPFP!TO(v z;GMn^^68q>zCKb#0&_GD5C^ItrY|4K=Y{LewVbKU+geZ7_djr<1y0002^ OzkCB|EJKL^C;$La-NP>c diff --git a/testing/darwinup/root3.tar.gz b/testing/darwinup/root3.tar.gz deleted file mode 100644 index be3d58777dd71a34ac1472d0c02613ec8846475f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 176 zcmb2|=3uBfaLSW``RzqVu0sX_tq<1~cg=B_Y?8_Uz;l(Gh!?kEQ2+f5^GU7(OFDkk zck?Jlo;kz)SmJf=R;{HWujkZUQCWZ5HT$ka`cyN&Wrrm~J-6pYci%QGQ`{lb8kui*Y3MVeEENmTkgrZiuK8x{$$_X<+bXnRn^DmKi@l>%N%{6zEOC& Y_xsi#W$p~f;GQWnce!p0g9ZZw0Gd`zb^rhX diff --git a/testing/darwinup/root5.tar.gz b/testing/darwinup/root5.tar.gz deleted file mode 100644 index 36b2c3c8f1b794afd48c9670727df37d2d5eab89..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 184 zcmb2|=3uycP0O2s`RyfNu0sX_Z4cK~cilPQGb!_Y@CqkK-6K`?m!~-u3c7SC?K_`# zfNBqFw)`*9^2a{$^na5%{Y%ezyua8o;bi>0&)?UT jPTjav>elbif1cmzz4mqcZw4fApjxh1%;FJ)1_J{C{BKzR diff --git a/testing/darwinup/root6.tar.gz b/testing/darwinup/root6.tar.gz deleted file mode 100644 index 5f2da65a52f36bd81b3412658763b37f3013a402..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 184 zcmb2|=3sbuP0O2s`R$d9T!$1yjuo!2=DM#?D)-%{S(Im0$3U8Vn2o9#UJ9 diff --git a/testing/darwinup/root7.tar.gz b/testing/darwinup/root7.tar.gz deleted file mode 100644 index 9846fbc98552ee22ac7f39c4044e870afef5aa29..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 184 zcmb2|=3sbwP0O2s`RyfNu0sX_Z4cK~cilPQGs*C|X2`+?Vo7`VXL>Iz2@L2^+IK$f z1b@mT{gv@`C{{p>-OJeXFvk?KC`Gl{np5!!N33j7Z6xq diff --git a/testing/darwinup/run-tests.sh b/testing/darwinup/run-tests.sh deleted file mode 100644 index 073716f..0000000 --- a/testing/darwinup/run-tests.sh +++ /dev/null @@ -1,571 +0,0 @@ -#!/bin/bash -set -e -set -x -pushd $(dirname $0) >> /dev/null - -# -# Run tests on darwinup -# -PREFIX=/tmp/testing/darwinup -ORIG=$PREFIX/orig -DEST=$PREFIX/dest -DESTTAR=dest.tar.gz - -HASXAR=$(darwinup 2>&1 | grep xar | wc -l) -HAS386=$(file `which darwinup` | grep i386 | wc -l) -HASX64=$(file `which darwinup` | grep x86_64 | wc -l) - -DARWINUP="darwinup $1 -p $DEST " -DIFF="diff -x .DarwinDepot -x broken -qru" - -ROOTS="root root2 root3" - - -function is_file { - test -f $1 -a ! -L $1 -} - -function is_dir { - test -d $1 -a ! -L $1 -} - -function is_link { - test -L $1; -} - - -echo "INFO: Cleaning up testing area ..." -rm -rf $PREFIX -mkdir -p $PREFIX - -echo "INFO: Untarring the test files ..." -tar zxvf $DESTTAR -C $PREFIX - -for R in $ROOTS; -do - tar zxvf $R.tar.gz -C $PREFIX -done; - -for R in root5 root6 root7 symlinks symlink_update; -do - tar zxvf $R.tar.gz -C $PREFIX -done; - -for R in rep_dir_file rep_dir_link rep_file_dir rep_file_link \ - rep_link_dir rep_link_file rep_flink_dir rep_flink_file; -do - tar zxvf $R.tar.gz -C $PREFIX -done; - -for R in 300dirs.tbz2 300files.tbz2 deep-rollback.cpgz deep-rollback-2.xar extension.tar.bz2 sandboxprofile.tar.bz2 xpcservice.tar.bz2; -do - cp $R $PREFIX/ -done; - -cp corrupt.tgz $PREFIX/ -cp depotroot.tar.gz $PREFIX/ - -mkdir -p $ORIG -cp -R $DEST/* $ORIG/ - -if [ -f /usr/bin/sudo ]; -then - echo "========== TEST: Listing =============" - /usr/bin/sudo -u nobody $DARWINUP list - $DARWINUP list -fi - -if [ $HAS386 -gt 0 -a $HASX64 -gt 0 ]; -then - echo "========== TEST: Trying both 32 and 64 bit ==========" - for R in $ROOTS; - do - echo "INFO: Installing $R ..."; - arch -i386 $DARWINUP install $PREFIX/$R - UUID=$($DARWINUP list | head -3 | tail -1 | awk '{print $1}') - echo "INFO: Uninstalling $R ..."; - arch -x86_64 $DARWINUP uninstall $UUID - echo "DIFF: diffing original test files to dest (should be no diffs) ..." - $DIFF $ORIG $DEST 2>&1 - echo "INFO: Installing $R ..."; - arch -x86_64 $DARWINUP install $PREFIX/$R - UUID=$($DARWINUP list | head -3 | tail -1 | awk '{print $1}') - echo "INFO: Uninstalling $R ..."; - arch -i386 $DARWINUP uninstall $UUID - echo "DIFF: diffing original test files to dest (should be no diffs) ..." - $DIFF $ORIG $DEST 2>&1 - done -fi - -echo "========== TEST: Test uninstall build check safety ==========" -$DARWINUP install $PREFIX/root2 -sqlite3 $DEST/.DarwinDepot/Database-V100 "UPDATE archives SET osbuild = '$(sw_vers -buildVersion)X'" -set +e -$DARWINUP uninstall root2 -if [ $? -eq 0 ]; then exit 1; fi -set -e -$DARWINUP -f uninstall root2 -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 - - -echo "========== TEST: Try installing a symlink-to-directory ==========" -ln -s root2 $PREFIX/root_link -# test without trailing slash -$DARWINUP install $PREFIX/root_link -$DARWINUP uninstall root_link -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 -# test with trailing slash -$DARWINUP install $PREFIX/root_link/ -$DARWINUP uninstall root_link -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 - -echo "========== TEST: Trying roots one at a time ==========" -for R in $ROOTS; -do - echo "INFO: Installing $R ..."; - $DARWINUP install $PREFIX/$R - UUID=$($DARWINUP list | head -3 | tail -1 | awk '{print $1}') - echo "INFO: Uninstalling $R ..."; - $DARWINUP uninstall $UUID - echo "DIFF: diffing original test files to dest (should be no diffs) ..." - $DIFF $ORIG $DEST 2>&1 -done - -echo "========== TEST: Multiple argument test =========="; -$DARWINUP install $PREFIX/root{,2,3} -LINES=$($DARWINUP list | wc -l) -if [ $LINES -lt 5 ]; then - echo "Failed multiple argument test." - exit 1; -fi -$DARWINUP uninstall all -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 - - -echo "========== TEST: Trying all roots at once and verifying =============="; -for R in $ROOTS; -do - echo "INFO: Installing $R ..."; - $DARWINUP install $PREFIX/$R -done - -$DARWINUP verify all -$DARWINUP files all -$DARWINUP dump - -echo "========== TEST: uninstall in reverse =========="; -for R in $ROOTS; -do - UUID=$($DARWINUP list | head -3 | tail -1 | awk '{print $1}') - echo "INFO: Uninstalling $UUID ..."; - $DARWINUP uninstall $UUID -done -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 - -echo "========== TEST: Trying all roots at once, uninstall in install order by serial ==========" -for R in $ROOTS; -do - echo "INFO: Installing $R ..."; - $DARWINUP install $PREFIX/$R -done -for R in $ROOTS; -do - UUID=$($DARWINUP list | grep $R$ | awk '{print $1}') - echo "INFO: Uninstalling $UUID ..."; - $DARWINUP uninstall $UUID -done -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 - -echo "========== TEST: Trying all roots at once, uninstall root2, root3, root by UUID ==========" -for R in $ROOTS; -do - echo "INFO: Installing $R ..."; - $DARWINUP install $PREFIX/$R -done -for R in root2 root3 root; -do - UUID=$($DARWINUP list | grep $R$ | awk '{print $2}') - echo "INFO: Uninstalling $UUID ..."; - $DARWINUP uninstall $UUID -done -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 - -echo "========== TEST: Trying roots in reverse, uninstall in install order ==========" -for R in root3 root2 root; -do - echo "INFO: Installing $R ..."; - $DARWINUP install $PREFIX/$R -done -for R in root3 root2 root; -do - UUID=$($DARWINUP list | grep $R$ | awk '{print $1}') - echo "INFO: Uninstalling $UUID ..."; - $DARWINUP uninstall $UUID -done -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 - -echo "========== TEST: trying large roots =========="; -echo "INFO: installing 300files"; -$DARWINUP install $PREFIX/300files.tbz2 -$DARWINUP uninstall 300files.tbz2 -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 -echo "INFO: installing 300dir"; -$DARWINUP install $PREFIX/300dirs.tbz2 -$DARWINUP uninstall 300dirs.tbz2 -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 -echo "INFO: installing both 300files and 300dirs"; -$DARWINUP install $PREFIX/300dirs.tbz2 -$DARWINUP install $PREFIX/300files.tbz2 -$DARWINUP uninstall 300dirs.tbz2 -$DARWINUP uninstall 300files.tbz2 -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 - -echo "========== TEST: Try uninstalling with user data in rollback ==========" -echo "INFO: Installing root5 ..."; -$DARWINUP install $PREFIX/root5 -$DARWINUP install $PREFIX/root6 -echo "modification" >> $DEST/d/file -$DARWINUP install $PREFIX/root7 -$DARWINUP uninstall root6 -$DARWINUP uninstall root5 -$DARWINUP uninstall root7 -stat $DEST/d/file -rm $DEST/d/file -rmdir $DEST/d -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 - -echo "========== TEST: Deep rollback while saving user data ==========" -$DARWINUP install $PREFIX/deep-rollback.cpgz -echo "modified" >> $DEST/d1/d2/d3/d4/d5/d6/file -$DARWINUP install $PREFIX/deep-rollback.cpgz -$DARWINUP uninstall newest -$DARWINUP uninstall newest -stat $DEST/d1/d2/d3/d4/d5/d6/file -rm $DEST/d1/d2/d3/d4/d5/d6/file -rm -rf $DEST/d1 -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 - -if [ $HASXAR -gt 0 ]; -then - $DARWINUP install $PREFIX/deep-rollback.cpgz - $DARWINUP install $PREFIX/deep-rollback-2.xar ; - $DARWINUP uninstall all - echo "DIFF: diffing original test files to dest (should be no diffs) ..." - $DIFF $ORIG $DEST 2>&1 -fi - -echo "========== TEST: Testing broken symlink handling ==========" -$DARWINUP install $PREFIX/symlinks -$DARWINUP uninstall symlinks -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 -$DARWINUP install $PREFIX/symlink_update -stat -L $DEST/broken -$DARWINUP uninstall newest -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 - -echo "========== TEST: Upgrades =============" -$DARWINUP install $PREFIX/root5 -$DARWINUP upgrade $PREFIX/root5 -$DARWINUP upgrade $PREFIX/root5 -$DARWINUP upgrade $PREFIX/root5 -C=$($DARWINUP list | grep root5 | wc -l | xargs) -test "$C" == "1" -$DARWINUP uninstall oldest -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 - -echo "========== TEST: Try to upgrade with non-existent file =============" -$DARWINUP install $PREFIX/root5 -mv $PREFIX/root5 $PREFIX/root5.tmp -set +e -$DARWINUP upgrade $PREFIX/root5 -set -e -C=$($DARWINUP list | grep root5 | wc -l | xargs) -test "$C" == "1" -mv $PREFIX/root5.tmp $PREFIX/root5 -$DARWINUP uninstall oldest -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 - -echo "========== TEST: Superseded =============" -$DARWINUP install $PREFIX/root5 -$DARWINUP install $PREFIX/root6 -$DARWINUP install $PREFIX/root5 -$DARWINUP install $PREFIX/root2 -$DARWINUP install $PREFIX/root6 -$DARWINUP install $PREFIX/root6 -$DARWINUP install $PREFIX/root5 -$DARWINUP list superseded -$DARWINUP uninstall superseded -C=$($DARWINUP list | grep root | wc -l | xargs) -test "$C" == "2" -$DARWINUP uninstall oldest -$DARWINUP uninstall oldest -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 - - -echo "========== TEST: Archive Rename =============" -$DARWINUP install $PREFIX/root2 -$DARWINUP install $PREFIX/root -$DARWINUP install $PREFIX/root6 -$DARWINUP rename root "RENAME1" -C=$($DARWINUP list | grep "RENAME1" | grep -Ev '^Found' | wc -l | xargs) -test "$C" == "1" -$DARWINUP rename oldest "RENAME2" -C=$($DARWINUP list | grep "RENAME2" | grep -Ev '^Found' | wc -l | xargs) -test "$C" == "1" -$DARWINUP uninstall "RENAME1" -C=$($DARWINUP list | grep "RENAME1" | grep -Ev '^Found' | wc -l | xargs) -test "$C" == "0" -C=$($DARWINUP files "RENAME2" | grep -Ev '^Found' | wc -l | xargs) -test "$C" == "17" -C=$($DARWINUP verify "RENAME2" | grep -Ev '^Found' | wc -l | xargs) -test "$C" == "17" -$DARWINUP rename root6 RENAME3 RENAME3 RENAME4 RENAME4 RENAME5 RENAME5 RENAME6 -C=$($DARWINUP list | grep "root6" | grep -Ev '^Found' | wc -l | xargs) -test "$C" == "0" -C=$($DARWINUP list | grep "RENAME6" | grep -Ev '^Found' | wc -l | xargs) -test "$C" == "1" -C=$($DARWINUP files "RENAME6" | grep -Ev '^Found' | wc -l | xargs) -test "$C" == "8" -$DARWINUP uninstall all -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 - -echo "========== TEST: Modify /System/Library/Extensions ==========" -mkdir -p $DEST/System/Library/Extensions/Foo.kext -BEFORE=$(ls -Tld $DEST/System/Library/Extensions/ | awk '{print $6$7$8$9}'); -sleep 2; -$DARWINUP install extension.tar.bz2 -AFTER=$(ls -Tld $DEST/System/Library/Extensions/ | awk '{print $6$7$8$9}'); -test $BEFORE != $AFTER -$DARWINUP uninstall newest -rm -rf $DEST/System -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 - -echo "========== TEST: Install XPC Service ==========" -mkdir -p $DEST/usr/libexec -mkdir -p $DEST/System -cp /usr/libexec/xpchelper $DEST/usr/libexec -$DARWINUP install xpcservice.tar.bz2 -test -f $DEST/System/Library/Caches/com.apple.xpchelper.cache -$DARWINUP uninstall newest -rm -rf $DEST/System $DEST/usr -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 - -echo "========== TEST: Install Sandbox Profile ==========" -mkdir -p $DEST/usr/libexec -mkdir -p $DEST/System -cp /usr/libexec/xpchelper $DEST/usr/libexec -$DARWINUP install sandboxprofile.tar.bz2 -test -f $DEST/System/Library/Caches/com.apple.xpchelper.cache -$DARWINUP uninstall newest -rm -rf $DEST/System $DEST/usr -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 - -echo "========== TEST: Forcing object change: file to directory ==========" -is_file $DEST/rep_file -$DARWINUP -f install $PREFIX/rep_file_dir -is_dir $DEST/rep_file -is_file $DEST/rep_file/subfile -is_dir $DEST/rep_file/subdir -is_file $DEST/rep_file/subdir/subsubfile -$DARWINUP uninstall newest -is_file $DEST/rep_file -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 - -echo "========== TEST: Forcing object change: file to symlink ==========" -is_file $DEST/rep_file -$DARWINUP -f install $PREFIX/rep_file_link -is_link $DEST/rep_file -$DARWINUP uninstall newest -is_file $DEST/rep_file -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 - -echo "========== TEST: Forcing object change: directory to file ==========" -is_dir $DEST/rep_dir -is_file $DEST/rep_dir/subfile -is_dir $DEST/rep_dir/subdir -is_file $DEST/rep_dir/subdir/subsubfile -$DARWINUP -f install $PREFIX/rep_dir_file -is_file $DEST/rep_dir -$DARWINUP uninstall newest -is_dir $DEST/rep_dir -is_file $DEST/rep_dir/subfile -is_dir $DEST/rep_dir/subdir -is_file $DEST/rep_dir/subdir/subsubfile -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 - -echo "========== TEST: Forcing object change: directory to symlink ==========" -is_dir $DEST/rep_dir -is_file $DEST/rep_dir/subfile -is_dir $DEST/rep_dir/subdir -is_file $DEST/rep_dir/subdir/subsubfile -$DARWINUP -f install $PREFIX/rep_dir_link -is_link $DEST/rep_dir -$DARWINUP uninstall newest -is_dir $DEST/rep_dir -is_file $DEST/rep_dir/subfile -is_dir $DEST/rep_dir/subdir -is_file $DEST/rep_dir/subdir/subsubfile -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 - -echo "========== TEST: Forcing object change: symlink->dir to file ==========" -is_link $DEST/rep_link -$DARWINUP -f install $PREFIX/rep_link_file -is_file $DEST/rep_link -$DARWINUP uninstall newest -is_link $DEST/rep_link -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 - -echo "========== TEST: Forcing object change: symlink->dir to directory ==========" -is_link $DEST/rep_link -$DARWINUP -f install $PREFIX/rep_link_dir -is_dir $DEST/rep_link -is_file $DEST/rep_link/anotherfile -is_dir $DEST/rep_link/anotherdir -is_file $DEST/rep_link/anotherdir/anothersubfile -$DARWINUP uninstall newest -is_link $DEST/rep_link -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 - -echo "========== TEST: Forcing object change: symlink->file to file ==========" -is_link $DEST/rep_flink -$DARWINUP -f install $PREFIX/rep_flink_file -is_file $DEST/rep_flink -$DARWINUP uninstall newest -is_link $DEST/rep_flink -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 - -echo "========== TEST: Forcing object change: symlink->file to directory ==========" -is_link $DEST/rep_flink -$DARWINUP -f install $PREFIX/rep_flink_dir -is_dir $DEST/rep_flink -is_file $DEST/rep_flink/subfile -is_dir $DEST/rep_flink/subdir -is_file $DEST/rep_flink/subdir/subsubfile -$DARWINUP uninstall newest -is_link $DEST/rep_flink -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 - - - -# -# The following are expected failures -# -echo "========== Expected Failures ==========" -set +e - -echo "========== TEST: testing early ditto failure =========="; - -$DARWINUP install $PREFIX/corrupt.tgz | tee $PREFIX/corrupt.log -C=$(grep -c 'Rolling back' $PREFIX/corrupt.log) -test $C -eq 0 -if [ $? -ne 0 ]; then exit 1; fi -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 -if [ $? -ne 0 ]; then exit 1; fi - -echo "========== TEST: testing recursive install guards =========="; -$DARWINUP install $PREFIX/depotroot.tar.gz -if [ $? -ne 255 ]; then exit 1; fi -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 -if [ $? -ne 0 ]; then exit 1; fi -$DARWINUP install $DEST -if [ $? -ne 255 ]; then exit 1; fi -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 -if [ $? -ne 0 ]; then exit 1; fi -darwinup $1 install / -if [ $? -ne 255 ]; then exit 1; fi -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 -if [ $? -ne 0 ]; then exit 1; fi - -echo "========== TEST: Try replacing File with Directory ==========" -$DARWINUP install $PREFIX/rep_file_dir -if [ $? -ne 255 ]; then exit 1; fi -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 -if [ $? -ne 0 ]; then exit 1; fi - -echo "========== TEST: Try replacing File with Symlink ==========" -$DARWINUP install $PREFIX/rep_file_link -if [ $? -ne 255 ]; then exit 1; fi -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 -if [ $? -ne 0 ]; then exit 1; fi - -echo "========== TEST: Try replacing Directory with Symlink ==========" -$DARWINUP install $PREFIX/rep_dir_link -if [ $? -ne 255 ]; then exit 1; fi -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 -if [ $? -ne 0 ]; then exit 1; fi - -echo "========== TEST: Try replacing Directory with File ==========" -$DARWINUP install $PREFIX/rep_dir_file -if [ $? -ne 255 ]; then exit 1; fi -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 -if [ $? -ne 0 ]; then exit 1; fi - -echo "========== TEST: Try replacing Symlink to directory with Directory ==========" -$DARWINUP install $PREFIX/rep_link_dir -if [ $? -ne 255 ]; then exit 1; fi -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 -if [ $? -ne 0 ]; then exit 1; fi - -echo "========== TEST: Try replacing Symlink to directory with File ==========" -$DARWINUP install $PREFIX/rep_link_file -if [ $? -ne 255 ]; then exit 1; fi -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 -if [ $? -ne 0 ]; then exit 1; fi - -echo "========== TEST: Try replacing Symlink to file with Directory ==========" -$DARWINUP install $PREFIX/rep_flink_dir -if [ $? -ne 255 ]; then exit 1; fi -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 -if [ $? -ne 0 ]; then exit 1; fi - -echo "========== TEST: Try replacing Symlink to file with File ==========" -$DARWINUP install $PREFIX/rep_flink_file -if [ $? -ne 255 ]; then exit 1; fi -echo "DIFF: diffing original test files to dest (should be no diffs) ..." -$DIFF $ORIG $DEST 2>&1 -if [ $? -ne 0 ]; then exit 1; fi - -popd >> /dev/null -echo "INFO: Done testing!" - diff --git a/testing/darwinup/symlink_update.tar.gz b/testing/darwinup/symlink_update.tar.gz deleted file mode 100644 index 99e9fe6626e3e06388cbb8a45492daafeeff5743..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 318 zcmV-E0m1$siwFSyhHOg!1MSx9PJ=K2hGBm1DtZOjBfXrZLZ@UL4DAy2>Ma{OwnSv6 zoiX{IKV8C-7GB!m-rA<__S?ftWxRdJQlOM-rO0tCP9x*=IDR6G2_YC2LNY>`6ij7A zC0WgtgY#wxOKJMjGzie9=2V)X|GfYBJNg`}`_qDJp+o;dX?pG-eL-{RKkuJp$F1)# zrItMOS9y3{zp?z*iqr3_38X)8vXCVKi7_wedlfGNoiV3c0=Ei>9ufqcsTjf`)2dk>jVG*0000000000 Q0DyHq0KblW$^a+;0BpXhm;e9( diff --git a/testing/darwinup/symlinks.tar.gz b/testing/darwinup/symlinks.tar.gz deleted file mode 100644 index 25896ecb1f8591ccd8c004e16a2dd3067439ab13..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 316 zcmV-C0mJ?uiwFQ+g=|Xz1MSw|PJ=KUhGC9(6}$hhihWt@)dj4&pIV3bQ`2xWpvRS=bNrp0rJ zwojw9zOwDg@9eQ_+{*Wt^H|n@BFz15zB}Nm{zeS_g%;?43rqip-k zf5}sSsfYg9|MUCO|J1a5@44xEXel@L=W2ZZB`*lwd5&+P|NQ+#rzVifyI8wOD%;iM)ccOiw?&yQPWkwDIQ;dT000000000000000 Ou+2OFeAx8>C;$Nd2CM1- From a7f8338cf4fc6375ab5f77372103f1781a30234d Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 3 Sep 2018 14:01:23 -0400 Subject: [PATCH 122/382] chmod +x createChroot in darwinbuild if needed For some reason, Xcode doesn't always honor the executable flag in the source tree when creating a build archive. If we don't fix this ourselves, then createChroot will silently fail and we will have a broken build root on our hands. --- darwinbuild/darwinbuild.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 4c0f2d0..a9d6508 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -597,6 +597,12 @@ if [ "$USE_CHROOT" = "YES" -a "$EUID" != "0" ]; then fi if [ "$USE_CHROOT" = "YES" -a ! -f "$BuildRoot/usr/local/darwinbuild/receipts/.host-system-chroot" ]; then + if [ ! -x $DATADIR/createChroot ]; then + # This can sometimes happen when darwinbuild was installed via an Xcode + # archive. Don't let it silently fail and then break things later. + chmod +x $DATADIR/createChroot + fi + echo "*** Creating chroot environment from host system, this may take a while ..." $DATADIR/createChroot "$BuildRoot" fi From a0faab6c46ccea60f3e95b596eb4a6b92c3f4777 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 3 Sep 2018 14:04:28 -0400 Subject: [PATCH 123/382] Use proper program name in help message --- darwinbuild/darwinbuild-create-tarball | 66 ++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100755 darwinbuild/darwinbuild-create-tarball diff --git a/darwinbuild/darwinbuild-create-tarball b/darwinbuild/darwinbuild-create-tarball new file mode 100755 index 0000000..9c41b28 --- /dev/null +++ b/darwinbuild/darwinbuild-create-tarball @@ -0,0 +1,66 @@ +#!/usr/bin/env python + +from __future__ import print_function +import sys +import os +import subprocess +import tarfile + +def popen_exec(args, cwd=None): + output = subprocess.check_output(args, universal_newlines=True, cwd=cwd) + return output.decode('utf-8') + +if len(sys.argv) < 3: + print('usage:', sys.argv[0], '/path/to/output project-version', file=sys.stderr) + exit(1) + +def process_submodule(base_path): + module_files = popen_exec(['git', 'ls-files'], cwd=base_path).split('\n') + + gitmodules_path = os.path.join(base_path, '.gitmodules') if base_path is not None else '.gitmodules' + if not os.path.isfile(gitmodules_path): + return module_files + + submodules = [] + with open(gitmodules_path) as fh: + module_file_lines = fh.read().decode('utf-8').split('\n') + for line in module_file_lines: + line = line.strip() + if line.startswith('path = '): + submodules.append(line.replace('path = ', '')) + + for module_path in submodules: + sub_path = os.path.join(base_path, module_path) if base_path is not None else module_path + for subfile in process_submodule(sub_path): + module_files.append(os.path.join(module_path, subfile)) + + return module_files + +outdir = sys.argv[1] +project_and_version = sys.argv[2] + +all_files = [] +try: + all_files = process_submodule(None) +except subprocess.CalledProcessError, e: + print(e.cmd, 'exited with code', e.returncode, file=sys.stderr) + exit(1) + +tarball = tarfile.open(os.path.join(outdir, project_and_version + '.tar.gz'), 'w:gz') + +counter = 0 +for filename in all_files: + if filename == '': continue + + # Don't try to add empty directories to the tarball. + # This would only occur when the directory in question + # is a submodule; Git otherwise tracks files only. + if os.path.isdir(str(filename)): continue + + counter += 1 + if (counter % 1000) == 0: + print('Processed', counter, 'files...') + + tarball.add(filename, os.path.join(project_and_version, filename)) + +tarball.close() From 2900132fa59d8ee77cfb263ecf84f96f9d034284 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 3 Sep 2018 14:19:08 -0400 Subject: [PATCH 124/382] Reindent darwinbuild.common --- darwinbuild/darwinbuild.common | 343 ++++++++++++++++----------------- 1 file changed, 169 insertions(+), 174 deletions(-) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index b115e20..ad910f9 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -1,21 +1,21 @@ #!/bin/sh # # Copyright (c) 2005-2010, Apple Computer, Inc. All rights reserved. -# +# # @APPLE_BSD_LICENSE_HEADER_START@ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. +# notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. +# documentation and/or other materials provided with the distribution. # 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of # its contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# +# from this software without specific prior written permission. +# # THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -46,21 +46,17 @@ function CheckDarwinBuildRoot() { cd "$DARWIN_BUILDROOT" fi fi - if [ -d Roots -a \ - -d Sources -a \ - -d Symbols -a \ - -d Headers -a \ - -d Logs ]; then + if [ -d Roots -a -d Sources -a -d Symbols -a -d Headers -a -d Logs ]; then export DARWIN_BUILDROOT="$(pwd -P)" else cat 1>&2 <<- EOB - ERROR: please change your working directory to one initialized by: - darwinbuild -init - Alternatively, you may set the DARWIN_BUILDROOT environment variable to the - absolute path of that directory. + ERROR: please change your working directory to one initialized by: + darwinbuild -init + Alternatively, you may set the DARWIN_BUILDROOT environment variable to the + absolute path of that directory. - EOB - exit 1 + EOB + exit 1 fi } @@ -80,7 +76,7 @@ function GetBuildVersion() { build=$(echo $X | sed -e 's/^.*~\([0-9]*\)$/\1/') # If the regex fails, it somtimes prints the same line if [ "$build" != "$X" -a "$build" != "" ]; then - # [ seems to things on the left of the -a, + # [ seems to things on the left of the -a, # so do this in a different statement to avoid # errors about non-numeric values of $build if [ "$build" -gt "$maxbuild" ]; then @@ -103,14 +99,14 @@ function CheckoutOrUpdate() { for master_site in $master_sites ; do - if [ ! -d "$destination/.svn" ]; then - echo "Checking out working copy" - mkdir -p "$destination" - svn co "$master_site/$branch" "$destination" && break - else - echo "Updating working copy" - svn up "$destination" && break - fi + if [ ! -d "$destination/.svn" ]; then + echo "Checking out working copy" + mkdir -p "$destination" + svn co "$master_site/$branch" "$destination" && break + else + echo "Updating working copy" + svn up "$destination" && break + fi done } @@ -128,7 +124,7 @@ function Download() { echo "Found $extracted in $destination" return fi - + ### ### Download the sources, ### @@ -143,15 +139,15 @@ function Download() { if [ -d "$srcdir/$proj" ]; then echo "Copying $srcdir/$proj ..." tar czf \ - "$destination/.tmp.${filename}" \ - -C "$srcdir" \ - "$proj" + "$destination/.tmp.${filename}" \ + -C "$srcdir" \ + "$proj" elif [ -d "$srcdir" ]; then echo "Copying $srcdir ..." tar czf \ - "$destination/.tmp.${filename}" \ - -C "$srcdir" \ - . + "$destination/.tmp.${filename}" \ + -C "$srcdir" \ + . else echo "No such directory: $srcdir" break @@ -201,44 +197,44 @@ function InstallRoot() { ### has already been installed. (Test for the presence of a receipt). ### if [ -d "$DARWIN_BUILDROOT/Roots/$Project" ]; then - ProjectAndVersion=$($DARWINXREF $dbfile version "$Project") - bv=$(GetBuildVersion $DARWIN_BUILDROOT/Roots/$Project/$ProjectAndVersion.root*) - if [ -n "$bv" ]; then - SelfBuiltRoot="$DARWIN_BUILDROOT/Roots/$Project/$ProjectAndVersion.root~$bv" - fi + ProjectAndVersion=$($DARWINXREF $dbfile version "$Project") + bv=$(GetBuildVersion $DARWIN_BUILDROOT/Roots/$Project/$ProjectAndVersion.root*) + if [ -n "$bv" ]; then + SelfBuiltRoot="$DARWIN_BUILDROOT/Roots/$Project/$ProjectAndVersion.root~$bv" + fi fi CheckForReceipt "$BuildRoot" "$Project" "root" if [ $? -eq 0 ]; then - # receipt is present. But do we have a newer local build? - CheckIfNewerThanReceipt "$BuildRoot" "$Project" "root" "$SelfBuiltRoot" - if [ $? -eq 0 ]; then - # we're newer. Load us - InstallSelfBuiltRoot=1 - fi + # receipt is present. But do we have a newer local build? + CheckIfNewerThanReceipt "$BuildRoot" "$Project" "root" "$SelfBuiltRoot" + if [ $? -eq 0 ]; then + # we're newer. Load us + InstallSelfBuiltRoot=1 + fi else - # there wasn't a receipt. but if we have a self-built root, we should use it - if [ -n "$SelfBuiltRoot" ]; then - InstallSelfBuiltRoot=1 - else - InstallPreBuiltRoot=1 - fi + # there wasn't a receipt. but if we have a self-built root, we should use it + if [ -n "$SelfBuiltRoot" ]; then + InstallSelfBuiltRoot=1 + else + InstallPreBuiltRoot=1 + fi fi # install a self-built root, or a prebuilt root, or nothing if [ $InstallSelfBuiltRoot -eq 1 ]; then - echo "Copying $Project from $SelfBuiltRoot ..." - ditto "$SelfBuiltRoot" "$BuildRoot" - "$DARWINXREF" register "$Project" "$SelfBuiltRoot" > /dev/null - TouchReceipt "$BuildRoot" "$Project" "root" - return 0 + echo "Copying $Project from $SelfBuiltRoot ..." + ditto "$SelfBuiltRoot" "$BuildRoot" + "$DARWINXREF" register "$Project" "$SelfBuiltRoot" > /dev/null + TouchReceipt "$BuildRoot" "$Project" "root" + return 0 elif [ $InstallPreBuiltRoot -eq 1 ]; then - # install a pre-built root, in inheritance order + # install a pre-built root, in inheritance order while [ "$dbuild" != "" ]; do - sites=$($DARWINXREF $dbfile -b $dbuild binary_sites "$Project") + sites=$($DARWINXREF $dbfile -b $dbuild binary_sites "$Project") Download "$CACHEDIR" \ "$Project.root.tar.gz" \ - "$sites" + "$sites" if [ -f "$CACHEDIR/$Project.root.tar.gz" ]; then cd "$BuildRoot" tar xzf "$CACHEDIR/$Project.root.tar.gz" @@ -248,8 +244,8 @@ function InstallRoot() { > /dev/null CheckForReceipt "$BuildRoot" "$Project" "root" if [ $? -ne 0 ]; then - echo -n | CreateReceipt "$BuildRoot" "$Project" "root" \ - "$CACHEDIR/$Project.root.tar.gz" + echo -n | CreateReceipt "$BuildRoot" "$Project" "root" \ + "$CACHEDIR/$Project.root.tar.gz" fi return 0 fi @@ -257,11 +253,11 @@ function InstallRoot() { dbuild=$($DARWINXREF $dbfile -b $dbuild inherits) fi - # if we didn't find the root for this build, keep looking in the next build - done - # we look through all inherited builds and couldn't actually install anything + # if we didn't find the root for this build, keep looking in the next build + done + # we look through all inherited builds and couldn't actually install anything echo "ERROR: could not find root: $Project" 1>&2 - exit 1 + exit 1 fi # we had a receipt, so no need to install @@ -295,34 +291,34 @@ function InstallHeader() { ### has already been installed. (Test for the presence of a receipt). ### if [ -d "$DARWIN_BUILDROOT/Roots/$Project" ]; then - ProjectAndVersion=$($DARWINXREF $dbfile version "$Project") - bv=$(GetBuildVersion $DARWIN_BUILDROOT/Roots/$Project/$ProjectAndVersion.root*) - if [ -n "$bv" ]; then - SelfBuiltRoot="$DARWIN_BUILDROOT/Roots/$Project/$ProjectAndVersion.root~$bv" - fi + ProjectAndVersion=$($DARWINXREF $dbfile version "$Project") + bv=$(GetBuildVersion $DARWIN_BUILDROOT/Roots/$Project/$ProjectAndVersion.root*) + if [ -n "$bv" ]; then + SelfBuiltRoot="$DARWIN_BUILDROOT/Roots/$Project/$ProjectAndVersion.root~$bv" + fi fi if [ -d "$DARWIN_BUILDROOT/Headers/$Project" ]; then - ProjectAndVersion=$($DARWINXREF $dbfile version "$Project") - bv=$(GetBuildVersion $DARWIN_BUILDROOT/Headers/$Project/$ProjectAndVersion.hdrs*) - if [ -n "$bv" ]; then - SelfBuiltHeader="$DARWIN_BUILDROOT/Headers/$Project/$ProjectAndVersion.hdrs~$bv" - fi + ProjectAndVersion=$($DARWINXREF $dbfile version "$Project") + bv=$(GetBuildVersion $DARWIN_BUILDROOT/Headers/$Project/$ProjectAndVersion.hdrs*) + if [ -n "$bv" ]; then + SelfBuiltHeader="$DARWIN_BUILDROOT/Headers/$Project/$ProjectAndVersion.hdrs~$bv" + fi fi # Install self-built headers only if they're newer than anything # else that's been installed (Headers and Roots) if [ -n "$SelfBuiltHeader" ]; then - CheckIfNewerThanReceipt "$BuildRoot" "$Project" "hdrs" "$SelfBuiltHeader" - if [ $? -eq 0 ]; then + CheckIfNewerThanReceipt "$BuildRoot" "$Project" "hdrs" "$SelfBuiltHeader" + if [ $? -eq 0 ]; then CheckIfNewerThanReceipt "$BuildRoot" "$Project" "root" "$SelfBuiltHeader" if [ $? -eq 0 ]; then # we're newer Headers. Load us InstallSelfBuiltHeader=1 fi - fi + fi fi - + # If we can't find self-built headers, install a self-built root only # if it's newer than anything else that's been installed (Headers and Roots) if [ $InstallSelfBuiltHeader -eq 0 -a -n "$SelfBuiltRoot" ]; then @@ -350,35 +346,35 @@ function InstallHeader() { # install a self-built root, or a prebuilt root, or nothing if [ $InstallSelfBuiltHeader -eq 1 ]; then - echo "Copying $Project from $SelfBuiltHeader ..." - ditto "$SelfBuiltHeader" "$BuildRoot" - "$DARWINXREF" register "$Project" "$SelfBuiltHeader" > /dev/null - TouchReceipt "$BuildRoot" "$Project" "hdrs" - return 0 + echo "Copying $Project from $SelfBuiltHeader ..." + ditto "$SelfBuiltHeader" "$BuildRoot" + "$DARWINXREF" register "$Project" "$SelfBuiltHeader" > /dev/null + TouchReceipt "$BuildRoot" "$Project" "hdrs" + return 0 elif [ $InstallSelfBuiltRoot -eq 1 ]; then - echo "Copying $Project from $SelfBuiltRoot ..." - ditto "$SelfBuiltRoot" "$BuildRoot" - "$DARWINXREF" register "$Project" "$SelfBuiltRoot" > /dev/null - TouchReceipt "$BuildRoot" "$Project" "root" - return 0 + echo "Copying $Project from $SelfBuiltRoot ..." + ditto "$SelfBuiltRoot" "$BuildRoot" + "$DARWINXREF" register "$Project" "$SelfBuiltRoot" > /dev/null + TouchReceipt "$BuildRoot" "$Project" "root" + return 0 elif [ $InstallPreBuiltRoot -eq 1 ]; then - # install a pre-built root, in inheritance order + # install a pre-built root, in inheritance order while [ "$dbuild" != "" ]; do - sites=$($DARWINXREF $dbfile -b $dbuild binary_sites "$Project") + sites=$($DARWINXREF $dbfile -b $dbuild binary_sites "$Project") Download "$CACHEDIR" \ "$Project.hdrs.tar.gz" \ - "$sites" + "$sites" if [ -f "$CACHEDIR/$Project.hdrs.tar.gz" ]; then cd "$BuildRoot" tar xzf "$CACHEDIR/$Project.hdrs.tar.gz" if [ $? -eq 0 ]; then tar tzf "$CACHEDIR/$Project.hdrs.tar.gz" | \ - "$DARWINXREF" register -stdin "$Project" "$BuildRoot" \ + "$DARWINXREF" register -stdin "$Project" "$BuildRoot" \ > /dev/null CheckForReceipt "$BuildRoot" "$Project" "hdrs" if [ $? -ne 0 ]; then - echo -n | CreateReceipt "$BuildRoot" "$Project" "hdrs" \ - "$CACHEDIR/$Project.hdrs.tar.gz" + echo -n | CreateReceipt "$BuildRoot" "$Project" "hdrs" \ + "$CACHEDIR/$Project.hdrs.tar.gz" fi return 0 fi @@ -387,7 +383,7 @@ function InstallHeader() { # try the full root Download "$CACHEDIR" \ "$Project.root.tar.gz" \ - "$sites" + "$sites" if [ -f "$CACHEDIR/$Project.root.tar.gz" ]; then cd "$BuildRoot" tar xzf "$CACHEDIR/$Project.root.tar.gz" @@ -397,8 +393,8 @@ function InstallHeader() { > /dev/null CheckForReceipt "$BuildRoot" "$Project" "root" if [ $? -ne 0 ]; then - echo -n | CreateReceipt "$BuildRoot" "$Project" "root" \ - "$CACHEDIR/$Project.root.tar.gz" + echo -n | CreateReceipt "$BuildRoot" "$Project" "root" \ + "$CACHEDIR/$Project.root.tar.gz" fi return 0 fi @@ -407,11 +403,11 @@ function InstallHeader() { fi fi - # if we didn't find the root for this build, keep looking in the next build - done - # we look through all inherited builds and couldn't actually install anything + # if we didn't find the root for this build, keep looking in the next build + done + # we look through all inherited builds and couldn't actually install anything echo "ERROR: could not find root: $Project" 1>&2 - exit 1 + exit 1 fi # we had a receipt, so nothing was request @@ -424,41 +420,41 @@ RECEIPTDIR=/usr/local/darwinbuild/receipts # For the given project and root type ("root" or "hdrs"), see if # a receipt is present in the build root function CheckForReceipt() { - local BuildRoot="$1" - local Project="$2" - local RootType=".$3" - local receipts="$BuildRoot/$RECEIPTDIR" - - if [ "$RootType" = ".root" ]; then - RootType="" - fi - - if [ -e "$receipts/$Project$RootType" ]; then - return 0 # success - else - return 1 - fi + local BuildRoot="$1" + local Project="$2" + local RootType=".$3" + local receipts="$BuildRoot/$RECEIPTDIR" + + if [ "$RootType" = ".root" ]; then + RootType="" + fi + + if [ -e "$receipts/$Project$RootType" ]; then + return 0 # success + else + return 1 + fi } ### # For the given project and root type ("root" or "hdrs"), touch the # a receipt so that it's timestamp is current function TouchReceipt() { - local BuildRoot="$1" - local Project="$2" - local RootType=".$3" - local receipts="$BuildRoot/$RECEIPTDIR" - - if [ "$RootType" = ".root" ]; then - RootType="" - fi - - if [ -e "$receipts/$Project$RootType" ]; then - touch "$receipts/$Project$RootType" - return 0 # success - else - return 1 - fi + local BuildRoot="$1" + local Project="$2" + local RootType=".$3" + local receipts="$BuildRoot/$RECEIPTDIR" + + if [ "$RootType" = ".root" ]; then + RootType="" + fi + + if [ -e "$receipts/$Project$RootType" ]; then + touch "$receipts/$Project$RootType" + return 0 # success + else + return 1 + fi } ### @@ -467,25 +463,25 @@ function TouchReceipt() { # By definition, something is newer than a non-existent receipt # If CmpDir is "", this will return false (1) function CheckIfNewerThanReceipt() { - local BuildRoot="$1" - local Project="$2" - local RootType=".$3" - local CmpDir="$4" - local receipts="$BuildRoot/$RECEIPTDIR" - - if [ "$RootType" = ".root" ]; then - RootType="" - fi - - if [ -e "$receipts/$Project$RootType" ]; then - if [ "$CmpDir" -nt "$receipts/$Project$RootType" ]; then - return 0 + local BuildRoot="$1" + local Project="$2" + local RootType=".$3" + local CmpDir="$4" + local receipts="$BuildRoot/$RECEIPTDIR" + + if [ "$RootType" = ".root" ]; then + RootType="" + fi + + if [ -e "$receipts/$Project$RootType" ]; then + if [ "$CmpDir" -nt "$receipts/$Project$RootType" ]; then + return 0 + else + return 1 + fi else - return 1 + return 0 fi - else - return 0 - fi } @@ -497,39 +493,39 @@ function CheckIfNewerThanReceipt() { # an optional hash source. The latter would be used to # hash a pre-built tarball instead of the receipt function CreateReceipt() { - local BuildRoot="$1" - local Project="$2" - local RootType=".$3" - local HashSource="$4" + local BuildRoot="$1" + local Project="$2" + local RootType=".$3" + local HashSource="$4" - local receipts="$BuildRoot/$RECEIPTDIR" - local TmpFile=$(mktemp -t "$Project") - local Hash="" + local receipts="$BuildRoot/$RECEIPTDIR" + local TmpFile=$(mktemp -t "$Project") + local Hash="" - if [ "$RootType" = ".root" ]; then - RootType="" - fi + if [ "$RootType" = ".root" ]; then + RootType="" + fi - mkdir -p "$receipts" + mkdir -p "$receipts" - # consume stdin - cat > "$TmpFile" + # consume stdin + cat > "$TmpFile" - if [ -n "$HashSource" ]; then - if [ ! -r "$HashSource" ]; then - echo "ERROR: Could not access $HashSource" 1>&2 - exit 1 + if [ -n "$HashSource" ]; then + if [ ! -r "$HashSource" ]; then + echo "ERROR: Could not access $HashSource" 1>&2 + exit 1 + fi + Hash=$($DIGEST < "$HashSource") + echo "# Hash of $HashSource" >> "$TmpFile" + else + Hash=$($DIGEST < "$TmpFile") fi - Hash=$($DIGEST < "$HashSource") - echo "# Hash of $HashSource" >> "$TmpFile" - else - Hash=$($DIGEST < "$TmpFile") - fi - - cp "$TmpFile" "$receipts/$Hash" - ln -sf "$Hash" "$receipts/$Project$RootType" - rm "$TmpFile" - return 0 + + cp "$TmpFile" "$receipts/$Hash" + ln -sf "$Hash" "$receipts/$Project$RootType" + rm "$TmpFile" + return 0 } # If a directory is empty, return 0 (success) @@ -545,4 +541,3 @@ function IsDirectoryEmpty() { return 0 fi } - From 020462394e012880684f9aab4902ed9f2ecd4bba Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 3 Sep 2018 14:22:05 -0400 Subject: [PATCH 125/382] Remove deprecated code from Xcode check Also fixed an indent error while I was at it. --- darwinbuild/darwinbuild.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index a9d6508..7ae6f15 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -570,10 +570,10 @@ fi ### ### Look for the build tool: make, xcodebuild ### -numfiles=$(echo *.pbxproj *.pbproj *.xcode *.xcodeproj 2> /dev/null ) +numfiles=$(echo *.xcodeproj 2> /dev/null ) if [ -n "$numfiles" ]; then - buildtool="xcodebuild" - export INSTALL_XCODE="YES" + buildtool="xcodebuild" + export INSTALL_XCODE="YES" else buildtool="make" fi From 4cca0da5a644d8f697d468089cceb084935b8c08 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 3 Sep 2018 14:33:48 -0400 Subject: [PATCH 126/382] Add *experimental* support for a separate dependency root directory --- darwinbuild/darwinbuild.common | 14 +++++++++++--- darwinbuild/darwinbuild.in | 32 ++++++++++++++++++++++++-------- 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index ad910f9..2dfaf49 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -184,6 +184,10 @@ function InstallRoot() { local BuildRoot="$1" local Project="$2" local dbuild="$3" + local DepRoot="$4" + if [ -z "$DepRoot" ]; then + DepRoot=$BuildRoot + fi local SelfBuiltRoot="" local InstallSelfBuiltRoot=0 @@ -224,7 +228,7 @@ function InstallRoot() { # install a self-built root, or a prebuilt root, or nothing if [ $InstallSelfBuiltRoot -eq 1 ]; then echo "Copying $Project from $SelfBuiltRoot ..." - ditto "$SelfBuiltRoot" "$BuildRoot" + ditto "$SelfBuiltRoot" "$DepRoot" "$DARWINXREF" register "$Project" "$SelfBuiltRoot" > /dev/null TouchReceipt "$BuildRoot" "$Project" "root" return 0 @@ -276,6 +280,10 @@ function InstallHeader() { local BuildRoot="$1" local Project="$2" local dbuild="$3" + local DepRoot="$4" + if [ -z "$DepRoot" ]; then + DepRoot=$BuildRoot + fi local SelfBuiltRoot="" local SelfBuiltHeader="" @@ -347,13 +355,13 @@ function InstallHeader() { # install a self-built root, or a prebuilt root, or nothing if [ $InstallSelfBuiltHeader -eq 1 ]; then echo "Copying $Project from $SelfBuiltHeader ..." - ditto "$SelfBuiltHeader" "$BuildRoot" + ditto "$SelfBuiltHeader" "$DepRoot" "$DARWINXREF" register "$Project" "$SelfBuiltHeader" > /dev/null TouchReceipt "$BuildRoot" "$Project" "hdrs" return 0 elif [ $InstallSelfBuiltRoot -eq 1 ]; then echo "Copying $Project from $SelfBuiltRoot ..." - ditto "$SelfBuiltRoot" "$BuildRoot" + ditto "$SelfBuiltRoot" "$DepRoot" "$DARWINXREF" register "$Project" "$SelfBuiltRoot" > /dev/null TouchReceipt "$BuildRoot" "$Project" "root" return 0 diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 7ae6f15..8644054 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -479,14 +479,15 @@ REAL_SRCROOT="$BuildRoot/SourceCache/$projnam/$project" REAL_OBJROOT="$BuildRoot/$vartmp/$projnam/$project.obj" REAL_SYMROOT="$BuildRoot/$vartmp/$projnam/$project.sym" REAL_DSTROOT="$BuildRoot/$vartmp/$projnam/$project.root" +REAL_DEPROOT="$BuildRoot/BinaryCache/$projnam" if [ "$nosource" != "YES" ]; then ### ### Remove any pre-existing directories that might be in the way ### and create new directories in their place. ### - rm -Rf "$REAL_SRCROOT" "$REAL_OBJROOT" "$REAL_SYMROOT" "$REAL_DSTROOT" - mkdir -p "$REAL_SRCROOT" "$REAL_OBJROOT" "$REAL_SYMROOT" "$REAL_DSTROOT" + rm -Rf "$REAL_SRCROOT" "$REAL_OBJROOT" "$REAL_SYMROOT" "$REAL_DSTROOT" "$REAL_DEPROOT" + mkdir -p "$REAL_SRCROOT" "$REAL_OBJROOT" "$REAL_SYMROOT" "$REAL_DSTROOT" "$REAL_DEPROOT" ### ### Install the sources and patches into the BuildRoot @@ -509,7 +510,7 @@ if [ "$nosource" != "YES" ]; then fi if [ "$branch" != "" ]; then - mkdir -p "$REAL_SRCROOT" "$REAL_OBJROOT" "$REAL_SYMROOT" "$REAL_DSTROOT" + mkdir -p "$REAL_SRCROOT" "$REAL_OBJROOT" "$REAL_SYMROOT" "$REAL_DSTROOT" "$REAL_DEPROOT" CheckoutOrUpdate "$REAL_SRCROOT" "$branch" "$($DARWINXREF source_sites $projnam)" fi @@ -612,13 +613,15 @@ if [ "$noload" != "YES" ]; then deps=$($DARWINXREF dependencies -build "$projnam") for X in $deps ; do - InstallRoot "$BuildRoot" "$X" "$depsbuild" + if [ "$action" != "installhdrs" ]; then + InstallRoot "$BuildRoot" "$X" "$depsbuild" "$REAL_DEPROOT" + fi done echo "*** Installing Headers ..." deps=$($DARWINXREF dependencies -header "$projnam") for X in $deps ; do - InstallHeader "$BuildRoot" "$X" "$depsbuild" + InstallHeader "$BuildRoot" "$X" "$depsbuild" "$REAL_DEPROOT" done if [ "$loadonly" = "YES" ]; then @@ -658,11 +661,12 @@ export SRCROOT="${REAL_SRCROOT/$prefix/}" export OBJROOT="${REAL_OBJROOT/$prefix/}" export SYMROOT="${REAL_SYMROOT/$prefix/}" export DSTROOT="${REAL_DSTROOT/$prefix/}" +export DEPROOT="${REAL_DEPROOT/$prefix/}" # Hide this variable from the unset -export -n SRCROOT OBJROOT SYMROOT DSTROOT +export -n SRCROOT OBJROOT SYMROOT DSTROOT DEPROOT export -n DARWIN_BUILDROOT DARWINBUILD_BUILD DARWINXREF_DB_FILE export -n USE_CHROOT INSTALL_XCODE @@ -676,7 +680,7 @@ for X in $(printenv) ; do done IFS="$OLDIFS" -export SRCROOT OBJROOT SYMROOT DSTROOT +export SRCROOT OBJROOT SYMROOT DSTROOT DEPROOT export DARWIN_BUILDROOT DARWINBUILD_BUILD DARWINXREF_DB_FILE export USE_CHROOT INSTALL_XCODE @@ -713,6 +717,17 @@ if [ "$buildtool" == "xcodebuild" -a "$configuration" != "" ]; then build_string="$build_string -configuration \"$configuration\"" fi +### +### Write out the xcconfig file to be used with the DEPROOT +### + +cat < $REAL_SRCROOT/darwinbuild.xcconfig +DEPROOT=$DEPROOT + +SYSTEM_HEADER_SEARCH_PATHS = \$(DEPROOT)/usr/include \$(DEPROOT)/usr/local/include \$(inherited) +FRAMEWORK_SEARCH_PATHS = \$(DEPROOT)/System/Library/Frameworks \$(DEPROOT)/System/Library/PrivateFrameworks \$(inherited) +EOF + ### ### Write out the build script that will be used. ### This may or may not be executed in a chroot. @@ -779,11 +794,12 @@ cat <<-EOF >> $SCRIPT echo OBJROOT: '$OBJROOT' echo SYMROOT: '$SYMROOT' echo DSTROOT: '$DSTROOT' + echo DEPROOT: '$DEPROOT' EOF ### ### Add in the build environment variables from darwinxref ### -build_string="$build_string \"SRCROOT=$SRCROOT\" \"OBJROOT=$OBJROOT\" \"SYMROOT=$SYMROOT\" \"DSTROOT=$DSTROOT\"" +build_string="$build_string \"SRCROOT=$SRCROOT\" \"OBJROOT=$OBJROOT\" \"SYMROOT=$SYMROOT\" \"DSTROOT=$DSTROOT\" \"DEPROOT=$DEPROOT\"" XREF_ENV=$($DARWINXREF environment $projnam) OLDIFS="$IFS" From de2a9945abc2784c69ad05a85e9d414c4d94b804 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 3 Sep 2018 14:34:02 -0400 Subject: [PATCH 127/382] Wire deproot functionality up to RC_BuildRoot This is done for backwards compatibility. --- darwinbuild/darwinbuild.in | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 8644054..7d8427d 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -816,9 +816,12 @@ for X in \ done IFS="$OLDIFS" -if [ "$USE_CHROOT" = "NO" ]; then - export RC_BuildRoot=$BuildRoot - build_string="$build_string \"RC_BuildRoot=$BuildRoot\"" +if [ "$USE_CHROOT" = "YES" ]; then + export RC_BuildRoot=$DEPROOT + build_string="$build_string \"RC_BuildRoot=$DEPROOT\"" +else + export RC_BuildRoot=$REAL_DEPROOT + build_string="$build_string \"RC_BuildRoot=$REAL_DEPROOT\"" fi cat <<-EOF >> $SCRIPT From b17c354145e79192d8284058c77aded4757ce36c Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 3 Sep 2018 14:34:45 -0400 Subject: [PATCH 128/382] Remove vestige of darwinup --- darwinup/NOTES | 114 ------------------------------------------------- 1 file changed, 114 deletions(-) delete mode 100644 darwinup/NOTES diff --git a/darwinup/NOTES b/darwinup/NOTES deleted file mode 100644 index 9e9e6d4..0000000 --- a/darwinup/NOTES +++ /dev/null @@ -1,114 +0,0 @@ -darwinup -12-Mar-2010 -Kevin Van Vechten -William Siegrist - -OVERVIEW -======== - -The Darwin Update utility provides a transaction-based mechanism to -install software on the base system that modifies or supersedes existing -system components. Darwin Update is not a "package manager," and does -not specify any package format. Updates can be installed from a directory, -a tar archive, or other formats. - -Darwin Update provides the following: - - * Installation of Darwin components (usually built with DarwinBuild) - * Verification of components previously installed with Darwin Update - * Un-installation of components installed with Darwin Update - -It is a design goal of Darwin Update that all components installed by -this utility can subsequently be uninstalled, leaving the system in its -original state. - - -THE DEPOT -========= - -The Darwin Update utility creates a directory at the root level of the -filesystem (/.DarwinDepot) where it stores its database of currently -installed components, and archived copies of the components they superseded. -This is known as the depot. - -The following files are present in the depot: - -/.DarwinDepot/Database-V100 -SQLite database containing information about all of the archives and files -that have been installed with darwinbuild. - -/.DarwinDepot/Archives/ -If an archive has any data to be installed, it will have a corresponding entry -in this directory. This is known as the backing-store of the archive. -The backing-store is either in a compressed (.tar.bz2) or expanded (directory) -state. The compressed state is always authoritative and the expanded state -is pruned when darwinup exits. The backing store for each archive is named -according to that archive's UUID in the database. - -/.DarwinDepot/Downloads/ -Temporary storage for any remote archives, such as when giving http or -rsync urls to darwinup. - -OPERATIONS -========== - -1. INSTALLATION - -When Darwin Update is used for installing a tar archive (for example), it -will first create two entries in the database. One for the archive to be -installed, and another for the "rollback" archive associated with this -archive. The rollback archive is where all of the base system files and -existing user data are preserved before the new archive is installed. - -A backing-store directory is created for both the new archive and the -rollback archive. Darwin Update extracts the tar archive into the newly -created backing store directory. This effectively pre-allocates space on -the root volume for the installation. - -Next, the location is compared against the software currently installed. -Records are inserted into the database for each file in the new archive. -Additionally, records are also inserted into the rollback archive -representing the initial state of the system. (Note, that if a new file -is identical to a file that Darwin Update has previously installed, no -rollback file will be added since the record of the previously installed -file is sufficient). - -Once all the records have been committed to the database, each file that -was added to the rollback archive is moved into the backing-store. At this -point the rollback archive backing store directory is compacted into a -.tar.bz2 archive. - -Finally, each new file is moved from the backing store to its location on -the root filesystem. - -Installation is complete. - -2. UNINSTALLATION - -When Darwin Update is used for uninstalling an archive, it will iterate -through all the files in that archive as recorded in the database. - -If another newer archive has installed a file in the same location, then -no action is taken because the archive to be uninstalled no longer has a -claim on that file. However, if there are no newer archives claiming this -file, it will be uninstalled. - -When a file is uninstalled, Darwin Update searches the database for the -previous version of the file, whether archived from the base system, or -installed in an earlier archive. If the file is identical to the previous -version, then no action is taken. However, if the previous version differs -it will need to be restored. - -During restoration, if the file did not previously exist at all, it will be -deleted. Otherwise, the rollback archive backing store is expanded, and the -file is moved from teh rollback archive backing store onto the root filesystem. -The previous file has been restored. - -At this point Darwin Update deletes the record of the previous file from the -database. - -Once all files affected by the uninstalled archive have been deleted or -restored, the archive and its list of files are deleted from the database. - -Uninstallation is complete. - From a92ce4ab9a48bfa367f608e3e8c61cdfc1bcdecc Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 3 Sep 2018 14:50:04 -0400 Subject: [PATCH 129/382] Write out xcconfig file during -loadonly as well --- darwinbuild/darwinbuild.in | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 7d8427d..f41ced0 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -625,7 +625,19 @@ if [ "$noload" != "YES" ]; then done if [ "$loadonly" = "YES" ]; then - exit + cat < $REAL_SRCROOT/darwinbuild.xcconfig +DEPROOT=$REAL_DEPROOT + +SYSTEM_HEADER_SEARCH_PATHS = \$(DEPROOT)/usr/include \$(DEPROOT)/usr/local/include \$(inherited) +FRAMEWORK_SEARCH_PATHS = \$(DEPROOT)/System/Library/Frameworks \$(DEPROOT)/System/Library/PrivateFrameworks \$(inherited) +EOF + + echo + echo "xcconfig file containing paths to staged dependencies is here:" + echo " $REAL_SRCROOT/darwinbuild.xcconfig" + echo + + exit fi fi From 385a55ea9e6eb27ebd89ca6521451ce1c3d3eabc Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 3 Sep 2018 14:50:18 -0400 Subject: [PATCH 130/382] Don't bother initializing the chroot when doing a -loadonly --- darwinbuild/darwinbuild.in | 1 + 1 file changed, 1 insertion(+) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index f41ced0..ac456b5 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -315,6 +315,7 @@ for ARG in "$@"; do noload="YES" elif [ "$ARG" == "-loadonly" ]; then loadonly="YES" + export USE_CHROOT="NO" elif [ "$ARG" == "-logdeps" ]; then logdeps="YES" elif [ "$ARG" == "-nosource" ]; then From 51305064918896e27dfc1f2e761bca3bd269a923 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 3 Sep 2018 15:06:44 -0400 Subject: [PATCH 131/382] Add -chroot option to darwinbuild I will be adding a mechanism to specify the default chroot option next commit, and I wanted to add an override mechanism first. --- darwinbuild/darwinbuild.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index ac456b5..82dffa9 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -192,7 +192,7 @@ function PrintUsage() { usage: $(basename $0) [action] [options] [] actions: [-headers] [-fetch] [-source] [-load] [-loadonly] options: [-build=X] [-target=X] [-configuration=X] - [-logdeps] [-nochroot] [-nopatch] [-noload] + [-logdeps] [-nochroot] [-chroot] [-nopatch] [-noload] [-depsbuild=X [-depsbuild=Y]] [-nosource] EOF @@ -265,6 +265,7 @@ fi ### -noload Don't load dependencies into the chroot. ### Has no effect if -nochroot is specified. ### -nochroot Do not chroot into the BuildRoot when building +### -chroot Always chroot into the BuildRoot when building ### -target=X The makefile or xcode target to build ### -configuration=X Specify the build configuration to use ### -build=X Specify the darwin build number to buld, e.g. 8B15 @@ -303,6 +304,9 @@ for ARG in "$@"; do elif [ "$ARG" == "-nochroot" ]; then export INSTALL_XCODE="NO" export USE_CHROOT="NO" + elif [ "$ARG" == "-chroot" ]; then + unset INSTALL_XCODE + export USE_CHROOT="YES" elif [ "$ARG" == "-nopatch" ]; then nopatch="YES" elif [ "$ARG" == "-load" ]; then From 0944b81ba87b6fb043aa8586f7cd26dc60feb412 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 3 Sep 2018 15:09:39 -0400 Subject: [PATCH 132/382] Add check for no_chroot_default file If this file is present, then the chroot will be disabled by default. If it is missing, then the chroot will be used by default. --- darwinbuild/darwinbuild.in | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 82dffa9..d8b04b0 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -246,6 +246,17 @@ if [ ! -e $SourceCache ]; then mkdir -p "$SourceCache" fi +### +### Set the default value for USE_CHROOT. +### If the .build/no_chroot_default file is present, do not enter +### the the chroot unless the -chroot flag was specified. +### +if [ -f .build/no_chroot_default ]; then + export USE_CHROOT="NO" +else + export USE_CHROOT="YES" +fi + ### ### Interpret our arguments: ### From 2aa6510ab21ab78f3b012ef76c7d760b32c99af4 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 3 Sep 2018 15:28:04 -0400 Subject: [PATCH 133/382] Add copyright header to darwinbuild-create-tarball --- darwinbuild/darwinbuild-create-tarball | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/darwinbuild/darwinbuild-create-tarball b/darwinbuild/darwinbuild-create-tarball index 9c41b28..87a22b0 100755 --- a/darwinbuild/darwinbuild-create-tarball +++ b/darwinbuild/darwinbuild-create-tarball @@ -1,4 +1,31 @@ #!/usr/bin/env python +# +# Copyright (c) 2017 William Kent. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of +# its contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY ITS CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# from __future__ import print_function import sys From c700f2e3fb0f8f74c08ae89136ee6910f48fc7ef Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 3 Sep 2018 15:29:49 -0400 Subject: [PATCH 134/382] Set ADDITIONAL_SDKS in the xcconfig as well --- darwinbuild/darwinbuild.in | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index d8b04b0..5492d4e 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -642,8 +642,9 @@ if [ "$noload" != "YES" ]; then if [ "$loadonly" = "YES" ]; then cat < $REAL_SRCROOT/darwinbuild.xcconfig -DEPROOT=$REAL_DEPROOT +DEPROOT = $REAL_DEPROOT +ADDITIONAL_SDKS = \$(DEPROOT) SYSTEM_HEADER_SEARCH_PATHS = \$(DEPROOT)/usr/include \$(DEPROOT)/usr/local/include \$(inherited) FRAMEWORK_SEARCH_PATHS = \$(DEPROOT)/System/Library/Frameworks \$(DEPROOT)/System/Library/PrivateFrameworks \$(inherited) EOF @@ -750,8 +751,9 @@ fi ### cat < $REAL_SRCROOT/darwinbuild.xcconfig -DEPROOT=$DEPROOT +DEPROOT = $REAL_DEPROOT +ADDITIONAL_SDKS = \$(DEPROOT) SYSTEM_HEADER_SEARCH_PATHS = \$(DEPROOT)/usr/include \$(DEPROOT)/usr/local/include \$(inherited) FRAMEWORK_SEARCH_PATHS = \$(DEPROOT)/System/Library/Frameworks \$(DEPROOT)/System/Library/PrivateFrameworks \$(inherited) EOF From 0abc065cdc0b6611fe4aa306559c9d307ae53414 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 3 Sep 2018 19:03:22 -0400 Subject: [PATCH 135/382] Add kernel-mode compatibility to darwinbuild.xcconfig Previously, the xcconfig files generated were compatible with user-mode projects only; they would create build errors in kext projects. No more. --- darwinbuild/darwinbuild.in | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 5492d4e..2f08c9e 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -645,8 +645,16 @@ if [ "$noload" != "YES" ]; then DEPROOT = $REAL_DEPROOT ADDITIONAL_SDKS = \$(DEPROOT) -SYSTEM_HEADER_SEARCH_PATHS = \$(DEPROOT)/usr/include \$(DEPROOT)/usr/local/include \$(inherited) -FRAMEWORK_SEARCH_PATHS = \$(DEPROOT)/System/Library/Frameworks \$(DEPROOT)/System/Library/PrivateFrameworks \$(inherited) +SYSTEM_HEADER_SEARCH_PATHS_USER = \$(DEPROOT)/usr/include \$(DEPROOT)/usr/local/include +SYSTEM_HEADER_SEARCH_PATHS_KERNEL = \$(DEPROOT)/System/Library/Frameworks/Kernel.framework/PrivateHeaders \$(DEPROOT)/System/Library/Frameworks/Kernel.framework/Headers +FRAMEWORK_SEARCH_PATHS_USER = \$(DEPROOT)/System/Library/Frameworks \$(DEPROOT)/System/Library/PrivateFrameworks + +// Default to user-mode unless \$(DARWINBUILD_SDK_MODE) is set to "KERNEL". +SYSTEM_HEADER_SEARCH_PATHS_ = \$(SYSTEM_HEADER_SEARCH_PATHS_USER) +FRAMEWORK_SEARCH_PATHS_ = \$(FRAMEWORK_SEARCH_PATHS_USER) + +SYSTEM_HEADER_SEARCH_PATHS = \$(SYSTEM_HEADER_SEARCH_PATHS_\$(DARWINBUILD_SDK_MODE)) \$(inherited) +FRAMEWORK_SEARCH_PATHS = \$(FRAMEWORK_SEARCH_PATHS_\$(DARWINBUILD_SDK_MODE)) \$(inherited) EOF echo @@ -754,8 +762,16 @@ cat < $REAL_SRCROOT/darwinbuild.xcconfig DEPROOT = $REAL_DEPROOT ADDITIONAL_SDKS = \$(DEPROOT) -SYSTEM_HEADER_SEARCH_PATHS = \$(DEPROOT)/usr/include \$(DEPROOT)/usr/local/include \$(inherited) -FRAMEWORK_SEARCH_PATHS = \$(DEPROOT)/System/Library/Frameworks \$(DEPROOT)/System/Library/PrivateFrameworks \$(inherited) +SYSTEM_HEADER_SEARCH_PATHS_USER = \$(DEPROOT)/usr/include \$(DEPROOT)/usr/local/include +SYSTEM_HEADER_SEARCH_PATHS_KERNEL = \$(DEPROOT)/System/Library/Frameworks/Kernel.framework/PrivateHeaders \$(DEPROOT)/System/Library/Frameworks/Kernel.framework/Headers +FRAMEWORK_SEARCH_PATHS_USER = \$(DEPROOT)/System/Library/Frameworks \$(DEPROOT)/System/Library/PrivateFrameworks + +// Default to user-mode unless \$(DARWINBUILD_SDK_MODE) is set to "KERNEL". +SYSTEM_HEADER_SEARCH_PATHS_ = \$(SYSTEM_HEADER_SEARCH_PATHS_USER) +FRAMEWORK_SEARCH_PATHS_ = \$(FRAMEWORK_SEARCH_PATHS_USER) + +SYSTEM_HEADER_SEARCH_PATHS = \$(SYSTEM_HEADER_SEARCH_PATHS_\$(DARWINBUILD_SDK_MODE)) \$(inherited) +FRAMEWORK_SEARCH_PATHS = \$(FRAMEWORK_SEARCH_PATHS_\$(DARWINBUILD_SDK_MODE)) \$(inherited) EOF ### From 672b2d7051902e1d1bdda1f9478bc8c113ba13fb Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 3 Sep 2018 19:40:56 -0400 Subject: [PATCH 136/382] Fix DEPROOT usage errors --- darwinbuild/darwinbuild.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 2f08c9e..0d58d00 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -642,7 +642,7 @@ if [ "$noload" != "YES" ]; then if [ "$loadonly" = "YES" ]; then cat < $REAL_SRCROOT/darwinbuild.xcconfig -DEPROOT = $REAL_DEPROOT +DEPROOT = $DEPROOT ADDITIONAL_SDKS = \$(DEPROOT) SYSTEM_HEADER_SEARCH_PATHS_USER = \$(DEPROOT)/usr/include \$(DEPROOT)/usr/local/include @@ -738,7 +738,7 @@ fi build_string="" if [ "$buildtool" == "xcodebuild" -a $INSTALL_XCODE == "YES" ]; then build_string="-sdk $platform" - build_string="$build_string ADDITIONAL_SDKS=\"$BuildRoot\"" + build_string="$build_string ADDITIONAL_SDKS=\"$DEPROOT\"" fi if [ "$buildtool" == "xcodebuild" -a "$target" != "" ]; then build_string="$build_string -target \"$target\"" @@ -759,7 +759,7 @@ fi ### cat < $REAL_SRCROOT/darwinbuild.xcconfig -DEPROOT = $REAL_DEPROOT +DEPROOT = $DEPROOT ADDITIONAL_SDKS = \$(DEPROOT) SYSTEM_HEADER_SEARCH_PATHS_USER = \$(DEPROOT)/usr/include \$(DEPROOT)/usr/local/include From b501f969fadd7c8e1bc6bc526836c5480b2d43fa Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 3 Sep 2018 20:00:54 -0400 Subject: [PATCH 137/382] Remove isdir check from darwinbuild-create-tarball This check gave a false-positive if used on symbolic links to directories. This led to a frustrating round of debugging, wondering why CoreFoundation.h was not being found, when what happened was that the create-tarball script had stripped out the symlinks from within CoreFoundation.framework --- darwinbuild/darwinbuild-create-tarball | 5 ----- 1 file changed, 5 deletions(-) diff --git a/darwinbuild/darwinbuild-create-tarball b/darwinbuild/darwinbuild-create-tarball index 87a22b0..1701765 100755 --- a/darwinbuild/darwinbuild-create-tarball +++ b/darwinbuild/darwinbuild-create-tarball @@ -79,11 +79,6 @@ counter = 0 for filename in all_files: if filename == '': continue - # Don't try to add empty directories to the tarball. - # This would only occur when the directory in question - # is a submodule; Git otherwise tracks files only. - if os.path.isdir(str(filename)): continue - counter += 1 if (counter % 1000) == 0: print('Processed', counter, 'files...') From f497cb2d7502713865d850d600aaeceb2d7c78e9 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 3 Sep 2018 20:14:59 -0400 Subject: [PATCH 138/382] Fix erroneous variable usage --- darwinbuild/darwinbuild.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 0d58d00..32679bc 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -642,7 +642,7 @@ if [ "$noload" != "YES" ]; then if [ "$loadonly" = "YES" ]; then cat < $REAL_SRCROOT/darwinbuild.xcconfig -DEPROOT = $DEPROOT +DEPROOT = $REAL_DEPROOT ADDITIONAL_SDKS = \$(DEPROOT) SYSTEM_HEADER_SEARCH_PATHS_USER = \$(DEPROOT)/usr/include \$(DEPROOT)/usr/local/include From d73b4fa8cbdf6a7bbec27842f5d383219c7cb907 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 4 Sep 2018 18:37:56 -0400 Subject: [PATCH 139/382] Fix inclusion of user-mode private headers --- darwinbuild/darwinbuild.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 32679bc..6efd141 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -645,7 +645,7 @@ if [ "$noload" != "YES" ]; then DEPROOT = $REAL_DEPROOT ADDITIONAL_SDKS = \$(DEPROOT) -SYSTEM_HEADER_SEARCH_PATHS_USER = \$(DEPROOT)/usr/include \$(DEPROOT)/usr/local/include +SYSTEM_HEADER_SEARCH_PATHS_USER = \$(DEPROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \$(DEPROOT)/usr/include \$(DEPROOT)/usr/local/include SYSTEM_HEADER_SEARCH_PATHS_KERNEL = \$(DEPROOT)/System/Library/Frameworks/Kernel.framework/PrivateHeaders \$(DEPROOT)/System/Library/Frameworks/Kernel.framework/Headers FRAMEWORK_SEARCH_PATHS_USER = \$(DEPROOT)/System/Library/Frameworks \$(DEPROOT)/System/Library/PrivateFrameworks @@ -762,7 +762,7 @@ cat < $REAL_SRCROOT/darwinbuild.xcconfig DEPROOT = $DEPROOT ADDITIONAL_SDKS = \$(DEPROOT) -SYSTEM_HEADER_SEARCH_PATHS_USER = \$(DEPROOT)/usr/include \$(DEPROOT)/usr/local/include +SYSTEM_HEADER_SEARCH_PATHS_USER = \$(DEPROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \$(DEPROOT)/usr/include \$(DEPROOT)/usr/local/include SYSTEM_HEADER_SEARCH_PATHS_KERNEL = \$(DEPROOT)/System/Library/Frameworks/Kernel.framework/PrivateHeaders \$(DEPROOT)/System/Library/Frameworks/Kernel.framework/Headers FRAMEWORK_SEARCH_PATHS_USER = \$(DEPROOT)/System/Library/Frameworks \$(DEPROOT)/System/Library/PrivateFrameworks From 89167e4f76347be59525e145bcbe439593400df5 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 4 Sep 2018 19:39:29 -0400 Subject: [PATCH 140/382] Add the currently running kernel to the chroot The dtrace command-line tool requires this. --- darwinbuild/createChroot | 1 + 1 file changed, 1 insertion(+) diff --git a/darwinbuild/createChroot b/darwinbuild/createChroot index cc0a288..0623533 100755 --- a/darwinbuild/createChroot +++ b/darwinbuild/createChroot @@ -19,6 +19,7 @@ EXTRACOPY=( \ /System/Library/PrivateFrameworks \ /System/Library/DTDs \ /System/Library/Fonts \ + /System/Library/Kernels \ /System/Library/Keyboard\ Layouts \ /System/Library/Perl \ /System/Library/Tcl \ From 590629d4e9f072b901e2af1a77fe070f6966a24a Mon Sep 17 00:00:00 2001 From: William Kent Date: Wed, 5 Sep 2018 14:57:06 -0400 Subject: [PATCH 141/382] Don't let fetch-from-github download an HTML error page This will confuse tar later on. --- darwinbuild/fetch-from-github | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/darwinbuild/fetch-from-github b/darwinbuild/fetch-from-github index 2e7c986..8e5ae94 100755 --- a/darwinbuild/fetch-from-github +++ b/darwinbuild/fetch-from-github @@ -59,15 +59,6 @@ GITHUB_PROJECT=$(python $EXTRACT_SCRIPT_FILENAME $DARWINBUILD_PLIST $PROJECT_NAM GITHUB_URL=https://github.com/${GITHUB_PROJECT}/archive/${PROJECT_VERSION}.tar.gz -echo -n "Downloading $GITHUB_URL " -curl -Ls -o "${SOURCES_DIR}/${PROJECT_NAME}-${PROJECT_VERSION}.tar.gz" "${GITHUB_URL}" -CURL_STATUS=$? - rm -f $EXTRACT_SCRIPT_FILENAME -if [ $CURL_STATUS = 0 ]; then - echo "- OK" - exit 0 -else - echo "- not found" - exit 1 -fi +echo "Downloading $GITHUB_URL ..." +exec curl -fLs -o "${SOURCES_DIR}/${PROJECT_NAME}-${PROJECT_VERSION}.tar.gz" "${GITHUB_URL}" From c8768ce8b7f50533916d2b4f78dbf32018a7fcd5 Mon Sep 17 00:00:00 2001 From: William Kent Date: Wed, 5 Sep 2018 14:59:08 -0400 Subject: [PATCH 142/382] Error out if the tarball could not be found --- darwinbuild/darwinbuild.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 6efd141..ac22fca 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -462,6 +462,11 @@ if [ "$nosource" != "YES" ]; then $DATADIR/fetch-from-github "$github_dxref_plist" $github_projname $github_projversion "$SourceCache" fi + if [ ! -f "$SourceCache/$filename" ]; then + echo "ERROR: Source tarball could not be found: $projnam" 1>&2 + exit 1 + fi + patchfilenames=$($DARWINXREF patchfiles $projnam) for p in $patchfilenames; do Download "$SourceCache" "$p" "$($DARWINXREF patch_sites $projnam)" From c1878682466ad4579d64fc897505f3675db71540 Mon Sep 17 00:00:00 2001 From: William Kent Date: Wed, 5 Sep 2018 15:39:02 -0400 Subject: [PATCH 143/382] Rewrite fetch-from-github in Python This change makes it possible for the script to handle projects with repository names that don't match (such as PureDarwin/launchd-and-libxpc). --- darwinbuild/fetch-from-github | 112 ++++++++++++++++------------------ 1 file changed, 51 insertions(+), 61 deletions(-) diff --git a/darwinbuild/fetch-from-github b/darwinbuild/fetch-from-github index 8e5ae94..1f8e209 100755 --- a/darwinbuild/fetch-from-github +++ b/darwinbuild/fetch-from-github @@ -1,64 +1,54 @@ -#!/bin/bash -# -# Copyright (c) 2017 William Kent. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of -# its contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY ITS CONTRIBUTORS "AS IS" AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR -# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# +#!/usr/bin/python -DARWINBUILD_PLIST=$1 -PROJECT_NAME=$2 -PROJECT_VERSION=$3 -SOURCES_DIR=$4 - -EXTRACT_SCRIPT_FILENAME=$(mktemp /tmp/darwinbuild-fetch-from-github.XXXXXXXXXX) -cat > $EXTRACT_SCRIPT_FILENAME < /dev/null || { - echo Python extraction script failed 1>&2 - rm $EXTRACT_SCRIPT_FILENAME - exit 1 -} - -GITHUB_PROJECT=$(python $EXTRACT_SCRIPT_FILENAME $DARWINBUILD_PLIST $PROJECT_NAME) -[ "$GITHUB_PROJECT" = "" ] && exit - -GITHUB_URL=https://github.com/${GITHUB_PROJECT}/archive/${PROJECT_VERSION}.tar.gz - -rm -f $EXTRACT_SCRIPT_FILENAME -echo "Downloading $GITHUB_URL ..." -exec curl -fLs -o "${SOURCES_DIR}/${PROJECT_NAME}-${PROJECT_VERSION}.tar.gz" "${GITHUB_URL}" +import subprocess +import tarfile +import tempfile +import shutil + +def popen_exec(argv, cwd=None): + return subprocess.check_output(argv, universal_newlines=True, cwd=cwd).decode('utf-8') + +if len(sys.argv) < 4: + print('Internal tool used by darwinbuild, please do not invoke directly', file=sys.stderr) + exit(1) + +plist_filename = sys.argv[1] +project_name = sys.argv[2] +project_version = sys.argv[3] +sources_dir = sys.argv[4] +print(sys.argv) +darwinbuild_plist = plistlib.readPlist(plist_filename) + +project_data = darwinbuild_plist['projects'][project_name] +if 'github' in project_data: + url = None + repo_basename = None + exact_filename = True + + github_data = project_data['github'] + if isinstance(github_data, str): + repo_basename = project_name + '-' + project_version + url = 'https://github.com/{}/archive/{}-{}.tar.gz'.format(github_data, project_name, project_version) + elif isinstance(github_data, dict): + repo_parts = github_data['repo'].split('/') + repo_basename = repo_parts[1] + '-' + github_data['archive'] + url = 'https://github.com/{}/archive/{}.tar.gz'.format(github_data['repo'], github_data['archive']) + exact_filename = False + else: + raise Exception('github data not string or dictionary') + + tarball_filename = project_name + '-' + project_version + '.tar.gz' + download_path = os.path.join(sources_dir, tarball_filename if exact_filename else tarball_filename + '.orig') + print('Downloading', url, '...') + popen_exec(['/usr/bin/curl', '-fLs', '-o', download_path, url]) + + if not exact_filename: + temp_dir = tempfile.mkdtemp(prefix='darwinbuild-fetch-from-github') + popen_exec(['/usr/bin/tar', 'xf', os.path.join(sources_dir, tarball_filename + '.orig')], cwd=temp_dir) + shutil.move(os.path.join(temp_dir, repo_basename), os.path.join(temp_dir, project_name + '-' + project_version)) + popen_exec(['/usr/bin/tar', 'czf', os.path.join(sources_dir, tarball_filename), project_name + '-' + project_version], cwd=temp_dir) + shutil.rmtree(temp_dir, ignore_errors=True) + os.remove(os.path.join(sources_dir, tarball_filename + '.orig')) From 00410dc2e0ccee1ac362c27cab7793c177dcdd49 Mon Sep 17 00:00:00 2001 From: William Kent Date: Wed, 5 Sep 2018 15:46:02 -0400 Subject: [PATCH 144/382] Give key more logical name --- darwinbuild/fetch-from-github | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/darwinbuild/fetch-from-github b/darwinbuild/fetch-from-github index 1f8e209..654f834 100755 --- a/darwinbuild/fetch-from-github +++ b/darwinbuild/fetch-from-github @@ -34,8 +34,8 @@ if 'github' in project_data: url = 'https://github.com/{}/archive/{}-{}.tar.gz'.format(github_data, project_name, project_version) elif isinstance(github_data, dict): repo_parts = github_data['repo'].split('/') - repo_basename = repo_parts[1] + '-' + github_data['archive'] - url = 'https://github.com/{}/archive/{}.tar.gz'.format(github_data['repo'], github_data['archive']) + repo_basename = repo_parts[1] + '-' + github_data['tag'] + url = 'https://github.com/{}/archive/{}.tar.gz'.format(github_data['repo'], github_data['tag']) exact_filename = False else: raise Exception('github data not string or dictionary') From 96dd0527526f3c22d4a5eb7f86fbc8efa8de00e9 Mon Sep 17 00:00:00 2001 From: William Kent Date: Wed, 5 Sep 2018 15:46:12 -0400 Subject: [PATCH 145/382] Remove debug-print statement --- darwinbuild/fetch-from-github | 1 - 1 file changed, 1 deletion(-) diff --git a/darwinbuild/fetch-from-github b/darwinbuild/fetch-from-github index 654f834..ed5fa79 100755 --- a/darwinbuild/fetch-from-github +++ b/darwinbuild/fetch-from-github @@ -19,7 +19,6 @@ plist_filename = sys.argv[1] project_name = sys.argv[2] project_version = sys.argv[3] sources_dir = sys.argv[4] -print(sys.argv) darwinbuild_plist = plistlib.readPlist(plist_filename) project_data = darwinbuild_plist['projects'][project_name] From babd0a207efb83358e260963b8e2c427df770b49 Mon Sep 17 00:00:00 2001 From: William Kent Date: Wed, 5 Sep 2018 16:07:11 -0400 Subject: [PATCH 146/382] Greatly simplify fetch-from-github script --- darwinbuild/fetch-from-github | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/darwinbuild/fetch-from-github b/darwinbuild/fetch-from-github index ed5fa79..d26fee1 100755 --- a/darwinbuild/fetch-from-github +++ b/darwinbuild/fetch-from-github @@ -8,9 +8,6 @@ import tarfile import tempfile import shutil -def popen_exec(argv, cwd=None): - return subprocess.check_output(argv, universal_newlines=True, cwd=cwd).decode('utf-8') - if len(sys.argv) < 4: print('Internal tool used by darwinbuild, please do not invoke directly', file=sys.stderr) exit(1) @@ -24,30 +21,34 @@ darwinbuild_plist = plistlib.readPlist(plist_filename) project_data = darwinbuild_plist['projects'][project_name] if 'github' in project_data: url = None + tag = project_version repo_basename = None - exact_filename = True github_data = project_data['github'] + if isinstance(github_data, str): - repo_basename = project_name + '-' + project_version - url = 'https://github.com/{}/archive/{}-{}.tar.gz'.format(github_data, project_name, project_version) + repo_parts = github_data.split('/') + repo_basename = repo_parts[1] + url = 'https://github.com/{}/archive/{}.tar.gz'.format(github_data, project_version) elif isinstance(github_data, dict): repo_parts = github_data['repo'].split('/') - repo_basename = repo_parts[1] + '-' + github_data['tag'] + repo_basename = repo_parts[1] url = 'https://github.com/{}/archive/{}.tar.gz'.format(github_data['repo'], github_data['tag']) - exact_filename = False + tag = github_data['tag'] else: raise Exception('github data not string or dictionary') tarball_filename = project_name + '-' + project_version + '.tar.gz' - download_path = os.path.join(sources_dir, tarball_filename if exact_filename else tarball_filename + '.orig') + download_path = os.path.join(sources_dir, tarball_filename) print('Downloading', url, '...') - popen_exec(['/usr/bin/curl', '-fLs', '-o', download_path, url]) + curl_exitcode = subprocess.call(['/usr/bin/curl', '-fLs', '-o', download_path, url]) + if curl_exitcode == 22: + # This occurs if the server returned a 404 or other error. + exit(1) - if not exact_filename: + if repo_basename != project_name or (tag is not None and tag != project_version): temp_dir = tempfile.mkdtemp(prefix='darwinbuild-fetch-from-github') - popen_exec(['/usr/bin/tar', 'xf', os.path.join(sources_dir, tarball_filename + '.orig')], cwd=temp_dir) - shutil.move(os.path.join(temp_dir, repo_basename), os.path.join(temp_dir, project_name + '-' + project_version)) - popen_exec(['/usr/bin/tar', 'czf', os.path.join(sources_dir, tarball_filename), project_name + '-' + project_version], cwd=temp_dir) + subprocess.check_output(['/usr/bin/tar', 'xf', os.path.join(sources_dir, tarball_filename)], cwd=temp_dir) + shutil.move(os.path.join(temp_dir, repo_basename + '-' + tag), os.path.join(temp_dir, project_name + '-' + project_version)) + subprocess.check_output(['/usr/bin/tar', 'czf', os.path.join(sources_dir, tarball_filename), project_name + '-' + project_version], cwd=temp_dir) shutil.rmtree(temp_dir, ignore_errors=True) - os.remove(os.path.join(sources_dir, tarball_filename + '.orig')) From 79d072460d18a79862029b3b84dccb4e12f145ea Mon Sep 17 00:00:00 2001 From: William Kent Date: Wed, 5 Sep 2018 16:12:29 -0400 Subject: [PATCH 147/382] Remove unnecessary test tag is never None, since it has a proper default value set. --- darwinbuild/fetch-from-github | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/fetch-from-github b/darwinbuild/fetch-from-github index d26fee1..9d1149a 100755 --- a/darwinbuild/fetch-from-github +++ b/darwinbuild/fetch-from-github @@ -46,7 +46,7 @@ if 'github' in project_data: # This occurs if the server returned a 404 or other error. exit(1) - if repo_basename != project_name or (tag is not None and tag != project_version): + if repo_basename != project_name or tag != project_version: temp_dir = tempfile.mkdtemp(prefix='darwinbuild-fetch-from-github') subprocess.check_output(['/usr/bin/tar', 'xf', os.path.join(sources_dir, tarball_filename)], cwd=temp_dir) shutil.move(os.path.join(temp_dir, repo_basename + '-' + tag), os.path.join(temp_dir, project_name + '-' + project_version)) From bf9b27f575ed548db2a8cb55727e8036d15cb3a6 Mon Sep 17 00:00:00 2001 From: William Kent Date: Wed, 5 Sep 2018 18:49:16 -0400 Subject: [PATCH 148/382] Improve error handling --- darwinbuild/fetch-from-github | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/fetch-from-github b/darwinbuild/fetch-from-github index 9d1149a..be021eb 100755 --- a/darwinbuild/fetch-from-github +++ b/darwinbuild/fetch-from-github @@ -42,7 +42,7 @@ if 'github' in project_data: download_path = os.path.join(sources_dir, tarball_filename) print('Downloading', url, '...') curl_exitcode = subprocess.call(['/usr/bin/curl', '-fLs', '-o', download_path, url]) - if curl_exitcode == 22: + if curl_exitcode != 0: # This occurs if the server returned a 404 or other error. exit(1) From 0b612b2ec5783f7e9c8e643fed1113d20c4b8991 Mon Sep 17 00:00:00 2001 From: William Kent Date: Wed, 5 Sep 2018 19:43:55 -0400 Subject: [PATCH 149/382] Add darwinbuild-codesign script This script aids in running codesign over the build artifacts output by a darwinbuild run (because codesigning inside the chroot is not possible). --- darwinbuild/darwinbuild-codesign | 165 +++++++++++++++++++++++++++++++ 1 file changed, 165 insertions(+) create mode 100755 darwinbuild/darwinbuild-codesign diff --git a/darwinbuild/darwinbuild-codesign b/darwinbuild/darwinbuild-codesign new file mode 100755 index 0000000..97603aa --- /dev/null +++ b/darwinbuild/darwinbuild-codesign @@ -0,0 +1,165 @@ +#!/usr/bin/env python +# +# Copyright (c) 2017 William Kent. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of +# its contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY ITS CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +from __future__ import print_function +import sys, os, re +import subprocess +import plistlib + +if len(sys.argv) < 2: + print('usage:', sys.argv[0], 'project-version', file=sys.stderr) + print(' ', sys.argv[0], 'project-version~build', file=sys.stderr) + print('', file=sys.stderr) + print('Codesigns the root generated by the given project using the file', file=sys.stderr) + print('"darwinbuild-codesign.plist" in the SRCROOT of that project.', file=sys.stderr) + exit(1) + +darwin_buildroot = os.getcwd() +if os.getenv('DARWIN_BUILDROOT') is not None: + darwin_buildroot = os.getenv('DARWIN_BUILDROOT') + +if not (os.path.isdir(os.path.join(darwin_buildroot, 'Roots')) and \ + os.path.isdir(os.path.join(darwin_buildroot, 'Sources')) and \ + os.path.isdir(os.path.join(darwin_buildroot, 'Symbols')) and \ + os.path.isdir(os.path.join(darwin_buildroot, 'Headers')) and \ + os.path.isdir(os.path.join(darwin_buildroot, 'Logs'))): + print('ERROR: please change your working directory to one initialized by:', file=sys.stderr) + print('darwinbuild -init ', file=sys.stderr) + print('Alternatively, you may set the DARWIN_BUILDROOT environment variable to the', file=sys.stderr) + print('absolute path of that directory.', file=sys.stderr) + exit(1) + +if not os.path.isdir(os.readlink(os.path.join(darwin_buildroot, 'BuildRoot'))): + try: + print('Attaching build root disk image...') + subprocess.check_call(['hdiutil', 'attach', '.build/buildroot.sparsebundle', '-readwrite', '-owners', 'on'], cwd=darwin_buildroot, stdout=None) + except Exception, e: + print('Could not attach buildroot.sparsebundle:', e, file=sys.stderr) + exit(1) + +project_name_and_version = sys.argv[1] +project_build = None +if len(project_name_and_version.split('~')) == 2: + parts = project_name_and_version.split('~') + project_name_and_version = parts[0] + project_build = parts[1] + +project_name = project_name_and_version.split('-')[0] +roots_dir = os.path.join(darwin_buildroot, 'Roots', project_name) + +if project_build is None: + possible_builds = next(os.walk(roots_dir))[1] + + largest_build_num = 0 + for dirname in possible_builds: + if dirname.startswith(project_name_and_version + '.root'): + this_build_num = int(dirname.split('~')[1]) + if this_build_num > largest_build_num: + largest_build_num = this_build_num + project_build = str(this_build_num) + +print('Using', project_name_and_version + '~' + project_build, '...') +project_root = os.path.join(roots_dir, project_name_and_version + '.root~' + project_build) + +codesign_plist = None +srcroot = os.path.join(darwin_buildroot, 'BuildRoot', 'SourceCache', project_name, project_name_and_version) +try: + codesign_plist = plistlib.readPlist(os.path.join(srcroot, 'darwinbuild-codesign.plist')) +except Exception, e: + print('Could not read darwinbuild-codesign.plist:', e, file=sys.stderr) + exit(1) + +################################################################################ + +def safe_get(dict, key, default=None): + if key in dict: + return dict[key] + else: + return default + +def get_bundle_identifier(bundle_path): + info_plist_path = os.path.join(bundle_path, 'Contents', 'Info.plist') + if os.path.exists(info_plist_path): + info_plist = plistlib.readPlist(info_plist_path) + return safe_get(info_plist, 'CFBundleIdentifier') + + return None + +default_certificate = safe_get(codesign_plist, 'certificate') +if default_certificate is None: + print('Default certificate must be provided (use "certificate" key in top-level of plist)', file=sys.stderr) + exit(1) + +default_hardened_runtime = safe_get(codesign_plist, 'hardened_runtime', default=False) + +for (filename, value) in codesign_plist['files'].items(): + if filename[0] == '/': + filename = filename[1:] + filename = os.path.join(project_root, filename) + + certificate = default_certificate + identifier = None + entitlements = None + hardened_runtime = default_hardened_runtime + dr = None + + if isinstance(value, bool): + pass # all default values + elif isinstance(value, dict): + certificate = safe_get(value, 'certificate', default=default_certificate) + identifier = safe_get(value, 'identifier') + entitlements = safe_get(value, 'entitlements') + if entitlements is not None: + entitlements = os.path.join(srcroot, entitlements) + hardened_runtime = bool(safe_get(value, 'hardened_runtime', default=default_hardened_runtime)) + dr = safe_get(value, 'dr') + else: + print('Error in darwinbuild-codesign.plist: Values in "files" dictionary must be booleans or dictionaries only') + exit(1) + + if identifier is None and os.isdir(filename): + identifier = get_bundle_identifier(filename) + + codesign_argv = ['/usr/bin/codesign', '-s', certificate, '-f'] + if identifier is not None: + codesign_argv.append('-i') + codesign_argv.append(identifier) + if dr is not None: + codesign_argv.append('-r') + codesign_argv.append(dr) + if entitlements is not None: + codesign_argv.append('--entitlements') + codesign_argv.append(entitlements) + if hardened_runtime: + codesign_argv.append('-o') + codesign_argv.append('runtime') + codesign_argv.append(filename) + + print(' '.join(codesign_argv)) + subprocess.check_call(codesign_argv) From 0a1857aa90e7ac91c2b7a1e29eabfaef1ec1d49d Mon Sep 17 00:00:00 2001 From: William Kent Date: Wed, 5 Sep 2018 19:49:33 -0400 Subject: [PATCH 150/382] Disable code signing when calling xcodebuild Attempting to sign during xcodebuild when building in the chroot will break the build every time. --- darwinbuild/darwinbuild.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index ac22fca..627dcec 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -759,6 +759,10 @@ if [ "$buildtool" == "xcodebuild" -a "$configuration" != "" ]; then build_string="$build_string -configuration \"$configuration\"" fi +if [ "$buildtool" == "xcodebuild" ]; then + build_string="$build_string CODE_SIGN_IDENTITY=\"\"" +fi + ### ### Write out the xcconfig file to be used with the DEPROOT ### From 15ff8e72124346719ce9cb45f90a8983a8be43fb Mon Sep 17 00:00:00 2001 From: William Kent Date: Wed, 5 Sep 2018 19:53:44 -0400 Subject: [PATCH 151/382] Fix minor error in darwinbuild-codesign --- darwinbuild/darwinbuild-codesign | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild-codesign b/darwinbuild/darwinbuild-codesign index 97603aa..c051b2f 100755 --- a/darwinbuild/darwinbuild-codesign +++ b/darwinbuild/darwinbuild-codesign @@ -143,7 +143,7 @@ for (filename, value) in codesign_plist['files'].items(): print('Error in darwinbuild-codesign.plist: Values in "files" dictionary must be booleans or dictionaries only') exit(1) - if identifier is None and os.isdir(filename): + if identifier is None and os.path.isdir(filename): identifier = get_bundle_identifier(filename) codesign_argv = ['/usr/bin/codesign', '-s', certificate, '-f'] From 358d15404346ea31bf68ce48b1c8ee34ddfe0ed5 Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 6 Sep 2018 12:39:35 -0400 Subject: [PATCH 152/382] Add explicit directory support to darwinbuild-codesign This change makes it possible to sign the output of a Travis CI build, which does not create a local darwinbuild Roots/SourceCache combo. --- darwinbuild/darwinbuild-codesign | 116 +++++++++++++++++-------------- 1 file changed, 62 insertions(+), 54 deletions(-) diff --git a/darwinbuild/darwinbuild-codesign b/darwinbuild/darwinbuild-codesign index c051b2f..9e43aca 100755 --- a/darwinbuild/darwinbuild-codesign +++ b/darwinbuild/darwinbuild-codesign @@ -31,64 +31,72 @@ from __future__ import print_function import sys, os, re import subprocess import plistlib - -if len(sys.argv) < 2: - print('usage:', sys.argv[0], 'project-version', file=sys.stderr) - print(' ', sys.argv[0], 'project-version~build', file=sys.stderr) - print('', file=sys.stderr) - print('Codesigns the root generated by the given project using the file', file=sys.stderr) - print('"darwinbuild-codesign.plist" in the SRCROOT of that project.', file=sys.stderr) - exit(1) - -darwin_buildroot = os.getcwd() -if os.getenv('DARWIN_BUILDROOT') is not None: - darwin_buildroot = os.getenv('DARWIN_BUILDROOT') - -if not (os.path.isdir(os.path.join(darwin_buildroot, 'Roots')) and \ - os.path.isdir(os.path.join(darwin_buildroot, 'Sources')) and \ - os.path.isdir(os.path.join(darwin_buildroot, 'Symbols')) and \ - os.path.isdir(os.path.join(darwin_buildroot, 'Headers')) and \ - os.path.isdir(os.path.join(darwin_buildroot, 'Logs'))): - print('ERROR: please change your working directory to one initialized by:', file=sys.stderr) - print('darwinbuild -init ', file=sys.stderr) - print('Alternatively, you may set the DARWIN_BUILDROOT environment variable to the', file=sys.stderr) - print('absolute path of that directory.', file=sys.stderr) - exit(1) - -if not os.path.isdir(os.readlink(os.path.join(darwin_buildroot, 'BuildRoot'))): - try: - print('Attaching build root disk image...') - subprocess.check_call(['hdiutil', 'attach', '.build/buildroot.sparsebundle', '-readwrite', '-owners', 'on'], cwd=darwin_buildroot, stdout=None) - except Exception, e: - print('Could not attach buildroot.sparsebundle:', e, file=sys.stderr) +import argparse + +parser = argparse.ArgumentParser(description='Code-signs a darwinbuild root or Xcode DSTROOT') +parser.add_argument('-d', '--dstroot', help='Code-sign the files in this directory') +parser.add_argument('-s', '--srcroot', help='Path to the sources corresponding to the dstroot') +parser.add_argument('-p', '--project', help='Code-sign this darwinbuild output root') + +args = parser.parse_args() +project_root = args.dstroot +srcroot = args.srcroot + +if args.project is not None: + darwin_buildroot = os.getcwd() + if os.getenv('DARWIN_BUILDROOT') is not None: + darwin_buildroot = os.getenv('DARWIN_BUILDROOT') + + if not (os.path.isdir(os.path.join(darwin_buildroot, 'Roots')) and \ + os.path.isdir(os.path.join(darwin_buildroot, 'Sources')) and \ + os.path.isdir(os.path.join(darwin_buildroot, 'Symbols')) and \ + os.path.isdir(os.path.join(darwin_buildroot, 'Headers')) and \ + os.path.isdir(os.path.join(darwin_buildroot, 'Logs'))): + print('ERROR: Could not find darwinbuild root, this is required when using --project', file=sys.stderr) + print('Please change your working directory to one initialized by:', file=sys.stderr) + print('darwinbuild -init ', file=sys.stderr) + print('Alternatively, you may set the DARWIN_BUILDROOT environment variable to the', file=sys.stderr) + print('absolute path of that directory.', file=sys.stderr) exit(1) -project_name_and_version = sys.argv[1] -project_build = None -if len(project_name_and_version.split('~')) == 2: - parts = project_name_and_version.split('~') - project_name_and_version = parts[0] - project_build = parts[1] - -project_name = project_name_and_version.split('-')[0] -roots_dir = os.path.join(darwin_buildroot, 'Roots', project_name) - -if project_build is None: - possible_builds = next(os.walk(roots_dir))[1] - - largest_build_num = 0 - for dirname in possible_builds: - if dirname.startswith(project_name_and_version + '.root'): - this_build_num = int(dirname.split('~')[1]) - if this_build_num > largest_build_num: - largest_build_num = this_build_num - project_build = str(this_build_num) - -print('Using', project_name_and_version + '~' + project_build, '...') -project_root = os.path.join(roots_dir, project_name_and_version + '.root~' + project_build) + if not os.path.isdir(os.readlink(os.path.join(darwin_buildroot, 'BuildRoot'))): + try: + print('Attaching build root disk image...') + subprocess.check_call(['hdiutil', 'attach', '.build/buildroot.sparsebundle', '-readwrite', '-owners', 'on'], cwd=darwin_buildroot, stdout=None) + except Exception, e: + print('Could not attach buildroot.sparsebundle:', e, file=sys.stderr) + exit(1) + + project_name_and_version = args.project + project_build = None + if len(project_name_and_version.split('~')) == 2: + parts = project_name_and_version.split('~') + project_name_and_version = parts[0] + project_build = parts[1] + + project_name = project_name_and_version.split('-')[0] + roots_dir = os.path.join(darwin_buildroot, 'Roots', project_name) + + if project_build is None: + possible_builds = next(os.walk(roots_dir))[1] + + largest_build_num = 0 + for dirname in possible_builds: + if dirname.startswith(project_name_and_version + '.root'): + this_build_num = int(dirname.split('~')[1]) + if this_build_num > largest_build_num: + largest_build_num = this_build_num + project_build = str(this_build_num) + + print('Using', project_name_and_version + '~' + project_build, '...') + project_root = os.path.join(roots_dir, project_name_and_version + '.root~' + project_build) + srcroot = os.path.join(darwin_buildroot, 'BuildRoot', 'SourceCache', project_name, project_name_and_version) + +if project_root is None or srcroot is None: + print('ERROR: Either -p, or both -d and -s must be specified', file=sys.stderr) + exit(1) codesign_plist = None -srcroot = os.path.join(darwin_buildroot, 'BuildRoot', 'SourceCache', project_name, project_name_and_version) try: codesign_plist = plistlib.readPlist(os.path.join(srcroot, 'darwinbuild-codesign.plist')) except Exception, e: From 348587d1140e8f6cba2b1210f8921f22aea0b03b Mon Sep 17 00:00:00 2001 From: William Kent Date: Sat, 6 Oct 2018 15:06:01 -0400 Subject: [PATCH 153/382] Add Mojave support to installXcode_Modern --- darwinbuild/installXcode_Modern | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/darwinbuild/installXcode_Modern b/darwinbuild/installXcode_Modern index c075dfd..f9a0233 100755 --- a/darwinbuild/installXcode_Modern +++ b/darwinbuild/installXcode_Modern @@ -64,7 +64,24 @@ mkdir -p $BUILDROOT/$(getconf DARWIN_USER_DIR) mkdir -p $BUILDROOT/$(getconf DARWIN_USER_TEMP_DIR) mkdir -p $BUILDROOT/$(getconf DARWIN_USER_CACHE_DIR) -if [[ "$HOST_DARWIN_VERSION" =~ ^10.13 ]]; then +if [[ "$HOST_DARWIN_VERSION" =~ ^10.14 ]]; then + mkdir -p $BUILDROOT/private/var/db + ln -s /Applications/Xcode.app/Contents/Developer $BUILDROOT/private/var/db/xcode_select_link + + # macOS versions >= 10.13 do not allow processes with entitlements + # to run inside a chroot. Therefore, I must strip the entitlements + # and re-sign xcodebuild. Hopefully, this won't break anything. + cat < $BUILDROOT/private/tmp/empty.entitlements + + + + + + +EOF + + codesign -s - -f --entitlements $BUILDROOT/private/tmp/empty.entitlements $BUILDROOT/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild +elif [[ "$HOST_DARWIN_VERSION" =~ ^10.13 ]]; then rm $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk mv $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk From 7688df1a013a60415b57d50c963dabfdc5c1af5b Mon Sep 17 00:00:00 2001 From: William Kent Date: Sat, 6 Oct 2018 15:07:15 -0400 Subject: [PATCH 154/382] Add support for non-standard Xcode locations --- darwinbuild/installXcode_Modern | 50 ++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/darwinbuild/installXcode_Modern b/darwinbuild/installXcode_Modern index f9a0233..666cac7 100755 --- a/darwinbuild/installXcode_Modern +++ b/darwinbuild/installXcode_Modern @@ -38,21 +38,27 @@ HOST_DARWIN_VERSION=$(sw_vers -productVersion) BUILDROOT="$1" mkdir -p "$BUILDROOT" -do_ditto /Applications/Xcode.app/Contents/Frameworks -do_ditto /Applications/Xcode.app/Contents/SharedFrameworks -do_ditto /Applications/Xcode.app/Contents/OtherFrameworks -do_ditto /Applications/Xcode.app/Contents/PlugIns -do_ditto /Applications/Xcode.app/Contents/XPCServices +XCODE_PATH=$(xcode-select --print-path) +if [[ "$XCODE_PATH" =~ Contents/Developer$ ]]; then + # Get the path to the root of the Xcode.app bundle. + XCODE_PATH=$(dirname $(dirname $XCODE_PATH)) +fi + +do_ditto $XCODE_PATH/Contents/Frameworks +do_ditto $XCODE_PATH/Contents/SharedFrameworks +do_ditto $XCODE_PATH/Contents/OtherFrameworks +do_ditto $XCODE_PATH/Contents/PlugIns +do_ditto $XCODE_PATH/Contents/XPCServices -do_ditto /Applications/Xcode.app/Contents/Developer/Library -do_ditto /Applications/Xcode.app/Contents/Developer/Makefiles -do_ditto /Applications/Xcode.app/Contents/Developer/Toolchains -do_ditto /Applications/Xcode.app/Contents/Developer/Tools -do_ditto /Applications/Xcode.app/Contents/Developer/usr +do_ditto $XCODE_PATH/Contents/Developer/Library +do_ditto $XCODE_PATH/Contents/Developer/Makefiles +do_ditto $XCODE_PATH/Contents/Developer/Toolchains +do_ditto $XCODE_PATH/Contents/Developer/Tools +do_ditto $XCODE_PATH/Contents/Developer/usr -do_ditto /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform -ditto /Applications/Xcode.app/Contents/Info.plist $BUILDROOT/Applications/Xcode.app/Contents -ditto /Applications/Xcode.app/Contents/version.plist $BUILDROOT/Applications/Xcode.app/Contents +do_ditto $XCODE_PATH/Contents/Developer/Platforms/MacOSX.platform +ditto $XCODE_PATH/Contents/Info.plist $BUILDROOT$XCODE_PATH/Contents +ditto $XCODE_PATH/Contents/version.plist $BUILDROOT$XCODE_PATH/Contents mkdir -p $BUILDROOT/System/Library/CoreServices ditto /System/Library/CoreServices/SystemVersion.plist $BUILDROOT/System/Library/CoreServices @@ -66,7 +72,7 @@ mkdir -p $BUILDROOT/$(getconf DARWIN_USER_CACHE_DIR) if [[ "$HOST_DARWIN_VERSION" =~ ^10.14 ]]; then mkdir -p $BUILDROOT/private/var/db - ln -s /Applications/Xcode.app/Contents/Developer $BUILDROOT/private/var/db/xcode_select_link + ln -s $XCODE_PATH/Contents/Developer $BUILDROOT/private/var/db/xcode_select_link # macOS versions >= 10.13 do not allow processes with entitlements # to run inside a chroot. Therefore, I must strip the entitlements @@ -80,18 +86,18 @@ if [[ "$HOST_DARWIN_VERSION" =~ ^10.14 ]]; then EOF - codesign -s - -f --entitlements $BUILDROOT/private/tmp/empty.entitlements $BUILDROOT/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild + codesign -s - -f --entitlements $BUILDROOT/private/tmp/empty.entitlements $BUILDROOT$XCODE_PATH/Contents/Developer/usr/bin/xcodebuild elif [[ "$HOST_DARWIN_VERSION" =~ ^10.13 ]]; then - rm $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk - mv $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk + rm $BUILDROOT$XCODE_PATH/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk + mv $BUILDROOT$XCODE_PATH/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk $BUILDROOT$XCODE_PATH/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk mkdir -p $BUILDROOT/private/var/db - ln -s /Applications/Xcode.app/Contents/Developer $BUILDROOT/private/var/db/xcode_select_link + ln -s $XCODE_PATH/Contents/Developer $BUILDROOT/private/var/db/xcode_select_link if [ -x /usr/local/share/darwinbuild/xcbuild ]; then # If it is available, overwrite Apple's xcodebuild with xcbuild. # This helps avoid the issue described in the 'else' block below. - cp -f /usr/local/share/darwinbuild/xcbuild $BUILDROOT/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild + cp -f /usr/local/share/darwinbuild/xcbuild $BUILDROOT$XCODE_PATH/Contents/Developer/usr/bin/xcodebuild else # High Sierra does not allow processes with entitlements to run inside a chroot. # Therefore, I must strip the entitlements and re-sign xcodebuild. @@ -105,9 +111,9 @@ elif [[ "$HOST_DARWIN_VERSION" =~ ^10.13 ]]; then EOF - codesign -s - -f --entitlements $BUILDROOT/private/tmp/empty.entitlements $BUILDROOT/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild + codesign -s - -f --entitlements $BUILDROOT/private/tmp/empty.entitlements $BUILDROOT$XCODE_PATH/Contents/Developer/usr/bin/xcodebuild fi elif [[ "$HOST_DARWIN_VERSION" =~ ^10.12 ]]; then - rm $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk - mv $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk $BUILDROOT/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk + rm $BUILDROOT$XCODE_PATH/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk + mv $BUILDROOT$XCODE_PATH/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk $BUILDROOT$XCODE_PATH/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk fi From e8d540aa7ae29ef3ace9f25ff6fc6b014205b174 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sat, 6 Oct 2018 15:08:55 -0400 Subject: [PATCH 155/382] Fix typo in fetch-from-github script --- darwinbuild/fetch-from-github | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/fetch-from-github b/darwinbuild/fetch-from-github index be021eb..c2f80f6 100755 --- a/darwinbuild/fetch-from-github +++ b/darwinbuild/fetch-from-github @@ -8,7 +8,7 @@ import tarfile import tempfile import shutil -if len(sys.argv) < 4: +if len(sys.argv) < 5: print('Internal tool used by darwinbuild, please do not invoke directly', file=sys.stderr) exit(1) From 3f85735c478b75ff13e040bf50a5f51bd4a7f32d Mon Sep 17 00:00:00 2001 From: William Kent Date: Sat, 6 Oct 2018 15:10:07 -0400 Subject: [PATCH 156/382] Resolve Xcode 10.0 update issues --- darwinbuild.xcodeproj/project.pbxproj | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index a59a771..a05d9ad 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -1774,7 +1774,7 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; - LastUpgradeCheck = 0930; + LastUpgradeCheck = 1000; ORGANIZATIONNAME = "The DarwinBuild Project"; TargetAttributes = { 1FAB24D32043A61B00329636 = { @@ -2715,6 +2715,7 @@ 1FAB24D42043A61B00329636 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = 3P242C9ES5; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -2724,6 +2725,7 @@ 1FAB24D52043A61B00329636 /* Public */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = 3P242C9ES5; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -2733,6 +2735,7 @@ 1FAB24D62043A61B00329636 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = 3P242C9ES5; PRODUCT_NAME = "$(TARGET_NAME)"; From 85c3305595ff231a4856047bcf67552d2c50b48f Mon Sep 17 00:00:00 2001 From: William Kent Date: Sat, 6 Oct 2018 15:12:10 -0400 Subject: [PATCH 157/382] Update project to Xcode 10 format Also disabled the deprecated ALWAYS_SEARCH_USER_PATHS setting. --- darwinbuild.xcodeproj/project.pbxproj | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index a05d9ad..4f7eadc 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 51; objects = { /* Begin PBXAggregateTarget section */ @@ -1785,7 +1785,7 @@ }; }; buildConfigurationList = 726DD14C10965C5700D5AEAB /* Build configuration list for PBXProject "darwinbuild" */; - compatibilityVersion = "Xcode 3.2"; + compatibilityVersion = "Xcode 10.0"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( @@ -3592,6 +3592,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; @@ -3755,6 +3756,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; @@ -3814,6 +3816,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; From c4f71786ec7e47404267a7f227be3b20844df6c0 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sat, 6 Oct 2018 15:19:48 -0400 Subject: [PATCH 158/382] Add Mojave support to setXcodePlatform script --- darwinbuild/setXcodePlatform | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/darwinbuild/setXcodePlatform b/darwinbuild/setXcodePlatform index 8802607..cdfce56 100755 --- a/darwinbuild/setXcodePlatform +++ b/darwinbuild/setXcodePlatform @@ -34,8 +34,9 @@ set -e HOST_DARWIN_VERSION=$(sw_vers -productVersion | sed -Ee 's,(10\.[0-9]{2}).*,\1,') -[ "$HOST_DARWIN_VERSION" = "10.13" ] && echo 'macosx10.13' > $1/.build/platform -[ "$HOST_DARWIN_VERSION" = "10.12" ] && echo 'macosx10.12' > $1/.build/platform +[[ "$HOST_DARWIN_VERSION" =~ ^10.14 ]] && echo 'macosx10.14' > $1/.build/platform +[[ "$HOST_DARWIN_VERSION" =~ ^10.13 ]] && echo 'macosx10.13' > $1/.build/platform +[[ "$HOST_DARWIN_VERSION" =~ ^10.12 ]] && echo 'macosx10.12' > $1/.build/platform if [ ! -f $1/.build/platform ]; then echo Unrecognized macOS version 1>&2 From c095e5705206b22d243ccb3c76a22674582e10f1 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sat, 6 Oct 2018 15:23:33 -0400 Subject: [PATCH 159/382] Use adhoc code-signing instead of disabling it This also works inside the chroot. --- darwinbuild/darwinbuild.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 627dcec..3b9c7c0 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -760,7 +760,7 @@ if [ "$buildtool" == "xcodebuild" -a "$configuration" != "" ]; then fi if [ "$buildtool" == "xcodebuild" ]; then - build_string="$build_string CODE_SIGN_IDENTITY=\"\"" + build_string="$build_string CODE_SIGN_IDENTITY=-" fi ### From 61e3674ecae718945c368c7e0fded34ff51363a1 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sat, 6 Oct 2018 15:34:36 -0400 Subject: [PATCH 160/382] Add explicit ordering support to darwinbuild-codesign This helps ensure that inner nested bundles get signed before outer ones, as Apple's documentation states is required. --- darwinbuild/darwinbuild-codesign | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/darwinbuild/darwinbuild-codesign b/darwinbuild/darwinbuild-codesign index 9e43aca..ab67a93 100755 --- a/darwinbuild/darwinbuild-codesign +++ b/darwinbuild/darwinbuild-codesign @@ -126,6 +126,7 @@ if default_certificate is None: default_hardened_runtime = safe_get(codesign_plist, 'hardened_runtime', default=False) +signing_map = {} for (filename, value) in codesign_plist['files'].items(): if filename[0] == '/': filename = filename[1:] @@ -136,6 +137,7 @@ for (filename, value) in codesign_plist['files'].items(): entitlements = None hardened_runtime = default_hardened_runtime dr = None + order = 0xFFFF if isinstance(value, bool): pass # all default values @@ -147,6 +149,13 @@ for (filename, value) in codesign_plist['files'].items(): entitlements = os.path.join(srcroot, entitlements) hardened_runtime = bool(safe_get(value, 'hardened_runtime', default=default_hardened_runtime)) dr = safe_get(value, 'dr') + order = safe_get(value, 'order', default=order) + + if isinstance(order, str): + order = int(order) + elif not isinstance(order, int): + print('Error in darwinbuild-codesign.plist: "order" key must have integer value (or string convertible to integer)') + exit(1) else: print('Error in darwinbuild-codesign.plist: Values in "files" dictionary must be booleans or dictionaries only') exit(1) @@ -169,5 +178,14 @@ for (filename, value) in codesign_plist['files'].items(): codesign_argv.append('runtime') codesign_argv.append(filename) - print(' '.join(codesign_argv)) - subprocess.check_call(codesign_argv) + if order not in signing_map: + signing_map[order] = [] + signing_map[order].append(codesign_argv) + +key_vector = signing_map.keys() +key_vector.sort(cmp=lambda a, b: cmp(a, b)) + +for order_index in key_vector: + for argv in signing_map[order_index]: + print(' '.join(argv)) + subprocess.check_call(argv) From 600cab099377577c52be1680818a8f3999a5b685 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sat, 6 Oct 2018 15:37:12 -0400 Subject: [PATCH 161/382] Improve darwinbuild-codesign help text --- darwinbuild/darwinbuild-codesign | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/darwinbuild/darwinbuild-codesign b/darwinbuild/darwinbuild-codesign index ab67a93..4599cc6 100755 --- a/darwinbuild/darwinbuild-codesign +++ b/darwinbuild/darwinbuild-codesign @@ -34,9 +34,9 @@ import plistlib import argparse parser = argparse.ArgumentParser(description='Code-signs a darwinbuild root or Xcode DSTROOT') -parser.add_argument('-d', '--dstroot', help='Code-sign the files in this directory') -parser.add_argument('-s', '--srcroot', help='Path to the sources corresponding to the dstroot') -parser.add_argument('-p', '--project', help='Code-sign this darwinbuild output root') +parser.add_argument('-d', '--dstroot', metavar='', help='Code-sign the files in this directory') +parser.add_argument('-s', '--srcroot', metavar='', help='Path to the sources corresponding to the dstroot') +parser.add_argument('-p', '--project', metavar='-', help='Code-sign this darwinbuild output root') args = parser.parse_args() project_root = args.dstroot From 519a0f38e66b743bf867828573faf380895c13ae Mon Sep 17 00:00:00 2001 From: William Kent Date: Sat, 13 Oct 2018 12:50:15 -0400 Subject: [PATCH 162/382] Update URL in README --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index 724f5e9..f7122b3 100644 --- a/README +++ b/README @@ -42,7 +42,7 @@ Due to the constant development of darwinbuild, the only version you should be working with is the master branch of the Git repository[1]. This should always be stable enough for building projects. -[1] +[1] =============== 2. Installation From caae551de85950f25fa53db950657615356885a2 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sat, 13 Oct 2018 13:16:45 -0400 Subject: [PATCH 163/382] First draft of creating_darwinbuild_plists.md --- Documentation/creating_darwinbuild_plists.md | 81 ++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 Documentation/creating_darwinbuild_plists.md diff --git a/Documentation/creating_darwinbuild_plists.md b/Documentation/creating_darwinbuild_plists.md new file mode 100644 index 0000000..ba68fa2 --- /dev/null +++ b/Documentation/creating_darwinbuild_plists.md @@ -0,0 +1,81 @@ +# Creating Build Definition Property Lists + +To use darwinbuild, you will need to create an XML-format property list that +cntains the build definitions. A barebones example looks like this: + +```xml + + + + + source_sites + + + + build + PD17D4 + + environment + + MACOSX_DEPLOYMENT_TARGET + 10.13 + SDKROOT + macosx10.13 + + + projects + + xnubuild + + version + 10.13 + + + + +``` + +Here is a key-by-key explanation of the above property list: + +* **`source_sites`** + This is a list of URLs from which darwinbuild will attempt to download the + source code for the projects it will build. Each URL will be tried in the order + it is specified here. The desired filename will be appended to each URL. If + the download returns a 404 or other error, the next URL will be tried. + + The only exception to the above logic is in the case of `opensource.apple.com`. + If the URL to download from contains the substring `opensource.apple.com/tarballs`, + then the project name (the part of the filename to download before the first hyphen) + will be prepended before the filename, like this: `opensource.apple.com/tarballs//`. + This is done to align with the way Apple organizes their website. +* **`build`** + This is the identifier of the “build” of PureDarwin the property list represents. + While there is no requirements for its format, it *must* match the filename exactly + (minus the `.plist` extension). Otherwise, darwinbuild will be unable to correctly + load the build definitions. +* **`environment`** + This dictionary contains a 1:1 mapping of environment variables that will + be propagated into each build command invoked by darwinbuild. +* **`projects`** + This is where the meat of the build definition is. The contents of + this dictionary will be described under “Project Definitions,” below. + +### Project Definitions + +A “project” is the core of the darwinbuild dependency model. The name of the project +is specified as the key in the `projects` dictionary. A project’s name is used to +refer to the project from both the command line, and from other projects as dependencies. + +The “version” of a project is in practice an arbitrary string, and is specified as +the `version` key in the project definition. Apple open-source releases +use a dot-separated sequence of one to five positive numbers here, but the logic behind +the changing of these numbers has never been publicly described. There is no strict +interpretation of which version is “newer” than another; if the version number has changed +in any way, the the project sources have changed and must be rebuilt. darwinbuild supports +keeping multiple versions of the same project in the Sources subdirectory of the build directory. + +The version does, however, determine the name of the source tarball to be downloaded. +It will always have the following format: `-.tar.gz`. The source +tarball must be available from one of the `source_sites` under this filename. If none +of the `source_sites` contain a copy of this file, darwinbuild also supports downloading +source archives from GitHub Releases; this is detailed in the “GitHub Releases Support” section. From 70b4f8d1544c9ab1042cbab2b81a6578009b065c Mon Sep 17 00:00:00 2001 From: InSaneDarwin Date: Mon, 15 Oct 2018 19:50:29 -0400 Subject: [PATCH 164/382] fix typo --- Documentation/creating_darwinbuild_plists.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/creating_darwinbuild_plists.md b/Documentation/creating_darwinbuild_plists.md index ba68fa2..ae98924 100644 --- a/Documentation/creating_darwinbuild_plists.md +++ b/Documentation/creating_darwinbuild_plists.md @@ -1,7 +1,7 @@ # Creating Build Definition Property Lists To use darwinbuild, you will need to create an XML-format property list that -cntains the build definitions. A barebones example looks like this: +contains the build definitions. A barebones example looks like this: ```xml From 3193e6cd35917ddff4b88748a036e10ffc7cc751 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 26 Nov 2018 19:34:35 -0500 Subject: [PATCH 165/382] Don't segregate installed roots by project This messes up the receipt-based mechanism for detecting if the installed roots are up-to-date, because the receipt files aren't aware of the per-project binary directories. --- darwinbuild/darwinbuild.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 3b9c7c0..3451ec2 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -500,7 +500,7 @@ REAL_SRCROOT="$BuildRoot/SourceCache/$projnam/$project" REAL_OBJROOT="$BuildRoot/$vartmp/$projnam/$project.obj" REAL_SYMROOT="$BuildRoot/$vartmp/$projnam/$project.sym" REAL_DSTROOT="$BuildRoot/$vartmp/$projnam/$project.root" -REAL_DEPROOT="$BuildRoot/BinaryCache/$projnam" +REAL_DEPROOT="$BuildRoot/InstalledRoots" if [ "$nosource" != "YES" ]; then ### From 0d6ff1f4108ca3d9e5bd7b5db801d2e70317e498 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 26 Nov 2018 19:37:05 -0500 Subject: [PATCH 166/382] Update contents of darwinbuild.xcconfig This will no longer produce spurious warnings in Xcode (caused by the use of the now-broken ADDITIONAL_SDKS build setting), as well as greatly simplify the process used to locate the installed roots. --- darwinbuild/darwinbuild.in | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 3451ec2..d46d188 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -649,17 +649,8 @@ if [ "$noload" != "YES" ]; then cat < $REAL_SRCROOT/darwinbuild.xcconfig DEPROOT = $REAL_DEPROOT -ADDITIONAL_SDKS = \$(DEPROOT) -SYSTEM_HEADER_SEARCH_PATHS_USER = \$(DEPROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \$(DEPROOT)/usr/include \$(DEPROOT)/usr/local/include -SYSTEM_HEADER_SEARCH_PATHS_KERNEL = \$(DEPROOT)/System/Library/Frameworks/Kernel.framework/PrivateHeaders \$(DEPROOT)/System/Library/Frameworks/Kernel.framework/Headers -FRAMEWORK_SEARCH_PATHS_USER = \$(DEPROOT)/System/Library/Frameworks \$(DEPROOT)/System/Library/PrivateFrameworks - -// Default to user-mode unless \$(DARWINBUILD_SDK_MODE) is set to "KERNEL". -SYSTEM_HEADER_SEARCH_PATHS_ = \$(SYSTEM_HEADER_SEARCH_PATHS_USER) -FRAMEWORK_SEARCH_PATHS_ = \$(FRAMEWORK_SEARCH_PATHS_USER) - -SYSTEM_HEADER_SEARCH_PATHS = \$(SYSTEM_HEADER_SEARCH_PATHS_\$(DARWINBUILD_SDK_MODE)) \$(inherited) -FRAMEWORK_SEARCH_PATHS = \$(FRAMEWORK_SEARCH_PATHS_\$(DARWINBUILD_SDK_MODE)) \$(inherited) +SYSTEM_HEADER_SEARCH_PATHS = \$(DEPROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \$(DEPROOT)/usr/include \$(DEPROOT)/usr/local/include +FRAMEWORK_SEARCH_PATHS = \$(DEPROOT)/System/Library/Frameworks \$(DEPROOT)/System/Library/PrivateFrameworks EOF echo @@ -770,17 +761,8 @@ fi cat < $REAL_SRCROOT/darwinbuild.xcconfig DEPROOT = $DEPROOT -ADDITIONAL_SDKS = \$(DEPROOT) -SYSTEM_HEADER_SEARCH_PATHS_USER = \$(DEPROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \$(DEPROOT)/usr/include \$(DEPROOT)/usr/local/include -SYSTEM_HEADER_SEARCH_PATHS_KERNEL = \$(DEPROOT)/System/Library/Frameworks/Kernel.framework/PrivateHeaders \$(DEPROOT)/System/Library/Frameworks/Kernel.framework/Headers -FRAMEWORK_SEARCH_PATHS_USER = \$(DEPROOT)/System/Library/Frameworks \$(DEPROOT)/System/Library/PrivateFrameworks - -// Default to user-mode unless \$(DARWINBUILD_SDK_MODE) is set to "KERNEL". -SYSTEM_HEADER_SEARCH_PATHS_ = \$(SYSTEM_HEADER_SEARCH_PATHS_USER) -FRAMEWORK_SEARCH_PATHS_ = \$(FRAMEWORK_SEARCH_PATHS_USER) - -SYSTEM_HEADER_SEARCH_PATHS = \$(SYSTEM_HEADER_SEARCH_PATHS_\$(DARWINBUILD_SDK_MODE)) \$(inherited) -FRAMEWORK_SEARCH_PATHS = \$(FRAMEWORK_SEARCH_PATHS_\$(DARWINBUILD_SDK_MODE)) \$(inherited) +SYSTEM_HEADER_SEARCH_PATHS = \$(DEPROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \$(DEPROOT)/usr/include \$(DEPROOT)/usr/local/include +FRAMEWORK_SEARCH_PATHS = \$(DEPROOT)/System/Library/Frameworks \$(DEPROOT)/System/Library/PrivateFrameworks EOF ### From 2a8c3cf791e943d6dc04ca9649226bb420495901 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 26 Nov 2018 19:41:56 -0500 Subject: [PATCH 167/382] Reindent and clean up buildorder script --- darwinbuild/buildorder | 74 ++++++++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 36 deletions(-) diff --git a/darwinbuild/buildorder b/darwinbuild/buildorder index 88d941e..6b2e311 100644 --- a/darwinbuild/buildorder +++ b/darwinbuild/buildorder @@ -32,9 +32,11 @@ my %BuiltProjectsHash = (); # has project built? my %Dependencies = (); my %InvertedDependencies = (); -my %DepExceptions = ( "passwordserver_sasl" => { "Kerberos" => 1}, - "IOKitUser" => { "configd" => 1 }, - "configd" => { "configd_plugins" => 1}); +my %DepExceptions = ( + "passwordserver_sasl" => { "Kerberos" => 1}, + "IOKitUser" => { "configd" => 1 }, + "configd" => { "configd_plugins" => 1} +); print "Considering projects: @UnbuiltProjects\n"; print "Compilers: @Compilers\n"; @@ -43,31 +45,31 @@ print "Generating dependency graph..."; foreach my $proj (@UnbuiltProjects) { my @deps = (); - my @xrefdeps = CommandAsList("darwinxref dependencies -lib $proj; " . - "darwinxref dependencies -staticlib $proj"); -# print "$proj depends on @xrefdeps\n"; + my @xrefdeps = CommandAsList( + "darwinxref dependencies -lib $proj; " . + "darwinxref dependencies -staticlib $proj" + ); foreach my $xdep (@xrefdeps) { - # don't depend on ourself, compilers, or projects - # not being built currently - if ($xdep eq $proj - || $CompilersHash{$xdep} - || !defined($UnbuiltProjectsHash{$xdep}) - || ( defined($DepExceptions{$proj}) && $DepExceptions{$proj}->{$xdep})) { - next; - } - push @deps, ($xdep); - if(defined($InvertedDependencies{$xdep})) { - push @{$InvertedDependencies{$xdep}}, ( $proj ); - } else { - $InvertedDependencies{$xdep} = [ $proj ]; - } + # don't depend on ourself, compilers, or projects + # not being built currently + next if ($xdep eq $proj + || $CompilersHash{$xdep} + || !defined($UnbuiltProjectsHash{$xdep}) + || ( defined($DepExceptions{$proj}) && $DepExceptions{$proj}->{$xdep})) + + push @deps, ($xdep); + if(defined($InvertedDependencies{$xdep})) { + push @{$InvertedDependencies{$xdep}}, ( $proj ); + } else { + $InvertedDependencies{$xdep} = [ $proj ]; + } } $Dependencies{$proj} = \@deps; # try to make sure there's even an empty list of # inverted deps (things that depend on me) if(!defined($InvertedDependencies{$proj})) { - $InvertedDependencies{$proj} = []; + $InvertedDependencies{$proj} = []; } } @@ -88,27 +90,27 @@ while ($#UnbuiltProjects > 0) { # got back to he beginning. Make sure we're making forward progress if($proj eq "SENTINEL") { - print "SENTINEL reached\n" if $loopdebug; - if($builtone) { - # great! - $builtone = 0; - goto Unmet; - } else { - print STDERR "Aborting, unmet dependency loop\n"; - print STDERR "Remaining projects: @UnbuiltProjects\n"; - exit(1); - } + print "SENTINEL reached\n" if $loopdebug; + if($builtone) { + # great! + $builtone = 0; + goto Unmet; + } else { + print STDERR "Aborting, unmet dependency loop\n"; + print STDERR "Remaining projects: @UnbuiltProjects\n"; + exit(1); + } } # See if all dependencies have been built my @deps = @{$Dependencies{$proj}}; print "$proj: " if $loopdebug; foreach my $dep (@deps) { - if(!defined($BuiltProjectsHash{$dep})) { - # dep hasn't built yet - print "$dep unbuilt\n" if $loopdebug; - goto Unmet; - } + if(!defined($BuiltProjectsHash{$dep})) { + # dep hasn't built yet + print "$dep unbuilt\n" if $loopdebug; + goto Unmet; + } } print "all deps built\n" if $loopdebug; From 41ce8524e568a419f27409d7cf041afff877793e Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 26 Nov 2018 19:42:07 -0500 Subject: [PATCH 168/382] Adjust buildorder script to match PureDarwin idioms --- darwinbuild/buildorder | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/darwinbuild/buildorder b/darwinbuild/buildorder index 6b2e311..a06543b 100644 --- a/darwinbuild/buildorder +++ b/darwinbuild/buildorder @@ -46,8 +46,8 @@ print "Generating dependency graph..."; foreach my $proj (@UnbuiltProjects) { my @deps = (); my @xrefdeps = CommandAsList( - "darwinxref dependencies -lib $proj; " . - "darwinxref dependencies -staticlib $proj" + "darwinxref dependencies -build $proj; " . + "darwinxref dependencies -header $proj" ); foreach my $xdep (@xrefdeps) { # don't depend on ourself, compilers, or projects From 3714376c0127b0a07afe42f676b4cc47455ddeac Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 26 Nov 2018 19:54:18 -0500 Subject: [PATCH 169/382] Typo fix --- darwinbuild/buildorder | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/buildorder b/darwinbuild/buildorder index a06543b..87a0341 100644 --- a/darwinbuild/buildorder +++ b/darwinbuild/buildorder @@ -55,7 +55,7 @@ foreach my $proj (@UnbuiltProjects) { next if ($xdep eq $proj || $CompilersHash{$xdep} || !defined($UnbuiltProjectsHash{$xdep}) - || ( defined($DepExceptions{$proj}) && $DepExceptions{$proj}->{$xdep})) + || ( defined($DepExceptions{$proj}) && $DepExceptions{$proj}->{$xdep})); push @deps, ($xdep); if(defined($InvertedDependencies{$xdep})) { From e5171b8891a473e7cc3d3f59c31ddd578f460483 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 3 Dec 2018 21:02:11 -0500 Subject: [PATCH 170/382] Add support for copying tarballs from local sources --- darwinbuild/darwinbuild.common | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index 2dfaf49..f0af97b 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -136,7 +136,10 @@ function Download() { proj=$(echo "$filename" | sed -e 's,.tar.gz$,,' | sed -e 's,.root$,,') projnam=$(echo "$proj" | sed -e 's,-[0-9.]*$,,') srcdir=$(echo "$master_site/$projnam" | sed -e 's,^file://,,') - if [ -d "$srcdir/$proj" ]; then + if [ -f "$srcdir/$filename" ]; then + echo "Copying $srcdir/$filename ..." + cp "$srcdir/$filename" "$destination/.tmp.${filename}" + elif [ -d "$srcdir/$proj" ]; then echo "Copying $srcdir/$proj ..." tar czf \ "$destination/.tmp.${filename}" \ From aa0ef72494814a6e4c4a2671367ed6980f732b85 Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 6 Dec 2018 18:03:44 -0500 Subject: [PATCH 171/382] Don't set ADDITIONAL_SDKS This exposes a bug in xcodebuild. Radar 45060216. --- darwinbuild/darwinbuild.in | 1 - 1 file changed, 1 deletion(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index d46d188..03ce5f6 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -734,7 +734,6 @@ fi build_string="" if [ "$buildtool" == "xcodebuild" -a $INSTALL_XCODE == "YES" ]; then build_string="-sdk $platform" - build_string="$build_string ADDITIONAL_SDKS=\"$DEPROOT\"" fi if [ "$buildtool" == "xcodebuild" -a "$target" != "" ]; then build_string="$build_string -target \"$target\"" From 816a5f7d157e4c6d918bdc5fa1a53ddd71e2a2cc Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 6 Dec 2018 18:19:05 -0500 Subject: [PATCH 172/382] Enable code signing for darwintrace and darwinxref --- darwinbuild.xcodeproj/project.pbxproj | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 4f7eadc..fe7aaae 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -3670,10 +3670,14 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "Mac Developer"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 3P242C9ES5; INSTALL_PATH = "$(DATDIR)/darwinbuild"; "INSTALL_PATH[sdk=iphonesimulator*]" = "$(SDKROOT)$(DATDIR)/darwinbuild"; LD_DYLIB_INSTALL_NAME = "$(DATDIR)/darwinbuild/darwintrace.dylib"; PRODUCT_NAME = darwintrace; + PROVISIONING_PROFILE_SPECIFIER = ""; }; name = Public; }; @@ -3682,6 +3686,9 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "Mac Developer"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 3P242C9ES5; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = "$(BINDIR)"; OTHER_CFLAGS = ( @@ -3690,6 +3697,7 @@ "-DDEFAULT_DB_FILE=\\\".build/xref.db\\\"", ); PRODUCT_NAME = darwinxref; + PROVISIONING_PROFILE_SPECIFIER = ""; PUBLIC_HEADERS_FOLDER_PATH = "$(INCDIR)/darwinbuild"; }; name = Debug; @@ -3699,6 +3707,9 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "Mac Developer"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 3P242C9ES5; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = "$(BINDIR)"; OTHER_CFLAGS = ( @@ -3707,6 +3718,7 @@ "-DDEFAULT_DB_FILE=\\\".build/xref.db\\\"", ); PRODUCT_NAME = darwinxref; + PROVISIONING_PROFILE_SPECIFIER = ""; PUBLIC_HEADERS_FOLDER_PATH = "$(INCDIR)/darwinbuild"; }; name = Public; @@ -3716,6 +3728,9 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "Mac Developer"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 3P242C9ES5; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = "$(BINDIR)"; OTHER_CFLAGS = ( @@ -3724,6 +3739,7 @@ "-DDEFAULT_DB_FILE=\\\".build/xref.db\\\"", ); PRODUCT_NAME = darwinxref; + PROVISIONING_PROFILE_SPECIFIER = ""; PUBLIC_HEADERS_FOLDER_PATH = "$(INCDIR)/darwinbuild"; }; name = Release; @@ -3895,10 +3911,14 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "Mac Developer"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 3P242C9ES5; INSTALL_PATH = "$(DATDIR)/darwinbuild"; "INSTALL_PATH[sdk=iphonesimulator*]" = "$(SDKROOT)$(DATDIR)/darwinbuild"; LD_DYLIB_INSTALL_NAME = "$(DATDIR)/darwinbuild/darwintrace.dylib"; PRODUCT_NAME = darwintrace; + PROVISIONING_PROFILE_SPECIFIER = ""; }; name = Debug; }; @@ -3907,10 +3927,14 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "Mac Developer"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 3P242C9ES5; INSTALL_PATH = "$(DATDIR)/darwinbuild"; "INSTALL_PATH[sdk=iphonesimulator*]" = "$(SDKROOT)$(DATDIR)/darwinbuild"; LD_DYLIB_INSTALL_NAME = "$(DATDIR)/darwinbuild/darwintrace.dylib"; PRODUCT_NAME = darwintrace; + PROVISIONING_PROFILE_SPECIFIER = ""; }; name = Release; }; From b8055c0b492f3777322ce4aba9ee6644cf597a5d Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 6 Dec 2018 18:23:55 -0500 Subject: [PATCH 173/382] Don't install the darwinxref headers These aren't useful outside of darwinbuild itself. All they do is clutter the installation. --- darwinbuild.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index fe7aaae..c6cfbd4 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -116,8 +116,8 @@ 7227AB44109897D500BE33D7 /* darwin.tcl in CopyFiles */ = {isa = PBXBuildFile; fileRef = 72C86BF710965EEA00C66E90 /* darwin.tcl */; }; 7227AB45109897D500BE33D7 /* group.tcl in CopyFiles */ = {isa = PBXBuildFile; fileRef = 72C86C0210965EEA00C66E90 /* group.tcl */; }; 7227AB46109897D500BE33D7 /* macosx.tcl in CopyFiles */ = {isa = PBXBuildFile; fileRef = 72C86C0710965EEA00C66E90 /* macosx.tcl */; }; - 7227AB67109899A600BE33D7 /* cfutils.h in Headers */ = {isa = PBXBuildFile; fileRef = 72C86BE910965E7500C66E90 /* cfutils.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7227AB68109899A600BE33D7 /* DBPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 72C86BED10965E7500C66E90 /* DBPlugin.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 7227AB67109899A600BE33D7 /* cfutils.h in Headers */ = {isa = PBXBuildFile; fileRef = 72C86BE910965E7500C66E90 /* cfutils.h */; }; + 7227AB68109899A600BE33D7 /* DBPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 72C86BED10965E7500C66E90 /* DBPlugin.h */; }; 7227AB7510989F8D00BE33D7 /* manifest.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86C2E1096600B00C66E90 /* manifest.c */; }; 7227AD1C109A05FA00BE33D7 /* buildlist in Copy Files */ = {isa = PBXBuildFile; fileRef = 7227AB871098A7BF00BE33D7 /* buildlist */; }; 7227AD1D109A05FA00BE33D7 /* buildorder in Copy Files */ = {isa = PBXBuildFile; fileRef = 7227AB881098A7BF00BE33D7 /* buildorder */; }; From 433b6b6eb2af3ea6f7d7b96601fb27c8f0891ec1 Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 6 Dec 2018 19:12:39 -0500 Subject: [PATCH 174/382] Add files to create installer --- .gitignore | 6 ++- darwinbuild.xcodeproj/project.pbxproj | 18 +++++++++ installer/build.sh | 30 +++++++++++++++ installer/conclusion.html | 26 +++++++++++++ installer/distribution.xml | 21 +++++++++++ installer/license.html | 54 +++++++++++++++++++++++++++ installer/welcome.html | 24 ++++++++++++ 7 files changed, 178 insertions(+), 1 deletion(-) create mode 100755 installer/build.sh create mode 100644 installer/conclusion.html create mode 100644 installer/distribution.xml create mode 100644 installer/license.html create mode 100644 installer/welcome.html diff --git a/.gitignore b/.gitignore index 9797113..99f4bf2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,8 @@ build/ .DS_Store darwinbuild.xcodeproj/project.xcworkspace/ -darwinbuild.xcodeproj/xcuserdata/ \ No newline at end of file +darwinbuild.xcodeproj/xcuserdata/ + +# Installer files +*.pkg +installer/payload diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index c6cfbd4..acc6e63 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -653,8 +653,13 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 1F4A793721B9F123000FE4B5 /* conclusion.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = conclusion.html; path = installer/conclusion.html; sourceTree = ""; }; + 1F4A793821B9F123000FE4B5 /* license.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = license.html; path = installer/license.html; sourceTree = ""; }; + 1F4A793921B9F123000FE4B5 /* welcome.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = welcome.html; path = installer/welcome.html; sourceTree = ""; }; 1F514C431F4A5CC0008D9341 /* fetch-from-github */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = "fetch-from-github"; path = "darwinbuild/fetch-from-github"; sourceTree = ""; }; 1FC854001ED462DF00EA2AF5 /* installXcode_Modern */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = installXcode_Modern; path = darwinbuild/installXcode_Modern; sourceTree = ""; }; + 1FD9F0CD21B9E90700FB866A /* build.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = build.sh; path = installer/build.sh; sourceTree = ""; }; + 1FD9F0CF21B9EAA300FB866A /* distribution.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = distribution.xml; path = installer/distribution.xml; sourceTree = ""; }; 1FECB5DE1FBBBC09002EA059 /* setXcodePlatform */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = setXcodePlatform; path = darwinbuild/setXcodePlatform; sourceTree = ""; }; 396301191EAB42B6006081C7 /* patch_sites.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = patch_sites.c; sourceTree = ""; }; 396301271EAB4E01006081C7 /* patch_sites.so */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.objfile"; includeInIndex = 0; path = patch_sites.so; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -977,6 +982,18 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 1FD9F0CE21B9E90C00FB866A /* installer */ = { + isa = PBXGroup; + children = ( + 1F4A793721B9F123000FE4B5 /* conclusion.html */, + 1F4A793821B9F123000FE4B5 /* license.html */, + 1F4A793921B9F123000FE4B5 /* welcome.html */, + 1FD9F0CD21B9E90700FB866A /* build.sh */, + 1FD9F0CF21B9EAA300FB866A /* distribution.xml */, + ); + name = installer; + sourceTree = ""; + }; 726DD14710965C5700D5AEAB = { isa = PBXGroup; children = ( @@ -984,6 +1001,7 @@ 72C86BD810965DDF00C66E90 /* darwintrace */, 72C86BD610965DD000C66E90 /* darwinxref */, 72C86BD510965DC900C66E90 /* darwinbuild */, + 1FD9F0CE21B9E90C00FB866A /* installer */, 72C86C391096607900C66E90 /* Products */, 72C86CE310974CC800C66E90 /* libsqlite3.dylib */, 72574A0F10977F7A00B13BC3 /* CoreFoundation.framework */, diff --git a/installer/build.sh b/installer/build.sh new file mode 100755 index 0000000..b7a3638 --- /dev/null +++ b/installer/build.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +set -e + +MY_DIR=$(cd `dirname $0` && pwd) +cd $MY_DIR + +xcodebuild install \ + -project $MY_DIR/../darwinbuild.xcodeproj \ + -target world \ + DSTROOT=$MY_DIR/payload + +pkgbuild \ + --ownership recommended \ + --identifier org.puredarwin.darwinbuild.component \ + --version 1.0 \ + --root $MY_DIR/payload \ + --install-location / \ + $MY_DIR/darwinbuild-component.pkg + +productbuild \ + --distribution $MY_DIR/distribution.xml \ + --identifier org.puredarwin.darwinbuild.release \ + --version 1.0 \ + --sign 'Developer ID Installer' --timestamp \ + --package-path $MY_DIR \ + --resources $MY_DIR \ + $MY_DIR/darwinbuild-installer.pkg + +echo "Complete! Your installer is located at: $MY_DIR/build/darwinbuild-installer.pkg" diff --git a/installer/conclusion.html b/installer/conclusion.html new file mode 100644 index 0000000..eb574c5 --- /dev/null +++ b/installer/conclusion.html @@ -0,0 +1,26 @@ + + + + PureDarwin Build System Installer + + + + +

+ You can find the darwinbuild tool at:
+ /usr/local/bin/darwinbuild +

+ +

+ http://puredarwin.org/ +

+ + diff --git a/installer/distribution.xml b/installer/distribution.xml new file mode 100644 index 0000000..a86dcbc --- /dev/null +++ b/installer/distribution.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + darwinbuild-component.pkg + + PureDarwin Build System + + + + + diff --git a/installer/license.html b/installer/license.html new file mode 100644 index 0000000..fe24c57 --- /dev/null +++ b/installer/license.html @@ -0,0 +1,54 @@ + + + + + + + + +

+Copyright © 2004-2012 Apple Inc. All rights reserved.
+Portions of the file DBTclPlugin.c are copyright © 2003 Kevin Van Vechten <kevin@opendarwin.org>
+Portions of the file dot.c are copyright © 2008 Michael Franz <mvfranz@gmail.com> +

+

+Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +

+
    +
  1. + Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +
  2. +
  3. + Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +
  4. +
  5. + Neither the name of Apple Inc. ("Apple") nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +
  6. +
+

+THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +

+ + + diff --git a/installer/welcome.html b/installer/welcome.html new file mode 100644 index 0000000..07bab02 --- /dev/null +++ b/installer/welcome.html @@ -0,0 +1,24 @@ + + + + PureDarwin Build System Installer + + + + +

+ This package installs darwinbuild, the build system used by + the PureDarwin project. You can learn more about darwinbuild at our GitHub + repository, + https://github.com/PureDarwin/darwinbuild. +

+ + From 731af6abba76e0dfe46ae6cdc21817e25b186205 Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 14 Dec 2018 13:51:30 -0500 Subject: [PATCH 175/382] Remove xcbuild. xcbuild is dead. --- .gitmodules | 3 - darwinbuild.xcodeproj/project.pbxproj | 103 -------------------------- xcbuild | 1 - 3 files changed, 107 deletions(-) delete mode 160000 xcbuild diff --git a/.gitmodules b/.gitmodules index ce5b6d2..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "xcbuild"] - path = xcbuild - url = git@github.com:Andromeda-OS/xcbuild diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index acc6e63..6751281 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -7,18 +7,6 @@ objects = { /* Begin PBXAggregateTarget section */ - 1FAB24D32043A61B00329636 /* xcbuild */ = { - isa = PBXAggregateTarget; - buildConfigurationList = 1FAB24D72043A61B00329636 /* Build configuration list for PBXAggregateTarget "xcbuild" */; - buildPhases = ( - 1FAB24D82043A61F00329636 /* Build */, - 1FAB24D92043A66800329636 /* Install */, - ); - dependencies = ( - ); - name = xcbuild; - productName = xcbuild; - }; 7227AB3D1098977C00BE33D7 /* tcl_plugins */ = { isa = PBXAggregateTarget; buildConfigurationList = 7227AB4A109897E500BE33D7 /* Build configuration list for PBXAggregateTarget "tcl_plugins" */; @@ -90,7 +78,6 @@ buildPhases = ( ); dependencies = ( - 1FAB24DB2043A6A900329636 /* PBXTargetDependency */, 72C86C611096617500C66E90 /* PBXTargetDependency */, 725740971097B03D008AD4D7 /* PBXTargetDependency */, 7227AB101097BBA900BE33D7 /* PBXTargetDependency */, @@ -165,13 +152,6 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 1FAB24DA2043A6A900329636 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 726DD14910965C5700D5AEAB /* Project object */; - proxyType = 1; - remoteGlobalIDString = 1FAB24D32043A61B00329636; - remoteInfo = xcbuild; - }; 3963011E1EAB4E01006081C7 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 726DD14910965C5700D5AEAB /* Project object */; @@ -1794,13 +1774,6 @@ BuildIndependentTargetsInParallel = YES; LastUpgradeCheck = 1000; ORGANIZATIONNAME = "The DarwinBuild Project"; - TargetAttributes = { - 1FAB24D32043A61B00329636 = { - CreatedOnToolsVersion = 9.3; - DevelopmentTeam = 3P242C9ES5; - ProvisioningStyle = Automatic; - }; - }; }; buildConfigurationList = 726DD14C10965C5700D5AEAB /* Build configuration list for PBXProject "darwinbuild" */; compatibilityVersion = "Xcode 10.0"; @@ -1856,7 +1829,6 @@ 7227AC271098DBDF00BE33D7 /* installXcode32 */, 720BE2EA120C90A700B3C4A5 /* digest */, 3963011C1EAB4E01006081C7 /* patch_sites */, - 1FAB24D32043A61B00329636 /* xcbuild */, ); }; /* End PBXProject section */ @@ -1958,36 +1930,6 @@ shellScript = "mkdir -p $DSTROOT/$DATDIR/darwinbuild\n/bin/cp $BUILT_PRODUCTS_DIR/installXcode32 $DSTROOT/$DATDIR/darwinbuild/installXcode32"; showEnvVarsInLog = 0; }; - 1FAB24D82043A61F00329636 /* Build */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = Build; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "which -s cmake || {\n echo CMake is required. Try \\`brew install cmake\\` 1>&2\n exit 1\n}\n\nwhich -s ninja || {\n echo ninja is required. Try \\`brew install ninja\\` 1>&2\n exit 1\n}\n\nif [ ! -f \"${SRCROOT}/xcbuild/Makefile\" ]; then\n echo xcbuild submodule not checked out, not building\n exit 0\nfi\n\nif [ ! -f \"${SRCROOT}/xcbuild/ThirdParty/googletest/CMakeLists.txt\" -o ! -f \"${SRCROOT}/xcbuild/ThirdParty/linenoise/Makefile\" ]; then\n echo Submodules of xcbuild submodule not checked out, build will not succeed 1>&2\n echo Try \\`git submodule update --init --recursive\\` 1>&2\n exit 1\nfi\n\nset -e\ncd \"${SRCROOT}/xcbuild\"\nmkdir -p $DERIVED_FILE_DIR\nmake all &> $DERIVED_FILE_DIR/xcbuild.log"; - showEnvVarsInLog = 0; - }; - 1FAB24D92043A66800329636 /* Install */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 8; - files = ( - ); - inputPaths = ( - ); - name = Install; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 1; - shellPath = /bin/sh; - shellScript = "if [ -f \"${SRCROOT}/xcbuild/build/xcbuild\" ]; then\n cp -f \"${SRCROOT}/xcbuild/build/xcbuild\" $DSTROOT/$DATDIR/darwinbuild/xcbuild.disabled\nfi\n"; - showEnvVarsInLog = 0; - }; 7227AB8F1098A89700BE33D7 /* Run Script */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -2412,11 +2354,6 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 1FAB24DB2043A6A900329636 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 1FAB24D32043A61B00329636 /* xcbuild */; - targetProxy = 1FAB24DA2043A6A900329636 /* PBXContainerItemProxy */; - }; 3963011D1EAB4E01006081C7 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 7257499F1097697300B13BC3 /* darwinxref */; @@ -2730,36 +2667,6 @@ /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ - 1FAB24D42043A61B00329636 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 3P242C9ES5; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 1FAB24D52043A61B00329636 /* Public */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 3P242C9ES5; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Public; - }; - 1FAB24D62043A61B00329636 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 3P242C9ES5; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; 396301241EAB4E01006081C7 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; @@ -4001,16 +3908,6 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 1FAB24D72043A61B00329636 /* Build configuration list for PBXAggregateTarget "xcbuild" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1FAB24D42043A61B00329636 /* Debug */, - 1FAB24D52043A61B00329636 /* Public */, - 1FAB24D62043A61B00329636 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; - }; 396301231EAB4E01006081C7 /* Build configuration list for PBXNativeTarget "patch_sites" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/xcbuild b/xcbuild deleted file mode 160000 index b2304e2..0000000 --- a/xcbuild +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b2304e27e3eed99a76897b390ef84cfbc115cead From ff1c173232a0649714772d6bb92f7df7f1d88569 Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 14 Dec 2018 13:55:33 -0500 Subject: [PATCH 176/382] Get rid of support for Xcode 2.x and 3.x --- darwinbuild.xcodeproj/project.pbxproj | 262 +----------------- .../{installXcode_Modern => installXcode} | 0 darwinbuild/installXcode.in | 29 -- darwinbuild/installXcode2 | 174 ------------ darwinbuild/installXcode3 | 152 ---------- darwinbuild/installXcode31 | 259 ----------------- darwinbuild/installXcode32.in | 44 --- 7 files changed, 4 insertions(+), 916 deletions(-) rename darwinbuild/{installXcode_Modern => installXcode} (100%) delete mode 100644 darwinbuild/installXcode.in delete mode 100644 darwinbuild/installXcode2 delete mode 100644 darwinbuild/installXcode3 delete mode 100644 darwinbuild/installXcode31 delete mode 100644 darwinbuild/installXcode32.in diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 6751281..9627d17 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -31,8 +31,6 @@ 7227AC3E1098DC6A00BE33D7 /* PBXTargetDependency */, 7227AC3C1098DC6A00BE33D7 /* PBXTargetDependency */, 7227AC3A1098DC6A00BE33D7 /* PBXTargetDependency */, - 7227AC381098DC6A00BE33D7 /* PBXTargetDependency */, - 7227AC361098DC6A00BE33D7 /* PBXTargetDependency */, ); name = darwinbuild_scripts; productName = darwinbuild_scripts; @@ -90,7 +88,7 @@ /* Begin PBXBuildFile section */ 1F514C441F4A5CDA008D9341 /* fetch-from-github in Copy Files */ = {isa = PBXBuildFile; fileRef = 1F514C431F4A5CC0008D9341 /* fetch-from-github */; }; - 1FC854011ED462EE00EA2AF5 /* installXcode_Modern in Copy Files */ = {isa = PBXBuildFile; fileRef = 1FC854001ED462DF00EA2AF5 /* installXcode_Modern */; }; + 1FC854011ED462EE00EA2AF5 /* installXcode in Copy Files */ = {isa = PBXBuildFile; fileRef = 1FC854001ED462DF00EA2AF5 /* installXcode */; }; 1FECB5DF1FBBBD41002EA059 /* setXcodePlatform in Copy Files */ = {isa = PBXBuildFile; fileRef = 1FECB5DE1FBBBC09002EA059 /* setXcodePlatform */; }; 3963011A1EAB4D60006081C7 /* source_sites.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86C0E10965EEA00C66E90 /* source_sites.c */; }; 396301211EAB4E01006081C7 /* patch_sites.c in Sources */ = {isa = PBXBuildFile; fileRef = 396301191EAB42B6006081C7 /* patch_sites.c */; }; @@ -114,9 +112,6 @@ 7227AD21109A05FA00BE33D7 /* createChroot in Copy Files */ = {isa = PBXBuildFile; fileRef = 72C86C221096600B00C66E90 /* createChroot */; }; 7227AD22109A05FA00BE33D7 /* darwinbuild.common in Copy Files */ = {isa = PBXBuildFile; fileRef = 72C86C231096600B00C66E90 /* darwinbuild.common */; }; 7227AD23109A05FA00BE33D7 /* Info.plist in Copy Files */ = {isa = PBXBuildFile; fileRef = 72C86C271096600B00C66E90 /* Info.plist */; }; - 7227AD24109A05FA00BE33D7 /* installXcode2 in Copy Files */ = {isa = PBXBuildFile; fileRef = 72C86C291096600B00C66E90 /* installXcode2 */; }; - 7227AD25109A05FA00BE33D7 /* installXcode3 in Copy Files */ = {isa = PBXBuildFile; fileRef = 72C86C2A1096600B00C66E90 /* installXcode3 */; }; - 7227AD26109A05FA00BE33D7 /* installXcode31 in Copy Files */ = {isa = PBXBuildFile; fileRef = 72C86C2B1096600B00C66E90 /* installXcode31 */; }; 7227AD27109A05FA00BE33D7 /* SDKSettings.plist in Copy Files */ = {isa = PBXBuildFile; fileRef = 72C86C311096600B00C66E90 /* SDKSettings.plist */; }; 72573FF71097A601008AD4D7 /* dependencies.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BF810965EEA00C66E90 /* dependencies.c */; }; 72573FF81097A60C008AD4D7 /* diff.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BFA10965EEA00C66E90 /* diff.c */; }; @@ -180,20 +175,6 @@ remoteGlobalIDString = 7227AB3D1098977C00BE33D7; remoteInfo = tcl_plugins; }; - 7227AC351098DC6A00BE33D7 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 726DD14910965C5700D5AEAB /* Project object */; - proxyType = 1; - remoteGlobalIDString = 7227AC271098DBDF00BE33D7; - remoteInfo = installXcode32; - }; - 7227AC371098DC6A00BE33D7 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 726DD14910965C5700D5AEAB /* Project object */; - proxyType = 1; - remoteGlobalIDString = 7227AC1E1098DB9200BE33D7; - remoteInfo = installXcode; - }; 7227AC391098DC6A00BE33D7 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 726DD14910965C5700D5AEAB /* Project object */; @@ -612,7 +593,7 @@ dstSubfolderSpec = 0; files = ( 1F514C441F4A5CDA008D9341 /* fetch-from-github in Copy Files */, - 1FC854011ED462EE00EA2AF5 /* installXcode_Modern in Copy Files */, + 1FC854011ED462EE00EA2AF5 /* installXcode in Copy Files */, 1FECB5DF1FBBBD41002EA059 /* setXcodePlatform in Copy Files */, 7227AD1C109A05FA00BE33D7 /* buildlist in Copy Files */, 7227AD1D109A05FA00BE33D7 /* buildorder in Copy Files */, @@ -622,9 +603,6 @@ 7227AD21109A05FA00BE33D7 /* createChroot in Copy Files */, 7227AD22109A05FA00BE33D7 /* darwinbuild.common in Copy Files */, 7227AD23109A05FA00BE33D7 /* Info.plist in Copy Files */, - 7227AD24109A05FA00BE33D7 /* installXcode2 in Copy Files */, - 7227AD25109A05FA00BE33D7 /* installXcode3 in Copy Files */, - 7227AD26109A05FA00BE33D7 /* installXcode31 in Copy Files */, 7227AD27109A05FA00BE33D7 /* SDKSettings.plist in Copy Files */, ); name = "Copy Files"; @@ -637,7 +615,7 @@ 1F4A793821B9F123000FE4B5 /* license.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = license.html; path = installer/license.html; sourceTree = ""; }; 1F4A793921B9F123000FE4B5 /* welcome.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = welcome.html; path = installer/welcome.html; sourceTree = ""; }; 1F514C431F4A5CC0008D9341 /* fetch-from-github */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = "fetch-from-github"; path = "darwinbuild/fetch-from-github"; sourceTree = ""; }; - 1FC854001ED462DF00EA2AF5 /* installXcode_Modern */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = installXcode_Modern; path = darwinbuild/installXcode_Modern; sourceTree = ""; }; + 1FC854001ED462DF00EA2AF5 /* installXcode */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = installXcode; path = darwinbuild/installXcode; sourceTree = ""; }; 1FD9F0CD21B9E90700FB866A /* build.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = build.sh; path = installer/build.sh; sourceTree = ""; }; 1FD9F0CF21B9EAA300FB866A /* distribution.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = distribution.xml; path = installer/distribution.xml; sourceTree = ""; }; 1FECB5DE1FBBBC09002EA059 /* setXcodePlatform */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = setXcodePlatform; path = darwinbuild/setXcodePlatform; sourceTree = ""; }; @@ -659,8 +637,6 @@ 7227AC0A1098D7CE00BE33D7 /* darwinmaster.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = darwinmaster.in; path = darwinbuild/darwinmaster.in; sourceTree = ""; }; 7227AC131098D84600BE33D7 /* packageRoots */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = packageRoots; sourceTree = BUILT_PRODUCTS_DIR; }; 7227AC1C1098D8DB00BE33D7 /* thinPackages */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = thinPackages; sourceTree = BUILT_PRODUCTS_DIR; }; - 7227AC251098DB9200BE33D7 /* installXcode */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = installXcode; sourceTree = BUILT_PRODUCTS_DIR; }; - 7227AC2E1098DBDF00BE33D7 /* installXcode32 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = installXcode32; sourceTree = BUILT_PRODUCTS_DIR; }; 72573F7F1097A488008AD4D7 /* dependencies.so */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.objfile"; includeInIndex = 0; path = dependencies.so; sourceTree = BUILT_PRODUCTS_DIR; }; 72573FD21097A4B7008AD4D7 /* dot.so */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.objfile"; includeInIndex = 0; path = dot.so; sourceTree = BUILT_PRODUCTS_DIR; }; 72573FDB1097A538008AD4D7 /* diff.so */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.objfile"; includeInIndex = 0; path = diff.so; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -732,11 +708,6 @@ 72C86C231096600B00C66E90 /* darwinbuild.common */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = darwinbuild.common; path = darwinbuild/darwinbuild.common; sourceTree = ""; }; 72C86C241096600B00C66E90 /* darwinbuild.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = darwinbuild.in; path = darwinbuild/darwinbuild.in; sourceTree = ""; }; 72C86C271096600B00C66E90 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = darwinbuild/Info.plist; sourceTree = ""; }; - 72C86C281096600B00C66E90 /* installXcode.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = installXcode.in; path = darwinbuild/installXcode.in; sourceTree = ""; }; - 72C86C291096600B00C66E90 /* installXcode2 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = installXcode2; path = darwinbuild/installXcode2; sourceTree = ""; }; - 72C86C2A1096600B00C66E90 /* installXcode3 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = installXcode3; path = darwinbuild/installXcode3; sourceTree = ""; }; - 72C86C2B1096600B00C66E90 /* installXcode31 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = installXcode31; path = darwinbuild/installXcode31; sourceTree = ""; }; - 72C86C2C1096600B00C66E90 /* installXcode32.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = installXcode32.in; path = darwinbuild/installXcode32.in; sourceTree = ""; }; 72C86C2E1096600B00C66E90 /* manifest.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = manifest.c; path = darwinbuild/manifest.c; sourceTree = ""; }; 72C86C311096600B00C66E90 /* SDKSettings.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = SDKSettings.plist; path = darwinbuild/SDKSettings.plist; sourceTree = ""; }; 72C86C381096607900C66E90 /* darwinbuild */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = darwinbuild; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -1007,12 +978,7 @@ 7227AC0A1098D7CE00BE33D7 /* darwinmaster.in */, 72C86C241096600B00C66E90 /* darwinbuild.in */, 72C86C271096600B00C66E90 /* Info.plist */, - 72C86C281096600B00C66E90 /* installXcode.in */, - 72C86C291096600B00C66E90 /* installXcode2 */, - 72C86C2A1096600B00C66E90 /* installXcode3 */, - 72C86C2B1096600B00C66E90 /* installXcode31 */, - 72C86C2C1096600B00C66E90 /* installXcode32.in */, - 1FC854001ED462DF00EA2AF5 /* installXcode_Modern */, + 1FC854001ED462DF00EA2AF5 /* installXcode */, 1FECB5DE1FBBBC09002EA059 /* setXcodePlatform */, 72C86C2E1096600B00C66E90 /* manifest.c */, 72C86C311096600B00C66E90 /* SDKSettings.plist */, @@ -1120,8 +1086,6 @@ 7227AC061098D78C00BE33D7 /* darwinmaster */, 7227AC131098D84600BE33D7 /* packageRoots */, 7227AC1C1098D8DB00BE33D7 /* thinPackages */, - 7227AC251098DB9200BE33D7 /* installXcode */, - 7227AC2E1098DBDF00BE33D7 /* installXcode32 */, 72D05CB711D267C400B33EDD /* query.so */, 720BE2F2120C90A700B3C4A5 /* digest */, 396301271EAB4E01006081C7 /* patch_sites.so */, @@ -1272,40 +1236,6 @@ productReference = 7227AC1C1098D8DB00BE33D7 /* thinPackages */; productType = "com.apple.product-type.tool"; }; - 7227AC1E1098DB9200BE33D7 /* installXcode */ = { - isa = PBXNativeTarget; - buildConfigurationList = 7227AC211098DB9200BE33D7 /* Build configuration list for PBXNativeTarget "installXcode" */; - buildPhases = ( - 7227AC1F1098DB9200BE33D7 /* ShellScript */, - 7227AC201098DB9200BE33D7 /* ShellScript */, - 1F71A5012030F86400020E2F /* ShellScript */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = installXcode; - productName = darwinbuild; - productReference = 7227AC251098DB9200BE33D7 /* installXcode */; - productType = "com.apple.product-type.tool"; - }; - 7227AC271098DBDF00BE33D7 /* installXcode32 */ = { - isa = PBXNativeTarget; - buildConfigurationList = 7227AC2A1098DBDF00BE33D7 /* Build configuration list for PBXNativeTarget "installXcode32" */; - buildPhases = ( - 7227AC281098DBDF00BE33D7 /* ShellScript */, - 7227AC291098DBDF00BE33D7 /* ShellScript */, - 1F71A5022030F88300020E2F /* ShellScript */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = installXcode32; - productName = darwinbuild; - productReference = 7227AC2E1098DBDF00BE33D7 /* installXcode32 */; - productType = "com.apple.product-type.tool"; - }; 72573F771097A488008AD4D7 /* dependencies */ = { isa = PBXNativeTarget; buildConfigurationList = 72573F7B1097A488008AD4D7 /* Build configuration list for PBXNativeTarget "dependencies" */; @@ -1825,8 +1755,6 @@ 7227ABFF1098D78C00BE33D7 /* darwinmaster */, 7227AC0C1098D84600BE33D7 /* packageRoots */, 7227AC151098D8DB00BE33D7 /* thinPackages */, - 7227AC1E1098DB9200BE33D7 /* installXcode */, - 7227AC271098DBDF00BE33D7 /* installXcode32 */, 720BE2EA120C90A700B3C4A5 /* digest */, 3963011C1EAB4E01006081C7 /* patch_sites */, ); @@ -1898,38 +1826,6 @@ shellScript = "mkdir -p $DSTROOT/$DATDIR/darwinbuild\n/bin/cp $BUILT_PRODUCTS_DIR/thinPackages $DSTROOT/$DATDIR/darwinbuild/thinPackages"; showEnvVarsInLog = 0; }; - 1F71A5012030F86400020E2F /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 8; - files = ( - ); - inputPaths = ( - "$(BUILT_PRODUCTS_DIR)/installXcode", - ); - outputPaths = ( - "$(DSTROOT)/$(DATDIR)/darwinbuild/installXcode", - ); - runOnlyForDeploymentPostprocessing = 1; - shellPath = /bin/sh; - shellScript = "mkdir -p $DSTROOT/$DATDIR/darwinbuild\n/bin/cp $BUILT_PRODUCTS_DIR/installXcode $DSTROOT/$DATDIR/darwinbuild/installXcode"; - showEnvVarsInLog = 0; - }; - 1F71A5022030F88300020E2F /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 8; - files = ( - ); - inputPaths = ( - "$(BUILT_PRODUCTS_DIR)/installXcode32", - ); - outputPaths = ( - "$(DSTROOT)/$(DATDIR)/installXcode32", - ); - runOnlyForDeploymentPostprocessing = 1; - shellPath = /bin/sh; - shellScript = "mkdir -p $DSTROOT/$DATDIR/darwinbuild\n/bin/cp $BUILT_PRODUCTS_DIR/installXcode32 $DSTROOT/$DATDIR/darwinbuild/installXcode32"; - showEnvVarsInLog = 0; - }; 7227AB8F1098A89700BE33D7 /* Run Script */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -2052,66 +1948,6 @@ shellPath = /bin/sh; shellScript = "/bin/cp $DERIVED_FILE_DIR/thinPackages $BUILT_PRODUCTS_DIR/thinPackages"; }; - 7227AC1F1098DB9200BE33D7 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "$(SRCROOT)/darwinbuild/installXcode.in", - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/installXcode", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/usr/bin/sed -e \"s,%%PREFIX%%,$PREFIX,\" $SRCROOT/darwinbuild/installXcode.in > $DERIVED_FILE_DIR/installXcode\n\n/bin/chmod 755 $DERIVED_FILE_DIR/installXcode\n\n"; - }; - 7227AC201098DB9200BE33D7 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "$(DERIVED_FILE_DIR)/installXcode", - ); - outputPaths = ( - "$(BUILT_PRODUCTS_DIR)/installXcode", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/cp $DERIVED_FILE_DIR/installXcode $BUILT_PRODUCTS_DIR/installXcode"; - }; - 7227AC281098DBDF00BE33D7 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "$(SRCROOT)/darwinbuild/installXcode32.in", - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/installXcode32", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/usr/bin/sed -e \"s,%%PREFIX%%,$PREFIX,\" $SRCROOT/darwinbuild/installXcode32.in > $DERIVED_FILE_DIR/installXcode32\n\n/bin/chmod 755 $DERIVED_FILE_DIR/installXcode32\n\n"; - }; - 7227AC291098DBDF00BE33D7 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "$(DERIVED_FILE_DIR)/installXcode32", - ); - outputPaths = ( - "$(BUILT_PRODUCTS_DIR)/installXcode32", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/cp $DERIVED_FILE_DIR/installXcode32 $BUILT_PRODUCTS_DIR/installXcode32"; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -2374,16 +2210,6 @@ target = 7227AB3D1098977C00BE33D7 /* tcl_plugins */; targetProxy = 7227AB47109897E000BE33D7 /* PBXContainerItemProxy */; }; - 7227AC361098DC6A00BE33D7 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 7227AC271098DBDF00BE33D7 /* installXcode32 */; - targetProxy = 7227AC351098DC6A00BE33D7 /* PBXContainerItemProxy */; - }; - 7227AC381098DC6A00BE33D7 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 7227AC1E1098DB9200BE33D7 /* installXcode */; - targetProxy = 7227AC371098DC6A00BE33D7 /* PBXContainerItemProxy */; - }; 7227AC3A1098DC6A00BE33D7 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 7227AC151098D8DB00BE33D7 /* thinPackages */; @@ -2871,66 +2697,6 @@ }; name = Release; }; - 7227AC221098DB9200BE33D7 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - INSTALL_PATH = "$(DATDIR)/darwinbuild"; - PRODUCT_NAME = installXcode; - }; - name = Debug; - }; - 7227AC231098DB9200BE33D7 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - INSTALL_PATH = "$(DATDIR)/darwinbuild"; - PRODUCT_NAME = installXcode; - }; - name = Public; - }; - 7227AC241098DB9200BE33D7 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - INSTALL_PATH = "$(DATDIR)/darwinbuild"; - PRODUCT_NAME = installXcode; - }; - name = Release; - }; - 7227AC2B1098DBDF00BE33D7 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - INSTALL_PATH = "$(DATDIR)/darwinbuild"; - PRODUCT_NAME = installXcode32; - }; - name = Debug; - }; - 7227AC2C1098DBDF00BE33D7 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - INSTALL_PATH = "$(DATDIR)/darwinbuild"; - PRODUCT_NAME = installXcode32; - }; - name = Public; - }; - 7227AC2D1098DBDF00BE33D7 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - INSTALL_PATH = "$(DATDIR)/darwinbuild"; - PRODUCT_NAME = installXcode32; - }; - name = Release; - }; 7227AC321098DC4F00BE33D7 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; @@ -3978,26 +3744,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Public; }; - 7227AC211098DB9200BE33D7 /* Build configuration list for PBXNativeTarget "installXcode" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 7227AC221098DB9200BE33D7 /* Debug */, - 7227AC231098DB9200BE33D7 /* Public */, - 7227AC241098DB9200BE33D7 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; - }; - 7227AC2A1098DBDF00BE33D7 /* Build configuration list for PBXNativeTarget "installXcode32" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 7227AC2B1098DBDF00BE33D7 /* Debug */, - 7227AC2C1098DBDF00BE33D7 /* Public */, - 7227AC2D1098DBDF00BE33D7 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; - }; 7227AC451098DC9900BE33D7 /* Build configuration list for PBXAggregateTarget "darwinbuild_scripts" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/darwinbuild/installXcode_Modern b/darwinbuild/installXcode similarity index 100% rename from darwinbuild/installXcode_Modern rename to darwinbuild/installXcode diff --git a/darwinbuild/installXcode.in b/darwinbuild/installXcode.in deleted file mode 100644 index 1f81156..0000000 --- a/darwinbuild/installXcode.in +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -PREFIX=%%PREFIX%% -BINDIR=$PREFIX/share/darwinbuild - -BROOT=$1 -VER=$(/usr/bin/xcodebuild -version | grep version | cut -d "-" -f 2 | cut -d ";" -f 1 | cut -d "." -f 1) - -if [ -e /Applications/Xcode.app ]; then - "$BINDIR/installXcode_Modern" "$BROOT" "$2" - exit 0 -fi - -if [ "$VER" -gt "920" ]; -then - if [ "$VER" -gt "1000" ]; - then - if [ "$VER" -gt "1600" ]; - then - "$BINDIR/installXcode32" "$BROOT"; - else - "$BINDIR/installXcode31" "$BROOT"; - fi - else - "$BINDIR/installXcode3" "$BROOT"; - fi -else - "$BINDIR/installXcode2" "$BROOT"; -fi diff --git a/darwinbuild/installXcode2 b/darwinbuild/installXcode2 deleted file mode 100644 index 695e9a2..0000000 --- a/darwinbuild/installXcode2 +++ /dev/null @@ -1,174 +0,0 @@ -#!/bin/sh - -FORCE="YES" - -XCODEBUILD=/usr/bin/xcodebuild -BUILDROOT="$1" - -EXTRACOPY=( \ - /usr/lib/dyld \ - /usr/share/icu \ - /System/Library/CoreServices/CharacterSets \ - /Developer/Private \ - /Developer/Tools \ - /usr/bin/xcodebuild \ - /Developer/Makefiles/pbx_jamfiles \ - /Library/Application\ Support/Xcode) - -JAMFILES=/Developer/Makefiles/pbx_jamfiles -XCODESETTINGS="/System/Library/PrivateFrameworks/DevToolsCore.framework/Versions/A/Resources/BuildSettings-macosx.plist" -XCODECOMP="/System/Library/PrivateFrameworks/DevToolsCore.framework/Versions/A/Resources/Built-in compilers.pbcompspec" - -if [ -z "$BUILDROOT" ]; then - echo "Usage: $0 /Volumes/DarwinBuild/BuildRoot" 1>&2 - exit 1 -fi - -mkdir -p "$BUILDROOT" - -### -### Recurse through frameworks and libraries looking for dependencies -### -RecurseLibs() { - echo $1 >> /tmp/installXcode.seen.$$ - otool -L $1 | tail -n +2 | awk '{ print $1 }' > /tmp/installXcode.tmplibs.$$ - cat /tmp/installXcode.tmplibs.$$ >> /tmp/installXcode.libs.$$ - cat /tmp/installXcode.tmplibs.$$ | while read X; do - if ! grep -q "^$X\$" /tmp/installXcode.seen.$$ ; then - RecurseLibs $X - fi - done -} - -RemoveTemps() { - rm -f /tmp/installXcode.libs.$$ - rm -f /tmp/installXcode.seen.$$ - rm -f /tmp/installXcode.tmplibs.$$ - rm -f /tmp/installXcode.tmpfiles.$$ - rm -f /tmp/installXcode.files.$$ -} - -AppendExtraFiles() { - for X in "${EXTRACOPY[@]}"; do - echo "$X" >> /tmp/installXcode.libs.$$ - done -} - -TransformLibs() { -# set -x - while read X; do - NEWX=$(echo $X | sed -n 's/\(.*\.framework\).*/\1/p') - if [ -n "$NEWX" ]; then - # if we're copying a framework binary, copy the entire bundle - echo "$NEWX" - continue - fi - - NEWX=$(echo $X | sed -n 's/\([^.]*\)\..*dylib$/\1/p') - if [ -n "$NEWX" ]; then - # if we're copying a dylib, copy associate symlinks and stuff - for Y in "$NEWX"*.dylib; do - echo "$Y" - done - continue - fi - - echo "$X" - done -# set +x -} - -GenerateFileNames() { - cat /tmp/installXcode.libs.$$ | sort -u | TransformLibs | sort -u | while read X; do - # echo adding children for "$X" - - # first mkdir parent directories - PARENT=$(dirname "$X") - while [ "$PARENT" != "/" -a "$PARENT" != "." ]; do - echo ".$PARENT" >> /tmp/installXcode.tmpfiles.$$ - PARENT=$(dirname "$PARENT") - done - find ".$X" \! \( -name \*_debug\* -o -name \*_profile\* -o -path \*/Headers\* -o -path \*/PrivateHeaders\* -o -path \*.dict\* \) >> /tmp/installXcode.tmpfiles.$$ - done - sort -u /tmp/installXcode.tmpfiles.$$ > /tmp/installXcode.files.$$ -} - -CopyFiles() { -# VERBOSECPIO="v" - VERBOSECPIO="" - echo -n "Copying Xcode and dependencies ..." - cpio -o -c < /tmp/installXcode.files.$$ | \ - sed -e 's,/System,/XCD/SY,g' \ - -e 's,/usr/lib,/XCD/lib,g' \ - -e 's,/usr/share/icu,/XCD/share/icu,g' \ - -e 's,/Developer,/XCD/loper,g' | \ - (cd "$BUILDROOT"; cpio -ium${VERBOSECPIO}d ) - - find ".$JAMFILES" ".$XCODECOMP" | cpio -o -c | \ - sed -e 's,$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks,/XCD/SY///////Library/PrivateFrameworks,g' \ - -e 's,/Developer/Makefiles/pbx_jamfiles,/XCD/loper/Makefiles/pbx_jamfiles,g' \ - -e 's,/System/Library/PrivateFrameworks/DevToolsCore.framework,/XCD/SY/Library/PrivateFrameworks/DevToolsCore.framework,g' | \ - (cd "$BUILDROOT"; cpio -ium${VERBOSECPIO}d ) - - find ".$XCODESETTINGS" | cpio -o -c | \ - sed -e 's,/System/Library/PrivateFrameworks/DevToolsCore.framework,/XCD/SY/Library/PrivateFrameworks/DevToolsCore.framework,g' | \ - (cd "$BUILDROOT"; cpio -ium${VERBOSECPIO}d ) - - echo "done" -} - - - -### -### Find all the framework and library dependencies of Xcode build -### For frameworks, copy over all supporting files. -### - -pushd / > /dev/null - -RemoveTemps -touch /tmp/installXcode.seen.$$ -echo Analyzing Xcode dependencies ... -RecurseLibs $XCODEBUILD -AppendExtraFiles -GenerateFileNames -CopyFiles - -popd > /dev/null - -if [ ! -e "$BUILDROOT/Library/Application Support/Xcode/Specifications/GCC 3.5.xcspec" ]; -then - echo "Generating GCC 3.5.xcspec" - SRC="$BUILDROOT/Library/Application Support/Xcode/Specifications/GCC 4.0.xcspec" - if [ ! -e "$SRC" ]; then - SRC="$BUILDROOT/Library/Application Support/Xcode/Specifications/GCC 4.0.xcplugin/Contents/Resources/GCC 4.0.xcspec" - if [ ! -e "$SRC" ]; then - echo "No template for 3.5 spec" 1>&2 - exit 1 - fi - fi - sed \ - -e 's/4\.0/3.5/g' \ - -e 's/4_0/3_5/g' \ - -e '/DashIFlagAcceptsHeadermaps/d' \ - -e '/SupportsPredictiveCompilation/d' \ - -e '/SupportsSeparateUserHeaderPaths/d' \ - -e '/SupportsSymbolSeparation/d' \ - -e '/SupportsMacOSXMinVersionFlag/d' \ - -e '/SupportsIsysroot/d' \ - -e 's/SupportsHeadermaps = Yes/SupportsHeadermaps = No/' \ - -e '/USE_HEADERMAP/,/}/ s/DefaultValue = YES/DefaultValue = NO/' \ - -e '/USE_HEADER_SYMLINKS/,/}/ s/DefaultValue = NO/DefaultValue = YES/' \ - -e '/Name = GCC_MACOSX_VERSION_MIN/,/},/d' \ - -e '/Name = GCC_ENABLE_SYMBOL_SEPARATION/,/},/d' \ - -e '/Name = GCC_ENABLE_SSE3_EXTENSIONS/,/},/d' \ - -e '/Name = GCC_THREADSAFE_STATICS/,/},/d' \ - -e '/Name = GCC_OBJC_CALL_CXX_CDTORS/,/},/d' \ - -e '/Name = GCC_USE_NASM_FOR_ASM_FILETYPE/,/},/d' \ - -e '/OptionsForSDKPackages/,/};/d' \ - < "$SRC" \ - > "$BUILDROOT/Library/Application Support/Xcode/Specifications/GCC 3.5.xcspec" - -fi - -RemoveTemps diff --git a/darwinbuild/installXcode3 b/darwinbuild/installXcode3 deleted file mode 100644 index fc4e06b..0000000 --- a/darwinbuild/installXcode3 +++ /dev/null @@ -1,152 +0,0 @@ -#!/bin/sh - -FORCE="YES" - -XCODEBUILD=/Developer/usr/bin/xcodebuild -BUILDROOT="$1" - -EXTRACOPY=( \ - /usr/lib/dyld \ - /usr/share/icu \ - /Developer/Private \ - /Developer/Tools \ - /usr/bin/xcodebuild \ - /usr/bin/xcode-select \ - /Developer/usr/bin/xcodebuild \ - /Developer/Makefiles/pbx_jamfiles) - - -JAMFILES=/Developer/Makefiles/pbx_jamfiles -XCODESETTINGS="/Developer/Library/PrivateFrameworks/DevToolsCore.framework/Versions/A/Resources/BuildSettings-macosx.plist" -XCODECOMP="/Developer/Library/PrivateFrameworks/DevToolsCore.framework/Versions/A/Resources/Built-in compilers.pbcompspec" - -RPATH=/Developer/Library/PrivateFrameworks - -if [ -z "$BUILDROOT" ]; then - echo "Usage: $0 " 1>&2 - exit 1 -fi - -mkdir -p "$BUILDROOT" - -### -### Recurse through frameworks and libraries looking for dependencies -### -RecurseLibs() { - echo $1 >> /tmp/installXcode.seen.$$ - otool -L $1 | tail -n +2 | awk '{ print $1 }' > /tmp/installXcode.tmplibs.$$ - sed -e s,@rpath,${RPATH}, < /tmp/installXcode.tmplibs.$$ > /tmp/installXcode.outlibs.$$ - cat /tmp/installXcode.outlibs.$$ >> /tmp/installXcode.libs.$$ - cat /tmp/installXcode.outlibs.$$ | while read X; do - if ! grep -q "^$X\$" /tmp/installXcode.seen.$$ ; then - RecurseLibs $X - fi - done -} - -RemoveTemps() { - rm -f /tmp/installXcode.libs.$$ - rm -f /tmp/installXcode.outlibs.$$ - rm -f /tmp/installXcode.seen.$$ - rm -f /tmp/installXcode.tmplibs.$$ - rm -f /tmp/installXcode.tmpfiles.$$ - rm -f /tmp/installXcode.files.$$ -} - -AppendExtraFiles() { - for X in "${EXTRACOPY[@]}"; do - echo "$X" >> /tmp/installXcode.libs.$$ - done -} - -TransformLibs() { -# set -x - while read X; do - NEWX=$(echo $X | sed -n 's/\(.*\.framework\).*/\1/p') - if [ -n "$NEWX" ]; then - # if we're copying a framework binary, copy the entire bundle - echo "$NEWX" - continue - fi - - NEWX=$(echo $X | sed -n 's/\([^.]*\)\..*dylib$/\1/p') - if [ -n "$NEWX" ]; then - # if we're copying a dylib, copy associate symlinks and stuff - for Y in "$NEWX"*.dylib; do - echo "$Y" - done - continue - fi - - echo "$X" - done -# set +x -} - -GenerateFileNames() { - cat /tmp/installXcode.libs.$$ | sort -u | TransformLibs | sort -u | while read X; do - # echo adding children for "$X" - - # first mkdir parent directories - PARENT=$(dirname "$X") - while [ "$PARENT" != "/" -a "$PARENT" != "." ]; do - echo ".$PARENT" >> /tmp/installXcode.tmpfiles.$$ - PARENT=$(dirname "$PARENT") - done - find ".$X" \! \( -name \*_debug\* -o -name \*_profile\* -o -path \*/Headers\* -o -path \*/PrivateHeaders\* -o -path \*.dict\* \) >> /tmp/installXcode.tmpfiles.$$ - done - sort -u /tmp/installXcode.tmpfiles.$$ > /tmp/installXcode.files.$$ -} - -CopyFiles() { -# VERBOSECPIO="v" - VERBOSECPIO="" - echo "Copying Xcode and dependencies ..." - - # copy files and use sed to rewrite paths during copy - cpio -o -c < /tmp/installXcode.files.$$ | \ - sed -e 's,/System,/XCD/SY,g' \ - -e 's,/usr/lib,/XCD/lib,g' \ - -e 's,/usr/share/icu,/XCD/share/icu,g' \ - -e 's,@rpath,/XCD/R,g' \ - -e 's,/Developer,/XCD/loper,g' | \ - (cd "$BUILDROOT"; cpio -ium${VERBOSECPIO}d ) - - # symlink R to @rpath so we can replace uses of @rpath - pushd "$BUILDROOT/XCD" > /dev/null - ln -s loper/Library/PrivateFrameworks R - popd > /dev/null - - find ".$JAMFILES" ".$XCODECOMP" | cpio -o -c | \ - sed -e 's,$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks,/XCD/SY///////Library/PrivateFrameworks,g' \ - -e 's,/Developer/Makefiles/pbx_jamfiles,/XCD/loper/Makefiles/pbx_jamfiles,g' \ - -e 's,/Developer/Library/PrivateFrameworks/DevToolsCore.framework,/XCD/SY/Library/PrivateFrameworks/DevToolsCore.framework,g' | \ - (cd "$BUILDROOT"; cpio -ium${VERBOSECPIO}d ) - - find ".$XCODESETTINGS" | cpio -o -c | \ - sed -e 's,/Developer/Library/PrivateFrameworks/DevToolsCore.framework,/XCD/SY/Library/PrivateFrameworks/DevToolsCore.framework,g' | \ - (cd "$BUILDROOT"; cpio -ium${VERBOSECPIO}d ) - - echo "done" -} - - - -### -### Find all the framework and library dependencies of Xcode build -### For frameworks, copy over all supporting files. -### - -pushd / > /dev/null - -RemoveTemps -touch /tmp/installXcode.seen.$$ -echo Analyzing Xcode dependencies ... -RecurseLibs $XCODEBUILD -AppendExtraFiles -GenerateFileNames -CopyFiles - -popd > /dev/null - -RemoveTemps diff --git a/darwinbuild/installXcode31 b/darwinbuild/installXcode31 deleted file mode 100644 index 14e718f..0000000 --- a/darwinbuild/installXcode31 +++ /dev/null @@ -1,259 +0,0 @@ -#!/bin/sh - -FORCE="YES" - -XCODEBUILD=/Developer/usr/bin/xcodebuild -BUILDROOT="$1" - -EXTRACOPY=( \ - /usr/lib/dyld \ - /usr/share/icu \ - /Developer/Private \ - /Developer/Tools \ - /usr/bin/xcodebuild \ - /usr/bin/xcode-select \ - /Developer/Library/version.plist \ - /Developer/usr/bin/xcodebuild) - -BINSYMLINKS=( \ - cc \ - dsymutil \ - gcc \ - gcc-4.0 \ - gcc-4.2 \ - gcov \ - gcov-4.0 \ - gcov-4.2 \ - g++ \ - g++-4.0 \ - g++-4.2 \ - lex \ - libtool \ - mig \ - ranlib \ - strip \ - yacc) - -LIBEXECLINKS=( \ - migcom) - -JAMFILES="/Developer/Makefiles/pbx_jamfiles" -#XCODERESOURCES="/Developer/Library/PrivateFrameworks/DevToolsCore.framework/Versions/A/Resources/" - -RPATH=/Developer/Library/PrivateFrameworks - -if [ -z "$BUILDROOT" ]; then - echo "Usage: $0 " 1>&2 - exit 1 -fi - -mkdir -p "$BUILDROOT" - -### -### Symlink opensource binaries used by Xcode to /usr/bin -### so the opensource-built binary can be used instead -### of the one that ships with Xcode -### -SymlinkBinaries() { - echo "Creating symlinks for binaries ..." - - BIN_DIR="$BUILDROOT/XCD/loper/usr/bin/" - mkdir -p $BIN_DIR - pushd $BIN_DIR > /dev/null - for B in "${BINSYMLINKS[@]}"; do - ln -s "/usr/bin/$B" "$B" - done - popd > /dev/null - - LIBEXEC_DIR="$BUILDROOT/XCD/loper/usr/libexec/" - mkdir -p $LIBEXEC_DIR - pushd $LIBEXEC_DIR > /dev/null - for L in "${LIBEXECLINKS[@]}"; do - ln -s "/usr/libexec/$L" "$L" - done - popd > /dev/null - - -} - -### -### Load opensource binaries if they dont exist so we can symlink to them -### -LoadBinaries() { - echo "Loading binaries ..." - if [ ! -f "$BUILDROOT/usr/bin/gcc" ]; then - darwinbuild -load gcc - fi - if [ ! -f "$BUILDROOT/usr/bin/gcc-4.2" ]; then - darwinbuild -load gcc_42 - fi -} - -### -### Recurse through frameworks and libraries looking for dependencies -### -RecurseLibs() { - echo $1 >> /tmp/installXcode.seen.$$ - otool -L $1 | tail -n +2 | awk '{ print $1 }' > /tmp/installXcode.tmplibs.$$ - sed -e s,@rpath,${RPATH}, < /tmp/installXcode.tmplibs.$$ > /tmp/installXcode.outlibs.$$ - cat /tmp/installXcode.outlibs.$$ >> /tmp/installXcode.libs.$$ - cat /tmp/installXcode.outlibs.$$ | while read X; do - if ! grep -q "^$X\$" /tmp/installXcode.seen.$$ ; then - RecurseLibs $X - fi - done -} - -RemoveTemps() { - rm -f /tmp/installXcode.libs.$$ - rm -f /tmp/installXcode.outlibs.$$ - rm -f /tmp/installXcode.seen.$$ - rm -f /tmp/installXcode.tmplibs.$$ - rm -f /tmp/installXcode.tmpfiles.$$ - rm -f /tmp/installXcode.files.$$ -} - -AppendExtraFiles() { - for X in "${EXTRACOPY[@]}"; do - echo "$X" >> /tmp/installXcode.libs.$$ - done -} - -TransformLibs() { -# set -x - while read X; do - NEWX=$(echo $X | sed -n 's/\(.*\.framework\).*/\1/p') - if [ -n "$NEWX" ]; then - # if we're copying a framework binary, copy the entire bundle - echo "$NEWX" - continue - fi - - NEWX=$(echo $X | sed -n 's/\([^.]*\)\..*dylib$/\1/p') - if [ -n "$NEWX" ]; then - # if we're copying a dylib, copy associate symlinks and stuff - for Y in "$NEWX"*.dylib; do - echo "$Y" - done - continue - fi - - echo "$X" - done -# set +x -} - -GenerateFileNames() { - cat /tmp/installXcode.libs.$$ | sort -u | TransformLibs | sort -u | while read X; do - # echo adding children for "$X" - - # first mkdir parent directories - PARENT=$(dirname "$X") - while [ "$PARENT" != "/" -a "$PARENT" != "." ]; do - echo ".$PARENT" >> /tmp/installXcode.tmpfiles.$$ - PARENT=$(dirname "$PARENT") - done - find ".$X" \! \( -name \*_debug\* -o -name \*_profile\* -o -path \*/Headers\* -o -path \*/PrivateHeaders\* -o -path \*.dict\* \) >> /tmp/installXcode.tmpfiles.$$ - done - sort -u /tmp/installXcode.tmpfiles.$$ > /tmp/installXcode.files.$$ -} - -CopyFiles() { -# VERBOSECPIO="v" - VERBOSECPIO="" - echo "Copying Xcode and dependencies ..." - - # copy files and use sed to rewrite paths during copy - cpio -o -c < /tmp/installXcode.files.$$ | \ - sed -e 's,/System,/XCD/SY,g' \ - -e 's,CoreServices/XCD/SY,CoreServices/System,g' \ - -e 's,Resources/XCD/SY,Resources/System,g' \ - -e 's,/usr/lib,/XCD/lib,g' \ - -e 's,/usr/share/icu,/XCD/share/icu,g' \ - -e 's,@rpath,/XCD/R,g' \ - -e 's,/Developer,/XCD/loper,g' \ - -e 's,platform/XCD/loper,platform/Developer,g' | \ - (cd "$BUILDROOT"; cpio -ium${VERBOSECPIO}d ) - - echo "Symlinking for RPATH ..." - # symlink R to @rpath so we can replace uses of @rpath - pushd "$BUILDROOT/XCD" > /dev/null - ln -s loper/Library/PrivateFrameworks R - popd > /dev/null - - echo "Copying Jamfiles ..." - find ".$JAMFILES" | cpio -o -c | \ - sed -e 's,$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks,/XCD/SY///////Library/PrivateFrameworks,g' \ - -e 's,/Developer/Makefiles/pbx_jamfiles,/XCD/loper/Makefiles/pbx_jamfiles,g' \ - -e 's,/Developer/Library/PrivateFrameworks/DevToolsCore.framework,/XCD/loper/Library/PrivateFrameworks/DevToolsCore.framework,g' | \ - (cd "$BUILDROOT"; cpio -ium${VERBOSECPIO}d ) - - - echo "Copying CoreServices ..." - find ./System/Library/CoreServices/System*.{plist,bundle} \ - ./System/Library/CoreServices/CoreTypes.bundle/ \ - | cpio -o -c | \ - sed -e 's,/System,/XCD/SY,g' \ - -e 's,CoreServices/XCD/SY,CoreServices/System,g' \ - -e 's,Resources/XCD/SY,Resources/System,g' \ - -e 's,/usr/lib,/XCD/lib,g' \ - -e 's,/usr/share/icu,/XCD/share/icu,g' \ - -e 's,@rpath,/XCD/R,g' \ - -e 's,/Developer,/XCD/loper,g' \ - -e 's,platform/XCD/loper,platform/Developer,g' | \ - (cd "$BUILDROOT"; cpio -ium${VERBOSECPIO}d ) - - # copy xcode support files such as plugins - # but do not copy svn plugins since they are unecessary - echo "Copying Xcode library support files ..." - find "./Developer/Library/Xcode/" \! -ipath '*subversion*' \ - | cpio -o -c | \ - sed -e 's,/System,/XCD/SY,g' \ - -e 's,CoreServices/XCD/SY,CoreServices/System,g' \ - -e 's,Resources/XCD/SY,Resources/System,g' \ - -e 's,/usr/lib,/XCD/lib,g' \ - -e 's,/usr/share/icu,/XCD/share/icu,g' \ - -e 's,@rpath,/XCD/R,g' \ - -e 's,/Developer,/XCD/loper,g' \ - -e 's,platform/XCD/loper,platform/Developer,g' | \ - (cd "$BUILDROOT"; cpio -ium${VERBOSECPIO}d ) - - # Platform - echo "Copying Mac OS X Platform ..." - find "./Developer/Platforms/MacOSX.platform" | cpio -o -c | \ - sed -e 's,/System,/XCD/SY,g' \ - -e 's,CoreServices/XCD/SY,CoreServices/System,g' \ - -e 's,Resources/XCD/SY,Resources/System,g' \ - -e 's,/usr/lib,/XCD/lib,g' \ - -e 's,/usr/share/icu,/XCD/share/icu,g' \ - -e 's,@rpath,/XCD/R,g' \ - -e 's,/Developer,/XCD/loper,g' \ - -e 's,platform/XCD/loper,platform/Developer,g' | \ - (cd "$BUILDROOT"; cpio -ium${VERBOSECPIO}d ) - -} - - - -### -### Find all the framework and library dependencies of Xcode build -### For frameworks, copy over all supporting files. -### - -pushd / > /dev/null - -RemoveTemps -touch /tmp/installXcode.seen.$$ -echo Analyzing Xcode dependencies ... -RecurseLibs $XCODEBUILD -AppendExtraFiles -GenerateFileNames -CopyFiles -LoadBinaries -SymlinkBinaries - -popd > /dev/null - -#RemoveTemps - -echo "Completed Xcode installation!" diff --git a/darwinbuild/installXcode32.in b/darwinbuild/installXcode32.in deleted file mode 100644 index df6703d..0000000 --- a/darwinbuild/installXcode32.in +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh - -FORCE="YES" -XCODEBUILD=/Developer/usr/bin/xcodebuild -BUILDROOT="$1" -DBROOT=$(dirname $BUILDROOT) -PLATFORMDIR="${DBROOT}/Platform" -STAMP=$(date +%Y%m%d%H%M%S) -BUILD=$(cat $DBROOT/.build/build) -PLATFORM="Darwinbuild_${BUILD}_${STAMP}" -INFOPLIST=%%PREFIX%%/share/darwinbuild/Info.plist -SDKPLIST=%%PREFIX%%/share/darwinbuild/SDKSettings.plist - -echo $PLATFORM > "${DBROOT}/.build/platform" -echo "Installing Platform/SDK $PLATFORM for Xcode 3.2" - -mkdir -p "${PLATFORMDIR}/Developer/SDKs" -mkdir -p "${PLATFORMDIR}/Developer/Library/Xcode" - -rsync -a "/Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/" \ - "${PLATFORMDIR}/Developer/Library/Xcode" - -sed -e "s,%%PLATFORM%%,${PLATFORM}," $INFOPLIST > "${PLATFORMDIR}/Info.plist" -sed -e "s,%%PLATFORM%%,${PLATFORM}," $SDKPLIST > "${BUILDROOT}/SDKSettings.plist" - -pushd "${PLATFORMDIR}/Developer" > /dev/null -ln -s ../../BuildRoot/usr/ usr -popd > /dev/null - -pushd "${PLATFORMDIR}/Developer/SDKs" > /dev/null -ln -s ../../../BuildRoot/ "${PLATFORM}.sdk" -popd > /dev/null - -pushd "/Developer/Platforms" > /dev/null -ln -s "$PLATFORMDIR" "${PLATFORM}.platform" -popd > /dev/null - -mkdir -p "${DBROOT}/BuildRoot/Developer/" -pushd "${DBROOT}/BuildRoot/Developer/" > /dev/null -ln -s ../usr usr -popd > /dev/null - -echo "Completed Platform/SDK install" - From e79b8cc422020c247044225534299229b0cfaf10 Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 14 Dec 2018 13:57:02 -0500 Subject: [PATCH 177/382] Simplify installXcode script --- darwinbuild/installXcode | 45 +++++++--------------------------------- 1 file changed, 7 insertions(+), 38 deletions(-) diff --git a/darwinbuild/installXcode b/darwinbuild/installXcode index 666cac7..efca2d0 100755 --- a/darwinbuild/installXcode +++ b/darwinbuild/installXcode @@ -70,14 +70,13 @@ mkdir -p $BUILDROOT/$(getconf DARWIN_USER_DIR) mkdir -p $BUILDROOT/$(getconf DARWIN_USER_TEMP_DIR) mkdir -p $BUILDROOT/$(getconf DARWIN_USER_CACHE_DIR) -if [[ "$HOST_DARWIN_VERSION" =~ ^10.14 ]]; then - mkdir -p $BUILDROOT/private/var/db - ln -s $XCODE_PATH/Contents/Developer $BUILDROOT/private/var/db/xcode_select_link +mkdir -p $BUILDROOT/private/var/db +ln -s $XCODE_PATH/Contents/Developer $BUILDROOT/private/var/db/xcode_select_link - # macOS versions >= 10.13 do not allow processes with entitlements - # to run inside a chroot. Therefore, I must strip the entitlements - # and re-sign xcodebuild. Hopefully, this won't break anything. - cat < $BUILDROOT/private/tmp/empty.entitlements +# macOS versions >= 10.13 do not allow processes with entitlements +# to run inside a chroot. Therefore, I must strip the entitlements +# and re-sign xcodebuild. Hopefully, this won't break anything. +cat < $BUILDROOT/private/tmp/empty.entitlements @@ -86,34 +85,4 @@ if [[ "$HOST_DARWIN_VERSION" =~ ^10.14 ]]; then EOF - codesign -s - -f --entitlements $BUILDROOT/private/tmp/empty.entitlements $BUILDROOT$XCODE_PATH/Contents/Developer/usr/bin/xcodebuild -elif [[ "$HOST_DARWIN_VERSION" =~ ^10.13 ]]; then - rm $BUILDROOT$XCODE_PATH/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk - mv $BUILDROOT$XCODE_PATH/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk $BUILDROOT$XCODE_PATH/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk - - mkdir -p $BUILDROOT/private/var/db - ln -s $XCODE_PATH/Contents/Developer $BUILDROOT/private/var/db/xcode_select_link - - if [ -x /usr/local/share/darwinbuild/xcbuild ]; then - # If it is available, overwrite Apple's xcodebuild with xcbuild. - # This helps avoid the issue described in the 'else' block below. - cp -f /usr/local/share/darwinbuild/xcbuild $BUILDROOT$XCODE_PATH/Contents/Developer/usr/bin/xcodebuild - else - # High Sierra does not allow processes with entitlements to run inside a chroot. - # Therefore, I must strip the entitlements and re-sign xcodebuild. - # Hopefully, this won't break anything. - cat < $BUILDROOT/private/tmp/empty.entitlements - - - - - - -EOF - - codesign -s - -f --entitlements $BUILDROOT/private/tmp/empty.entitlements $BUILDROOT$XCODE_PATH/Contents/Developer/usr/bin/xcodebuild - fi -elif [[ "$HOST_DARWIN_VERSION" =~ ^10.12 ]]; then - rm $BUILDROOT$XCODE_PATH/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk - mv $BUILDROOT$XCODE_PATH/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk $BUILDROOT$XCODE_PATH/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -fi +codesign -s - -f --entitlements $BUILDROOT/private/tmp/empty.entitlements $BUILDROOT$XCODE_PATH/Contents/Developer/usr/bin/xcodebuild From 8584a9ce331707a65acc5d9b8f19e17b4ab2f4b1 Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 14 Dec 2018 14:19:19 -0500 Subject: [PATCH 178/382] Get rid of unneeded plist files These were only required if using Xcode 2.x or 3.x. Later versions ignore them. --- darwinbuild.xcodeproj/project.pbxproj | 8 -------- darwinbuild/Info.plist | 28 --------------------------- darwinbuild/SDKSettings.plist | 27 -------------------------- 3 files changed, 63 deletions(-) delete mode 100644 darwinbuild/Info.plist delete mode 100644 darwinbuild/SDKSettings.plist diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 9627d17..2df970c 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -111,8 +111,6 @@ 7227AD20109A05FA00BE33D7 /* thinFile in Copy Files */ = {isa = PBXBuildFile; fileRef = 7227AB8C1098A7BF00BE33D7 /* thinFile */; }; 7227AD21109A05FA00BE33D7 /* createChroot in Copy Files */ = {isa = PBXBuildFile; fileRef = 72C86C221096600B00C66E90 /* createChroot */; }; 7227AD22109A05FA00BE33D7 /* darwinbuild.common in Copy Files */ = {isa = PBXBuildFile; fileRef = 72C86C231096600B00C66E90 /* darwinbuild.common */; }; - 7227AD23109A05FA00BE33D7 /* Info.plist in Copy Files */ = {isa = PBXBuildFile; fileRef = 72C86C271096600B00C66E90 /* Info.plist */; }; - 7227AD27109A05FA00BE33D7 /* SDKSettings.plist in Copy Files */ = {isa = PBXBuildFile; fileRef = 72C86C311096600B00C66E90 /* SDKSettings.plist */; }; 72573FF71097A601008AD4D7 /* dependencies.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BF810965EEA00C66E90 /* dependencies.c */; }; 72573FF81097A60C008AD4D7 /* diff.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BFA10965EEA00C66E90 /* diff.c */; }; 72573FF91097A64C008AD4D7 /* dot.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BFB10965EEA00C66E90 /* dot.c */; }; @@ -602,8 +600,6 @@ 7227AD20109A05FA00BE33D7 /* thinFile in Copy Files */, 7227AD21109A05FA00BE33D7 /* createChroot in Copy Files */, 7227AD22109A05FA00BE33D7 /* darwinbuild.common in Copy Files */, - 7227AD23109A05FA00BE33D7 /* Info.plist in Copy Files */, - 7227AD27109A05FA00BE33D7 /* SDKSettings.plist in Copy Files */, ); name = "Copy Files"; runOnlyForDeploymentPostprocessing = 1; @@ -707,9 +703,7 @@ 72C86C221096600B00C66E90 /* createChroot */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = createChroot; path = darwinbuild/createChroot; sourceTree = ""; }; 72C86C231096600B00C66E90 /* darwinbuild.common */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = darwinbuild.common; path = darwinbuild/darwinbuild.common; sourceTree = ""; }; 72C86C241096600B00C66E90 /* darwinbuild.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = darwinbuild.in; path = darwinbuild/darwinbuild.in; sourceTree = ""; }; - 72C86C271096600B00C66E90 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = darwinbuild/Info.plist; sourceTree = ""; }; 72C86C2E1096600B00C66E90 /* manifest.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = manifest.c; path = darwinbuild/manifest.c; sourceTree = ""; }; - 72C86C311096600B00C66E90 /* SDKSettings.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = SDKSettings.plist; path = darwinbuild/SDKSettings.plist; sourceTree = ""; }; 72C86C381096607900C66E90 /* darwinbuild */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = darwinbuild; sourceTree = BUILT_PRODUCTS_DIR; }; 72C86C52109660CA00C66E90 /* darwintrace.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = darwintrace.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; 72C86CE310974CC800C66E90 /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = /usr/lib/libsqlite3.dylib; sourceTree = ""; }; @@ -977,11 +971,9 @@ 72C86C231096600B00C66E90 /* darwinbuild.common */, 7227AC0A1098D7CE00BE33D7 /* darwinmaster.in */, 72C86C241096600B00C66E90 /* darwinbuild.in */, - 72C86C271096600B00C66E90 /* Info.plist */, 1FC854001ED462DF00EA2AF5 /* installXcode */, 1FECB5DE1FBBBC09002EA059 /* setXcodePlatform */, 72C86C2E1096600B00C66E90 /* manifest.c */, - 72C86C311096600B00C66E90 /* SDKSettings.plist */, ); name = darwinbuild; sourceTree = ""; diff --git a/darwinbuild/Info.plist b/darwinbuild/Info.plist deleted file mode 100644 index 01b20c6..0000000 --- a/darwinbuild/Info.plist +++ /dev/null @@ -1,28 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleIdentifier - org.macosforge.darwinbuild.platforms.%%PLATFORM%% - CFBundleName - %%PLATFORM%% SDKs - CFBundleShortVersionString - 1 - Description - %%PLATFORM%% - FamilyIdentifier - %%PLATFORM%% - FamilyName - %%PLATFORM%% - Identifier - org.macosforge.darwinbuild.platforms.%%PLATFORM%% - Name - %%PLATFORM%% - Type - Platform - Version - 1 - - diff --git a/darwinbuild/SDKSettings.plist b/darwinbuild/SDKSettings.plist deleted file mode 100644 index 8f55117..0000000 --- a/darwinbuild/SDKSettings.plist +++ /dev/null @@ -1,27 +0,0 @@ - - - - - CanonicalName - %%PLATFORM%% - DefaultProperties - - MACOSX_DEPLOYMENT_TARGET - 10.6 - PLATFORM_NAME - %%PLATFORM%% - - DisplayName - %%PLATFORM%% - MaximumDeploymentTarget - 10.6 - MinimalDisplayName - 10.6 - MinimumSupportedToolsVersion - 3.2 - Version - 10.6 - isBaseSDK - YES - - From 1507ee9e4fef8a93ecd385c9179b7716dc6d105a Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 14 Dec 2018 14:19:43 -0500 Subject: [PATCH 179/382] Get rid of unused script --- darwinbuild.xcodeproj/project.pbxproj | 4 ---- darwinbuild/ditto | 25 ------------------------- 2 files changed, 29 deletions(-) delete mode 100644 darwinbuild/ditto diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 2df970c..f01e9c5 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -106,7 +106,6 @@ 7227AB7510989F8D00BE33D7 /* manifest.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86C2E1096600B00C66E90 /* manifest.c */; }; 7227AD1C109A05FA00BE33D7 /* buildlist in Copy Files */ = {isa = PBXBuildFile; fileRef = 7227AB871098A7BF00BE33D7 /* buildlist */; }; 7227AD1D109A05FA00BE33D7 /* buildorder in Copy Files */ = {isa = PBXBuildFile; fileRef = 7227AB881098A7BF00BE33D7 /* buildorder */; }; - 7227AD1E109A05FA00BE33D7 /* ditto in Copy Files */ = {isa = PBXBuildFile; fileRef = 7227AB891098A7BF00BE33D7 /* ditto */; }; 7227AD1F109A05FA00BE33D7 /* synthfat in Copy Files */ = {isa = PBXBuildFile; fileRef = 7227AB8B1098A7BF00BE33D7 /* synthfat */; }; 7227AD20109A05FA00BE33D7 /* thinFile in Copy Files */ = {isa = PBXBuildFile; fileRef = 7227AB8C1098A7BF00BE33D7 /* thinFile */; }; 7227AD21109A05FA00BE33D7 /* createChroot in Copy Files */ = {isa = PBXBuildFile; fileRef = 72C86C221096600B00C66E90 /* createChroot */; }; @@ -595,7 +594,6 @@ 1FECB5DF1FBBBD41002EA059 /* setXcodePlatform in Copy Files */, 7227AD1C109A05FA00BE33D7 /* buildlist in Copy Files */, 7227AD1D109A05FA00BE33D7 /* buildorder in Copy Files */, - 7227AD1E109A05FA00BE33D7 /* ditto in Copy Files */, 7227AD1F109A05FA00BE33D7 /* synthfat in Copy Files */, 7227AD20109A05FA00BE33D7 /* thinFile in Copy Files */, 7227AD21109A05FA00BE33D7 /* createChroot in Copy Files */, @@ -623,7 +621,6 @@ 7227AB6D10989A9900BE33D7 /* manifest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = manifest; sourceTree = BUILT_PRODUCTS_DIR; }; 7227AB871098A7BF00BE33D7 /* buildlist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = buildlist; path = darwinbuild/buildlist; sourceTree = ""; }; 7227AB881098A7BF00BE33D7 /* buildorder */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; name = buildorder; path = darwinbuild/buildorder; sourceTree = ""; }; - 7227AB891098A7BF00BE33D7 /* ditto */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = ditto; path = darwinbuild/ditto; sourceTree = ""; }; 7227AB8A1098A7BF00BE33D7 /* packageRoots.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = packageRoots.in; path = darwinbuild/packageRoots.in; sourceTree = ""; }; 7227AB8B1098A7BF00BE33D7 /* synthfat */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = synthfat; path = darwinbuild/synthfat; sourceTree = ""; }; 7227AB8C1098A7BF00BE33D7 /* thinFile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = thinFile; path = darwinbuild/thinFile; sourceTree = ""; }; @@ -962,7 +959,6 @@ 720BE2E9120C909E00B3C4A5 /* digest.c */, 7227AB871098A7BF00BE33D7 /* buildlist */, 7227AB881098A7BF00BE33D7 /* buildorder */, - 7227AB891098A7BF00BE33D7 /* ditto */, 7227AB8A1098A7BF00BE33D7 /* packageRoots.in */, 7227AB8B1098A7BF00BE33D7 /* synthfat */, 7227AB8C1098A7BF00BE33D7 /* thinFile */, diff --git a/darwinbuild/ditto b/darwinbuild/ditto deleted file mode 100644 index 8711a80..0000000 --- a/darwinbuild/ditto +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -INDEX=0 -COUNT=$# -for ARG in "$@" ; do - INDEX=$(($INDEX + 1)) - if [ "$ARG" == "-c" -o "$ARG" == "-x" ]; then - echo "Error: -c and -x are not supported by this ditto." 1>&2 - exit 1 - elif [ "${ARG:0:1}" != "-" -o "$ARG" == "--" ]; then - break - fi -done - -DST=${@:$COUNT:1} -for SRC in ${@:$INDEX:$(($COUNT - $INDEX))} ; do - if [ -d "$SRC" ]; then - if [ ! -d "$DST" ]; then - mkdir -p "$DST" - fi - tar cf - -C "$SRC" . | tar xpf - -C "$DST" - elif [ -f "$SRC" ]; then - cp -p "$SRC" "$DST" - fi -done From 4ab8c4be7dcea6768e6bfbb72b7cc4e2ef872676 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 17 Dec 2018 22:02:02 -0500 Subject: [PATCH 180/382] Add --prefix support to darwinbuild-codesign --- darwinbuild/darwinbuild-codesign | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild-codesign b/darwinbuild/darwinbuild-codesign index 4599cc6..2910ea2 100755 --- a/darwinbuild/darwinbuild-codesign +++ b/darwinbuild/darwinbuild-codesign @@ -125,6 +125,7 @@ if default_certificate is None: exit(1) default_hardened_runtime = safe_get(codesign_plist, 'hardened_runtime', default=False) +default_prefix = safe_get(codesign_plist, 'prefix') signing_map = {} for (filename, value) in codesign_plist['files'].items(): @@ -134,6 +135,7 @@ for (filename, value) in codesign_plist['files'].items(): certificate = default_certificate identifier = None + prefix = None entitlements = None hardened_runtime = default_hardened_runtime dr = None @@ -144,6 +146,7 @@ for (filename, value) in codesign_plist['files'].items(): elif isinstance(value, dict): certificate = safe_get(value, 'certificate', default=default_certificate) identifier = safe_get(value, 'identifier') + prefix = safe_get(value, 'prefix', default=default_prefix) entitlements = safe_get(value, 'entitlements') if entitlements is not None: entitlements = os.path.join(srcroot, entitlements) @@ -164,7 +167,10 @@ for (filename, value) in codesign_plist['files'].items(): identifier = get_bundle_identifier(filename) codesign_argv = ['/usr/bin/codesign', '-s', certificate, '-f'] - if identifier is not None: + if prefix is not None: + codesign_argv.append('--prefix') + codesign_argv.append(prefix) + elif identifier is not None: codesign_argv.append('-i') codesign_argv.append(identifier) if dr is not None: From 447bcb2903371e6764733400c2c8944879b8a6e9 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 17 Dec 2018 22:02:16 -0500 Subject: [PATCH 181/382] Simplify sort call --- darwinbuild/darwinbuild-codesign | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild-codesign b/darwinbuild/darwinbuild-codesign index 2910ea2..b8e80c0 100755 --- a/darwinbuild/darwinbuild-codesign +++ b/darwinbuild/darwinbuild-codesign @@ -189,7 +189,7 @@ for (filename, value) in codesign_plist['files'].items(): signing_map[order].append(codesign_argv) key_vector = signing_map.keys() -key_vector.sort(cmp=lambda a, b: cmp(a, b)) +key_vector.sort(cmp=cmp) for order_index in key_vector: for argv in signing_map[order_index]: From ccc8acfa459f6923feb46fcb4c3bcec1682c9f65 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 17 Dec 2018 22:06:56 -0500 Subject: [PATCH 182/382] Remove get_bundle_identifier() function from darwinbuild-codesign codesign is smart enough to do this by itself. --- darwinbuild/darwinbuild-codesign | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/darwinbuild/darwinbuild-codesign b/darwinbuild/darwinbuild-codesign index b8e80c0..9dd597d 100755 --- a/darwinbuild/darwinbuild-codesign +++ b/darwinbuild/darwinbuild-codesign @@ -111,14 +111,6 @@ def safe_get(dict, key, default=None): else: return default -def get_bundle_identifier(bundle_path): - info_plist_path = os.path.join(bundle_path, 'Contents', 'Info.plist') - if os.path.exists(info_plist_path): - info_plist = plistlib.readPlist(info_plist_path) - return safe_get(info_plist, 'CFBundleIdentifier') - - return None - default_certificate = safe_get(codesign_plist, 'certificate') if default_certificate is None: print('Default certificate must be provided (use "certificate" key in top-level of plist)', file=sys.stderr) @@ -163,9 +155,6 @@ for (filename, value) in codesign_plist['files'].items(): print('Error in darwinbuild-codesign.plist: Values in "files" dictionary must be booleans or dictionaries only') exit(1) - if identifier is None and os.path.isdir(filename): - identifier = get_bundle_identifier(filename) - codesign_argv = ['/usr/bin/codesign', '-s', certificate, '-f'] if prefix is not None: codesign_argv.append('--prefix') From d7c05ac15134656a5686ed0ff3f4bf2f15d72205 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 17 Dec 2018 22:13:58 -0500 Subject: [PATCH 183/382] Add darwinbuild-recursive script --- darwinbuild.xcodeproj/project.pbxproj | 4 ++ darwinbuild/darwinbuild-recursive | 78 +++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100755 darwinbuild/darwinbuild-recursive diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index f01e9c5..92c1670 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -87,6 +87,7 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ + 1F12836121C89D2C00E3A732 /* darwinbuild-recursive in Copy Files */ = {isa = PBXBuildFile; fileRef = 1F12836021C89D2C00E3A732 /* darwinbuild-recursive */; }; 1F514C441F4A5CDA008D9341 /* fetch-from-github in Copy Files */ = {isa = PBXBuildFile; fileRef = 1F514C431F4A5CC0008D9341 /* fetch-from-github */; }; 1FC854011ED462EE00EA2AF5 /* installXcode in Copy Files */ = {isa = PBXBuildFile; fileRef = 1FC854001ED462DF00EA2AF5 /* installXcode */; }; 1FECB5DF1FBBBD41002EA059 /* setXcodePlatform in Copy Files */ = {isa = PBXBuildFile; fileRef = 1FECB5DE1FBBBC09002EA059 /* setXcodePlatform */; }; @@ -596,6 +597,7 @@ 7227AD1D109A05FA00BE33D7 /* buildorder in Copy Files */, 7227AD1F109A05FA00BE33D7 /* synthfat in Copy Files */, 7227AD20109A05FA00BE33D7 /* thinFile in Copy Files */, + 1F12836121C89D2C00E3A732 /* darwinbuild-recursive in Copy Files */, 7227AD21109A05FA00BE33D7 /* createChroot in Copy Files */, 7227AD22109A05FA00BE33D7 /* darwinbuild.common in Copy Files */, ); @@ -605,6 +607,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 1F12836021C89D2C00E3A732 /* darwinbuild-recursive */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; name = "darwinbuild-recursive"; path = "darwinbuild/darwinbuild-recursive"; sourceTree = ""; }; 1F4A793721B9F123000FE4B5 /* conclusion.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = conclusion.html; path = installer/conclusion.html; sourceTree = ""; }; 1F4A793821B9F123000FE4B5 /* license.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = license.html; path = installer/license.html; sourceTree = ""; }; 1F4A793921B9F123000FE4B5 /* welcome.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = welcome.html; path = installer/welcome.html; sourceTree = ""; }; @@ -955,6 +958,7 @@ 72C86BD510965DC900C66E90 /* darwinbuild */ = { isa = PBXGroup; children = ( + 1F12836021C89D2C00E3A732 /* darwinbuild-recursive */, 1F514C431F4A5CC0008D9341 /* fetch-from-github */, 720BE2E9120C909E00B3C4A5 /* digest.c */, 7227AB871098A7BF00BE33D7 /* buildlist */, diff --git a/darwinbuild/darwinbuild-recursive b/darwinbuild/darwinbuild-recursive new file mode 100755 index 0000000..435277b --- /dev/null +++ b/darwinbuild/darwinbuild-recursive @@ -0,0 +1,78 @@ +#!/usr/bin/python + +from __future__ import print_function +import sys, os +import plistlib +import subprocess + +if len(sys.argv) != 3: + print('Internal tool used by darwinbuild, please do not invoke directly', file=sys.stderr) + exit(1) + +darwin_buildroot = os.getcwd() +if os.getenv('DARWIN_BUILDROOT') is not None: + darwin_buildroot = os.getenv('DARWIN_BUILDROOT') + os.chdir(darwin_buildroot) + +valid_buildroot = True +for name in ['Roots', 'Sources', 'Symbols', 'Headers', 'Logs']: + valid_buildroot = os.path.isdir(name) + +if not valid_buildroot: + print('ERROR: Could not find darwinbuild root, this is required', file=sys.stderr) + print('Please change your working directory to one initialized by:', file=sys.stderr) + print('\t$ darwinbuild -init ', file=sys.stderr) + print('Alternatively, you may set the DARWIN_BUILDROOT environment variable to the', file=sys.stderr) + print('absolute path of that directory.', file=sys.stderr) + exit(1) + +group_mode = False +input_name = sys.argv[2] + +if sys.argv[1] == '-g': + group_mode = True +elif sys.argv[1] != '-p': + print('ERROR: First argument must be either -g or -p', file=sys.stderr) + exit(1) + +header_deps_done = {} +build_deps_done = {} + +def recursive_build(project, is_header=False): + if project == '': return + + if is_header: + if project in header_deps_done: + return + else: + if project in build_deps_done: + return + + if is_header: + header_deps_done[project] = True + else: + build_deps_done[project] = True + + build_deps = subprocess.check_output(['darwinxref', 'dependencies', '-build', project]).split('\n') + header_deps = subprocess.check_output(['darwinxref', 'dependencies', '-header', project]).split('\n') + + for dep in header_deps: + recursive_build(dep, is_header=True) + for dep in build_deps: + recursive_build(dep, is_header=False) + + darwinbuild_argv = ['darwinbuild'] + if is_header: + darwinbuild_argv.append('-headers') + darwinbuild_argv.append(project) + + subprocess.check_call(darwinbuild_argv, stdout=sys.stdout, stderr=sys.stderr) + +if group_mode: + group_output = subprocess.check_output(['darwinxref', 'group', input_name]) + group_output = group_output.split('\n') + for line in group_output: + for project in line.split(' '): + recursive_build(project) +else: + recursive_build(input_name) From 8fcb76a35d9f800217a5fa074d796e3e22e01775 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 17 Dec 2018 22:20:29 -0500 Subject: [PATCH 184/382] Add -recursive and -group flags to darwinbuild --- darwinbuild/darwinbuild.in | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 03ce5f6..cdb7540 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -190,7 +190,7 @@ fi function PrintUsage() { cat <<-EOF 1>&2 usage: $(basename $0) [action] [options] [] - actions: [-headers] [-fetch] [-source] [-load] [-loadonly] + actions: [-headers] [-fetch] [-source] [-load] [-loadonly] [-recursive] [-group] options: [-build=X] [-target=X] [-configuration=X] [-logdeps] [-nochroot] [-chroot] [-nopatch] [-noload] [-depsbuild=X [-depsbuild=Y]] [-nosource] @@ -261,12 +261,14 @@ fi ### Interpret our arguments: ### ### Actions: -### -headers Do the installhdrs phase, instead of install -### -fetch Only download necessary source and patch files -### -source Extract, patch, and stage source -### -load Populate the BuildRoot with one project -### -loadonly Only load dependencies into the chroot, but -### don't build. +### -headers Do the installhdrs phase, instead of install +### -fetch Only download necessary source and patch files +### -source Extract, patch, and stage source +### -load Populate the BuildRoot with one project +### -loadonly Only load dependencies into the chroot, but don't build. +### -recursive Build given project and all required dependencies +### -group Build all projects in the given darwinxref group, +### as with darwinbuild -recursive ### ### Options: ### -nosource Do not fetch or stage source. This assumes that the @@ -304,6 +306,10 @@ for ARG in "$@"; do action="fetch" elif [ "$ARG" == "-source" ]; then action="source" + elif [ "$ARG" = "-recursive" ]; then + action="recursive" + elif [ "$ARG" = "-group" ]; then + action="group" elif [ "${ARG/=*/}" == "-target" ]; then target="${ARG/*=/}" elif [ "${ARG/=*/}" == "-configuration" ]; then @@ -380,6 +386,7 @@ fi ### ### If we are doing a -load, install the root and exit. +### Also handle -recursive and -group here. ### if [ "$action" == "load" ]; then InstallRoot "$BuildRoot" "$projnam" "$depsbuild" @@ -387,6 +394,10 @@ if [ "$action" == "load" ]; then elif [ "$action" == "loadhdrs" ]; then InstallHeader "$BuildRoot" "$projnam" "$depsbuild" exit 0 +elif [ "$action" == "recursive" ]; then + exec $DATADIR/darwinbuild-recursive -p "$projnam" +elif [ "$action" == "group" ]; then + exec $DATADIR/darwinbuild-recursive -g "$projnam" fi # From 77f9fa999a64bf8a895d01838e648f0a92ee9f01 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 17 Dec 2018 22:22:45 -0500 Subject: [PATCH 185/382] Improve darwinbuild-recursive error handling --- darwinbuild/darwinbuild-recursive | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild-recursive b/darwinbuild/darwinbuild-recursive index 435277b..fad0957 100755 --- a/darwinbuild/darwinbuild-recursive +++ b/darwinbuild/darwinbuild-recursive @@ -66,7 +66,11 @@ def recursive_build(project, is_header=False): darwinbuild_argv.append('-headers') darwinbuild_argv.append(project) - subprocess.check_call(darwinbuild_argv, stdout=sys.stdout, stderr=sys.stderr) + try: + subprocess.check_call(darwinbuild_argv, stdout=sys.stdout, stderr=sys.stderr) + except subprocess.CalledProcessError, e: + print(' '.join(darwinbuild_argv), 'failed with code', e.returncode, file=sys.stderr) + exit(1) if group_mode: group_output = subprocess.check_output(['darwinxref', 'group', input_name]) From ff60626ddc87aa5aa91f44e141a68dd5de8df995 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 17 Dec 2018 22:23:12 -0500 Subject: [PATCH 186/382] Remove reference to deleted script --- darwinbuild/darwinbuild.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index cdb7540..b18216b 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -82,7 +82,7 @@ DATADIR=$PREFIX/share/darwinbuild DIGEST=$DATADIR/digest COMMONFILE=$DATADIR/darwinbuild.common DARWINTRACE=$DATADIR/darwintrace.dylib -DITTO=$DATADIR/ditto +DITTO=ditto DEFAULTPLISTSITE=http://svn.macosforge.org/repository/darwinbuild/trunk/plists/ build="" From 0dbbab6fe820649089b813011a26aaa0533c0b89 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 17 Dec 2018 22:25:16 -0500 Subject: [PATCH 187/382] Install darwinbuild-codesign into bin directory --- darwinbuild.xcodeproj/project.pbxproj | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 92c1670..7cab555 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -23,6 +23,7 @@ buildConfigurationList = 7227AC451098DC9900BE33D7 /* Build configuration list for PBXAggregateTarget "darwinbuild_scripts" */; buildPhases = ( 7227AD1B109A053900BE33D7 /* Copy Files */, + 1F12836421C89FB900E3A732 /* CopyFiles */, ); dependencies = ( 720BE2F6120C90E500B3C4A5 /* PBXTargetDependency */, @@ -88,6 +89,7 @@ /* Begin PBXBuildFile section */ 1F12836121C89D2C00E3A732 /* darwinbuild-recursive in Copy Files */ = {isa = PBXBuildFile; fileRef = 1F12836021C89D2C00E3A732 /* darwinbuild-recursive */; }; + 1F12836621C89FD000E3A732 /* darwinbuild-codesign in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1F12836521C89FC800E3A732 /* darwinbuild-codesign */; }; 1F514C441F4A5CDA008D9341 /* fetch-from-github in Copy Files */ = {isa = PBXBuildFile; fileRef = 1F514C431F4A5CC0008D9341 /* fetch-from-github */; }; 1FC854011ED462EE00EA2AF5 /* installXcode in Copy Files */ = {isa = PBXBuildFile; fileRef = 1FC854001ED462DF00EA2AF5 /* installXcode */; }; 1FECB5DF1FBBBD41002EA059 /* setXcodePlatform in Copy Files */ = {isa = PBXBuildFile; fileRef = 1FECB5DE1FBBBC09002EA059 /* setXcodePlatform */; }; @@ -568,6 +570,16 @@ /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ + 1F12836421C89FB900E3A732 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 8; + dstPath = "$(BINDIR)"; + dstSubfolderSpec = 0; + files = ( + 1F12836621C89FD000E3A732 /* darwinbuild-codesign in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 1; + }; 7227AB3C1098977C00BE33D7 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 8; @@ -608,6 +620,7 @@ /* Begin PBXFileReference section */ 1F12836021C89D2C00E3A732 /* darwinbuild-recursive */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; name = "darwinbuild-recursive"; path = "darwinbuild/darwinbuild-recursive"; sourceTree = ""; }; + 1F12836521C89FC800E3A732 /* darwinbuild-codesign */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "darwinbuild-codesign"; path = "darwinbuild/darwinbuild-codesign"; sourceTree = ""; }; 1F4A793721B9F123000FE4B5 /* conclusion.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = conclusion.html; path = installer/conclusion.html; sourceTree = ""; }; 1F4A793821B9F123000FE4B5 /* license.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = license.html; path = installer/license.html; sourceTree = ""; }; 1F4A793921B9F123000FE4B5 /* welcome.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = welcome.html; path = installer/welcome.html; sourceTree = ""; }; @@ -958,6 +971,7 @@ 72C86BD510965DC900C66E90 /* darwinbuild */ = { isa = PBXGroup; children = ( + 1F12836521C89FC800E3A732 /* darwinbuild-codesign */, 1F12836021C89D2C00E3A732 /* darwinbuild-recursive */, 1F514C431F4A5CC0008D9341 /* fetch-from-github */, 720BE2E9120C909E00B3C4A5 /* digest.c */, From 5f42766c891feccbfb5e5c0435380f7fa40f619e Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 17 Dec 2018 22:27:27 -0500 Subject: [PATCH 188/382] Remove debug print from darwinbuild-codesign --- darwinbuild/darwinbuild-codesign | 1 - 1 file changed, 1 deletion(-) diff --git a/darwinbuild/darwinbuild-codesign b/darwinbuild/darwinbuild-codesign index 9dd597d..b92dc6c 100755 --- a/darwinbuild/darwinbuild-codesign +++ b/darwinbuild/darwinbuild-codesign @@ -88,7 +88,6 @@ if args.project is not None: largest_build_num = this_build_num project_build = str(this_build_num) - print('Using', project_name_and_version + '~' + project_build, '...') project_root = os.path.join(roots_dir, project_name_and_version + '.root~' + project_build) srcroot = os.path.join(darwin_buildroot, 'BuildRoot', 'SourceCache', project_name, project_name_and_version) From 550c52aba3b7f9ecef0a12874f7ce8935de58429 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 15 Apr 2019 13:37:01 -0400 Subject: [PATCH 189/382] Resolve Xcode 10.2 update warnings --- darwinbuild.xcodeproj/project.pbxproj | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 7cab555..dbfda82 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -1713,13 +1713,14 @@ }; buildConfigurationList = 726DD14C10965C5700D5AEAB /* Build configuration list for PBXProject "darwinbuild" */; compatibilityVersion = "Xcode 10.0"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( - English, - Japanese, - French, - German, + en, + ja, + fr, + de, + Base, ); mainGroup = 726DD14710965C5700D5AEAB; productRefGroup = 72C86C391096607900C66E90 /* Products */; From 5ed29eb4e5fa934187eef319f6be91dbc8a4f11c Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 15 Apr 2019 13:39:26 -0400 Subject: [PATCH 190/382] Enable code signing on all binaries I missed a few when I first enabled code signing. --- darwinbuild.xcodeproj/project.pbxproj | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index dbfda82..3739aa1 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -2532,8 +2532,12 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "Mac Developer"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 3P242C9ES5; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = digest; + PROVISIONING_PROFILE_SPECIFIER = ""; }; name = Debug; }; @@ -2542,8 +2546,12 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "Mac Developer"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 3P242C9ES5; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = digest; + PROVISIONING_PROFILE_SPECIFIER = ""; }; name = Public; }; @@ -2552,8 +2560,12 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "Mac Developer"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 3P242C9ES5; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = digest; + PROVISIONING_PROFILE_SPECIFIER = ""; }; name = Release; }; @@ -2589,8 +2601,12 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "Mac Developer"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 3P242C9ES5; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = manifest; + PROVISIONING_PROFILE_SPECIFIER = ""; }; name = Debug; }; @@ -2599,8 +2615,12 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "Mac Developer"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 3P242C9ES5; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = manifest; + PROVISIONING_PROFILE_SPECIFIER = ""; }; name = Public; }; @@ -2609,8 +2629,12 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "Mac Developer"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 3P242C9ES5; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = manifest; + PROVISIONING_PROFILE_SPECIFIER = ""; }; name = Release; }; From 12f0e70fd4df7257f5608377fd55ca5332d5276f Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 15 Apr 2019 13:39:50 -0400 Subject: [PATCH 191/382] Normalize indentation in distribution.xml file --- installer/distribution.xml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/installer/distribution.xml b/installer/distribution.xml index a86dcbc..d898999 100644 --- a/installer/distribution.xml +++ b/installer/distribution.xml @@ -1,17 +1,17 @@ - - - - - - - - - - - - darwinbuild-component.pkg + + + + + + + + + + + + darwinbuild-component.pkg PureDarwin Build System From 65488ad9b261ebcb8c31a74d4f60f09964ff0549 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 15 Apr 2019 13:40:15 -0400 Subject: [PATCH 192/382] Bump installer package version --- installer/build.sh | 4 ++-- installer/distribution.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/installer/build.sh b/installer/build.sh index b7a3638..b401369 100755 --- a/installer/build.sh +++ b/installer/build.sh @@ -13,7 +13,7 @@ xcodebuild install \ pkgbuild \ --ownership recommended \ --identifier org.puredarwin.darwinbuild.component \ - --version 1.0 \ + --version 1.1 \ --root $MY_DIR/payload \ --install-location / \ $MY_DIR/darwinbuild-component.pkg @@ -21,7 +21,7 @@ pkgbuild \ productbuild \ --distribution $MY_DIR/distribution.xml \ --identifier org.puredarwin.darwinbuild.release \ - --version 1.0 \ + --version 1.1 \ --sign 'Developer ID Installer' --timestamp \ --package-path $MY_DIR \ --resources $MY_DIR \ diff --git a/installer/distribution.xml b/installer/distribution.xml index d898999..c41a62e 100644 --- a/installer/distribution.xml +++ b/installer/distribution.xml @@ -11,7 +11,7 @@ - darwinbuild-component.pkg + darwinbuild-component.pkg PureDarwin Build System From 2aec0cf07a17d147830629e0b4150121d44705d5 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 15 Apr 2019 13:47:09 -0400 Subject: [PATCH 193/382] Sign all binaries as Developer ID Application --- darwinbuild.xcodeproj/project.pbxproj | 54 +++++++++------------------ 1 file changed, 18 insertions(+), 36 deletions(-) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 3739aa1..1633114 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -2532,9 +2532,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "Mac Developer"; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 3P242C9ES5; + CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = digest; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -2546,9 +2544,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "Mac Developer"; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 3P242C9ES5; + CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = digest; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -2560,9 +2556,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "Mac Developer"; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 3P242C9ES5; + CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = digest; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -2601,9 +2595,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "Mac Developer"; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 3P242C9ES5; + CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = manifest; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -2615,9 +2607,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "Mac Developer"; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 3P242C9ES5; + CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = manifest; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -2629,9 +2619,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "Mac Developer"; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 3P242C9ES5; + CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = manifest; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -3333,8 +3321,10 @@ CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "Developer ID Application"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = 3P242C9ES5; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = c99; GCC_ENABLE_PASCAL_STRINGS = NO; @@ -3392,9 +3382,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "Mac Developer"; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 3P242C9ES5; + CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; "INSTALL_PATH[sdk=iphonesimulator*]" = "$(SDKROOT)$(DATDIR)/darwinbuild"; LD_DYLIB_INSTALL_NAME = "$(DATDIR)/darwinbuild/darwintrace.dylib"; @@ -3408,9 +3396,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "Mac Developer"; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 3P242C9ES5; + CODE_SIGN_STYLE = Manual; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = "$(BINDIR)"; OTHER_CFLAGS = ( @@ -3429,9 +3415,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "Mac Developer"; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 3P242C9ES5; + CODE_SIGN_STYLE = Manual; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = "$(BINDIR)"; OTHER_CFLAGS = ( @@ -3450,9 +3434,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "Mac Developer"; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 3P242C9ES5; + CODE_SIGN_STYLE = Manual; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = "$(BINDIR)"; OTHER_CFLAGS = ( @@ -3513,8 +3495,10 @@ CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "Developer ID Application"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = 3P242C9ES5; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = c99; @@ -3573,8 +3557,10 @@ CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "Developer ID Application"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = 3P242C9ES5; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = c99; GCC_ENABLE_PASCAL_STRINGS = NO; @@ -3633,9 +3619,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "Mac Developer"; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 3P242C9ES5; + CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; "INSTALL_PATH[sdk=iphonesimulator*]" = "$(SDKROOT)$(DATDIR)/darwinbuild"; LD_DYLIB_INSTALL_NAME = "$(DATDIR)/darwinbuild/darwintrace.dylib"; @@ -3649,9 +3633,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "Mac Developer"; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 3P242C9ES5; + CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; "INSTALL_PATH[sdk=iphonesimulator*]" = "$(SDKROOT)$(DATDIR)/darwinbuild"; LD_DYLIB_INSTALL_NAME = "$(DATDIR)/darwinbuild/darwintrace.dylib"; From b11b289a6d934994171a025b787d23c3c8bd69cf Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 15 Apr 2019 13:56:25 -0400 Subject: [PATCH 194/382] Add installer/notarize.sh --- darwinbuild.xcodeproj/project.pbxproj | 2 ++ installer/notarize.sh | 30 +++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100755 installer/notarize.sh diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 1633114..321ac1c 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -628,6 +628,7 @@ 1FC854001ED462DF00EA2AF5 /* installXcode */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = installXcode; path = darwinbuild/installXcode; sourceTree = ""; }; 1FD9F0CD21B9E90700FB866A /* build.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = build.sh; path = installer/build.sh; sourceTree = ""; }; 1FD9F0CF21B9EAA300FB866A /* distribution.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = distribution.xml; path = installer/distribution.xml; sourceTree = ""; }; + 1FEA10392264FBCF008B675D /* notarize.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = notarize.sh; path = installer/notarize.sh; sourceTree = ""; }; 1FECB5DE1FBBBC09002EA059 /* setXcodePlatform */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = setXcodePlatform; path = darwinbuild/setXcodePlatform; sourceTree = ""; }; 396301191EAB42B6006081C7 /* patch_sites.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = patch_sites.c; sourceTree = ""; }; 396301271EAB4E01006081C7 /* patch_sites.so */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.objfile"; includeInIndex = 0; path = patch_sites.so; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -947,6 +948,7 @@ 1F4A793821B9F123000FE4B5 /* license.html */, 1F4A793921B9F123000FE4B5 /* welcome.html */, 1FD9F0CD21B9E90700FB866A /* build.sh */, + 1FEA10392264FBCF008B675D /* notarize.sh */, 1FD9F0CF21B9EAA300FB866A /* distribution.xml */, ); name = installer; diff --git a/installer/notarize.sh b/installer/notarize.sh new file mode 100755 index 0000000..5c77a44 --- /dev/null +++ b/installer/notarize.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +set -e + +MY_DIR=$(cd `dirname $0` && pwd) +cd $MY_DIR + +if [ "$1" == "-upload" ]; then + if [ ! -f $MY_DIR/darwinbuild-installer.pkg ]; then + echo "darwinbuild-installer.pkg not present, please run build.sh to create it" 1>&2 + exit 1 + fi + + exec xcrun altool --notarize-app --primary-bundle-id org.puredarwin.darwinbuild.release \ + --username "ADC Notarization" --password "@keychain:ADC Notarization" \ + --file $MY_DIR/darwinbuild-installer.pkg +elif [ "$1" == "-staple" ]; then + if [ ! -f $MY_DIR/darwinbuild-installer.pkg ]; then + echo "darwinbuild-installer.pkg not present, please run build.sh to create it" 1>&2 + exit 1 + fi + + exec xcrun stapler staple $MY_DIR/darwinbuild-installer.pkg +elif [ "$1" == "-status" ]; then + exec xcrun altool --notarization-history 0 -u "ADC Notarization" -p "@keychain:ADC Notarization" +else + echo "usage: $0 { -upload | -staple | -status }" 1>&2 + echo "Wraps altool to ease notarization of the darwinbuild installer package" 1>&2 + exit 1 +fi From 57964262ac4dc80ff370b788d09e4516cff95406 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 15 Apr 2019 13:58:10 -0400 Subject: [PATCH 195/382] Fix another code signing error --- darwinbuild.xcodeproj/project.pbxproj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 321ac1c..f0cc320 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -3324,6 +3324,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "Developer ID Application"; + CODE_SIGN_STYLE = Manual; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 3P242C9ES5; @@ -3498,6 +3499,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "Developer ID Application"; + CODE_SIGN_STYLE = Manual; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 3P242C9ES5; @@ -3560,6 +3562,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "Developer ID Application"; + CODE_SIGN_STYLE = Manual; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 3P242C9ES5; From fa9ccc7bff8261f1ed079fbef8de686523cc2b70 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 15 Apr 2019 14:00:53 -0400 Subject: [PATCH 196/382] Globally enable hardened runtime --- darwinbuild.xcodeproj/project.pbxproj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index f0cc320..7dd4ccf 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -3328,6 +3328,7 @@ COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 3P242C9ES5; + ENABLE_HARDENED_RUNTIME = YES; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = c99; GCC_ENABLE_PASCAL_STRINGS = NO; @@ -3503,6 +3504,7 @@ COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 3P242C9ES5; + ENABLE_HARDENED_RUNTIME = YES; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = c99; @@ -3566,6 +3568,7 @@ COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 3P242C9ES5; + ENABLE_HARDENED_RUNTIME = YES; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = c99; GCC_ENABLE_PASCAL_STRINGS = NO; From 36a5936601cea2b6d6b0ca9d9a44f58e18d69cbb Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 15 Apr 2019 15:30:57 -0400 Subject: [PATCH 197/382] Use correct username in notrization script --- installer/notarize.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/installer/notarize.sh b/installer/notarize.sh index 5c77a44..a89de06 100755 --- a/installer/notarize.sh +++ b/installer/notarize.sh @@ -12,7 +12,7 @@ if [ "$1" == "-upload" ]; then fi exec xcrun altool --notarize-app --primary-bundle-id org.puredarwin.darwinbuild.release \ - --username "ADC Notarization" --password "@keychain:ADC Notarization" \ + --username "wjk011@gmail.com" --password "@keychain:ADC Notarization" \ --file $MY_DIR/darwinbuild-installer.pkg elif [ "$1" == "-staple" ]; then if [ ! -f $MY_DIR/darwinbuild-installer.pkg ]; then @@ -22,7 +22,7 @@ elif [ "$1" == "-staple" ]; then exec xcrun stapler staple $MY_DIR/darwinbuild-installer.pkg elif [ "$1" == "-status" ]; then - exec xcrun altool --notarization-history 0 -u "ADC Notarization" -p "@keychain:ADC Notarization" + exec xcrun altool --notarization-history 0 -u "wjk011@gmail.com" -p "@keychain:ADC Notarization" else echo "usage: $0 { -upload | -staple | -status }" 1>&2 echo "Wraps altool to ease notarization of the darwinbuild installer package" 1>&2 From b8a53683667789a570f6149ff8b494f695556e3b Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 15 Apr 2019 15:34:08 -0400 Subject: [PATCH 198/382] Explicitly specify Release configuration --- installer/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer/build.sh b/installer/build.sh index b401369..efd371b 100755 --- a/installer/build.sh +++ b/installer/build.sh @@ -7,7 +7,7 @@ cd $MY_DIR xcodebuild install \ -project $MY_DIR/../darwinbuild.xcodeproj \ - -target world \ + -target world -configuration Release \ DSTROOT=$MY_DIR/payload pkgbuild \ From 6e2ae061e1ce38bc85a2b20dd80ea626be368c18 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 15 Apr 2019 15:46:20 -0400 Subject: [PATCH 199/382] Add entitlements file to darwinxref This is required so that the system will allow darwinxref to load its plugins. I could not get Xcode to code-sign the plugins (at all), for reasons that escape me. --- darwinbuild.xcodeproj/project.pbxproj | 5 +++++ darwinxref/darwinxref.entitlements | 8 ++++++++ 2 files changed, 13 insertions(+) create mode 100644 darwinxref/darwinxref.entitlements diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 7dd4ccf..d5e2d8e 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -625,6 +625,7 @@ 1F4A793821B9F123000FE4B5 /* license.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = license.html; path = installer/license.html; sourceTree = ""; }; 1F4A793921B9F123000FE4B5 /* welcome.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = welcome.html; path = installer/welcome.html; sourceTree = ""; }; 1F514C431F4A5CC0008D9341 /* fetch-from-github */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = "fetch-from-github"; path = "darwinbuild/fetch-from-github"; sourceTree = ""; }; + 1F9D9647226516AA0024E830 /* darwinxref.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = darwinxref.entitlements; path = darwinxref/darwinxref.entitlements; sourceTree = ""; }; 1FC854001ED462DF00EA2AF5 /* installXcode */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = installXcode; path = darwinbuild/installXcode; sourceTree = ""; }; 1FD9F0CD21B9E90700FB866A /* build.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = build.sh; path = installer/build.sh; sourceTree = ""; }; 1FD9F0CF21B9EAA300FB866A /* distribution.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = distribution.xml; path = installer/distribution.xml; sourceTree = ""; }; @@ -1007,6 +1008,7 @@ 72C86BEE10965E7500C66E90 /* DBPluginPriv.h */, 72C86BEF10965E7500C66E90 /* DBTclPlugin.c */, 72C86BF010965E7500C66E90 /* main.c */, + 1F9D9647226516AA0024E830 /* darwinxref.entitlements */, ); name = darwinxref; sourceTree = ""; @@ -3400,6 +3402,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_ENTITLEMENTS = darwinxref/darwinxref.entitlements; CODE_SIGN_STYLE = Manual; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = "$(BINDIR)"; @@ -3419,6 +3422,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_ENTITLEMENTS = darwinxref/darwinxref.entitlements; CODE_SIGN_STYLE = Manual; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = "$(BINDIR)"; @@ -3438,6 +3442,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_ENTITLEMENTS = darwinxref/darwinxref.entitlements; CODE_SIGN_STYLE = Manual; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = "$(BINDIR)"; diff --git a/darwinxref/darwinxref.entitlements b/darwinxref/darwinxref.entitlements new file mode 100644 index 0000000..8cc185a --- /dev/null +++ b/darwinxref/darwinxref.entitlements @@ -0,0 +1,8 @@ + + + + + com.apple.security.cs.disable-library-validation + + + From 095893db1315d2d0e434e34de67a2187c07ead35 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 15 Apr 2019 15:48:31 -0400 Subject: [PATCH 200/382] Bump installer package version --- installer/build.sh | 4 ++-- installer/distribution.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/installer/build.sh b/installer/build.sh index efd371b..1e3631d 100755 --- a/installer/build.sh +++ b/installer/build.sh @@ -13,7 +13,7 @@ xcodebuild install \ pkgbuild \ --ownership recommended \ --identifier org.puredarwin.darwinbuild.component \ - --version 1.1 \ + --version 1.1.1 \ --root $MY_DIR/payload \ --install-location / \ $MY_DIR/darwinbuild-component.pkg @@ -21,7 +21,7 @@ pkgbuild \ productbuild \ --distribution $MY_DIR/distribution.xml \ --identifier org.puredarwin.darwinbuild.release \ - --version 1.1 \ + --version 1.1.1 \ --sign 'Developer ID Installer' --timestamp \ --package-path $MY_DIR \ --resources $MY_DIR \ diff --git a/installer/distribution.xml b/installer/distribution.xml index c41a62e..2e619eb 100644 --- a/installer/distribution.xml +++ b/installer/distribution.xml @@ -11,7 +11,7 @@ - darwinbuild-component.pkg + darwinbuild-component.pkg PureDarwin Build System From b5424852dec91dfc4b0db60561dbf76e30abf10e Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 15 Apr 2019 18:15:46 -0400 Subject: [PATCH 201/382] Add timestamp support to darwinbuild-codesign --- darwinbuild/darwinbuild-codesign | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/darwinbuild/darwinbuild-codesign b/darwinbuild/darwinbuild-codesign index b92dc6c..2766c38 100755 --- a/darwinbuild/darwinbuild-codesign +++ b/darwinbuild/darwinbuild-codesign @@ -117,6 +117,7 @@ if default_certificate is None: default_hardened_runtime = safe_get(codesign_plist, 'hardened_runtime', default=False) default_prefix = safe_get(codesign_plist, 'prefix') +default_timestamp = safe_get(codesign_plist, 'timestamp', default=True) signing_map = {} for (filename, value) in codesign_plist['files'].items(): @@ -131,6 +132,7 @@ for (filename, value) in codesign_plist['files'].items(): hardened_runtime = default_hardened_runtime dr = None order = 0xFFFF + timestamp = True if isinstance(value, bool): pass # all default values @@ -144,6 +146,7 @@ for (filename, value) in codesign_plist['files'].items(): hardened_runtime = bool(safe_get(value, 'hardened_runtime', default=default_hardened_runtime)) dr = safe_get(value, 'dr') order = safe_get(value, 'order', default=order) + timestamp = safe_get(value, 'timestamp', default=default_timestamp) if isinstance(order, str): order = int(order) @@ -170,6 +173,16 @@ for (filename, value) in codesign_plist['files'].items(): if hardened_runtime: codesign_argv.append('-o') codesign_argv.append('runtime') + if isinstance(timestamp, str): + codesign_argv.append('--timestamp=' + timestamp) + elif isinstance(timestamp, bool): + if timestamp: + codesign_argv.append('--timestamp') + else: + codesign_argv.append('--timestamp=none') + else: + print('Error in darwinbuild-codesign.plist: "timestamp" key must be either boolean or string', file=sys.stderr) + exit(1) codesign_argv.append(filename) if order not in signing_map: From 17680df105b889a20a4f4642f145375bd2a0eddb Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 15 Apr 2019 18:16:14 -0400 Subject: [PATCH 202/382] Use stderr for all error output --- darwinbuild/darwinbuild-codesign | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/darwinbuild/darwinbuild-codesign b/darwinbuild/darwinbuild-codesign index 2766c38..798739e 100755 --- a/darwinbuild/darwinbuild-codesign +++ b/darwinbuild/darwinbuild-codesign @@ -151,10 +151,10 @@ for (filename, value) in codesign_plist['files'].items(): if isinstance(order, str): order = int(order) elif not isinstance(order, int): - print('Error in darwinbuild-codesign.plist: "order" key must have integer value (or string convertible to integer)') + print('Error in darwinbuild-codesign.plist: "order" key must have integer value (or string convertible to integer)', file=sys.stderr) exit(1) else: - print('Error in darwinbuild-codesign.plist: Values in "files" dictionary must be booleans or dictionaries only') + print('Error in darwinbuild-codesign.plist: Values in "files" dictionary must be booleans or dictionaries only', file=sys.stderr) exit(1) codesign_argv = ['/usr/bin/codesign', '-s', certificate, '-f'] From fd18a9410114c0c98a4160a2005cdf0b11af9b9d Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 15 Apr 2019 18:21:57 -0400 Subject: [PATCH 203/382] Use default prefix if none is specified Previously, the prefix value would be None, which would prevent the --prefix flag from being passed to the codesign tool, even if the prefix key was set at the top-level of the codesigning plist. --- darwinbuild/darwinbuild-codesign | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild-codesign b/darwinbuild/darwinbuild-codesign index 798739e..0367669 100755 --- a/darwinbuild/darwinbuild-codesign +++ b/darwinbuild/darwinbuild-codesign @@ -127,7 +127,7 @@ for (filename, value) in codesign_plist['files'].items(): certificate = default_certificate identifier = None - prefix = None + prefix = default_prefix entitlements = None hardened_runtime = default_hardened_runtime dr = None From be364cc7effacaec50e280d5f65a9870d1a4e6bb Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 15 Apr 2019 18:30:42 -0400 Subject: [PATCH 204/382] Improve darwinbuild-codesign error handling --- darwinbuild/darwinbuild-codesign | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild-codesign b/darwinbuild/darwinbuild-codesign index 0367669..74e0aba 100755 --- a/darwinbuild/darwinbuild-codesign +++ b/darwinbuild/darwinbuild-codesign @@ -78,7 +78,13 @@ if args.project is not None: roots_dir = os.path.join(darwin_buildroot, 'Roots', project_name) if project_build is None: - possible_builds = next(os.walk(roots_dir))[1] + possible_builds = None + try: + possible_builds = next(os.walk(roots_dir))[1] + except StopIteration: + # This is raised if the project name given doesn't exist. + print('Project', project_name_and_version, 'not found in Roots directory', file=sys.stderr) + exit(1) largest_build_num = 0 for dirname in possible_builds: @@ -88,6 +94,12 @@ if args.project is not None: largest_build_num = this_build_num project_build = str(this_build_num) + if project_build is None: + print('Could not determine latest build for', project_name_and_version, file=sys.stderr) + if len(project_name_and_version.split('-')) != 2: + print('(Did you forget the version in the project name', project_name_and_version + '?)', file=sys.stderr) + exit(1) + project_root = os.path.join(roots_dir, project_name_and_version + '.root~' + project_build) srcroot = os.path.join(darwin_buildroot, 'BuildRoot', 'SourceCache', project_name, project_name_and_version) From b8c3d1341d5fd3656b59d3694ce30899534ab81d Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 15 Apr 2019 18:32:01 -0400 Subject: [PATCH 205/382] Bump installer version --- installer/build.sh | 4 ++-- installer/distribution.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/installer/build.sh b/installer/build.sh index 1e3631d..cc1d885 100755 --- a/installer/build.sh +++ b/installer/build.sh @@ -13,7 +13,7 @@ xcodebuild install \ pkgbuild \ --ownership recommended \ --identifier org.puredarwin.darwinbuild.component \ - --version 1.1.1 \ + --version 1.2 \ --root $MY_DIR/payload \ --install-location / \ $MY_DIR/darwinbuild-component.pkg @@ -21,7 +21,7 @@ pkgbuild \ productbuild \ --distribution $MY_DIR/distribution.xml \ --identifier org.puredarwin.darwinbuild.release \ - --version 1.1.1 \ + --version 1.2 \ --sign 'Developer ID Installer' --timestamp \ --package-path $MY_DIR \ --resources $MY_DIR \ diff --git a/installer/distribution.xml b/installer/distribution.xml index 2e619eb..e0a7cae 100644 --- a/installer/distribution.xml +++ b/installer/distribution.xml @@ -11,7 +11,7 @@ - darwinbuild-component.pkg + darwinbuild-component.pkg PureDarwin Build System From dba18a47f5f5869a6432b58814ca02feea54d762 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 16 Apr 2019 15:41:15 -0400 Subject: [PATCH 206/382] Normalize indentation in createChroot script --- darwinbuild/createChroot | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/darwinbuild/createChroot b/darwinbuild/createChroot index 0623533..e49ccd3 100755 --- a/darwinbuild/createChroot +++ b/darwinbuild/createChroot @@ -60,15 +60,15 @@ AppendExtraFiles() { GenerateFileNames() { cat /tmp/installXcode.libs.$$ | sort -u | while read X; do - echo adding children for "$X" - - # first mkdir parent directories - PARENT=$(dirname "$X") - while [ "$PARENT" != "/" -a "$PARENT" != "." ]; do - echo ".$PARENT" >> /tmp/installXcode.tmpfiles.$$ - PARENT=$(dirname "$PARENT") - done - find -x ".$X" \! \( -name \*_debug\* -o -name \*_profile\* -o -path \*.lproj\* -o -path \*.dict\* \) >> /tmp/installXcode.tmpfiles.$$ + echo adding children for "$X" + + # first mkdir parent directories + PARENT=$(dirname "$X") + while [ "$PARENT" != "/" -a "$PARENT" != "." ]; do + echo ".$PARENT" >> /tmp/installXcode.tmpfiles.$$ + PARENT=$(dirname "$PARENT") + done + find -x ".$X" \! \( -name \*_debug\* -o -name \*_profile\* -o -path \*.lproj\* -o -path \*.dict\* \) >> /tmp/installXcode.tmpfiles.$$ done sort -u /tmp/installXcode.tmpfiles.$$ > /tmp/installXcode.files.$$ } From 653d6a82fdec86cf29f38a366a30db19366314dd Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 16 Apr 2019 15:41:53 -0400 Subject: [PATCH 207/382] Remove unused variable --- darwinbuild/createChroot | 2 -- 1 file changed, 2 deletions(-) diff --git a/darwinbuild/createChroot b/darwinbuild/createChroot index e49ccd3..62340a2 100755 --- a/darwinbuild/createChroot +++ b/darwinbuild/createChroot @@ -1,7 +1,5 @@ #!/bin/bash -FORCE="YES" - XCODEBUILD=/usr/bin/xcodebuild BUILDROOT="$1" From 3139727a9630c321d8612645977d4b8ed9771d9e Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 16 Apr 2019 15:43:15 -0400 Subject: [PATCH 208/382] Don't write "empty" darwinbuild receipts The functionality that required these receipts to be written is now long-gone (both from darwinbuild, and from macOS). I also moved the stamp file out of the receipts directory for the same reason. --- darwinbuild/createChroot | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/darwinbuild/createChroot b/darwinbuild/createChroot index 62340a2..4383c01 100755 --- a/darwinbuild/createChroot +++ b/darwinbuild/createChroot @@ -105,12 +105,8 @@ for X in "${EXTRALINKS[@]}"; do ln -sf $X $BUILDROOT/ done -# We provide this functionality, at least -mkdir -p $BUILDROOT/usr/local/darwinbuild/receipts -touch $BUILDROOT/usr/local/darwinbuild/receipts/files -touch $BUILDROOT/usr/local/darwinbuild/receipts/bash -touch $BUILDROOT/usr/local/darwinbuild/receipts/perl -touch $BUILDROOT/usr/local/darwinbuild/receipts/.host-system-chroot +mkdir -p $BUILDROOT/usr/local/darwinbuild +touch $BUILDROOT/usr/local/darwinbuild/.host-system-chroot-created popd > /dev/null From ca711bc1d21790eb38e36e0174bc1a310c8ddfd5 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 16 Apr 2019 15:45:04 -0400 Subject: [PATCH 209/382] Update darwinbuild following previous commit --- darwinbuild/darwinbuild.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index b18216b..86ccdc6 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -629,7 +629,7 @@ if [ "$USE_CHROOT" = "YES" -a "$EUID" != "0" ]; then exit 1 fi -if [ "$USE_CHROOT" = "YES" -a ! -f "$BuildRoot/usr/local/darwinbuild/receipts/.host-system-chroot" ]; then +if [ "$USE_CHROOT" = "YES" -a ! -f "$BuildRoot/usr/local/darwinbuild/.host-system-chroot-created" ]; then if [ ! -x $DATADIR/createChroot ]; then # This can sometimes happen when darwinbuild was installed via an Xcode # archive. Don't let it silently fail and then break things later. From e0ba78290796c3a258f19788b194db8d7f70d60f Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 16 Apr 2019 15:57:18 -0400 Subject: [PATCH 210/382] Tweak status message --- darwinbuild/createChroot | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/darwinbuild/createChroot b/darwinbuild/createChroot index 4383c01..53bbf32 100755 --- a/darwinbuild/createChroot +++ b/darwinbuild/createChroot @@ -74,11 +74,9 @@ GenerateFileNames() { CopyFiles() { # VERBOSECPIO="v" VERBOSECPIO="" - echo -n "Copying system... " + echo "Copying system..." cpio -o -c < /tmp/installXcode.files.$$ | \ (cd "$BUILDROOT"; cpio -ium${VERBOSECPIO}d ) - - echo "done" } From 4ce02610e544d5e0d02646c3139e6175b1c1790b Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 16 Apr 2019 16:02:34 -0400 Subject: [PATCH 211/382] Fix longstanding root-installation bug Previously, each root would be copied into the chroot each time, because the receipt files were copied into $BUILDROOT/InstalledRoots, but were checked for in $BUILDROOT. This is now resolved. --- darwinbuild/darwinbuild.common | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index f0af97b..9b39069 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -232,6 +232,14 @@ function InstallRoot() { if [ $InstallSelfBuiltRoot -eq 1 ]; then echo "Copying $Project from $SelfBuiltRoot ..." ditto "$SelfBuiltRoot" "$DepRoot" + + if [ "$DepRoot" != "$BuildRoot" ]; then + # If the DepRoot is different from the BuildRoot, then the + # receipts will not be present in the correct location. + # We must copy them there ourselves. + ditto "$SelfBuiltRoot/usr/local/darwinbuild/receipts" "$BuildRoot/usr/local/darwinbuild/receipts" + fi + "$DARWINXREF" register "$Project" "$SelfBuiltRoot" > /dev/null TouchReceipt "$BuildRoot" "$Project" "root" return 0 @@ -359,12 +367,28 @@ function InstallHeader() { if [ $InstallSelfBuiltHeader -eq 1 ]; then echo "Copying $Project from $SelfBuiltHeader ..." ditto "$SelfBuiltHeader" "$DepRoot" + + if [ "$DepRoot" != "$BuildRoot" ]; then + # If the DepRoot is different from the BuildRoot, then the + # receipts will not be present in the correct location. + # We must copy them there ourselves. + ditto "$SelfBuiltHeader/usr/local/darwinbuild/receipts" "$BuildRoot/usr/local/darwinbuild/receipts" + fi + "$DARWINXREF" register "$Project" "$SelfBuiltHeader" > /dev/null TouchReceipt "$BuildRoot" "$Project" "hdrs" return 0 elif [ $InstallSelfBuiltRoot -eq 1 ]; then echo "Copying $Project from $SelfBuiltRoot ..." ditto "$SelfBuiltRoot" "$DepRoot" + + if [ "$DepRoot" != "$BuildRoot" ]; then + # If the DepRoot is different from the BuildRoot, then the + # receipts will not be present in the correct location. + # We must copy them there ourselves. + ditto "$SelfBuiltRoot/usr/local/darwinbuild/receipts" "$BuildRoot/usr/local/darwinbuild/receipts" + fi + "$DARWINXREF" register "$Project" "$SelfBuiltRoot" > /dev/null TouchReceipt "$BuildRoot" "$Project" "root" return 0 From 9705a9b3fdebee295395b0cb963e098cd2aadd8f Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 16 Apr 2019 16:07:43 -0400 Subject: [PATCH 212/382] Install Xcode directly after creating the chroot This seems like a more logical place to do so than after the roots are copied. --- darwinbuild/darwinbuild.in | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 86ccdc6..da95141 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -640,6 +640,12 @@ if [ "$USE_CHROOT" = "YES" -a ! -f "$BuildRoot/usr/local/darwinbuild/.host-syste $DATADIR/createChroot "$BuildRoot" fi +if [ ! -f "$BuildRoot/usr/local/darwinbuild/.xcode-copied" -a "$USE_CHROOT" = "YES" ]; then + echo "*** Installing Xcode Tools ..." + "$DATADIR/installXcode" "$BuildRoot" "$PWDP" + touch "$BuildRoot/usr/local/darwinbuild/.xcode-copied" +fi + if [ "$noload" != "YES" ]; then echo "*** Installing Roots ..." deps=$($DARWINXREF dependencies -build "$projnam") @@ -674,12 +680,6 @@ EOF fi -if [ ! -f "$receipts/xcodebuild" -a "$USE_CHROOT" = "YES" ]; then - echo "*** Installing Xcode Tools ..." - "$DATADIR/installXcode" "$BuildRoot" "$PWDP" - touch "$receipts/xcodebuild" -fi - "$DATADIR/setXcodePlatform" "$PWDP" || { echo Could not set Xcode platform, build cannot continue 1>&2 exit 1 From 7648f2a0779185cb53d3be1ef9832a4344b95f23 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 16 Apr 2019 16:12:08 -0400 Subject: [PATCH 213/382] Stylistic improvements to darwinbuild-recursive --- darwinbuild/darwinbuild-recursive | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/darwinbuild/darwinbuild-recursive b/darwinbuild/darwinbuild-recursive index fad0957..deb492c 100755 --- a/darwinbuild/darwinbuild-recursive +++ b/darwinbuild/darwinbuild-recursive @@ -44,14 +44,13 @@ def recursive_build(project, is_header=False): if is_header: if project in header_deps_done: return + else: + header_deps_done[project] = True else: if project in build_deps_done: return - - if is_header: - header_deps_done[project] = True - else: - build_deps_done[project] = True + else: + build_deps_done[project] = True build_deps = subprocess.check_output(['darwinxref', 'dependencies', '-build', project]).split('\n') header_deps = subprocess.check_output(['darwinxref', 'dependencies', '-header', project]).split('\n') From 1d67168f04dfe44712bd5a45e8671b4e6dffc580 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 16 Apr 2019 16:15:10 -0400 Subject: [PATCH 214/382] Bump installer package version --- installer/build.sh | 4 ++-- installer/distribution.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/installer/build.sh b/installer/build.sh index cc1d885..01a7b9c 100755 --- a/installer/build.sh +++ b/installer/build.sh @@ -13,7 +13,7 @@ xcodebuild install \ pkgbuild \ --ownership recommended \ --identifier org.puredarwin.darwinbuild.component \ - --version 1.2 \ + --version 1.3 \ --root $MY_DIR/payload \ --install-location / \ $MY_DIR/darwinbuild-component.pkg @@ -21,7 +21,7 @@ pkgbuild \ productbuild \ --distribution $MY_DIR/distribution.xml \ --identifier org.puredarwin.darwinbuild.release \ - --version 1.2 \ + --version 1.3 \ --sign 'Developer ID Installer' --timestamp \ --package-path $MY_DIR \ --resources $MY_DIR \ diff --git a/installer/distribution.xml b/installer/distribution.xml index e0a7cae..4f47812 100644 --- a/installer/distribution.xml +++ b/installer/distribution.xml @@ -11,7 +11,7 @@ - darwinbuild-component.pkg + darwinbuild-component.pkg PureDarwin Build System From fd26bc01e02b813738de75d8a986a97682b31a34 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 16 Apr 2019 16:37:28 -0400 Subject: [PATCH 215/382] Don't delete the DEPROOT This was causing serious problems, due to the receipts being left behind and the files they point to being missing. There is little need to clean out the DEPROOT, anyway. --- darwinbuild/darwinbuild.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index da95141..2a4b86b 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -518,7 +518,7 @@ if [ "$nosource" != "YES" ]; then ### Remove any pre-existing directories that might be in the way ### and create new directories in their place. ### - rm -Rf "$REAL_SRCROOT" "$REAL_OBJROOT" "$REAL_SYMROOT" "$REAL_DSTROOT" "$REAL_DEPROOT" + rm -Rf "$REAL_SRCROOT" "$REAL_OBJROOT" "$REAL_SYMROOT" "$REAL_DSTROOT" mkdir -p "$REAL_SRCROOT" "$REAL_OBJROOT" "$REAL_SYMROOT" "$REAL_DSTROOT" "$REAL_DEPROOT" ### From 0331202df387fdd7c4e34c7d37c9d31344a6f8b3 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 16 Apr 2019 16:38:26 -0400 Subject: [PATCH 216/382] Bump installer package version --- installer/build.sh | 4 ++-- installer/distribution.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/installer/build.sh b/installer/build.sh index 01a7b9c..9f5cdf8 100755 --- a/installer/build.sh +++ b/installer/build.sh @@ -13,7 +13,7 @@ xcodebuild install \ pkgbuild \ --ownership recommended \ --identifier org.puredarwin.darwinbuild.component \ - --version 1.3 \ + --version 1.3.1 \ --root $MY_DIR/payload \ --install-location / \ $MY_DIR/darwinbuild-component.pkg @@ -21,7 +21,7 @@ pkgbuild \ productbuild \ --distribution $MY_DIR/distribution.xml \ --identifier org.puredarwin.darwinbuild.release \ - --version 1.3 \ + --version 1.3.1 \ --sign 'Developer ID Installer' --timestamp \ --package-path $MY_DIR \ --resources $MY_DIR \ diff --git a/installer/distribution.xml b/installer/distribution.xml index 4f47812..9a2302b 100644 --- a/installer/distribution.xml +++ b/installer/distribution.xml @@ -11,7 +11,7 @@ - darwinbuild-component.pkg + darwinbuild-component.pkg PureDarwin Build System From ece4a5c068fa3212207b784311f51c376ede4938 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 5 May 2019 18:58:11 -0400 Subject: [PATCH 217/382] Set LIBRARY_SEARCH_PATHS in darwinbuild.xcconfig files --- darwinbuild/darwinbuild.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 2a4b86b..6403e88 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -668,6 +668,7 @@ DEPROOT = $REAL_DEPROOT SYSTEM_HEADER_SEARCH_PATHS = \$(DEPROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \$(DEPROOT)/usr/include \$(DEPROOT)/usr/local/include FRAMEWORK_SEARCH_PATHS = \$(DEPROOT)/System/Library/Frameworks \$(DEPROOT)/System/Library/PrivateFrameworks +LIBRARY_SEARCH_PATHS = \$(DEPROOT)/usr/local/lib \$(DEPROOT)/usr/lib EOF echo @@ -773,6 +774,7 @@ DEPROOT = $DEPROOT SYSTEM_HEADER_SEARCH_PATHS = \$(DEPROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \$(DEPROOT)/usr/include \$(DEPROOT)/usr/local/include FRAMEWORK_SEARCH_PATHS = \$(DEPROOT)/System/Library/Frameworks \$(DEPROOT)/System/Library/PrivateFrameworks +LIBRARY_SEARCH_PATHS = \$(DEPROOT)/usr/local/lib \$(DEPROOT)/usr/lib EOF ### From aa08d5cb0bb93c16ca6d104223c10ed2650a3617 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 5 May 2019 19:44:41 -0400 Subject: [PATCH 218/382] Add nochroot support to darwinbuild-recursive This should speed up Travis buildds a lot. --- darwinbuild/darwinbuild-recursive | 5 ++++- darwinbuild/darwinbuild.in | 12 ++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/darwinbuild/darwinbuild-recursive b/darwinbuild/darwinbuild-recursive index deb492c..accf152 100755 --- a/darwinbuild/darwinbuild-recursive +++ b/darwinbuild/darwinbuild-recursive @@ -5,10 +5,12 @@ import sys, os import plistlib import subprocess -if len(sys.argv) != 3: +if len(sys.argv) < 3: print('Internal tool used by darwinbuild, please do not invoke directly', file=sys.stderr) exit(1) +extra_args = sys.argv[3:] + darwin_buildroot = os.getcwd() if os.getenv('DARWIN_BUILDROOT') is not None: darwin_buildroot = os.getenv('DARWIN_BUILDROOT') @@ -61,6 +63,7 @@ def recursive_build(project, is_header=False): recursive_build(dep, is_header=False) darwinbuild_argv = ['darwinbuild'] + darwinbuild_argv += extra_args if is_header: darwinbuild_argv.append('-headers') darwinbuild_argv.append(project) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 6403e88..c99a681 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -395,9 +395,17 @@ elif [ "$action" == "loadhdrs" ]; then InstallHeader "$BuildRoot" "$projnam" "$depsbuild" exit 0 elif [ "$action" == "recursive" ]; then - exec $DATADIR/darwinbuild-recursive -p "$projnam" + if [ "$USE_CHROOT" == "NO" ]; then + exec $DATADIR/darwinbuild-recursive -p "$projnam" -nochroot + else + exec $DATADIR/darwinbuild-recursive -p "$projnam" + fi elif [ "$action" == "group" ]; then - exec $DATADIR/darwinbuild-recursive -g "$projnam" + if [ "$USE_CHROOT" == "NO" ]; then + exec $DATADIR/darwinbuild-recursive -g "$projnam" -nochroot + else + exec $DATADIR/darwinbuild-recursive -g "$projnam" + fi fi # From 43d7aba204aa8b2908b994d1e2a678d0db965dc3 Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 18 Jul 2019 20:04:25 -0400 Subject: [PATCH 219/382] Resolve Xcode 11 update warnings Also changed Debug builds to sign using Apple Development certificate. --- darwinbuild.xcodeproj/project.pbxproj | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index d5e2d8e..3e105f3 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -1712,7 +1712,7 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; - LastUpgradeCheck = 1000; + LastUpgradeCheck = 1100; ORGANIZATIONNAME = "The DarwinBuild Project"; }; buildConfigurationList = 726DD14C10965C5700D5AEAB /* Build configuration list for PBXProject "darwinbuild" */; @@ -2536,6 +2536,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = digest; @@ -2548,6 +2549,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = digest; @@ -2560,6 +2562,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = digest; @@ -2599,6 +2602,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = manifest; @@ -2611,6 +2615,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = manifest; @@ -2623,6 +2628,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = manifest; @@ -2635,6 +2641,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; INSTALL_PATH = "$(BINDIR)"; PRODUCT_NAME = darwinmaster; }; @@ -2645,6 +2652,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; INSTALL_PATH = "$(BINDIR)"; PRODUCT_NAME = darwinmaster; }; @@ -2655,6 +2663,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; INSTALL_PATH = "$(BINDIR)"; PRODUCT_NAME = darwinmaster; }; @@ -2665,6 +2674,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = packageRoots; }; @@ -2675,6 +2685,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = packageRoots; }; @@ -2685,6 +2696,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = packageRoots; }; @@ -2695,6 +2707,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = thinPackages; }; @@ -2705,6 +2718,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = thinPackages; }; @@ -2715,6 +2729,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = thinPackages; }; @@ -3378,6 +3393,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; INSTALL_PATH = "$(BINDIR)"; PRODUCT_NAME = darwinbuild; }; @@ -3403,6 +3419,7 @@ buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; CODE_SIGN_ENTITLEMENTS = darwinxref/darwinxref.entitlements; + CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = "$(BINDIR)"; @@ -3423,6 +3440,7 @@ buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; CODE_SIGN_ENTITLEMENTS = darwinxref/darwinxref.entitlements; + CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = "$(BINDIR)"; @@ -3443,6 +3461,7 @@ buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; CODE_SIGN_ENTITLEMENTS = darwinxref/darwinxref.entitlements; + CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = "$(BINDIR)"; @@ -3504,7 +3523,7 @@ CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "Developer ID Application"; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Manual; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; @@ -3612,6 +3631,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; INSTALL_PATH = "$(BINDIR)"; PRODUCT_NAME = darwinbuild; }; @@ -3622,6 +3642,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; INSTALL_PATH = "$(BINDIR)"; PRODUCT_NAME = darwinbuild; }; From d9986538c950704a0606179e721d20a6aba0dc0a Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 18 Jul 2019 20:21:14 -0400 Subject: [PATCH 220/382] Rewrite instller/notarize.sh The script now polls for the notarization status, instead of requiring the user to do that manually. --- installer/notarize.sh | 68 +++++++++++++++++++++++++++++++++---------- 1 file changed, 53 insertions(+), 15 deletions(-) diff --git a/installer/notarize.sh b/installer/notarize.sh index a89de06..40b48de 100755 --- a/installer/notarize.sh +++ b/installer/notarize.sh @@ -5,26 +5,64 @@ set -e MY_DIR=$(cd `dirname $0` && pwd) cd $MY_DIR -if [ "$1" == "-upload" ]; then - if [ ! -f $MY_DIR/darwinbuild-installer.pkg ]; then - echo "darwinbuild-installer.pkg not present, please run build.sh to create it" 1>&2 +if [ ! -f $MY_DIR/darwinbuild-installer.pkg ]; then + echo "darwinbuild-installer.pkg not present, please run build.sh to create it" 1>&2 + exit 1 +fi + +ALTOOL_LOG=$(mktemp -q -t altool.log) +if [ $? -ne 0 ]; then + echo "Could not create temporary file for altool log" 1>&2 + exit 1 +fi + +xcrun altool --notarize-app --primary-bundle-id org.puredarwin.darwinbuild.release \ + --username "wjk011@gmail.com" --password "@keychain:ADC Notarization" \ + --file $MY_DIR/darwinbuild-installer.pkg \ + --output-format xml > $ALTOOL_LOG +if [ $? -ne 0 ]; then + echo "altool failed to upload, cannot continue" 1>&2 + echo "altool log file is located at: $ALTOOL_LOG" 1>&2 + exit 1 +fi + +request_id=$(/usr/libexec/PlistBuddy -c "print :notarization-upload:RequestUUID" $ALTOOL_LOG) +if [[ $request_id =~ ^\{?[A-F0-9a-f]{8}-[A-F0-9a-f]{4}-[A-F0-9a-f]{4}-[A-F0-9a-f]{4}-[A-F0-9a-f]{12}\}?$ ]]; then + attempts=5 + + while :; do + echo "Sleeping 20 seconds before checking notarization status..." + sleep 20 + + xcrun altool --notarization-info $request_id \ + --username "wjk011@gmail.com" --password "@keychain:ADC Notarization" \ + --output-format xml > $ALTOOL_LOG + + notarization_status=$(/usr/libexec/PlistBuddy -c "print :notarization-info:Status" $ALTOOL_LOG) + + if [ ! -z "$notarization_status" ]; then + [ "$notarization_status" != "in progress" ] && break + else + (($attempts <= 0)) && break + ((attempts--)) + fi + done + + if [ "$status" != "success" ]; then + echo "altool reported notarization error" 1>&2 exit 1 fi - exec xcrun altool --notarize-app --primary-bundle-id org.puredarwin.darwinbuild.release \ - --username "wjk011@gmail.com" --password "@keychain:ADC Notarization" \ - --file $MY_DIR/darwinbuild-installer.pkg -elif [ "$1" == "-staple" ]; then - if [ ! -f $MY_DIR/darwinbuild-installer.pkg ]; then - echo "darwinbuild-installer.pkg not present, please run build.sh to create it" 1>&2 + log_url=$(/usr/libexec/PlistBuddy -c "print :notarization-info:LogFileURL" $ALTOOL_LOG) + echo "Log file can be downloaded from: $log_url" + + xcrun stapler staple $MY_DIR/darwinbuild-installer.pkg + xcrun stapler validate -v $MY_DIR/darwinbuild-installer.pkg + if [ $@ -ne 0 ]; then + echo "validation of installer notarization failed" 1>&2 exit 1 fi - - exec xcrun stapler staple $MY_DIR/darwinbuild-installer.pkg -elif [ "$1" == "-status" ]; then - exec xcrun altool --notarization-history 0 -u "wjk011@gmail.com" -p "@keychain:ADC Notarization" else - echo "usage: $0 { -upload | -staple | -status }" 1>&2 - echo "Wraps altool to ease notarization of the darwinbuild installer package" 1>&2 + echo "Invalid request ID found in altool output, cannot continue." 1>&2 exit 1 fi From 6832d753bbb0894ec48e85678405e6157cda3934 Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 18 Jul 2019 20:27:19 -0400 Subject: [PATCH 221/382] Remove chroot support from darwinbuild This is likely to become less and less practical as time moves on and Apple continues to lock down macOS. Furthermore, there is little real reason to continue to do this anyway. --- darwinbuild/darwinbuild.in | 212 +++---------------------------------- 1 file changed, 12 insertions(+), 200 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index c99a681..d0c8bb7 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -60,18 +60,6 @@ ### exist, then this script will attempt to use curl(1) to fetch the sources ### from the source sites specified in the plist. ### -### If the -chroot option is specified, the script will use the darwinxref tool -### to populate the build root with the "Roots" necessary to build the project -### (Roots are pre-compiled projects ready for installation). This script -### will look for an existing root in the root cache (BuildRoot/Roots). If a -### root is missing, then this script will attempt to use curl(1) to fetch the -### roots from the binary sites specified in the build plist. -### -### If the specified project requires Xcode to build (i.e. it does not use -### a makefile, but instead has a .pbproj or .xcodeproj file), then an SDK -### will be synthesized and chroot will not be used. -### -### PREFIX=%%PREFIX%% PWDP=$(pwd -P) @@ -98,7 +86,6 @@ target="" configuration="" version="" -USE_CHROOT="YES" INSTALL_XCODE="NO" ### @@ -192,7 +179,7 @@ function PrintUsage() { usage: $(basename $0) [action] [options] [] actions: [-headers] [-fetch] [-source] [-load] [-loadonly] [-recursive] [-group] options: [-build=X] [-target=X] [-configuration=X] - [-logdeps] [-nochroot] [-chroot] [-nopatch] [-noload] + [-logdeps] [-nopatch] [-noload] [-depsbuild=X [-depsbuild=Y]] [-nosource] EOF @@ -246,17 +233,6 @@ if [ ! -e $SourceCache ]; then mkdir -p "$SourceCache" fi -### -### Set the default value for USE_CHROOT. -### If the .build/no_chroot_default file is present, do not enter -### the the chroot unless the -chroot flag was specified. -### -if [ -f .build/no_chroot_default ]; then - export USE_CHROOT="NO" -else - export USE_CHROOT="YES" -fi - ### ### Interpret our arguments: ### @@ -265,7 +241,7 @@ fi ### -fetch Only download necessary source and patch files ### -source Extract, patch, and stage source ### -load Populate the BuildRoot with one project -### -loadonly Only load dependencies into the chroot, but don't build. +### -loadonly Only load dependencies into the build root, but don't build. ### -recursive Build given project and all required dependencies ### -group Build all projects in the given darwinxref group, ### as with darwinbuild -recursive @@ -275,10 +251,7 @@ fi ### source is already in place in the BuildRoot. ### -logdeps Do magic to log the build-time dependencies ### -nopatch Don't patch sources before building. -### -noload Don't load dependencies into the chroot. -### Has no effect if -nochroot is specified. -### -nochroot Do not chroot into the BuildRoot when building -### -chroot Always chroot into the BuildRoot when building +### -noload Don't load dependencies into the build root. ### -target=X The makefile or xcode target to build ### -configuration=X Specify the build configuration to use ### -build=X Specify the darwin build number to buld, e.g. 8B15 @@ -318,12 +291,6 @@ for ARG in "$@"; do build="${ARG/*=/}" elif [ "${ARG/=*/}" == "-depsbuild" ]; then depsbuild="${depsbuild} ${ARG/*=/}" - elif [ "$ARG" == "-nochroot" ]; then - export INSTALL_XCODE="NO" - export USE_CHROOT="NO" - elif [ "$ARG" == "-chroot" ]; then - unset INSTALL_XCODE - export USE_CHROOT="YES" elif [ "$ARG" == "-nopatch" ]; then nopatch="YES" elif [ "$ARG" == "-load" ]; then @@ -336,7 +303,6 @@ for ARG in "$@"; do noload="YES" elif [ "$ARG" == "-loadonly" ]; then loadonly="YES" - export USE_CHROOT="NO" elif [ "$ARG" == "-logdeps" ]; then logdeps="YES" elif [ "$ARG" == "-nosource" ]; then @@ -395,17 +361,9 @@ elif [ "$action" == "loadhdrs" ]; then InstallHeader "$BuildRoot" "$projnam" "$depsbuild" exit 0 elif [ "$action" == "recursive" ]; then - if [ "$USE_CHROOT" == "NO" ]; then - exec $DATADIR/darwinbuild-recursive -p "$projnam" -nochroot - else - exec $DATADIR/darwinbuild-recursive -p "$projnam" - fi + exec $DATADIR/darwinbuild-recursive -p "$projnam" elif [ "$action" == "group" ]; then - if [ "$USE_CHROOT" == "NO" ]; then - exec $DATADIR/darwinbuild-recursive -g "$projnam" -nochroot - else - exec $DATADIR/darwinbuild-recursive -g "$projnam" - fi + exec $DATADIR/darwinbuild-recursive -g "$projnam" fi # @@ -511,9 +469,6 @@ chmod 1777 "$BuildRoot/$vartmp" ### Define the SRCROOT, OBJROOT, SYMROOT, and DSTROOT. ### This script refers to the absolute paths of the build ### directory, and should use REAL_SRCROOT, etc. -### If USE_CHROOT, then the environment variables will have -### the BuildRoot prefix omitted because the chroot -### will make all paths relative to that point. ### REAL_SRCROOT="$BuildRoot/SourceCache/$projnam/$project" REAL_OBJROOT="$BuildRoot/$vartmp/$projnam/$project.obj" @@ -623,37 +578,6 @@ fi receipts="$BuildRoot/usr/local/darwinbuild/receipts" mkdir -p "$receipts" -### -### If we are going to build in a chroot, -### install the roots into the BuildRoot. -### Make sure we have at least a minimally functioning root -### by installing bash and its dependencies. -### -### Also install CoreOSMakefiles and Perl for make based projects -### - -if [ "$USE_CHROOT" = "YES" -a "$EUID" != "0" ]; then - echo "darwinbuild must be run as root if building in the chroot" 1>&2 - exit 1 -fi - -if [ "$USE_CHROOT" = "YES" -a ! -f "$BuildRoot/usr/local/darwinbuild/.host-system-chroot-created" ]; then - if [ ! -x $DATADIR/createChroot ]; then - # This can sometimes happen when darwinbuild was installed via an Xcode - # archive. Don't let it silently fail and then break things later. - chmod +x $DATADIR/createChroot - fi - - echo "*** Creating chroot environment from host system, this may take a while ..." - $DATADIR/createChroot "$BuildRoot" -fi - -if [ ! -f "$BuildRoot/usr/local/darwinbuild/.xcode-copied" -a "$USE_CHROOT" = "YES" ]; then - echo "*** Installing Xcode Tools ..." - "$DATADIR/installXcode" "$BuildRoot" "$PWDP" - touch "$BuildRoot/usr/local/darwinbuild/.xcode-copied" -fi - if [ "$noload" != "YES" ]; then echo "*** Installing Roots ..." deps=$($DARWINXREF dependencies -build "$projnam") @@ -705,23 +629,9 @@ LOG="$DARWIN_BUILDROOT/Logs/$projnam/$project.log~$build_version" TRACELOG="$BuildRoot/private/var/tmp/$projnam/$project.trace~$build_version" mkdir -p "$DARWIN_BUILDROOT/Logs/$projnam" -if [ "$USE_CHROOT" == "YES" ]; then - prefix="$BuildRoot" -else - prefix="" -fi -export SRCROOT="${REAL_SRCROOT/$prefix/}" -export OBJROOT="${REAL_OBJROOT/$prefix/}" -export SYMROOT="${REAL_SYMROOT/$prefix/}" -export DSTROOT="${REAL_DSTROOT/$prefix/}" -export DEPROOT="${REAL_DEPROOT/$prefix/}" - - - # Hide this variable from the unset export -n SRCROOT OBJROOT SYMROOT DSTROOT DEPROOT export -n DARWIN_BUILDROOT DARWINBUILD_BUILD DARWINXREF_DB_FILE -export -n USE_CHROOT INSTALL_XCODE # Screen sets this to a multi-line value which causes trouble unset TERMCAP @@ -735,7 +645,6 @@ IFS="$OLDIFS" export SRCROOT OBJROOT SYMROOT DSTROOT DEPROOT export DARWIN_BUILDROOT DARWINBUILD_BUILD DARWINXREF_DB_FILE -export USE_CHROOT INSTALL_XCODE export PATH=/bin:/sbin:/usr/bin:/usr/sbin/:/usr/local/bin:/usr/local/sbin export SHELL="/bin/sh" @@ -787,9 +696,6 @@ EOF ### ### Write out the build script that will be used. -### This may or may not be executed in a chroot. -### We want things like the gcc version to be picked -### up from the chroot. ### SCRIPT="$BuildRoot/$vartmp/$projnam/build-$project~$build_version.sh" @@ -809,30 +715,6 @@ cat <<-EOF > $SCRIPT # Panther cctools unlinks -o target, so don't use /dev/null echo " cctools version: \$(as -v -o /.devnull < /dev/null 2>&1 | grep version | grep -v dwarf-version 2>/dev/null)" EOF -if [ "$logdeps" == "YES" ]; then - if [ "$USE_CHROOT" == "YES" ]; then - mkdir -p "$BuildRoot/usr/lib" - cp "$DARWINTRACE" \ - "$BuildRoot/usr/lib/darwintrace.dylib" - - echo "export DARWINTRACE_LOG=\"${TRACELOG/$BuildRoot/}\"" >> $SCRIPT - echo "export DYLD_INSERT_LIBRARIES=/usr/lib/darwintrace.dylib" >> $SCRIPT - else - echo "export DARWINTRACE_LOG=\"${TRACELOG}\"" >> $SCRIPT - echo "export DYLD_INSERT_LIBRARIES=$DARWINTRACE" >> $SCRIPT - fi -fi - -if [ "$USE_CHROOT" == "NO" ]; then - echo "*** Redirecting ..." - echo "DARWINTRACE_REDIRECT=\"${BuildRoot}\"" - echo "DARWINTRACE_LOG=\"${TRACELOG}\"" - echo "DYLD_INSERT_LIBRARIES=$DARWINTRACE" - echo "" - echo "export DARWINTRACE_REDIRECT=\"${BuildRoot}\"" >> $SCRIPT - echo "export DARWINTRACE_LOG=\"${TRACELOG}\"" >> $SCRIPT - echo "export DYLD_INSERT_LIBRARIES=$DARWINTRACE" >> $SCRIPT -fi if [ "$buildtool" == "xcodebuild" ]; then cat <<-EOF >> $SCRIPT @@ -873,13 +755,8 @@ for X in \ done IFS="$OLDIFS" -if [ "$USE_CHROOT" = "YES" ]; then - export RC_BuildRoot=$DEPROOT - build_string="$build_string \"RC_BuildRoot=$DEPROOT\"" -else - export RC_BuildRoot=$REAL_DEPROOT - build_string="$build_string \"RC_BuildRoot=$REAL_DEPROOT\"" -fi +export RC_BuildRoot=$REAL_DEPROOT +build_string="$build_string \"RC_BuildRoot=$REAL_DEPROOT\"" cat <<-EOF >> $SCRIPT echo '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++' @@ -898,10 +775,6 @@ cat <<-EOF >> $SCRIPT echo 'Installed Roots:' EOF # I didn't really want to use perl(1) here, but ls(1) doesn't support this. -# For now, execute this outside the chroot so we don't require perl to be -# installed in there. This should probably be re-written as a C tool -# that can be installed into the chroot. -# Uses tail +3 to avoid getting . and .. RECEIPTS=$DARWIN_BUILDROOT/BuildRoot/usr/local/darwinbuild/receipts perl -e "opendir(DIR,\"$RECEIPTS\"); @files = sort(readdir(DIR)); @@ -950,73 +823,12 @@ EOF chmod ugo+x $SCRIPT -ExitHandler() { - ### Once for fdsec - [ -z "$(echo $BuildRoot/dev/*)" ] || umount "$BuildRoot/dev" - ### Twice for devfs - [ -z "$(echo $BuildRoot/dev/*)" ] || umount "$BuildRoot/dev" - ### Thrice for volfs - [ -z "$(echo $BuildRoot/.vol/*)" ] || chroot "$BuildRoot" umount /.vol -} - - -if [ "$USE_CHROOT" == "YES" ] ; then - ### - ### Mount devfs in the chroot - ### We'll make /dev/null our de-facto test for the existence of devfs - ### - ### Warning: - ### This must be done *BEFORE* the call to chroot, otherwise there is - ### no way to unmount the filesystem except rebooting. - ### - echo "*** Mounting special filesystems ..." - trap ExitHandler EXIT - - if [ ! -c "$BuildRoot/dev/null" ]; then - echo "Mounting devfs ..." - mkdir -p "$BuildRoot/dev" - mount -t devfs stdin "$BuildRoot/dev" - mount -t fdesc -o union stdin "$BuildRoot/dev" - else - echo "devfs appears to exist ..." - fi - - if [ -x /sbin/mount_volfs ]; then - # volfs is no longer present (nor needed) on Leopard. - if [ -z "$(echo $BuildRoot/.vol/*)" ]; then - echo "Mounting volfs ..." - [ -d "$BuildRoot/sbin" ] || mkdir -p "$BuildRoot/sbin" - [ -x "$BuildRoot/sbin/mount_volfs" ] || \ - cp /sbin/mount_volfs "$BuildRoot/sbin/" - [ -x "$BuildRoot/sbin/umount" ] || \ - cp /sbin/umount "$BuildRoot/sbin/" - [ -d "$BuildRoot/.vol" ] || mkdir -p "$BuildRoot/.vol" - ## If the directory is empty, assume volfs not mounted - chroot "$BuildRoot" /sbin/mount_volfs "/.vol" - else - echo "volfs appears to be mounted ..." - fi - fi - - ### - ### Actually invoke the build tool here - ### - chroot -u root -g wheel $BuildRoot $vartmp/$projnam/build-$project~$build_version.sh 2>&1 | tee -a "$LOG"; - EXIT_STATUS="${PIPESTATUS[0]}" -else - ### - ### Actually invoke the build tool here - ### - $BuildRoot/$vartmp/$projnam/build-$project~$build_version.sh 2>&1 | tee -a "$LOG" - EXIT_STATUS="${PIPESTATUS[0]}" - ### - ### Clean up the logging - ### - if [ "$logdeps" == "YES" ]; then - export -n DYLD_INSERT_LIBRARIES DYLD_FORCE_FLAT_NAMESPACE DARWINTRACE_LOG - fi -fi +### +### Actually invoke the build tool here +### +$BuildRoot/$vartmp/$projnam/build-$project~$build_version.sh 2>&1 | tee -a "$LOG" +EXIT_STATUS="${PIPESTATUS[0]}" if [ $EXIT_STATUS -eq 0 ]; then IsDirectoryEmpty "$REAL_DSTROOT" From a9e7f337bc68f4fcc365a6c957c44dff98d17b61 Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 18 Jul 2019 20:27:45 -0400 Subject: [PATCH 222/382] Remove createChroot script --- darwinbuild.xcodeproj/project.pbxproj | 4 - darwinbuild/createChroot | 111 -------------------------- 2 files changed, 115 deletions(-) delete mode 100755 darwinbuild/createChroot diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 3e105f3..90ebfd5 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -111,7 +111,6 @@ 7227AD1D109A05FA00BE33D7 /* buildorder in Copy Files */ = {isa = PBXBuildFile; fileRef = 7227AB881098A7BF00BE33D7 /* buildorder */; }; 7227AD1F109A05FA00BE33D7 /* synthfat in Copy Files */ = {isa = PBXBuildFile; fileRef = 7227AB8B1098A7BF00BE33D7 /* synthfat */; }; 7227AD20109A05FA00BE33D7 /* thinFile in Copy Files */ = {isa = PBXBuildFile; fileRef = 7227AB8C1098A7BF00BE33D7 /* thinFile */; }; - 7227AD21109A05FA00BE33D7 /* createChroot in Copy Files */ = {isa = PBXBuildFile; fileRef = 72C86C221096600B00C66E90 /* createChroot */; }; 7227AD22109A05FA00BE33D7 /* darwinbuild.common in Copy Files */ = {isa = PBXBuildFile; fileRef = 72C86C231096600B00C66E90 /* darwinbuild.common */; }; 72573FF71097A601008AD4D7 /* dependencies.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BF810965EEA00C66E90 /* dependencies.c */; }; 72573FF81097A60C008AD4D7 /* diff.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BFA10965EEA00C66E90 /* diff.c */; }; @@ -610,7 +609,6 @@ 7227AD1F109A05FA00BE33D7 /* synthfat in Copy Files */, 7227AD20109A05FA00BE33D7 /* thinFile in Copy Files */, 1F12836121C89D2C00E3A732 /* darwinbuild-recursive in Copy Files */, - 7227AD21109A05FA00BE33D7 /* createChroot in Copy Files */, 7227AD22109A05FA00BE33D7 /* darwinbuild.common in Copy Files */, ); name = "Copy Files"; @@ -715,7 +713,6 @@ 72C86C0E10965EEA00C66E90 /* source_sites.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = source_sites.c; sourceTree = ""; }; 72C86C0F10965EEA00C66E90 /* target.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = target.c; sourceTree = ""; }; 72C86C1010965EEA00C66E90 /* version.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = version.c; sourceTree = ""; }; - 72C86C221096600B00C66E90 /* createChroot */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = createChroot; path = darwinbuild/createChroot; sourceTree = ""; }; 72C86C231096600B00C66E90 /* darwinbuild.common */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = darwinbuild.common; path = darwinbuild/darwinbuild.common; sourceTree = ""; }; 72C86C241096600B00C66E90 /* darwinbuild.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = darwinbuild.in; path = darwinbuild/darwinbuild.in; sourceTree = ""; }; 72C86C2E1096600B00C66E90 /* manifest.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = manifest.c; path = darwinbuild/manifest.c; sourceTree = ""; }; @@ -984,7 +981,6 @@ 7227AB8B1098A7BF00BE33D7 /* synthfat */, 7227AB8C1098A7BF00BE33D7 /* thinFile */, 7227AB8D1098A7BF00BE33D7 /* thinPackages.in */, - 72C86C221096600B00C66E90 /* createChroot */, 72C86C231096600B00C66E90 /* darwinbuild.common */, 7227AC0A1098D7CE00BE33D7 /* darwinmaster.in */, 72C86C241096600B00C66E90 /* darwinbuild.in */, diff --git a/darwinbuild/createChroot b/darwinbuild/createChroot deleted file mode 100755 index 53bbf32..0000000 --- a/darwinbuild/createChroot +++ /dev/null @@ -1,111 +0,0 @@ -#!/bin/bash - -XCODEBUILD=/usr/bin/xcodebuild -BUILDROOT="$1" - -EXTRADIR=( \ - /.vol \ - /cores \ - /dev \ - /private/tmp \ - /private/var \ - /private/var/tmp ) - -EXTRACOPY=( \ - /Library/Application\ Support \ - /System/Library/Frameworks \ - /System/Library/PrivateFrameworks \ - /System/Library/DTDs \ - /System/Library/Fonts \ - /System/Library/Kernels \ - /System/Library/Keyboard\ Layouts \ - /System/Library/Perl \ - /System/Library/Tcl \ - /bin \ - /private/etc \ - /sbin \ - /usr/bin \ - /usr/lib \ - /usr/libexec \ - /usr/sbin \ - /usr/share ) - -EXTRALINKS=( \ - private/tmp \ - private/var \ - private/etc ) - -if [ -z "$BUILDROOT" ]; then - echo "Usage: $0 /Volumes/DarwinBuild/BuildRoot" 1>&2 - exit 1 -fi - -mkdir -p "$BUILDROOT" - -RemoveTemps() { - rm -f /tmp/installXcode.libs.$$ - rm -f /tmp/installXcode.seen.$$ - rm -f /tmp/installXcode.tmplibs.$$ - rm -f /tmp/installXcode.tmpfiles.$$ - rm -f /tmp/installXcode.files.$$ -} - -AppendExtraFiles() { - for X in "${EXTRACOPY[@]}"; do - echo "$X" >> /tmp/installXcode.libs.$$ - done -} - -GenerateFileNames() { - cat /tmp/installXcode.libs.$$ | sort -u | while read X; do - echo adding children for "$X" - - # first mkdir parent directories - PARENT=$(dirname "$X") - while [ "$PARENT" != "/" -a "$PARENT" != "." ]; do - echo ".$PARENT" >> /tmp/installXcode.tmpfiles.$$ - PARENT=$(dirname "$PARENT") - done - find -x ".$X" \! \( -name \*_debug\* -o -name \*_profile\* -o -path \*.lproj\* -o -path \*.dict\* \) >> /tmp/installXcode.tmpfiles.$$ - done - sort -u /tmp/installXcode.tmpfiles.$$ > /tmp/installXcode.files.$$ -} - -CopyFiles() { -# VERBOSECPIO="v" - VERBOSECPIO="" - echo "Copying system..." - cpio -o -c < /tmp/installXcode.files.$$ | \ - (cd "$BUILDROOT"; cpio -ium${VERBOSECPIO}d ) -} - - - -### -### Find all the framework and library dependencies of Xcode build -### For frameworks, copy over all supporting files. -### - -pushd / > /dev/null - -RemoveTemps -touch /tmp/installXcode.seen.$$ -echo Analyzing files to copy into chroot... -AppendExtraFiles -GenerateFileNames -CopyFiles - -for X in "${EXTRADIR[@]}"; do - mkdir -p $BUILDROOT/$X -done - -for X in "${EXTRALINKS[@]}"; do - ln -sf $X $BUILDROOT/ -done - -mkdir -p $BUILDROOT/usr/local/darwinbuild -touch $BUILDROOT/usr/local/darwinbuild/.host-system-chroot-created - -popd > /dev/null - -RemoveTemps From b750cddd99038a143135b21e2bfa849a80268d0e Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 18 Jul 2019 20:27:59 -0400 Subject: [PATCH 223/382] Remove installXcode script --- darwinbuild.xcodeproj/project.pbxproj | 4 -- darwinbuild/installXcode | 88 --------------------------- 2 files changed, 92 deletions(-) delete mode 100755 darwinbuild/installXcode diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 90ebfd5..771f4a3 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -91,7 +91,6 @@ 1F12836121C89D2C00E3A732 /* darwinbuild-recursive in Copy Files */ = {isa = PBXBuildFile; fileRef = 1F12836021C89D2C00E3A732 /* darwinbuild-recursive */; }; 1F12836621C89FD000E3A732 /* darwinbuild-codesign in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1F12836521C89FC800E3A732 /* darwinbuild-codesign */; }; 1F514C441F4A5CDA008D9341 /* fetch-from-github in Copy Files */ = {isa = PBXBuildFile; fileRef = 1F514C431F4A5CC0008D9341 /* fetch-from-github */; }; - 1FC854011ED462EE00EA2AF5 /* installXcode in Copy Files */ = {isa = PBXBuildFile; fileRef = 1FC854001ED462DF00EA2AF5 /* installXcode */; }; 1FECB5DF1FBBBD41002EA059 /* setXcodePlatform in Copy Files */ = {isa = PBXBuildFile; fileRef = 1FECB5DE1FBBBC09002EA059 /* setXcodePlatform */; }; 3963011A1EAB4D60006081C7 /* source_sites.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86C0E10965EEA00C66E90 /* source_sites.c */; }; 396301211EAB4E01006081C7 /* patch_sites.c in Sources */ = {isa = PBXBuildFile; fileRef = 396301191EAB42B6006081C7 /* patch_sites.c */; }; @@ -602,7 +601,6 @@ dstSubfolderSpec = 0; files = ( 1F514C441F4A5CDA008D9341 /* fetch-from-github in Copy Files */, - 1FC854011ED462EE00EA2AF5 /* installXcode in Copy Files */, 1FECB5DF1FBBBD41002EA059 /* setXcodePlatform in Copy Files */, 7227AD1C109A05FA00BE33D7 /* buildlist in Copy Files */, 7227AD1D109A05FA00BE33D7 /* buildorder in Copy Files */, @@ -624,7 +622,6 @@ 1F4A793921B9F123000FE4B5 /* welcome.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = welcome.html; path = installer/welcome.html; sourceTree = ""; }; 1F514C431F4A5CC0008D9341 /* fetch-from-github */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = "fetch-from-github"; path = "darwinbuild/fetch-from-github"; sourceTree = ""; }; 1F9D9647226516AA0024E830 /* darwinxref.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = darwinxref.entitlements; path = darwinxref/darwinxref.entitlements; sourceTree = ""; }; - 1FC854001ED462DF00EA2AF5 /* installXcode */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = installXcode; path = darwinbuild/installXcode; sourceTree = ""; }; 1FD9F0CD21B9E90700FB866A /* build.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = build.sh; path = installer/build.sh; sourceTree = ""; }; 1FD9F0CF21B9EAA300FB866A /* distribution.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = distribution.xml; path = installer/distribution.xml; sourceTree = ""; }; 1FEA10392264FBCF008B675D /* notarize.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = notarize.sh; path = installer/notarize.sh; sourceTree = ""; }; @@ -984,7 +981,6 @@ 72C86C231096600B00C66E90 /* darwinbuild.common */, 7227AC0A1098D7CE00BE33D7 /* darwinmaster.in */, 72C86C241096600B00C66E90 /* darwinbuild.in */, - 1FC854001ED462DF00EA2AF5 /* installXcode */, 1FECB5DE1FBBBC09002EA059 /* setXcodePlatform */, 72C86C2E1096600B00C66E90 /* manifest.c */, ); diff --git a/darwinbuild/installXcode b/darwinbuild/installXcode deleted file mode 100755 index efca2d0..0000000 --- a/darwinbuild/installXcode +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2017 William Kent. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of -# its contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY ITS CONTRIBUTORS "AS IS" AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR -# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - -do_ditto () { - local path=$1 - echo ditto $path - mkdir -p $BUILDROOT/$path - ditto "$path" "$BUILDROOT/$path" || exit 1 -} - -HOST_DARWIN_VERSION=$(sw_vers -productVersion) -BUILDROOT="$1" -mkdir -p "$BUILDROOT" - -XCODE_PATH=$(xcode-select --print-path) -if [[ "$XCODE_PATH" =~ Contents/Developer$ ]]; then - # Get the path to the root of the Xcode.app bundle. - XCODE_PATH=$(dirname $(dirname $XCODE_PATH)) -fi - -do_ditto $XCODE_PATH/Contents/Frameworks -do_ditto $XCODE_PATH/Contents/SharedFrameworks -do_ditto $XCODE_PATH/Contents/OtherFrameworks -do_ditto $XCODE_PATH/Contents/PlugIns -do_ditto $XCODE_PATH/Contents/XPCServices - -do_ditto $XCODE_PATH/Contents/Developer/Library -do_ditto $XCODE_PATH/Contents/Developer/Makefiles -do_ditto $XCODE_PATH/Contents/Developer/Toolchains -do_ditto $XCODE_PATH/Contents/Developer/Tools -do_ditto $XCODE_PATH/Contents/Developer/usr - -do_ditto $XCODE_PATH/Contents/Developer/Platforms/MacOSX.platform -ditto $XCODE_PATH/Contents/Info.plist $BUILDROOT$XCODE_PATH/Contents -ditto $XCODE_PATH/Contents/version.plist $BUILDROOT$XCODE_PATH/Contents - -mkdir -p $BUILDROOT/System/Library/CoreServices -ditto /System/Library/CoreServices/SystemVersion.plist $BUILDROOT/System/Library/CoreServices - -# Create extra directories required by the Xcode tools. -# While not strictly part of Xcode, without them the tools will crash. -mkdir -p $BUILDROOT/Users/$(whoami) -mkdir -p $BUILDROOT/$(getconf DARWIN_USER_DIR) -mkdir -p $BUILDROOT/$(getconf DARWIN_USER_TEMP_DIR) -mkdir -p $BUILDROOT/$(getconf DARWIN_USER_CACHE_DIR) - -mkdir -p $BUILDROOT/private/var/db -ln -s $XCODE_PATH/Contents/Developer $BUILDROOT/private/var/db/xcode_select_link - -# macOS versions >= 10.13 do not allow processes with entitlements -# to run inside a chroot. Therefore, I must strip the entitlements -# and re-sign xcodebuild. Hopefully, this won't break anything. -cat < $BUILDROOT/private/tmp/empty.entitlements - - - - - - -EOF - -codesign -s - -f --entitlements $BUILDROOT/private/tmp/empty.entitlements $BUILDROOT$XCODE_PATH/Contents/Developer/usr/bin/xcodebuild From 6f4d869b082a954424c9d510c512b41b108889ae Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 18 Jul 2019 20:29:11 -0400 Subject: [PATCH 224/382] Remove extra_args support from darwinbuild-recursive This was only needed to pass the -nochroot flag. Now that the chroot is gone, this code is superfluous. --- darwinbuild/darwinbuild-recursive | 3 --- 1 file changed, 3 deletions(-) diff --git a/darwinbuild/darwinbuild-recursive b/darwinbuild/darwinbuild-recursive index accf152..badf96c 100755 --- a/darwinbuild/darwinbuild-recursive +++ b/darwinbuild/darwinbuild-recursive @@ -9,8 +9,6 @@ if len(sys.argv) < 3: print('Internal tool used by darwinbuild, please do not invoke directly', file=sys.stderr) exit(1) -extra_args = sys.argv[3:] - darwin_buildroot = os.getcwd() if os.getenv('DARWIN_BUILDROOT') is not None: darwin_buildroot = os.getenv('DARWIN_BUILDROOT') @@ -63,7 +61,6 @@ def recursive_build(project, is_header=False): recursive_build(dep, is_header=False) darwinbuild_argv = ['darwinbuild'] - darwinbuild_argv += extra_args if is_header: darwinbuild_argv.append('-headers') darwinbuild_argv.append(project) From f1314f31cf1a5cfe26ee055f0d3b756f38d64181 Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 18 Jul 2019 20:38:41 -0400 Subject: [PATCH 225/382] Modernize the DEPROOT Since we are no longer using the chroot, we no longer need to worry about overwriting Apple-supplied frameworks. Therefore, we can install roots into the BuildRoot DMG directly now. --- darwinbuild/darwinbuild.common | 49 +++++++++++----------------------- darwinbuild/darwinbuild.in | 44 +++++++++--------------------- 2 files changed, 27 insertions(+), 66 deletions(-) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index 9b39069..ad524b2 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -187,10 +187,6 @@ function InstallRoot() { local BuildRoot="$1" local Project="$2" local dbuild="$3" - local DepRoot="$4" - if [ -z "$DepRoot" ]; then - DepRoot=$BuildRoot - fi local SelfBuiltRoot="" local InstallSelfBuiltRoot=0 @@ -231,14 +227,7 @@ function InstallRoot() { # install a self-built root, or a prebuilt root, or nothing if [ $InstallSelfBuiltRoot -eq 1 ]; then echo "Copying $Project from $SelfBuiltRoot ..." - ditto "$SelfBuiltRoot" "$DepRoot" - - if [ "$DepRoot" != "$BuildRoot" ]; then - # If the DepRoot is different from the BuildRoot, then the - # receipts will not be present in the correct location. - # We must copy them there ourselves. - ditto "$SelfBuiltRoot/usr/local/darwinbuild/receipts" "$BuildRoot/usr/local/darwinbuild/receipts" - fi + ditto "$SelfBuiltRoot" "$BuildRoot" "$DARWINXREF" register "$Project" "$SelfBuiltRoot" > /dev/null TouchReceipt "$BuildRoot" "$Project" "root" @@ -291,10 +280,6 @@ function InstallHeader() { local BuildRoot="$1" local Project="$2" local dbuild="$3" - local DepRoot="$4" - if [ -z "$DepRoot" ]; then - DepRoot=$BuildRoot - fi local SelfBuiltRoot="" local SelfBuiltHeader="" @@ -366,29 +351,13 @@ function InstallHeader() { # install a self-built root, or a prebuilt root, or nothing if [ $InstallSelfBuiltHeader -eq 1 ]; then echo "Copying $Project from $SelfBuiltHeader ..." - ditto "$SelfBuiltHeader" "$DepRoot" - - if [ "$DepRoot" != "$BuildRoot" ]; then - # If the DepRoot is different from the BuildRoot, then the - # receipts will not be present in the correct location. - # We must copy them there ourselves. - ditto "$SelfBuiltHeader/usr/local/darwinbuild/receipts" "$BuildRoot/usr/local/darwinbuild/receipts" - fi - + ditto "$SelfBuiltHeader" "$BuildRoot" "$DARWINXREF" register "$Project" "$SelfBuiltHeader" > /dev/null TouchReceipt "$BuildRoot" "$Project" "hdrs" return 0 elif [ $InstallSelfBuiltRoot -eq 1 ]; then echo "Copying $Project from $SelfBuiltRoot ..." - ditto "$SelfBuiltRoot" "$DepRoot" - - if [ "$DepRoot" != "$BuildRoot" ]; then - # If the DepRoot is different from the BuildRoot, then the - # receipts will not be present in the correct location. - # We must copy them there ourselves. - ditto "$SelfBuiltRoot/usr/local/darwinbuild/receipts" "$BuildRoot/usr/local/darwinbuild/receipts" - fi - + ditto "$SelfBuiltRoot" "$BuildRoot" "$DARWINXREF" register "$Project" "$SelfBuiltRoot" > /dev/null TouchReceipt "$BuildRoot" "$Project" "root" return 0 @@ -576,3 +545,15 @@ function IsDirectoryEmpty() { return 0 fi } + +function WriteDarwinbuildXcodeConfig() { + local BuildRoot="$1" + local SRCROOT="$2" + + cat < $SRCROOT/darwinbuild.xcconfig + PD_BUILD_ROOT = "$BuildRoot" + + OTHER_LDFLAGS = \$(OTHER_LDFLAGS) -isysroot "$PD_BUILD_ROOT" + OTHER_CFLAGS = \$(OTHER_CFLAGS) -isysroot "$PD_BUILD_ROOT" +EOF +} diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index d0c8bb7..11b8e11 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -474,7 +474,6 @@ REAL_SRCROOT="$BuildRoot/SourceCache/$projnam/$project" REAL_OBJROOT="$BuildRoot/$vartmp/$projnam/$project.obj" REAL_SYMROOT="$BuildRoot/$vartmp/$projnam/$project.sym" REAL_DSTROOT="$BuildRoot/$vartmp/$projnam/$project.root" -REAL_DEPROOT="$BuildRoot/InstalledRoots" if [ "$nosource" != "YES" ]; then ### @@ -482,7 +481,7 @@ if [ "$nosource" != "YES" ]; then ### and create new directories in their place. ### rm -Rf "$REAL_SRCROOT" "$REAL_OBJROOT" "$REAL_SYMROOT" "$REAL_DSTROOT" - mkdir -p "$REAL_SRCROOT" "$REAL_OBJROOT" "$REAL_SYMROOT" "$REAL_DSTROOT" "$REAL_DEPROOT" + mkdir -p "$REAL_SRCROOT" "$REAL_OBJROOT" "$REAL_SYMROOT" "$REAL_DSTROOT" ### ### Install the sources and patches into the BuildRoot @@ -505,7 +504,7 @@ if [ "$nosource" != "YES" ]; then fi if [ "$branch" != "" ]; then - mkdir -p "$REAL_SRCROOT" "$REAL_OBJROOT" "$REAL_SYMROOT" "$REAL_DSTROOT" "$REAL_DEPROOT" + mkdir -p "$REAL_SRCROOT" "$REAL_OBJROOT" "$REAL_SYMROOT" "$REAL_DSTROOT" CheckoutOrUpdate "$REAL_SRCROOT" "$branch" "$($DARWINXREF source_sites $projnam)" fi @@ -584,30 +583,18 @@ if [ "$noload" != "YES" ]; then for X in $deps ; do if [ "$action" != "installhdrs" ]; then - InstallRoot "$BuildRoot" "$X" "$depsbuild" "$REAL_DEPROOT" + InstallRoot "$BuildRoot" "$X" "$depsbuild" "$BuildRoot" fi done echo "*** Installing Headers ..." deps=$($DARWINXREF dependencies -header "$projnam") for X in $deps ; do - InstallHeader "$BuildRoot" "$X" "$depsbuild" "$REAL_DEPROOT" + InstallHeader "$BuildRoot" "$X" "$depsbuild" "$BuildRoot" done if [ "$loadonly" = "YES" ]; then - cat < $REAL_SRCROOT/darwinbuild.xcconfig -DEPROOT = $REAL_DEPROOT - -SYSTEM_HEADER_SEARCH_PATHS = \$(DEPROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \$(DEPROOT)/usr/include \$(DEPROOT)/usr/local/include -FRAMEWORK_SEARCH_PATHS = \$(DEPROOT)/System/Library/Frameworks \$(DEPROOT)/System/Library/PrivateFrameworks -LIBRARY_SEARCH_PATHS = \$(DEPROOT)/usr/local/lib \$(DEPROOT)/usr/lib -EOF - - echo - echo "xcconfig file containing paths to staged dependencies is here:" - echo " $REAL_SRCROOT/darwinbuild.xcconfig" - echo - + WriteDarwinbuildXcodeConfig "$BuildRoot" "$REAL_SRCROOT" exit fi @@ -630,7 +617,7 @@ TRACELOG="$BuildRoot/private/var/tmp/$projnam/$project.trace~$build_version" mkdir -p "$DARWIN_BUILDROOT/Logs/$projnam" # Hide this variable from the unset -export -n SRCROOT OBJROOT SYMROOT DSTROOT DEPROOT +export -n SRCROOT OBJROOT SYMROOT DSTROOT export -n DARWIN_BUILDROOT DARWINBUILD_BUILD DARWINXREF_DB_FILE # Screen sets this to a multi-line value which causes trouble @@ -643,7 +630,7 @@ for X in $(printenv) ; do done IFS="$OLDIFS" -export SRCROOT OBJROOT SYMROOT DSTROOT DEPROOT +export SRCROOT OBJROOT SYMROOT DSTROOT export DARWIN_BUILDROOT DARWINBUILD_BUILD DARWINXREF_DB_FILE export PATH=/bin:/sbin:/usr/bin:/usr/sbin/:/usr/local/bin:/usr/local/sbin @@ -683,16 +670,10 @@ if [ "$buildtool" == "xcodebuild" ]; then fi ### -### Write out the xcconfig file to be used with the DEPROOT +### Write out the xcconfig file to override the Xcode SDK. ### -cat < $REAL_SRCROOT/darwinbuild.xcconfig -DEPROOT = $DEPROOT - -SYSTEM_HEADER_SEARCH_PATHS = \$(DEPROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \$(DEPROOT)/usr/include \$(DEPROOT)/usr/local/include -FRAMEWORK_SEARCH_PATHS = \$(DEPROOT)/System/Library/Frameworks \$(DEPROOT)/System/Library/PrivateFrameworks -LIBRARY_SEARCH_PATHS = \$(DEPROOT)/usr/local/lib \$(DEPROOT)/usr/lib -EOF +WriteDarwinbuildXcodeConfig "$BuildRoot" "$REAL_SRCROOT" ### ### Write out the build script that will be used. @@ -733,12 +714,11 @@ cat <<-EOF >> $SCRIPT echo OBJROOT: '$OBJROOT' echo SYMROOT: '$SYMROOT' echo DSTROOT: '$DSTROOT' - echo DEPROOT: '$DEPROOT' EOF ### ### Add in the build environment variables from darwinxref ### -build_string="$build_string \"SRCROOT=$SRCROOT\" \"OBJROOT=$OBJROOT\" \"SYMROOT=$SYMROOT\" \"DSTROOT=$DSTROOT\" \"DEPROOT=$DEPROOT\"" +build_string="$build_string \"SRCROOT=$SRCROOT\" \"OBJROOT=$OBJROOT\" \"SYMROOT=$SYMROOT\" \"DSTROOT=$DSTROOT\" XREF_ENV=$($DARWINXREF environment $projnam) OLDIFS="$IFS" @@ -755,8 +735,8 @@ for X in \ done IFS="$OLDIFS" -export RC_BuildRoot=$REAL_DEPROOT -build_string="$build_string \"RC_BuildRoot=$REAL_DEPROOT\"" +export RC_BuildRoot=$BuildRoot +build_string="$build_string \"RC_BuildRoot=$BuildRoot\"" cat <<-EOF >> $SCRIPT echo '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++' From 4d0d2517ec4378f88a043baec338dababec616de Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 18 Jul 2019 20:41:57 -0400 Subject: [PATCH 226/382] Copy the Xcode SDK into the buildroot This is needed because the technique we are now using to overlay on top of the Apple SDK actually overrides the SDK completely. For low-level components to be able to build, we must provide the *entire* macOS SDK, or else we will get dozens of header/library-not-found errors. --- darwinbuild/darwinbuild.in | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 11b8e11..6748edb 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -156,6 +156,13 @@ if [ "$1" == "-init" ]; then -volname $DMGVOLUME \ $DMGFILE ln -s "/Volumes/${DMGVOLUME}" BuildRoot + + echo "Copying Xcode SDK into build root disk image..." + XC_SDKROOT=$(xcrun --show-sdk-path) + mkdir -p BuildRoot/System/Library BuildRoot/usr + cp -R $XC_SDKROOT/System/Library/Frameworks BuildRoot/System/Library + cp -R $XC_SDKROOT/usr/include BuildRoot/usr + cp -R $XC_SDKROOT/usr/lib BuildRoot/usr fi fi From 4c3ae430ffef95e7037ecc790a94b3318b5696d3 Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 18 Jul 2019 20:44:19 -0400 Subject: [PATCH 227/382] Remove the REAL_ prefix from the various roots --- darwinbuild/darwinbuild.in | 50 +++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 6748edb..378288d 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -487,23 +487,23 @@ if [ "$nosource" != "YES" ]; then ### Remove any pre-existing directories that might be in the way ### and create new directories in their place. ### - rm -Rf "$REAL_SRCROOT" "$REAL_OBJROOT" "$REAL_SYMROOT" "$REAL_DSTROOT" - mkdir -p "$REAL_SRCROOT" "$REAL_OBJROOT" "$REAL_SYMROOT" "$REAL_DSTROOT" + rm -Rf "$SRCROOT" "$OBJROOT" "$SYMROOT" "$DSTROOT" + mkdir -p "$SRCROOT" "$OBJROOT" "$SYMROOT" "$DSTROOT" ### ### Install the sources and patches into the BuildRoot ### - cd "$REAL_SRCROOT/.." + cd "$SRCROOT/.." echo "*** Copying Sources ..." if [ -d "$SourceCache/$project" ]; then tar c -C "$SourceCache" "$project" | tar xf - elif [ "$alias" != "" -a -d "$SourceCache/$alias-$version" ]; then tar c -C "$SourceCache" "$alias-$version" | tar xf - - rmdir "$REAL_SRCROOT" + rmdir "$SRCROOT" ln -fhs "$alias-$version" "$project" elif [ "$alias" != "" ]; then tar xzf "$SourceCache/$alias-$version.tar.gz" - rmdir "$REAL_SRCROOT" + rmdir "$SRCROOT" ln -fhs "$alias-$version" "$project" else tar xzf "$SourceCache/$filename" @@ -511,8 +511,8 @@ if [ "$nosource" != "YES" ]; then fi if [ "$branch" != "" ]; then - mkdir -p "$REAL_SRCROOT" "$REAL_OBJROOT" "$REAL_SYMROOT" "$REAL_DSTROOT" - CheckoutOrUpdate "$REAL_SRCROOT" "$branch" "$($DARWINXREF source_sites $projnam)" + mkdir -p "$SRCROOT" "$OBJROOT" "$SYMROOT" "$DSTROOT" + CheckoutOrUpdate "$SRCROOT" "$branch" "$($DARWINXREF source_sites $projnam)" fi # you can avoid registering patches in the DB by using "xnu-792--patches.tar.gz" @@ -524,11 +524,11 @@ fi ### Apply the patches ### Current working directory should be the SRCROOT ### -cd "$REAL_SRCROOT" +cd "$SRCROOT" if [ "$nopatch" != "YES" ]; then -if [ -d "$REAL_SRCROOT/../$project-patches" ]; then +if [ -d "$SRCROOT/../$project-patches" ]; then echo "*** Applying Patches ..." - cat $REAL_SRCROOT/../$project-patches/* | patch -p0 + cat $SRCROOT/../$project-patches/* | patch -p0 fi for patchfile in $patchfilenames; do echo "*** Applying Patch $patchfile ..." @@ -601,7 +601,7 @@ if [ "$noload" != "YES" ]; then done if [ "$loadonly" = "YES" ]; then - WriteDarwinbuildXcodeConfig "$BuildRoot" "$REAL_SRCROOT" + WriteDarwinbuildXcodeConfig "$BuildRoot" "$SRCROOT" exit fi @@ -680,7 +680,7 @@ fi ### Write out the xcconfig file to override the Xcode SDK. ### -WriteDarwinbuildXcodeConfig "$BuildRoot" "$REAL_SRCROOT" +WriteDarwinbuildXcodeConfig "$BuildRoot" "$SRCROOT" ### ### Write out the build script that will be used. @@ -818,9 +818,9 @@ $BuildRoot/$vartmp/$projnam/build-$project~$build_version.sh 2>&1 | tee -a "$LOG EXIT_STATUS="${PIPESTATUS[0]}" if [ $EXIT_STATUS -eq 0 ]; then - IsDirectoryEmpty "$REAL_DSTROOT" + IsDirectoryEmpty "$DSTROOT" if [ $? -eq 0 ]; then - echo "$REAL_DSTROOT is empty. Build verification failed." 1>&2 + echo "$DSTROOT is empty. Build verification failed." 1>&2 EXIT_STATUS=3 fi fi @@ -835,31 +835,31 @@ if [ "$EXIT_STATUS" == "0" ]; then if [ "$action" == "installhdrs" ]; then ### Output the manifest MANIFEST="/tmp/$projnam.$$" - "$DARWINXREF" register "$projnam" "$REAL_DSTROOT" | tee "$MANIFEST" + "$DARWINXREF" register "$projnam" "$DSTROOT" | tee "$MANIFEST" SHA1=$(cat "$MANIFEST" | $DIGEST) - mkdir -p "$REAL_DSTROOT/usr/local/darwinbuild/receipts" - cp "$MANIFEST" "$REAL_DSTROOT/usr/local/darwinbuild/receipts/$SHA1" - ln -s "$SHA1" "$REAL_DSTROOT/usr/local/darwinbuild/receipts/$projnam.hdrs" + mkdir -p "$DSTROOT/usr/local/darwinbuild/receipts" + cp "$MANIFEST" "$DSTROOT/usr/local/darwinbuild/receipts/$SHA1" + ln -s "$SHA1" "$DSTROOT/usr/local/darwinbuild/receipts/$projnam.hdrs" rm -f "$MANIFEST" mkdir -p "$DARWIN_BUILDROOT/Headers/$projnam/$project.hdrs~$build_version" - ditto "$REAL_DSTROOT" "$DARWIN_BUILDROOT/Headers/$projnam/$project.hdrs~$build_version" + ditto "$DSTROOT" "$DARWIN_BUILDROOT/Headers/$projnam/$project.hdrs~$build_version" else ### Register the root with the darwinxref database. This will output a manifest ### which can be used to uniquely identify the root. Store the unique identifier ### in the receipts directory after registration. MANIFEST="/tmp/$projnam.$$" - "$DARWINXREF" register "$projnam" "$REAL_DSTROOT" | tee "$MANIFEST" + "$DARWINXREF" register "$projnam" "$DSTROOT" | tee "$MANIFEST" SHA1=$(cat "$MANIFEST" | $DIGEST) - mkdir -p "$REAL_DSTROOT/usr/local/darwinbuild/receipts" - cp "$MANIFEST" "$REAL_DSTROOT/usr/local/darwinbuild/receipts/$SHA1" - ln -s "$SHA1" "$REAL_DSTROOT/usr/local/darwinbuild/receipts/$projnam" + mkdir -p "$DSTROOT/usr/local/darwinbuild/receipts" + cp "$MANIFEST" "$DSTROOT/usr/local/darwinbuild/receipts/$SHA1" + ln -s "$SHA1" "$DSTROOT/usr/local/darwinbuild/receipts/$projnam" rm -f "$MANIFEST" mkdir -p "$DARWIN_BUILDROOT/Symbols/$projnam/$project.sym~$build_version" mkdir -p "$DARWIN_BUILDROOT/Roots/$projnam/$project.root~$build_version" - ditto "$REAL_SYMROOT" "$DARWIN_BUILDROOT/Symbols/$projnam/$project.sym~$build_version" - ditto "$REAL_DSTROOT" "$DARWIN_BUILDROOT/Roots/$projnam/$project.root~$build_version" + ditto "$SYMROOT" "$DARWIN_BUILDROOT/Symbols/$projnam/$project.sym~$build_version" + ditto "$DSTROOT" "$DARWIN_BUILDROOT/Roots/$projnam/$project.root~$build_version" if [ "$logdeps" == "YES" ]; then ### Log dependencies, but filter out duplicates, relative paths, and temporary files From 27e0a905067e49e9953c1600026424f884f27f73 Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 18 Jul 2019 20:45:25 -0400 Subject: [PATCH 228/382] Remove override of CODE_SIGN_IDENTITY Now that there is no more chroot, any certificates in the macOS keychain can be readily used. --- darwinbuild/darwinbuild.in | 4 ---- 1 file changed, 4 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 378288d..72d5616 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -672,10 +672,6 @@ if [ "$buildtool" == "xcodebuild" -a "$configuration" != "" ]; then build_string="$build_string -configuration \"$configuration\"" fi -if [ "$buildtool" == "xcodebuild" ]; then - build_string="$build_string CODE_SIGN_IDENTITY=-" -fi - ### ### Write out the xcconfig file to override the Xcode SDK. ### From 36aa977ed16169454d0dfa028225f8cdae7af177 Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 18 Jul 2019 20:45:56 -0400 Subject: [PATCH 229/382] Add macOS Catalina support to setXcodePlatform script --- darwinbuild/setXcodePlatform | 1 + 1 file changed, 1 insertion(+) diff --git a/darwinbuild/setXcodePlatform b/darwinbuild/setXcodePlatform index cdfce56..6648b83 100755 --- a/darwinbuild/setXcodePlatform +++ b/darwinbuild/setXcodePlatform @@ -34,6 +34,7 @@ set -e HOST_DARWIN_VERSION=$(sw_vers -productVersion | sed -Ee 's,(10\.[0-9]{2}).*,\1,') +[[ "$HOST_DARWIN_VERSION" =~ ^10.15 ]] && echo 'macosx10.15' > $1/.build/platform [[ "$HOST_DARWIN_VERSION" =~ ^10.14 ]] && echo 'macosx10.14' > $1/.build/platform [[ "$HOST_DARWIN_VERSION" =~ ^10.13 ]] && echo 'macosx10.13' > $1/.build/platform [[ "$HOST_DARWIN_VERSION" =~ ^10.12 ]] && echo 'macosx10.12' > $1/.build/platform From 8adb992ef7a47cc91285135d0b23ea3bb0a9d217 Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 18 Jul 2019 20:50:46 -0400 Subject: [PATCH 230/382] Addendum to 4c3ae430ffef --- darwinbuild/darwinbuild.in | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 72d5616..1983ad5 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -474,13 +474,11 @@ chmod 1777 "$BuildRoot/$vartmp" ### ### Define the SRCROOT, OBJROOT, SYMROOT, and DSTROOT. -### This script refers to the absolute paths of the build -### directory, and should use REAL_SRCROOT, etc. ### -REAL_SRCROOT="$BuildRoot/SourceCache/$projnam/$project" -REAL_OBJROOT="$BuildRoot/$vartmp/$projnam/$project.obj" -REAL_SYMROOT="$BuildRoot/$vartmp/$projnam/$project.sym" -REAL_DSTROOT="$BuildRoot/$vartmp/$projnam/$project.root" +SRCROOT="$BuildRoot/SourceCache/$projnam/$project" +OBJROOT="$BuildRoot/$vartmp/$projnam/$project.obj" +SYMROOT="$BuildRoot/$vartmp/$projnam/$project.sym" +DSTROOT="$BuildRoot/$vartmp/$projnam/$project.root" if [ "$nosource" != "YES" ]; then ### From 9784704a6bc0a41e3ad5e1460e1a0006fd3ebbf4 Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 18 Jul 2019 20:51:50 -0400 Subject: [PATCH 231/382] Bump installer component versions --- installer/build.sh | 4 ++-- installer/distribution.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/installer/build.sh b/installer/build.sh index 9f5cdf8..e9e3abd 100755 --- a/installer/build.sh +++ b/installer/build.sh @@ -13,7 +13,7 @@ xcodebuild install \ pkgbuild \ --ownership recommended \ --identifier org.puredarwin.darwinbuild.component \ - --version 1.3.1 \ + --version 2.0 \ --root $MY_DIR/payload \ --install-location / \ $MY_DIR/darwinbuild-component.pkg @@ -21,7 +21,7 @@ pkgbuild \ productbuild \ --distribution $MY_DIR/distribution.xml \ --identifier org.puredarwin.darwinbuild.release \ - --version 1.3.1 \ + --version 2.0 \ --sign 'Developer ID Installer' --timestamp \ --package-path $MY_DIR \ --resources $MY_DIR \ diff --git a/installer/distribution.xml b/installer/distribution.xml index 9a2302b..e405e64 100644 --- a/installer/distribution.xml +++ b/installer/distribution.xml @@ -11,7 +11,7 @@ - darwinbuild-component.pkg + darwinbuild-component.pkg PureDarwin Build System From 0453b4c1db8a0bbb007d211f3611b54da892970e Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 18 Jul 2019 20:56:10 -0400 Subject: [PATCH 232/382] Fix embarrassing typo --- darwinbuild/darwinbuild.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 1983ad5..44b5567 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -719,7 +719,7 @@ EOF ### ### Add in the build environment variables from darwinxref ### -build_string="$build_string \"SRCROOT=$SRCROOT\" \"OBJROOT=$OBJROOT\" \"SYMROOT=$SYMROOT\" \"DSTROOT=$DSTROOT\" +build_string="$build_string \"SRCROOT=$SRCROOT\" \"OBJROOT=$OBJROOT\" \"SYMROOT=$SYMROOT\" \"DSTROOT=$DSTROOT\"" XREF_ENV=$($DARWINXREF environment $projnam) OLDIFS="$IFS" From 6a5672a8784d89d936ad2cea0b2cec0d090c62fb Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 18 Jul 2019 21:02:37 -0400 Subject: [PATCH 233/382] Rearrange Xcode SDK installation --- darwinbuild/darwinbuild.in | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 44b5567..dce6d78 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -156,13 +156,6 @@ if [ "$1" == "-init" ]; then -volname $DMGVOLUME \ $DMGFILE ln -s "/Volumes/${DMGVOLUME}" BuildRoot - - echo "Copying Xcode SDK into build root disk image..." - XC_SDKROOT=$(xcrun --show-sdk-path) - mkdir -p BuildRoot/System/Library BuildRoot/usr - cp -R $XC_SDKROOT/System/Library/Frameworks BuildRoot/System/Library - cp -R $XC_SDKROOT/usr/include BuildRoot/usr - cp -R $XC_SDKROOT/usr/lib BuildRoot/usr fi fi @@ -472,6 +465,25 @@ vartmp="private/var/tmp" mkdir -p "$BuildRoot/$vartmp" chmod 1777 "$BuildRoot/$vartmp" +### +### Install the Xcode SDK, if required. +### +mkdir -p $BuildRoot/usr/local/darwinbuild +if [ ! -f $BuildRoot/usr/local/darwinbuild/.xcode-sdk-installed ]; then + echo "*** Copying Xcode SDK into build root disk image ..." + + XC_SDKROOT=$(xcrun --show-sdk-path) + mkdir -p BuildRoot/System/Library BuildRoot/usr + cp -aLR $XC_SDKROOT/System/Library/Frameworks BuildRoot/System/Library + cp -aLR $XC_SDKROOT/usr/include BuildRoot/usr + cp -aR $XC_SDKROOT/usr/lib BuildRoot/usr + + echo "*** Removing cached roots, as they may be inconsistent ..." + rm -f $BuildRoot/${RECEIPTDIR}/* + + touch BuildRoot/usr/local/darwinbuild/.xcode-sdk-installed +fi + ### ### Define the SRCROOT, OBJROOT, SYMROOT, and DSTROOT. ### From 783ae0f0f2665a64199ffc3b2e14bb7131249b90 Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 18 Jul 2019 21:05:13 -0400 Subject: [PATCH 234/382] Remove installXcode leftovers --- darwinbuild/darwinbuild.in | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index dce6d78..f272ce0 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -657,17 +657,7 @@ export LOGNAME="root" export USER="root" export GROUP="wheel" -# read the platform data installed by installXcode -if [ $INSTALL_XCODE == "YES" ]; then - platform=$(cat "${DARWIN_BUILDROOT}/.build/platform") - # set SDKROOT for Makefiles that use xcrun - export SDKROOT="$BuildRoot" -fi - build_string="" -if [ "$buildtool" == "xcodebuild" -a $INSTALL_XCODE == "YES" ]; then - build_string="-sdk $platform" -fi if [ "$buildtool" == "xcodebuild" -a "$target" != "" ]; then build_string="$build_string -target \"$target\"" elif [ "$target" != "" ]; then From 805ec51c7f65eb6c38e342bd9c93dacb4afb4261 Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 18 Jul 2019 21:12:18 -0400 Subject: [PATCH 235/382] Strip leading indentation from darwinbuild.xcconfig file --- darwinbuild/darwinbuild.common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index ad524b2..1602ada 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -550,7 +550,7 @@ function WriteDarwinbuildXcodeConfig() { local BuildRoot="$1" local SRCROOT="$2" - cat < $SRCROOT/darwinbuild.xcconfig + cat <<-EOF > $SRCROOT/darwinbuild.xcconfig PD_BUILD_ROOT = "$BuildRoot" OTHER_LDFLAGS = \$(OTHER_LDFLAGS) -isysroot "$PD_BUILD_ROOT" From 8caa3e5d99e61b323f0b0054ed6082b9303130ec Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 18 Jul 2019 21:13:06 -0400 Subject: [PATCH 236/382] Don't copy the Apple SDK into the build root If a low-level project needs to use the Apple macOS SDK, they simply do not import darwinbuild.xcconfig in their build system. All projects (of higher level than xnu) should use the build root SDK. --- darwinbuild/darwinbuild.in | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index f272ce0..8d60f3e 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -465,25 +465,6 @@ vartmp="private/var/tmp" mkdir -p "$BuildRoot/$vartmp" chmod 1777 "$BuildRoot/$vartmp" -### -### Install the Xcode SDK, if required. -### -mkdir -p $BuildRoot/usr/local/darwinbuild -if [ ! -f $BuildRoot/usr/local/darwinbuild/.xcode-sdk-installed ]; then - echo "*** Copying Xcode SDK into build root disk image ..." - - XC_SDKROOT=$(xcrun --show-sdk-path) - mkdir -p BuildRoot/System/Library BuildRoot/usr - cp -aLR $XC_SDKROOT/System/Library/Frameworks BuildRoot/System/Library - cp -aLR $XC_SDKROOT/usr/include BuildRoot/usr - cp -aR $XC_SDKROOT/usr/lib BuildRoot/usr - - echo "*** Removing cached roots, as they may be inconsistent ..." - rm -f $BuildRoot/${RECEIPTDIR}/* - - touch BuildRoot/usr/local/darwinbuild/.xcode-sdk-installed -fi - ### ### Define the SRCROOT, OBJROOT, SYMROOT, and DSTROOT. ### From 49d5e798617fd25efd8a1436ea9938a212b88e43 Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 18 Jul 2019 21:16:11 -0400 Subject: [PATCH 237/382] Fix darwinbuild.xcconfig syntax --- darwinbuild/darwinbuild.common | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index 1602ada..333d011 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -551,9 +551,9 @@ function WriteDarwinbuildXcodeConfig() { local SRCROOT="$2" cat <<-EOF > $SRCROOT/darwinbuild.xcconfig - PD_BUILD_ROOT = "$BuildRoot" + PD_BUILD_ROOT = $BuildRoot - OTHER_LDFLAGS = \$(OTHER_LDFLAGS) -isysroot "$PD_BUILD_ROOT" - OTHER_CFLAGS = \$(OTHER_CFLAGS) -isysroot "$PD_BUILD_ROOT" + OTHER_LDFLAGS = \$(OTHER_LDFLAGS) -isysroot "\$(PD_BUILD_ROOT)" + OTHER_CFLAGS = \$(OTHER_CFLAGS) -isysroot "\$(PD_BUILD_ROOT)" EOF } From 03f1194b3bdcd24eafdca7629c5d3b011fd92a73 Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 19 Jul 2019 11:00:59 -0400 Subject: [PATCH 238/382] Back out pointless breaking change There is no good reason to rename the DEPROOT variable, and plenty of reasons not to. --- darwinbuild/darwinbuild.common | 6 +++--- darwinbuild/darwinbuild.in | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index 333d011..0ed4c56 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -551,9 +551,9 @@ function WriteDarwinbuildXcodeConfig() { local SRCROOT="$2" cat <<-EOF > $SRCROOT/darwinbuild.xcconfig - PD_BUILD_ROOT = $BuildRoot + DEPROOT = $BuildRoot - OTHER_LDFLAGS = \$(OTHER_LDFLAGS) -isysroot "\$(PD_BUILD_ROOT)" - OTHER_CFLAGS = \$(OTHER_CFLAGS) -isysroot "\$(PD_BUILD_ROOT)" + OTHER_LDFLAGS = \$(OTHER_LDFLAGS) -isysroot "\$(DEPROOT)" + OTHER_CFLAGS = \$(OTHER_CFLAGS) -isysroot "\$(DEPROOT)" EOF } diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 8d60f3e..e47d8f2 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -645,6 +645,10 @@ elif [ "$target" != "" ]; then action="$target" fi +if [ "$buildtool" == "make" ]; then + build_string="$build_string DEPROOT=$BuildRoot" +fi + # # append build configuration to $action, if any # this is only applicable to xcodebuild From 32bbf42185b8595c69a40438bd743c577b1beac4 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sat, 20 Jul 2019 13:27:19 -0400 Subject: [PATCH 239/382] Use Python 3 instead of Python 2 Python 2 is deprecated starting in macOS Catalina. Python 3 is shipped in Xcode starting with Xcode 11. --- darwinbuild/darwinbuild-codesign | 3 +-- darwinbuild/darwinbuild-create-tarball | 3 +-- darwinbuild/darwinbuild-recursive | 3 +-- darwinbuild/fetch-from-github | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/darwinbuild/darwinbuild-codesign b/darwinbuild/darwinbuild-codesign index 74e0aba..9e1ef42 100755 --- a/darwinbuild/darwinbuild-codesign +++ b/darwinbuild/darwinbuild-codesign @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright (c) 2017 William Kent. All rights reserved. # @@ -27,7 +27,6 @@ # POSSIBILITY OF SUCH DAMAGE. # -from __future__ import print_function import sys, os, re import subprocess import plistlib diff --git a/darwinbuild/darwinbuild-create-tarball b/darwinbuild/darwinbuild-create-tarball index 1701765..c55a2a0 100755 --- a/darwinbuild/darwinbuild-create-tarball +++ b/darwinbuild/darwinbuild-create-tarball @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright (c) 2017 William Kent. All rights reserved. # @@ -27,7 +27,6 @@ # POSSIBILITY OF SUCH DAMAGE. # -from __future__ import print_function import sys import os import subprocess diff --git a/darwinbuild/darwinbuild-recursive b/darwinbuild/darwinbuild-recursive index badf96c..e9191b2 100755 --- a/darwinbuild/darwinbuild-recursive +++ b/darwinbuild/darwinbuild-recursive @@ -1,6 +1,5 @@ -#!/usr/bin/python +#!/usr/bin/python3 -from __future__ import print_function import sys, os import plistlib import subprocess diff --git a/darwinbuild/fetch-from-github b/darwinbuild/fetch-from-github index c2f80f6..561fc87 100755 --- a/darwinbuild/fetch-from-github +++ b/darwinbuild/fetch-from-github @@ -1,6 +1,5 @@ -#!/usr/bin/python +#!/usr/bin/python3 -from __future__ import print_function import sys, os import plistlib import subprocess From bb9c96acfa7f10be325b044c11ca1fd39a7fe158 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sat, 20 Jul 2019 13:32:38 -0400 Subject: [PATCH 240/382] Fix Python 3 compatibility errors --- darwinbuild/darwinbuild-codesign | 12 +++++++----- darwinbuild/darwinbuild-create-tarball | 8 ++------ darwinbuild/darwinbuild-recursive | 10 +++++----- darwinbuild/fetch-from-github | 7 +++++-- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/darwinbuild/darwinbuild-codesign b/darwinbuild/darwinbuild-codesign index 9e1ef42..0df5a36 100755 --- a/darwinbuild/darwinbuild-codesign +++ b/darwinbuild/darwinbuild-codesign @@ -62,7 +62,7 @@ if args.project is not None: try: print('Attaching build root disk image...') subprocess.check_call(['hdiutil', 'attach', '.build/buildroot.sparsebundle', '-readwrite', '-owners', 'on'], cwd=darwin_buildroot, stdout=None) - except Exception, e: + except Exception as e: print('Could not attach buildroot.sparsebundle:', e, file=sys.stderr) exit(1) @@ -108,8 +108,10 @@ if project_root is None or srcroot is None: codesign_plist = None try: - codesign_plist = plistlib.readPlist(os.path.join(srcroot, 'darwinbuild-codesign.plist')) -except Exception, e: + filename = os.path.join(srcroot, 'darwinbuild-codesign.plist') + with open(filename, 'rb') as file: + codesign_plist = plistlib.load(file) +except Exception as e: print('Could not read darwinbuild-codesign.plist:', e, file=sys.stderr) exit(1) @@ -200,8 +202,8 @@ for (filename, value) in codesign_plist['files'].items(): signing_map[order] = [] signing_map[order].append(codesign_argv) -key_vector = signing_map.keys() -key_vector.sort(cmp=cmp) +key_vector = list(signing_map.keys()) +key_vector.sort() for order_index in key_vector: for argv in signing_map[order_index]: diff --git a/darwinbuild/darwinbuild-create-tarball b/darwinbuild/darwinbuild-create-tarball index c55a2a0..5ed7a40 100755 --- a/darwinbuild/darwinbuild-create-tarball +++ b/darwinbuild/darwinbuild-create-tarball @@ -32,16 +32,12 @@ import os import subprocess import tarfile -def popen_exec(args, cwd=None): - output = subprocess.check_output(args, universal_newlines=True, cwd=cwd) - return output.decode('utf-8') - if len(sys.argv) < 3: print('usage:', sys.argv[0], '/path/to/output project-version', file=sys.stderr) exit(1) def process_submodule(base_path): - module_files = popen_exec(['git', 'ls-files'], cwd=base_path).split('\n') + module_files = subprocess.check_output(['git', 'ls-files'], universal_newlines=True, cwd=base_path).split('\n') gitmodules_path = os.path.join(base_path, '.gitmodules') if base_path is not None else '.gitmodules' if not os.path.isfile(gitmodules_path): @@ -68,7 +64,7 @@ project_and_version = sys.argv[2] all_files = [] try: all_files = process_submodule(None) -except subprocess.CalledProcessError, e: +except subprocess.CalledProcessError as e: print(e.cmd, 'exited with code', e.returncode, file=sys.stderr) exit(1) diff --git a/darwinbuild/darwinbuild-recursive b/darwinbuild/darwinbuild-recursive index e9191b2..ebf17e6 100755 --- a/darwinbuild/darwinbuild-recursive +++ b/darwinbuild/darwinbuild-recursive @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 import sys, os import plistlib @@ -51,8 +51,8 @@ def recursive_build(project, is_header=False): else: build_deps_done[project] = True - build_deps = subprocess.check_output(['darwinxref', 'dependencies', '-build', project]).split('\n') - header_deps = subprocess.check_output(['darwinxref', 'dependencies', '-header', project]).split('\n') + build_deps = subprocess.check_output(['darwinxref', 'dependencies', '-build', project], universal_newlines=True).split('\n') + header_deps = subprocess.check_output(['darwinxref', 'dependencies', '-header', project], universal_newlines=True).split('\n') for dep in header_deps: recursive_build(dep, is_header=True) @@ -66,12 +66,12 @@ def recursive_build(project, is_header=False): try: subprocess.check_call(darwinbuild_argv, stdout=sys.stdout, stderr=sys.stderr) - except subprocess.CalledProcessError, e: + except subprocess.CalledProcessError as e: print(' '.join(darwinbuild_argv), 'failed with code', e.returncode, file=sys.stderr) exit(1) if group_mode: - group_output = subprocess.check_output(['darwinxref', 'group', input_name]) + group_output = subprocess.check_output(['darwinxref', 'group', input_name], universal_newlines=True) group_output = group_output.split('\n') for line in group_output: for project in line.split(' '): diff --git a/darwinbuild/fetch-from-github b/darwinbuild/fetch-from-github index 561fc87..67c31cf 100755 --- a/darwinbuild/fetch-from-github +++ b/darwinbuild/fetch-from-github @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 import sys, os import plistlib @@ -15,7 +15,10 @@ plist_filename = sys.argv[1] project_name = sys.argv[2] project_version = sys.argv[3] sources_dir = sys.argv[4] -darwinbuild_plist = plistlib.readPlist(plist_filename) +darwinbuild_plist = None + +with open(plist_filename, 'rb') as file: + darwinbuild_plist = plistlib.load(file) project_data = darwinbuild_plist['projects'][project_name] if 'github' in project_data: From e662bccbe9989eed87b20deacfb99edfcacd89d1 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 21 Jul 2019 13:38:22 -0400 Subject: [PATCH 241/382] Add in stub handling of the -chroot and -nochroot flags With this change, users passing either of these flags in the darwinbuild command line will no longer see an unrecognized-argument error. --- darwinbuild/darwinbuild.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index e47d8f2..d3842e0 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -291,6 +291,11 @@ for ARG in "$@"; do build="${ARG/*=/}" elif [ "${ARG/=*/}" == "-depsbuild" ]; then depsbuild="${depsbuild} ${ARG/*=/}" + elif [ "$ARG" == "-nochroot" ]; then + # Ignore this flag. + elif [ "$ARG" == "-chroot" ]; then + echo "WARNING: Building in the chroot is no longer supported." 1>&2 + echo "The -chroot flag will be ignored." 1>&2 elif [ "$ARG" == "-nopatch" ]; then nopatch="YES" elif [ "$ARG" == "-load" ]; then From 28440f40554b3b97431103463c41c72b37ab5836 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 21 Jul 2019 13:44:19 -0400 Subject: [PATCH 242/382] Add a colon (no-op command) to prevent a syntax error Apparently, an if-then block containing no commands results in a syntax error if immediately followed by an elif statement. --- darwinbuild/darwinbuild.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index d3842e0..029bc4e 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -291,7 +291,7 @@ for ARG in "$@"; do build="${ARG/*=/}" elif [ "${ARG/=*/}" == "-depsbuild" ]; then depsbuild="${depsbuild} ${ARG/*=/}" - elif [ "$ARG" == "-nochroot" ]; then + elif [ "$ARG" == "-nochroot" ]; then : # Ignore this flag. elif [ "$ARG" == "-chroot" ]; then echo "WARNING: Building in the chroot is no longer supported." 1>&2 From b4d4ccf5e72707b3c756d2f98bb5cd6810583cd5 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 21 Jul 2019 13:59:01 -0400 Subject: [PATCH 243/382] Remove use of deprecated redo_prebinding tool Prebinding became well and truly obsolete with the change to Intel processors during the tenure of Mac OS X Tiger. There is no reason why we should still have logic to support it. Also, redo_prebinding is not included in Xcode 11; it is only present in the command line tools download. This causes a dialog to appear if the command line tools are not installed. --- darwinxref/plugins/register.c | 62 +---------------------------------- 1 file changed, 1 insertion(+), 61 deletions(-) diff --git a/darwinxref/plugins/register.c b/darwinxref/plugins/register.c index 7c99758..d9c10d3 100644 --- a/darwinxref/plugins/register.c +++ b/darwinxref/plugins/register.c @@ -154,62 +154,6 @@ static char* calculate_digest(int fd) { return format_digest(md); } -static char* calculate_unprebound_digest(const char* filename); - -static int have_undo_prebinding() { - static int result = -2; - if (result == -2) { - struct stat sb; - result = stat("/usr/bin/redo_prebinding", &sb); - } - - // Not all versions of redo_prebinding support -u - if (result == 0) { - char* digest = calculate_unprebound_digest("/bin/sh"); - if (digest) { - if (strcmp(digest, "ERROR") == 0) { - result = -1; - } - free(digest); - } - } - return result; -} - -static char* calculate_unprebound_digest(const char* filename) { - pid_t pid; - int status; - int fds[2]; - - assert(pipe(fds) != -1); - - pid = fork(); - assert(pid != -1); - if (pid == 0) { - close(fds[0]); - assert(dup2(fds[1], STDOUT_FILENO) != -1); - const char* args[] = { - "/usr/bin/redo_prebinding", - "-z", "-u", "-i", "-s", - filename, - NULL - }; - assert(execve(args[0], (char**)args, environ) != -1); - // NOT REACHED - } - close(fds[1]); - - char* checksum = calculate_digest(fds[0]); - - close(fds[0]); - waitpid(pid, &status, 0); - if (status != 0) { - checksum = strdup("ERROR"); - } - - return checksum; -} - // If the path points to a Mach-O file, records all dylib // link commands as library dependencies in the database. // XXX @@ -649,11 +593,7 @@ int register_files(char* build, char* project, char* path) { int isMachO; res = register_libraries(fd, build, project, filename, &isMachO); lseek(fd, (off_t)0, SEEK_SET); - if (isMachO && have_undo_prebinding() == 0) { - checksum = calculate_unprebound_digest(ent->fts_accpath); - } else { - checksum = calculate_digest(fd); - } + checksum = calculate_digest(fd); close(fd); } From 32d775e5a08203ebbdad58ceeafc8857e6833e71 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 21 Jul 2019 18:30:41 -0400 Subject: [PATCH 244/382] Add comment to clarify syntax choice --- darwinbuild/darwinbuild.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 029bc4e..bbad88d 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -291,8 +291,9 @@ for ARG in "$@"; do build="${ARG/*=/}" elif [ "${ARG/=*/}" == "-depsbuild" ]; then depsbuild="${depsbuild} ${ARG/*=/}" - elif [ "$ARG" == "-nochroot" ]; then : + elif [ "$ARG" == "-nochroot" ]; then # Ignore this flag. + : # Don't remove this colon, or a syntax error will occur on the next line. elif [ "$ARG" == "-chroot" ]; then echo "WARNING: Building in the chroot is no longer supported." 1>&2 echo "The -chroot flag will be ignored." 1>&2 From 8ed6f378ea9e2036300931da52b9830addb4d00a Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 21 Jul 2019 19:32:32 -0400 Subject: [PATCH 245/382] Add darwinbuild-codesign Swift taarget --- darwinbuild.xcodeproj/project.pbxproj | 175 ++++++++++++++++++ .../xcschemes/darwinbuild-codesign.xcscheme | 78 ++++++++ swift/Utilities.swift | 16 ++ swift/darwinbuild-codesign/main.swift | 34 ++++ 4 files changed, 303 insertions(+) create mode 100644 darwinbuild.xcodeproj/xcshareddata/xcschemes/darwinbuild-codesign.xcscheme create mode 100644 swift/Utilities.swift create mode 100644 swift/darwinbuild-codesign/main.swift diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 771f4a3..8a088da 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -91,7 +91,9 @@ 1F12836121C89D2C00E3A732 /* darwinbuild-recursive in Copy Files */ = {isa = PBXBuildFile; fileRef = 1F12836021C89D2C00E3A732 /* darwinbuild-recursive */; }; 1F12836621C89FD000E3A732 /* darwinbuild-codesign in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1F12836521C89FC800E3A732 /* darwinbuild-codesign */; }; 1F514C441F4A5CDA008D9341 /* fetch-from-github in Copy Files */ = {isa = PBXBuildFile; fileRef = 1F514C431F4A5CC0008D9341 /* fetch-from-github */; }; + 1FB1351722E522B5005E9A88 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FB1351622E522B5005E9A88 /* main.swift */; }; 1FECB5DF1FBBBD41002EA059 /* setXcodePlatform in Copy Files */ = {isa = PBXBuildFile; fileRef = 1FECB5DE1FBBBC09002EA059 /* setXcodePlatform */; }; + 1FF4AFCC22E5237B002F09C6 /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FF4AFCB22E5237B002F09C6 /* Utilities.swift */; }; 3963011A1EAB4D60006081C7 /* source_sites.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86C0E10965EEA00C66E90 /* source_sites.c */; }; 396301211EAB4E01006081C7 /* patch_sites.c in Sources */ = {isa = PBXBuildFile; fileRef = 396301191EAB42B6006081C7 /* patch_sites.c */; }; 396301291EAB5DBC006081C7 /* patch_sites.tcl in CopyFiles */ = {isa = PBXBuildFile; fileRef = 396301281EAB5DB5006081C7 /* patch_sites.tcl */; }; @@ -622,10 +624,13 @@ 1F4A793921B9F123000FE4B5 /* welcome.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = welcome.html; path = installer/welcome.html; sourceTree = ""; }; 1F514C431F4A5CC0008D9341 /* fetch-from-github */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = "fetch-from-github"; path = "darwinbuild/fetch-from-github"; sourceTree = ""; }; 1F9D9647226516AA0024E830 /* darwinxref.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = darwinxref.entitlements; path = darwinxref/darwinxref.entitlements; sourceTree = ""; }; + 1FB1351422E522B5005E9A88 /* darwinbuild-codesign */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "darwinbuild-codesign"; sourceTree = BUILT_PRODUCTS_DIR; }; + 1FB1351622E522B5005E9A88 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; 1FD9F0CD21B9E90700FB866A /* build.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = build.sh; path = installer/build.sh; sourceTree = ""; }; 1FD9F0CF21B9EAA300FB866A /* distribution.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = distribution.xml; path = installer/distribution.xml; sourceTree = ""; }; 1FEA10392264FBCF008B675D /* notarize.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = notarize.sh; path = installer/notarize.sh; sourceTree = ""; }; 1FECB5DE1FBBBC09002EA059 /* setXcodePlatform */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = setXcodePlatform; path = darwinbuild/setXcodePlatform; sourceTree = ""; }; + 1FF4AFCB22E5237B002F09C6 /* Utilities.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utilities.swift; sourceTree = ""; }; 396301191EAB42B6006081C7 /* patch_sites.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = patch_sites.c; sourceTree = ""; }; 396301271EAB4E01006081C7 /* patch_sites.so */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.objfile"; includeInIndex = 0; path = patch_sites.so; sourceTree = BUILT_PRODUCTS_DIR; }; 396301281EAB5DB5006081C7 /* patch_sites.tcl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = patch_sites.tcl; sourceTree = ""; }; @@ -727,6 +732,13 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 1FB1351122E522B5005E9A88 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 396301221EAB4E01006081C7 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -936,6 +948,23 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 1FB1351522E522B5005E9A88 /* swift */ = { + isa = PBXGroup; + children = ( + 1FB1351C22E522EA005E9A88 /* darwinbuild-codesign */, + 1FF4AFCB22E5237B002F09C6 /* Utilities.swift */, + ); + path = swift; + sourceTree = ""; + }; + 1FB1351C22E522EA005E9A88 /* darwinbuild-codesign */ = { + isa = PBXGroup; + children = ( + 1FB1351622E522B5005E9A88 /* main.swift */, + ); + path = "darwinbuild-codesign"; + sourceTree = ""; + }; 1FD9F0CE21B9E90C00FB866A /* installer */ = { isa = PBXGroup; children = ( @@ -957,6 +986,7 @@ 72C86BD610965DD000C66E90 /* darwinxref */, 72C86BD510965DC900C66E90 /* darwinbuild */, 1FD9F0CE21B9E90C00FB866A /* installer */, + 1FB1351522E522B5005E9A88 /* swift */, 72C86C391096607900C66E90 /* Products */, 72C86CE310974CC800C66E90 /* libsqlite3.dylib */, 72574A0F10977F7A00B13BC3 /* CoreFoundation.framework */, @@ -1091,6 +1121,7 @@ 72D05CB711D267C400B33EDD /* query.so */, 720BE2F2120C90A700B3C4A5 /* digest */, 396301271EAB4E01006081C7 /* patch_sites.so */, + 1FB1351422E522B5005E9A88 /* darwinbuild-codesign */, ); name = Products; sourceTree = ""; @@ -1138,6 +1169,22 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ + 1FB1351322E522B5005E9A88 /* darwinbuild-codesign */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1FB1351B22E522B5005E9A88 /* Build configuration list for PBXNativeTarget "darwinbuild-codesign" */; + buildPhases = ( + 1FB1351022E522B5005E9A88 /* Sources */, + 1FB1351122E522B5005E9A88 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "darwinbuild-codesign"; + productName = "darwinbuild-codesign"; + productReference = 1FB1351422E522B5005E9A88 /* darwinbuild-codesign */; + productType = "com.apple.product-type.tool"; + }; 3963011C1EAB4E01006081C7 /* patch_sites */ = { isa = PBXNativeTarget; buildConfigurationList = 396301231EAB4E01006081C7 /* Build configuration list for PBXNativeTarget "patch_sites" */; @@ -1704,8 +1751,14 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; + LastSwiftUpdateCheck = 1100; LastUpgradeCheck = 1100; ORGANIZATIONNAME = "The DarwinBuild Project"; + TargetAttributes = { + 1FB1351322E522B5005E9A88 = { + CreatedOnToolsVersion = 11.0; + }; + }; }; buildConfigurationList = 726DD14C10965C5700D5AEAB /* Build configuration list for PBXProject "darwinbuild" */; compatibilityVersion = "Xcode 10.0"; @@ -1760,6 +1813,7 @@ 7227AC151098D8DB00BE33D7 /* thinPackages */, 720BE2EA120C90A700B3C4A5 /* digest */, 3963011C1EAB4E01006081C7 /* patch_sites */, + 1FB1351322E522B5005E9A88 /* darwinbuild-codesign */, ); }; /* End PBXProject section */ @@ -1954,6 +2008,15 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 1FB1351022E522B5005E9A88 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1FF4AFCC22E5237B002F09C6 /* Utilities.swift in Sources */, + 1FB1351722E522B5005E9A88 /* main.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 3963011F1EAB4E01006081C7 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -2496,6 +2559,108 @@ /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ + 1FB1351822E522B5005E9A88 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = 3P242C9ES5; + ENABLE_HARDENED_RUNTIME = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 1FB1351922E522B5005E9A88 /* Public */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 3P242C9ES5; + ENABLE_HARDENED_RUNTIME = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_VERSION = 5.0; + }; + name = Public; + }; + 1FB1351A22E522B5005E9A88 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 3P242C9ES5; + ENABLE_HARDENED_RUNTIME = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; 396301241EAB4E01006081C7 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; @@ -3713,6 +3878,16 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 1FB1351B22E522B5005E9A88 /* Build configuration list for PBXNativeTarget "darwinbuild-codesign" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1FB1351822E522B5005E9A88 /* Debug */, + 1FB1351922E522B5005E9A88 /* Public */, + 1FB1351A22E522B5005E9A88 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Public; + }; 396301231EAB4E01006081C7 /* Build configuration list for PBXNativeTarget "patch_sites" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/darwinbuild.xcodeproj/xcshareddata/xcschemes/darwinbuild-codesign.xcscheme b/darwinbuild.xcodeproj/xcshareddata/xcschemes/darwinbuild-codesign.xcscheme new file mode 100644 index 0000000..163d70c --- /dev/null +++ b/darwinbuild.xcodeproj/xcshareddata/xcschemes/darwinbuild-codesign.xcscheme @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/swift/Utilities.swift b/swift/Utilities.swift new file mode 100644 index 0000000..d545199 --- /dev/null +++ b/swift/Utilities.swift @@ -0,0 +1,16 @@ +// +// Utilities.swift +// darwinbuild-codesign +// +// Created by William Kent on 7/21/19. +// Copyright © 2019 The DarwinBuild Project. All rights reserved. +// + +import Foundation + +internal class StandardErrorWriter: TextOutputStream { + func write(_ string: String) { + fputs(string, stderr) + } +} +internal let standardError = StandardErrorWriter() diff --git a/swift/darwinbuild-codesign/main.swift b/swift/darwinbuild-codesign/main.swift new file mode 100644 index 0000000..332576c --- /dev/null +++ b/swift/darwinbuild-codesign/main.swift @@ -0,0 +1,34 @@ +// +// Copyright (c) 2019 William Kent. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of +// its contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY ITS CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +// IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +import Foundation + +func main() { +} + +main() From 0659382dfd7d084b7b5d3ae118c191796632126d Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 21 Jul 2019 19:33:32 -0400 Subject: [PATCH 246/382] Require Xcode 11 to load project This was done because I will be adding a Swift Package reference next commit, which is an Xcode 11-only feature. --- darwinbuild.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 8a088da..4a82a89 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 52; objects = { /* Begin PBXAggregateTarget section */ @@ -1761,7 +1761,7 @@ }; }; buildConfigurationList = 726DD14C10965C5700D5AEAB /* Build configuration list for PBXProject "darwinbuild" */; - compatibilityVersion = "Xcode 10.0"; + compatibilityVersion = "Xcode 11.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( From 679fe86425cd9acc99c0419c467811ebbd7316f6 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 21 Jul 2019 19:34:37 -0400 Subject: [PATCH 247/382] Add SwiftCLI package reference --- darwinbuild.xcodeproj/project.pbxproj | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 4a82a89..6daa177 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -91,6 +91,7 @@ 1F12836121C89D2C00E3A732 /* darwinbuild-recursive in Copy Files */ = {isa = PBXBuildFile; fileRef = 1F12836021C89D2C00E3A732 /* darwinbuild-recursive */; }; 1F12836621C89FD000E3A732 /* darwinbuild-codesign in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1F12836521C89FC800E3A732 /* darwinbuild-codesign */; }; 1F514C441F4A5CDA008D9341 /* fetch-from-github in Copy Files */ = {isa = PBXBuildFile; fileRef = 1F514C431F4A5CC0008D9341 /* fetch-from-github */; }; + 1F7D730D22E52DFD003F8A67 /* SwiftCLI in Frameworks */ = {isa = PBXBuildFile; productRef = 1F7D730C22E52DFD003F8A67 /* SwiftCLI */; }; 1FB1351722E522B5005E9A88 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FB1351622E522B5005E9A88 /* main.swift */; }; 1FECB5DF1FBBBD41002EA059 /* setXcodePlatform in Copy Files */ = {isa = PBXBuildFile; fileRef = 1FECB5DE1FBBBC09002EA059 /* setXcodePlatform */; }; 1FF4AFCC22E5237B002F09C6 /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FF4AFCB22E5237B002F09C6 /* Utilities.swift */; }; @@ -736,6 +737,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 1F7D730D22E52DFD003F8A67 /* SwiftCLI in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1181,6 +1183,9 @@ dependencies = ( ); name = "darwinbuild-codesign"; + packageProductDependencies = ( + 1F7D730C22E52DFD003F8A67 /* SwiftCLI */, + ); productName = "darwinbuild-codesign"; productReference = 1FB1351422E522B5005E9A88 /* darwinbuild-codesign */; productType = "com.apple.product-type.tool"; @@ -1772,6 +1777,9 @@ Base, ); mainGroup = 726DD14710965C5700D5AEAB; + packageReferences = ( + 1F7D730B22E52DFD003F8A67 /* XCRemoteSwiftPackageReference "SwiftCLI" */, + ); productRefGroup = 72C86C391096607900C66E90 /* Products */; projectDirPath = ""; projectRoot = ""; @@ -4269,6 +4277,25 @@ defaultConfigurationName = Public; }; /* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + 1F7D730B22E52DFD003F8A67 /* XCRemoteSwiftPackageReference "SwiftCLI" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/jakeheis/SwiftCLI"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 5.3.2; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 1F7D730C22E52DFD003F8A67 /* SwiftCLI */ = { + isa = XCSwiftPackageProductDependency; + package = 1F7D730B22E52DFD003F8A67 /* XCRemoteSwiftPackageReference "SwiftCLI" */; + productName = SwiftCLI; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 726DD14910965C5700D5AEAB /* Project object */; } From d3beb167350ecb4c3bd67a30d5c3a129857e0f69 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 21 Jul 2019 20:18:25 -0400 Subject: [PATCH 248/382] Make StandardErrorWriter a struct Having this as a class gives no advantages. --- swift/Utilities.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/swift/Utilities.swift b/swift/Utilities.swift index d545199..3e4f9e7 100644 --- a/swift/Utilities.swift +++ b/swift/Utilities.swift @@ -8,9 +8,9 @@ import Foundation -internal class StandardErrorWriter: TextOutputStream { - func write(_ string: String) { +internal struct StandardErrorWriter: TextOutputStream { + mutating func write(_ string: String) { fputs(string, stderr) } } -internal let standardError = StandardErrorWriter() +internal var standardError = StandardErrorWriter() From 050a0f38d7cab8734b430243c6fdf9fef83b2163 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 21 Jul 2019 20:33:43 -0400 Subject: [PATCH 249/382] Add Swift code to get and set the working directory --- swift/Utilities.swift | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/swift/Utilities.swift b/swift/Utilities.swift index 3e4f9e7..4881a55 100644 --- a/swift/Utilities.swift +++ b/swift/Utilities.swift @@ -14,3 +14,24 @@ internal struct StandardErrorWriter: TextOutputStream { } } internal var standardError = StandardErrorWriter() + +internal extension CommandLine { + static var workingDirectory: String { + get { + let buffer = UnsafeMutablePointer.allocate(capacity: Int(MAXPATHLEN) * MemoryLayout.stride) + defer { + buffer.deallocate() + } + + getcwd(buffer, Int(MAXPATHLEN)) + return String(cString: UnsafePointer(OpaquePointer(buffer))) + } + + set { + _ = newValue.withCString { + buffer in + chdir(buffer) + } + } + } +} From e235c39da52d1e93d25b3cf1aa634197b358de33 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 21 Jul 2019 20:37:50 -0400 Subject: [PATCH 250/382] Add EnvironmentAccessor to Utilities.swift --- swift/Utilities.swift | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/swift/Utilities.swift b/swift/Utilities.swift index 4881a55..c5fad52 100644 --- a/swift/Utilities.swift +++ b/swift/Utilities.swift @@ -34,4 +34,38 @@ internal extension CommandLine { } } } + + enum Environment { + internal static subscript(name: String) -> String? { + get { + let buffer = name.withCString { + nameBuffer in + getenv(nameBuffer) + } + + if let buffer = buffer { + return String(cString: buffer) + } else { + return nil + } + } + + set { + if let newValue = newValue { + _ = name.withCString { + nameBuffer in + newValue.withCString { + valueBuffer in + setenv(nameBuffer, valueBuffer, 1) + } + } + } else { + _ = name.withCString { + nameBuffer in + unsetenv(nameBuffer) + } + } + } + } + } } From 24cb8f4bd3bcff3f687bc12bd44b1287dfa80665 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 21 Jul 2019 20:41:33 -0400 Subject: [PATCH 251/382] Add isdir/isfile methods to Utility.swift --- swift/Utilities.swift | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/swift/Utilities.swift b/swift/Utilities.swift index c5fad52..7c57eaf 100644 --- a/swift/Utilities.swift +++ b/swift/Utilities.swift @@ -69,3 +69,17 @@ internal extension CommandLine { } } } + +internal extension FileManager { + func directoryExists(atPath path: String) -> Bool { + var isDir = ObjCBool(false) + let exists = self.fileExists(atPath: path, isDirectory: &isDir) + return exists && isDir.boolValue + } + + func fileExists(atPath path: String) -> Bool { + var isDir = ObjCBool(false) + let exists = self.fileExists(atPath: path, isDirectory: &isDir) + return exists && !isDir.boolValue + } +} From eeed58b162145e5b3289b7f13c5b224b51134f97 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 21 Jul 2019 20:43:22 -0400 Subject: [PATCH 252/382] Add joinPath function to Utilities.swift --- swift/Utilities.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/swift/Utilities.swift b/swift/Utilities.swift index 7c57eaf..2cf37b1 100644 --- a/swift/Utilities.swift +++ b/swift/Utilities.swift @@ -83,3 +83,11 @@ internal extension FileManager { return exists && !isDir.boolValue } } + +internal func joinPath(_ paths: String...) -> String { + var accumulator = URL(fileURLWithPath: paths[0]) + for element in paths[1...] { + accumulator = accumulator.appendingPathComponent(element) + } + return accumulator.path +} From 4081512609df91c8657c36af75cfaddfe94b7f6e Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 21 Jul 2019 20:49:08 -0400 Subject: [PATCH 253/382] Start reimplementing darwinbuild-codesign in Swift --- swift/darwinbuild-codesign/main.swift | 38 +++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/swift/darwinbuild-codesign/main.swift b/swift/darwinbuild-codesign/main.swift index 332576c..2b7ff29 100644 --- a/swift/darwinbuild-codesign/main.swift +++ b/swift/darwinbuild-codesign/main.swift @@ -27,8 +27,46 @@ // import Foundation +import SwiftCLI + +class CodesignCommand: Command { + let name = "darwinbuild-codesign" + + private let dstroot = Key("--dstroot", "-d", description: "Code-sign the files in this directory") + private let srcroot = Key("--srcroot", "-s", description: "Path to the sources corresponding to the dstroot") + private let projectName = Key("--project", "-p", description: "Code-sign this darwinbuild output root") + + public func execute() throws { + var dstroot = self.dstroot.value + var srcroot = self.srcroot.value + + if let projectName = projectName.value { + let buildroot = CommandLine.Environment["DARWIN_BUILDROOT"] ?? CommandLine.workingDirectory + + let fm = FileManager() + if !(fm.directoryExists(atPath: joinPath(buildroot, "Roots")) && + fm.directoryExists(atPath: joinPath(buildroot, "Sources")) && + fm.directoryExists(atPath: joinPath(buildroot, "Symbols")) && + fm.directoryExists(atPath: joinPath(buildroot, "Headers")) && + fm.directoryExists(atPath: joinPath(buildroot, "Logs"))) { + print("ERROR: Could not find darwinbuild root, this is required when using --project", to: &standardError) + print("Please change your working directory to one initialized by:", to: &standardError) + print("darwinbuild -init ", to: &standardError) + print("Alternatively, you may set the DARWIN_BUILDROOT environment variable to the", to: &standardError) + print("absolute path of that directory.", to: &standardError) + + exit(1) + } + + print("Not implemented...", to: &standardError) + exit(-1) + } + } +} func main() { + let parser = CLI(singleCommand: CodesignCommand()) + parser.goAndExit() } main() From 7208c55f3eeea8f1ff0cad73a225ab8120fd1290 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 21 Jul 2019 21:16:54 -0400 Subject: [PATCH 254/382] Continue reimplementing darwinbuild-codesign --- swift/darwinbuild-codesign/main.swift | 88 ++++++++++++++++++++++++++- 1 file changed, 85 insertions(+), 3 deletions(-) diff --git a/swift/darwinbuild-codesign/main.swift b/swift/darwinbuild-codesign/main.swift index 2b7ff29..34de631 100644 --- a/swift/darwinbuild-codesign/main.swift +++ b/swift/darwinbuild-codesign/main.swift @@ -29,6 +29,16 @@ import Foundation import SwiftCLI +internal extension Dictionary { + func get(_ key: Key) -> Type? { + if let value = self[key] { + return value as? Type + } else { + return nil + } + } +} + class CodesignCommand: Command { let name = "darwinbuild-codesign" @@ -39,11 +49,11 @@ class CodesignCommand: Command { public func execute() throws { var dstroot = self.dstroot.value var srcroot = self.srcroot.value + let fm = FileManager() - if let projectName = projectName.value { + if let projectNameArgument = projectName.value { let buildroot = CommandLine.Environment["DARWIN_BUILDROOT"] ?? CommandLine.workingDirectory - let fm = FileManager() if !(fm.directoryExists(atPath: joinPath(buildroot, "Roots")) && fm.directoryExists(atPath: joinPath(buildroot, "Sources")) && fm.directoryExists(atPath: joinPath(buildroot, "Symbols")) && @@ -58,8 +68,80 @@ class CodesignCommand: Command { exit(1) } - print("Not implemented...", to: &standardError) + if let buildrootType = (try fm.attributesOfItem(atPath: joinPath(buildroot, "BuildRoot")))[.type] as? FileAttributeType?, buildrootType == FileAttributeType.typeSymbolicLink { + if !fm.directoryExists(atPath: try fm.destinationOfSymbolicLink(atPath: joinPath(buildroot, "BuildRoot"))) { + print("Attaching build root disk image...") + + let task = Task(executable: "/usr/bin/hdiutil", arguments: [ + "attach", ".build/buildroot.sparsebundle", + "-readwrite", "-owners", "on" + ], directory: buildroot) + if task.runSync() != 0 { + print("Could not attach buildroot.sparsebundle", to: &standardError) + exit(1) + } + } + } + + let projectNameAndVersion: String + let projectBuild: String + if projectNameArgument.range(of: "~") != nil { + let parts = projectNameArgument.components(separatedBy: "~") + projectNameAndVersion = parts[0] + projectBuild = parts[1] + } else { + projectNameAndVersion = projectNameArgument + var largestBuildNumber = -1 + for subdir in try fm.contentsOfDirectory(atPath: joinPath(buildroot, "Roots", projectNameAndVersion)) { + if subdir.hasPrefix(projectNameAndVersion + ".root") { + let parts = subdir.components(separatedBy: "~") + if let buildNumber = Int(parts[1], radix: 10) { + if buildNumber > largestBuildNumber { + largestBuildNumber = buildNumber + } + } + } + } + + if largestBuildNumber == -1 { + print("Could not determine latest build for \(projectNameAndVersion)", to: &standardError) + if projectNameAndVersion.range(of: "-") == nil { + print("(Did you forget the version in the project name?)", to: &standardError) + } + exit(1) + } + + projectBuild = String(largestBuildNumber, radix: 10) + } + + dstroot = joinPath(buildroot, "Roots", projectNameAndVersion + ".root~" + projectBuild) + srcroot = joinPath(buildroot, "BuildRoot", "SourceCache", projectNameAndVersion.components(separatedBy: "-")[0], projectNameAndVersion) + } + + if let dstroot = dstroot, let srcroot = srcroot { + let data = try Data(contentsOf: URL(fileURLWithPath: joinPath(srcroot, "darwinbuild-codesign.plist"))) + let codesignPlist = try PropertyListSerialization.propertyList(from: data, options: [], format: nil) as! [String: Any] + + guard let certificate: String = codesignPlist.get("certificate") else { + print("ERROR: Default certificate must be provided (use \"certificate\" key in top-level of plist", to: &standardError) + exit(1) + } + + let defaultHardenedRuntime = codesignPlist.get("hardened_runtime") ?? false + let defaultPrefix: String? = codesignPlist.get("prefix") + let defaultTimestampURL = codesignPlist.get("timestamp") ?? "" + + let signingMap: [Int: [Task]] + guard let fileMap: [String: [String: Any]] = codesignPlist.get("files") else { + print("Warning: Nothing to sign") + return + } + + print("ERROR: Not further implemented...", to: &standardError) exit(-1) + } else { + print("ERROR: Either -p, or both -d and -s must be specified", to: &standardError) + exit(1) } } } From be94dbaeccd2104de6649cfa3019984eeff0e5ee Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 22 Jul 2019 12:30:14 -0400 Subject: [PATCH 255/382] Finish reimplmenting darinwbuild-codesign in Swift Next comes debugging it. --- swift/darwinbuild-codesign/main.swift | 132 ++++++++++++++++++++++++-- 1 file changed, 126 insertions(+), 6 deletions(-) diff --git a/swift/darwinbuild-codesign/main.swift b/swift/darwinbuild-codesign/main.swift index 34de631..3448398 100644 --- a/swift/darwinbuild-codesign/main.swift +++ b/swift/darwinbuild-codesign/main.swift @@ -29,6 +29,10 @@ import Foundation import SwiftCLI +fileprivate enum Exception: Error { + case message(_ text: String) +} + internal extension Dictionary { func get(_ key: Key) -> Type? { if let value = self[key] { @@ -46,6 +50,27 @@ class CodesignCommand: Command { private let srcroot = Key("--srcroot", "-s", description: "Path to the sources corresponding to the dstroot") private let projectName = Key("--project", "-p", description: "Code-sign this darwinbuild output root") + private enum TimestampType + { + case apple + case custom(arg: String) + case disabled + } + + private func parseTimestampType(_ plistValue: Any) throws -> TimestampType { + if let arg = plistValue as? String { + return .custom(arg: arg) + } else if let arg = plistValue as? Bool { + if arg { + return .apple + } else { + return .disabled + } + } else { + throw Exception.message("Unrecognized timestamp value: must be either string or boolean") + } + } + public func execute() throws { var dstroot = self.dstroot.value var srcroot = self.srcroot.value @@ -122,23 +147,118 @@ class CodesignCommand: Command { let data = try Data(contentsOf: URL(fileURLWithPath: joinPath(srcroot, "darwinbuild-codesign.plist"))) let codesignPlist = try PropertyListSerialization.propertyList(from: data, options: [], format: nil) as! [String: Any] - guard let certificate: String = codesignPlist.get("certificate") else { + guard let defaultCertificate: String = codesignPlist.get("certificate") else { print("ERROR: Default certificate must be provided (use \"certificate\" key in top-level of plist", to: &standardError) exit(1) } let defaultHardenedRuntime = codesignPlist.get("hardened_runtime") ?? false let defaultPrefix: String? = codesignPlist.get("prefix") - let defaultTimestampURL = codesignPlist.get("timestamp") ?? "" + let defaultTimestamp: TimestampType + if let timestampValue: Any = codesignPlist.get("timestamp") { + defaultTimestamp = try parseTimestampType(timestampValue) + } else { + defaultTimestamp = .apple + } - let signingMap: [Int: [Task]] - guard let fileMap: [String: [String: Any]] = codesignPlist.get("files") else { + var signingMap: [Int: [Task]] = [:] + guard let fileMap: [String: Any] = codesignPlist.get("files") else { print("Warning: Nothing to sign") return } - print("ERROR: Not further implemented...", to: &standardError) - exit(-1) + for (key, data) in fileMap { + let certificate: String + let identifier: String? + let prefix: String? + let entitlements: String? + let hardenedRuntime: Bool + let dr: String? + let order: Int + let timestamp: TimestampType + + if let flag = data as? Bool { + if !flag { + print("Warning: false value interpreted as \"use all default values\"", to: &standardError) + } + + certificate = defaultCertificate + identifier = nil + prefix = defaultPrefix + entitlements = nil + hardenedRuntime = defaultHardenedRuntime + dr = nil + order = 0xFFFF + timestamp = defaultTimestamp + } else if let data = data as? [String: Any] { + certificate = data.get("certificate") ?? defaultCertificate + identifier = data.get("identifier") + prefix = data.get("prefix") ?? defaultPrefix + entitlements = data.get("entitlements") + hardenedRuntime = defaultHardenedRuntime + dr = data.get("dr") + order = data.get("order") ?? 0xFFFF + if let timestampValue: Any = data.get("timestamp") { + timestamp = try parseTimestampType(timestampValue) + } else { + timestamp = defaultTimestamp + } + } else { + throw Exception.message("Values in \"files\" dictionary must be booleans or dictionaries only") + } + + var codesignArgv = ["-s", certificate, "-f"] + if let identifier = identifier { + codesignArgv.append("-i") + codesignArgv.append(identifier) + } + if let prefix = prefix { + codesignArgv.append("--prefix") + codesignArgv.append(prefix) + } + if let dr = dr { + codesignArgv.append("-r") + codesignArgv.append(dr) + } + if let entitlements = entitlements { + codesignArgv.append("--entitlements") + codesignArgv.append(joinPath(srcroot, entitlements)) + } + if hardenedRuntime { + codesignArgv.append("-o") + codesignArgv.append("runtime") + } + switch timestamp { + case .apple: + codesignArgv.append("--timestamp") + case .disabled: + codesignArgv.append("--timestamp=none") + case .custom(let arg): + codesignArgv.append("--timestamp=\(arg)") + } + codesignArgv.append(joinPath(dstroot, key)) + + let task = Task(executable: "/usr/bin/codesign", arguments: codesignArgv, stdout: WriteStream.stdout, stderr: WriteStream.stderr) + if var orderDict = signingMap[order] { + orderDict.append(task) + signingMap[order] = orderDict + } else { + signingMap[order] = [task] + } + } + + let keyVector = signingMap.keys.sorted() + for index in keyVector { + if let tasks = signingMap[index] { + for task in tasks { + let exitCode = task.runSync() + if exitCode != 0 { + print("Signing command failed with code \(exitCode)", to: &standardError) + exit(1) + } + } + } + } } else { print("ERROR: Either -p, or both -d and -s must be specified", to: &standardError) exit(1) From e4769b5b129a305eea5b6691b9f90be8dbfd42f7 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 22 Jul 2019 12:34:34 -0400 Subject: [PATCH 256/382] Fix darwinbuild-codesign bugs --- swift/darwinbuild-codesign/main.swift | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/swift/darwinbuild-codesign/main.swift b/swift/darwinbuild-codesign/main.swift index 3448398..c7b58d4 100644 --- a/swift/darwinbuild-codesign/main.swift +++ b/swift/darwinbuild-codesign/main.swift @@ -108,16 +108,19 @@ class CodesignCommand: Command { } } + let projectName: String let projectNameAndVersion: String let projectBuild: String if projectNameArgument.range(of: "~") != nil { let parts = projectNameArgument.components(separatedBy: "~") projectNameAndVersion = parts[0] projectBuild = parts[1] + projectName = projectNameAndVersion.components(separatedBy: "-")[0] } else { projectNameAndVersion = projectNameArgument + projectName = projectNameAndVersion.components(separatedBy: "-")[0] var largestBuildNumber = -1 - for subdir in try fm.contentsOfDirectory(atPath: joinPath(buildroot, "Roots", projectNameAndVersion)) { + for subdir in try fm.contentsOfDirectory(atPath: joinPath(buildroot, "Roots", projectName)) { if subdir.hasPrefix(projectNameAndVersion + ".root") { let parts = subdir.components(separatedBy: "~") if let buildNumber = Int(parts[1], radix: 10) { @@ -139,8 +142,8 @@ class CodesignCommand: Command { projectBuild = String(largestBuildNumber, radix: 10) } - dstroot = joinPath(buildroot, "Roots", projectNameAndVersion + ".root~" + projectBuild) - srcroot = joinPath(buildroot, "BuildRoot", "SourceCache", projectNameAndVersion.components(separatedBy: "-")[0], projectNameAndVersion) + dstroot = joinPath(buildroot, "Roots", projectName, projectNameAndVersion + ".root~" + projectBuild) + srcroot = joinPath(buildroot, "BuildRoot", "SourceCache", projectName, projectNameAndVersion) } if let dstroot = dstroot, let srcroot = srcroot { From f7c991c928627ee6ce3064621ee441259d8617d9 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 22 Jul 2019 12:37:36 -0400 Subject: [PATCH 257/382] Remove Python darwinbuild-codesign The Swift version is now installed instead. --- darwinbuild.xcodeproj/project.pbxproj | 17 ++- darwinbuild/darwinbuild-codesign | 211 -------------------------- 2 files changed, 13 insertions(+), 215 deletions(-) delete mode 100755 darwinbuild/darwinbuild-codesign diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 6daa177..c590bea 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -77,6 +77,7 @@ buildPhases = ( ); dependencies = ( + 1FA9FAFD22E61D9D0096A78D /* PBXTargetDependency */, 72C86C611096617500C66E90 /* PBXTargetDependency */, 725740971097B03D008AD4D7 /* PBXTargetDependency */, 7227AB101097BBA900BE33D7 /* PBXTargetDependency */, @@ -89,7 +90,6 @@ /* Begin PBXBuildFile section */ 1F12836121C89D2C00E3A732 /* darwinbuild-recursive in Copy Files */ = {isa = PBXBuildFile; fileRef = 1F12836021C89D2C00E3A732 /* darwinbuild-recursive */; }; - 1F12836621C89FD000E3A732 /* darwinbuild-codesign in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1F12836521C89FC800E3A732 /* darwinbuild-codesign */; }; 1F514C441F4A5CDA008D9341 /* fetch-from-github in Copy Files */ = {isa = PBXBuildFile; fileRef = 1F514C431F4A5CC0008D9341 /* fetch-from-github */; }; 1F7D730D22E52DFD003F8A67 /* SwiftCLI in Frameworks */ = {isa = PBXBuildFile; productRef = 1F7D730C22E52DFD003F8A67 /* SwiftCLI */; }; 1FB1351722E522B5005E9A88 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FB1351622E522B5005E9A88 /* main.swift */; }; @@ -148,6 +148,13 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 1FA9FAFC22E61D9D0096A78D /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 726DD14910965C5700D5AEAB /* Project object */; + proxyType = 1; + remoteGlobalIDString = 1FB1351322E522B5005E9A88; + remoteInfo = "darwinbuild-codesign"; + }; 3963011E1EAB4E01006081C7 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 726DD14910965C5700D5AEAB /* Project object */; @@ -577,7 +584,6 @@ dstPath = "$(BINDIR)"; dstSubfolderSpec = 0; files = ( - 1F12836621C89FD000E3A732 /* darwinbuild-codesign in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 1; }; @@ -619,7 +625,6 @@ /* Begin PBXFileReference section */ 1F12836021C89D2C00E3A732 /* darwinbuild-recursive */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; name = "darwinbuild-recursive"; path = "darwinbuild/darwinbuild-recursive"; sourceTree = ""; }; - 1F12836521C89FC800E3A732 /* darwinbuild-codesign */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "darwinbuild-codesign"; path = "darwinbuild/darwinbuild-codesign"; sourceTree = ""; }; 1F4A793721B9F123000FE4B5 /* conclusion.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = conclusion.html; path = installer/conclusion.html; sourceTree = ""; }; 1F4A793821B9F123000FE4B5 /* license.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = license.html; path = installer/license.html; sourceTree = ""; }; 1F4A793921B9F123000FE4B5 /* welcome.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = welcome.html; path = installer/welcome.html; sourceTree = ""; }; @@ -1000,7 +1005,6 @@ 72C86BD510965DC900C66E90 /* darwinbuild */ = { isa = PBXGroup; children = ( - 1F12836521C89FC800E3A732 /* darwinbuild-codesign */, 1F12836021C89D2C00E3A732 /* darwinbuild-recursive */, 1F514C431F4A5CC0008D9341 /* fetch-from-github */, 720BE2E9120C909E00B3C4A5 /* digest.c */, @@ -2264,6 +2268,11 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 1FA9FAFD22E61D9D0096A78D /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 1FB1351322E522B5005E9A88 /* darwinbuild-codesign */; + targetProxy = 1FA9FAFC22E61D9D0096A78D /* PBXContainerItemProxy */; + }; 3963011D1EAB4E01006081C7 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 7257499F1097697300B13BC3 /* darwinxref */; diff --git a/darwinbuild/darwinbuild-codesign b/darwinbuild/darwinbuild-codesign deleted file mode 100755 index 0df5a36..0000000 --- a/darwinbuild/darwinbuild-codesign +++ /dev/null @@ -1,211 +0,0 @@ -#!/usr/bin/env python3 -# -# Copyright (c) 2017 William Kent. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of -# its contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY ITS CONTRIBUTORS "AS IS" AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR -# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - -import sys, os, re -import subprocess -import plistlib -import argparse - -parser = argparse.ArgumentParser(description='Code-signs a darwinbuild root or Xcode DSTROOT') -parser.add_argument('-d', '--dstroot', metavar='', help='Code-sign the files in this directory') -parser.add_argument('-s', '--srcroot', metavar='', help='Path to the sources corresponding to the dstroot') -parser.add_argument('-p', '--project', metavar='-', help='Code-sign this darwinbuild output root') - -args = parser.parse_args() -project_root = args.dstroot -srcroot = args.srcroot - -if args.project is not None: - darwin_buildroot = os.getcwd() - if os.getenv('DARWIN_BUILDROOT') is not None: - darwin_buildroot = os.getenv('DARWIN_BUILDROOT') - - if not (os.path.isdir(os.path.join(darwin_buildroot, 'Roots')) and \ - os.path.isdir(os.path.join(darwin_buildroot, 'Sources')) and \ - os.path.isdir(os.path.join(darwin_buildroot, 'Symbols')) and \ - os.path.isdir(os.path.join(darwin_buildroot, 'Headers')) and \ - os.path.isdir(os.path.join(darwin_buildroot, 'Logs'))): - print('ERROR: Could not find darwinbuild root, this is required when using --project', file=sys.stderr) - print('Please change your working directory to one initialized by:', file=sys.stderr) - print('darwinbuild -init ', file=sys.stderr) - print('Alternatively, you may set the DARWIN_BUILDROOT environment variable to the', file=sys.stderr) - print('absolute path of that directory.', file=sys.stderr) - exit(1) - - if not os.path.isdir(os.readlink(os.path.join(darwin_buildroot, 'BuildRoot'))): - try: - print('Attaching build root disk image...') - subprocess.check_call(['hdiutil', 'attach', '.build/buildroot.sparsebundle', '-readwrite', '-owners', 'on'], cwd=darwin_buildroot, stdout=None) - except Exception as e: - print('Could not attach buildroot.sparsebundle:', e, file=sys.stderr) - exit(1) - - project_name_and_version = args.project - project_build = None - if len(project_name_and_version.split('~')) == 2: - parts = project_name_and_version.split('~') - project_name_and_version = parts[0] - project_build = parts[1] - - project_name = project_name_and_version.split('-')[0] - roots_dir = os.path.join(darwin_buildroot, 'Roots', project_name) - - if project_build is None: - possible_builds = None - try: - possible_builds = next(os.walk(roots_dir))[1] - except StopIteration: - # This is raised if the project name given doesn't exist. - print('Project', project_name_and_version, 'not found in Roots directory', file=sys.stderr) - exit(1) - - largest_build_num = 0 - for dirname in possible_builds: - if dirname.startswith(project_name_and_version + '.root'): - this_build_num = int(dirname.split('~')[1]) - if this_build_num > largest_build_num: - largest_build_num = this_build_num - project_build = str(this_build_num) - - if project_build is None: - print('Could not determine latest build for', project_name_and_version, file=sys.stderr) - if len(project_name_and_version.split('-')) != 2: - print('(Did you forget the version in the project name', project_name_and_version + '?)', file=sys.stderr) - exit(1) - - project_root = os.path.join(roots_dir, project_name_and_version + '.root~' + project_build) - srcroot = os.path.join(darwin_buildroot, 'BuildRoot', 'SourceCache', project_name, project_name_and_version) - -if project_root is None or srcroot is None: - print('ERROR: Either -p, or both -d and -s must be specified', file=sys.stderr) - exit(1) - -codesign_plist = None -try: - filename = os.path.join(srcroot, 'darwinbuild-codesign.plist') - with open(filename, 'rb') as file: - codesign_plist = plistlib.load(file) -except Exception as e: - print('Could not read darwinbuild-codesign.plist:', e, file=sys.stderr) - exit(1) - -################################################################################ - -def safe_get(dict, key, default=None): - if key in dict: - return dict[key] - else: - return default - -default_certificate = safe_get(codesign_plist, 'certificate') -if default_certificate is None: - print('Default certificate must be provided (use "certificate" key in top-level of plist)', file=sys.stderr) - exit(1) - -default_hardened_runtime = safe_get(codesign_plist, 'hardened_runtime', default=False) -default_prefix = safe_get(codesign_plist, 'prefix') -default_timestamp = safe_get(codesign_plist, 'timestamp', default=True) - -signing_map = {} -for (filename, value) in codesign_plist['files'].items(): - if filename[0] == '/': - filename = filename[1:] - filename = os.path.join(project_root, filename) - - certificate = default_certificate - identifier = None - prefix = default_prefix - entitlements = None - hardened_runtime = default_hardened_runtime - dr = None - order = 0xFFFF - timestamp = True - - if isinstance(value, bool): - pass # all default values - elif isinstance(value, dict): - certificate = safe_get(value, 'certificate', default=default_certificate) - identifier = safe_get(value, 'identifier') - prefix = safe_get(value, 'prefix', default=default_prefix) - entitlements = safe_get(value, 'entitlements') - if entitlements is not None: - entitlements = os.path.join(srcroot, entitlements) - hardened_runtime = bool(safe_get(value, 'hardened_runtime', default=default_hardened_runtime)) - dr = safe_get(value, 'dr') - order = safe_get(value, 'order', default=order) - timestamp = safe_get(value, 'timestamp', default=default_timestamp) - - if isinstance(order, str): - order = int(order) - elif not isinstance(order, int): - print('Error in darwinbuild-codesign.plist: "order" key must have integer value (or string convertible to integer)', file=sys.stderr) - exit(1) - else: - print('Error in darwinbuild-codesign.plist: Values in "files" dictionary must be booleans or dictionaries only', file=sys.stderr) - exit(1) - - codesign_argv = ['/usr/bin/codesign', '-s', certificate, '-f'] - if prefix is not None: - codesign_argv.append('--prefix') - codesign_argv.append(prefix) - elif identifier is not None: - codesign_argv.append('-i') - codesign_argv.append(identifier) - if dr is not None: - codesign_argv.append('-r') - codesign_argv.append(dr) - if entitlements is not None: - codesign_argv.append('--entitlements') - codesign_argv.append(entitlements) - if hardened_runtime: - codesign_argv.append('-o') - codesign_argv.append('runtime') - if isinstance(timestamp, str): - codesign_argv.append('--timestamp=' + timestamp) - elif isinstance(timestamp, bool): - if timestamp: - codesign_argv.append('--timestamp') - else: - codesign_argv.append('--timestamp=none') - else: - print('Error in darwinbuild-codesign.plist: "timestamp" key must be either boolean or string', file=sys.stderr) - exit(1) - codesign_argv.append(filename) - - if order not in signing_map: - signing_map[order] = [] - signing_map[order].append(codesign_argv) - -key_vector = list(signing_map.keys()) -key_vector.sort() - -for order_index in key_vector: - for argv in signing_map[order_index]: - print(' '.join(argv)) - subprocess.check_call(argv) From 18cd89a51014d85735bfc4f03c0d42cd25ecffc5 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 22 Jul 2019 13:28:56 -0400 Subject: [PATCH 258/382] Fix signing error --- darwinbuild.xcodeproj/project.pbxproj | 6 ------ 1 file changed, 6 deletions(-) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index c590bea..4230995 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -2590,9 +2590,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_STYLE = Automatic; DEBUG_INFORMATION_FORMAT = dwarf; - DEVELOPMENT_TEAM = 3P242C9ES5; ENABLE_HARDENED_RUNTIME = YES; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_DYNAMIC_NO_PIC = NO; @@ -2628,8 +2626,6 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 3P242C9ES5; ENABLE_HARDENED_RUNTIME = YES; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -2660,8 +2656,6 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 3P242C9ES5; ENABLE_HARDENED_RUNTIME = YES; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu11; From 3eb1362f839edacb835c8c8948db3c709c33236c Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 22 Jul 2019 13:31:04 -0400 Subject: [PATCH 259/382] Update xcodebuild arguments in installer/build.sh --- installer/build.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/installer/build.sh b/installer/build.sh index e9e3abd..88f1bc4 100755 --- a/installer/build.sh +++ b/installer/build.sh @@ -5,9 +5,15 @@ set -e MY_DIR=$(cd `dirname $0` && pwd) cd $MY_DIR +mkdir -p $MY_DIR/../build/DependencyPackages +xcodebuild -resolvePackageDependencies \ + -project $MY_DIR/../darwinbuild.xcodeproj \ + -clonedSourcePackagesDirPath $MY_DIR/../build/DependencyPackages + xcodebuild install \ -project $MY_DIR/../darwinbuild.xcodeproj \ - -target world -configuration Release \ + -scheme world -configuration Release \ + -clonedSourcePackagesDirPath $MY_DIR/../build/DependencyPackages \ DSTROOT=$MY_DIR/payload pkgbuild \ From 31e31711617581bb2b5a7be939c316ea633cc565 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 22 Jul 2019 13:31:34 -0400 Subject: [PATCH 260/382] Fix path name in status message --- installer/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer/build.sh b/installer/build.sh index 88f1bc4..8f1dc2b 100755 --- a/installer/build.sh +++ b/installer/build.sh @@ -33,4 +33,4 @@ productbuild \ --resources $MY_DIR \ $MY_DIR/darwinbuild-installer.pkg -echo "Complete! Your installer is located at: $MY_DIR/build/darwinbuild-installer.pkg" +echo "Complete! Your installer is located at: $MY_DIR/darwinbuild-installer.pkg" From 718be775ed0b1c99300723c823fd6ab86a89562d Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 22 Jul 2019 13:34:03 -0400 Subject: [PATCH 261/382] Move scheme file into shared directory --- .../xcshareddata/xcschemes/world.xcscheme | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 darwinbuild.xcodeproj/xcshareddata/xcschemes/world.xcscheme diff --git a/darwinbuild.xcodeproj/xcshareddata/xcschemes/world.xcscheme b/darwinbuild.xcodeproj/xcshareddata/xcschemes/world.xcscheme new file mode 100644 index 0000000..09a6d41 --- /dev/null +++ b/darwinbuild.xcodeproj/xcshareddata/xcschemes/world.xcscheme @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + From 81f85277389c89eca17bfaa0647e33bc86b4f561 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 22 Jul 2019 13:54:33 -0400 Subject: [PATCH 262/382] Add darwinbuild-recursive Swift implementation --- darwinbuild.xcodeproj/project.pbxproj | 182 +++++++++++++++++++++++++ swift/darwinbuild-recursive/main.swift | 137 +++++++++++++++++++ 2 files changed, 319 insertions(+) create mode 100644 swift/darwinbuild-recursive/main.swift diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 4230995..1c15e6e 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -92,6 +92,9 @@ 1F12836121C89D2C00E3A732 /* darwinbuild-recursive in Copy Files */ = {isa = PBXBuildFile; fileRef = 1F12836021C89D2C00E3A732 /* darwinbuild-recursive */; }; 1F514C441F4A5CDA008D9341 /* fetch-from-github in Copy Files */ = {isa = PBXBuildFile; fileRef = 1F514C431F4A5CC0008D9341 /* fetch-from-github */; }; 1F7D730D22E52DFD003F8A67 /* SwiftCLI in Frameworks */ = {isa = PBXBuildFile; productRef = 1F7D730C22E52DFD003F8A67 /* SwiftCLI */; }; + 1FA2A9EA22E62BF600F53888 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FA2A9E922E62BF600F53888 /* main.swift */; }; + 1FA2A9EF22E62BFE00F53888 /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FF4AFCB22E5237B002F09C6 /* Utilities.swift */; }; + 1FA2A9F222E62C1900F53888 /* SwiftCLI in Frameworks */ = {isa = PBXBuildFile; productRef = 1FA2A9F122E62C1900F53888 /* SwiftCLI */; }; 1FB1351722E522B5005E9A88 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FB1351622E522B5005E9A88 /* main.swift */; }; 1FECB5DF1FBBBD41002EA059 /* setXcodePlatform in Copy Files */ = {isa = PBXBuildFile; fileRef = 1FECB5DE1FBBBC09002EA059 /* setXcodePlatform */; }; 1FF4AFCC22E5237B002F09C6 /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FF4AFCB22E5237B002F09C6 /* Utilities.swift */; }; @@ -587,6 +590,15 @@ ); runOnlyForDeploymentPostprocessing = 1; }; + 1FA2A9E522E62BF600F53888 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = /usr/share/man/man1/; + dstSubfolderSpec = 0; + files = ( + ); + runOnlyForDeploymentPostprocessing = 1; + }; 7227AB3C1098977C00BE33D7 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 8; @@ -630,6 +642,8 @@ 1F4A793921B9F123000FE4B5 /* welcome.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = welcome.html; path = installer/welcome.html; sourceTree = ""; }; 1F514C431F4A5CC0008D9341 /* fetch-from-github */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = "fetch-from-github"; path = "darwinbuild/fetch-from-github"; sourceTree = ""; }; 1F9D9647226516AA0024E830 /* darwinxref.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = darwinxref.entitlements; path = darwinxref/darwinxref.entitlements; sourceTree = ""; }; + 1FA2A9E722E62BF600F53888 /* darwinbuild-recursive */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "darwinbuild-recursive"; sourceTree = BUILT_PRODUCTS_DIR; }; + 1FA2A9E922E62BF600F53888 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; 1FB1351422E522B5005E9A88 /* darwinbuild-codesign */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "darwinbuild-codesign"; sourceTree = BUILT_PRODUCTS_DIR; }; 1FB1351622E522B5005E9A88 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; 1FD9F0CD21B9E90700FB866A /* build.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = build.sh; path = installer/build.sh; sourceTree = ""; }; @@ -738,6 +752,14 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 1FA2A9E422E62BF600F53888 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 1FA2A9F222E62C1900F53888 /* SwiftCLI in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 1FB1351122E522B5005E9A88 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -955,9 +977,18 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 1FA2A9E822E62BF600F53888 /* darwinbuild-recursive */ = { + isa = PBXGroup; + children = ( + 1FA2A9E922E62BF600F53888 /* main.swift */, + ); + path = "darwinbuild-recursive"; + sourceTree = ""; + }; 1FB1351522E522B5005E9A88 /* swift */ = { isa = PBXGroup; children = ( + 1FA2A9E822E62BF600F53888 /* darwinbuild-recursive */, 1FB1351C22E522EA005E9A88 /* darwinbuild-codesign */, 1FF4AFCB22E5237B002F09C6 /* Utilities.swift */, ); @@ -1128,6 +1159,7 @@ 720BE2F2120C90A700B3C4A5 /* digest */, 396301271EAB4E01006081C7 /* patch_sites.so */, 1FB1351422E522B5005E9A88 /* darwinbuild-codesign */, + 1FA2A9E722E62BF600F53888 /* darwinbuild-recursive */, ); name = Products; sourceTree = ""; @@ -1175,6 +1207,26 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ + 1FA2A9E622E62BF600F53888 /* darwinbuild-recursive */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1FA2A9EE22E62BF600F53888 /* Build configuration list for PBXNativeTarget "darwinbuild-recursive" */; + buildPhases = ( + 1FA2A9E322E62BF600F53888 /* Sources */, + 1FA2A9E422E62BF600F53888 /* Frameworks */, + 1FA2A9E522E62BF600F53888 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "darwinbuild-recursive"; + packageProductDependencies = ( + 1FA2A9F122E62C1900F53888 /* SwiftCLI */, + ); + productName = "darwinbuild-recursive"; + productReference = 1FA2A9E722E62BF600F53888 /* darwinbuild-recursive */; + productType = "com.apple.product-type.tool"; + }; 1FB1351322E522B5005E9A88 /* darwinbuild-codesign */ = { isa = PBXNativeTarget; buildConfigurationList = 1FB1351B22E522B5005E9A88 /* Build configuration list for PBXNativeTarget "darwinbuild-codesign" */; @@ -1764,6 +1816,9 @@ LastUpgradeCheck = 1100; ORGANIZATIONNAME = "The DarwinBuild Project"; TargetAttributes = { + 1FA2A9E622E62BF600F53888 = { + CreatedOnToolsVersion = 11.0; + }; 1FB1351322E522B5005E9A88 = { CreatedOnToolsVersion = 11.0; }; @@ -1826,6 +1881,7 @@ 720BE2EA120C90A700B3C4A5 /* digest */, 3963011C1EAB4E01006081C7 /* patch_sites */, 1FB1351322E522B5005E9A88 /* darwinbuild-codesign */, + 1FA2A9E622E62BF600F53888 /* darwinbuild-recursive */, ); }; /* End PBXProject section */ @@ -2020,6 +2076,15 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 1FA2A9E322E62BF600F53888 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1FA2A9EF22E62BFE00F53888 /* Utilities.swift in Sources */, + 1FA2A9EA22E62BF600F53888 /* main.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 1FB1351022E522B5005E9A88 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -2576,6 +2641,108 @@ /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ + 1FA2A9EB22E62BF600F53888 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = 3P242C9ES5; + ENABLE_HARDENED_RUNTIME = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 1FA2A9EC22E62BF600F53888 /* Public */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 3P242C9ES5; + ENABLE_HARDENED_RUNTIME = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_VERSION = 5.0; + }; + name = Public; + }; + 1FA2A9ED22E62BF600F53888 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 3P242C9ES5; + ENABLE_HARDENED_RUNTIME = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; 1FB1351822E522B5005E9A88 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -3889,6 +4056,16 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 1FA2A9EE22E62BF600F53888 /* Build configuration list for PBXNativeTarget "darwinbuild-recursive" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1FA2A9EB22E62BF600F53888 /* Debug */, + 1FA2A9EC22E62BF600F53888 /* Public */, + 1FA2A9ED22E62BF600F53888 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Public; + }; 1FB1351B22E522B5005E9A88 /* Build configuration list for PBXNativeTarget "darwinbuild-codesign" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -4298,6 +4475,11 @@ package = 1F7D730B22E52DFD003F8A67 /* XCRemoteSwiftPackageReference "SwiftCLI" */; productName = SwiftCLI; }; + 1FA2A9F122E62C1900F53888 /* SwiftCLI */ = { + isa = XCSwiftPackageProductDependency; + package = 1F7D730B22E52DFD003F8A67 /* XCRemoteSwiftPackageReference "SwiftCLI" */; + productName = SwiftCLI; + }; /* End XCSwiftPackageProductDependency section */ }; rootObject = 726DD14910965C5700D5AEAB /* Project object */; diff --git a/swift/darwinbuild-recursive/main.swift b/swift/darwinbuild-recursive/main.swift new file mode 100644 index 0000000..740ced8 --- /dev/null +++ b/swift/darwinbuild-recursive/main.swift @@ -0,0 +1,137 @@ +// +// Copyright (c) 2019 William Kent. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of +// its contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY ITS CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +// IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +import Foundation +import SwiftCLI + +fileprivate func readProcessOutput(commandName: String, arguments: [String]) -> String { + let outputPipe = Pipe() + let task = Task(executable: commandName, arguments: arguments, stdout: WriteStream.for(fileHandle: outputPipe.fileHandleForWriting)) + + let exitCode = task.runSync() + if exitCode != 0 { + print("\(commandName) \(arguments) failed with code \(exitCode)", to: &standardError) + exit(1) + } + + let data = outputPipe.fileHandleForReading.readDataToEndOfFile() + if let text = String(data: data, encoding: .utf8) { + return text + } else { + fatalError("could not decode tool output into UTF-8 string") + } +} + +fileprivate func splitLines(_ input: String) -> [String] { + var retval: [String] = [] + input.enumerateLines { + (line, _) in + retval.append(line) + } + return retval +} + +fileprivate struct RecursiveBuildContext { + fileprivate var completedDependencies = Set() + fileprivate var completedHeaderDependencies = Set() + + fileprivate mutating func buildProject(projectName: String, isHeaderDependency: Bool = false) { + if isHeaderDependency { + if completedHeaderDependencies.contains(projectName) { + return + } else { + completedHeaderDependencies.insert(projectName) + } + } else { + if completedDependencies.contains(projectName) { + return + } else { + completedDependencies.insert(projectName) + } + } + + let buildDependencies = splitLines(readProcessOutput(commandName: "darwinxref", arguments: ["dependencies", "-build", projectName])) + let headerDependencies = splitLines(readProcessOutput(commandName: "darwinxref", arguments: ["dependencies", "-header", projectName])) + + for dep in headerDependencies { + buildProject(projectName: dep, isHeaderDependency: true) + } + for dep in buildDependencies { + buildProject(projectName: dep, isHeaderDependency: false) + } + + let task = Task(executable: "darwinbuild", arguments: isHeaderDependency ? ["-header", projectName] : [projectName], stdout: WriteStream.stdout, stderr: WriteStream.stderr) + let exitCode = task.runSync() + if exitCode != 0 { + print("darwinbuild \(isHeaderDependency ? "-header " : "")\(projectName) failed with code \(exitCode)", to: &standardError) + exit(1) + } + } +} + +func main() { + if CommandLine.arguments.count < 3 { + print("Internal tool used by darwinbuild, please do not invoke directly", to: &standardError) + exit(1) + } + + let fm = FileManager() + let buildroot = CommandLine.Environment["DARWIN_BUILDROOT"] ?? CommandLine.workingDirectory + if !(fm.directoryExists(atPath: joinPath(buildroot, "Roots")) && + fm.directoryExists(atPath: joinPath(buildroot, "Sources")) && + fm.directoryExists(atPath: joinPath(buildroot, "Symbols")) && + fm.directoryExists(atPath: joinPath(buildroot, "Headers")) && + fm.directoryExists(atPath: joinPath(buildroot, "Logs"))) { + print("ERROR: Could not find darwinbuild root, this is required when using --project", to: &standardError) + print("Please change your working directory to one initialized by:", to: &standardError) + print("\t$ darwinbuild -init ", to: &standardError) + print("Alternatively, you may set the DARWIN_BUILDROOT environment variable to the", to: &standardError) + print("absolute path of that directory.", to: &standardError) + + exit(1) + } + + var context = RecursiveBuildContext() + if CommandLine.arguments[1] == "-g" { + let groupOutput = splitLines(readProcessOutput(commandName: "darwinxref", arguments: ["group", CommandLine.arguments[2]])) + for line in groupOutput { + for word in line.components(separatedBy: NSCharacterSet.whitespaces) { + if word != "" { + context.buildProject(projectName: word) + } + } + } + } else if CommandLine.arguments[1] == "-p" { + context.buildProject(projectName: CommandLine.arguments[2]) + } else { + print("ERROR: First argument must be either -g or -p", to: &standardError) + exit(1) + } +} + +main() From 6dde8959ac69e89dfb589e7adbcc92c9681b0d5c Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 22 Jul 2019 13:54:50 -0400 Subject: [PATCH 263/382] Update copyright header --- swift/Utilities.swift | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/swift/Utilities.swift b/swift/Utilities.swift index 2cf37b1..0ef3077 100644 --- a/swift/Utilities.swift +++ b/swift/Utilities.swift @@ -1,9 +1,29 @@ // -// Utilities.swift -// darwinbuild-codesign +// Copyright (c) 2019 William Kent. All rights reserved. // -// Created by William Kent on 7/21/19. -// Copyright © 2019 The DarwinBuild Project. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of +// its contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY ITS CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +// IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // import Foundation From 8a7c2f4ccc42c207b9de03aacf9fff5cafc6b38d Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 22 Jul 2019 13:57:28 -0400 Subject: [PATCH 264/382] Clarify error message --- .../xcschemes/darwinbuild-recursive.xcscheme | 96 +++++++++++++++++++ swift/darwinbuild-recursive/main.swift | 2 +- 2 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 darwinbuild.xcodeproj/xcshareddata/xcschemes/darwinbuild-recursive.xcscheme diff --git a/darwinbuild.xcodeproj/xcshareddata/xcschemes/darwinbuild-recursive.xcscheme b/darwinbuild.xcodeproj/xcshareddata/xcschemes/darwinbuild-recursive.xcscheme new file mode 100644 index 0000000..8e7b7bf --- /dev/null +++ b/darwinbuild.xcodeproj/xcshareddata/xcschemes/darwinbuild-recursive.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/swift/darwinbuild-recursive/main.swift b/swift/darwinbuild-recursive/main.swift index 740ced8..063f6cc 100644 --- a/swift/darwinbuild-recursive/main.swift +++ b/swift/darwinbuild-recursive/main.swift @@ -107,7 +107,7 @@ func main() { fm.directoryExists(atPath: joinPath(buildroot, "Symbols")) && fm.directoryExists(atPath: joinPath(buildroot, "Headers")) && fm.directoryExists(atPath: joinPath(buildroot, "Logs"))) { - print("ERROR: Could not find darwinbuild root, this is required when using --project", to: &standardError) + print("ERROR: Could not find darwinbuild root, this is required", to: &standardError) print("Please change your working directory to one initialized by:", to: &standardError) print("\t$ darwinbuild -init ", to: &standardError) print("Alternatively, you may set the DARWIN_BUILDROOT environment variable to the", to: &standardError) From ce9091efc3754a6a418373232f6c25ed4e7e14ee Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 22 Jul 2019 14:07:17 -0400 Subject: [PATCH 265/382] Fix several bugs in darwinbuild-recursive Still does not work, though. --- swift/darwinbuild-recursive/main.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/swift/darwinbuild-recursive/main.swift b/swift/darwinbuild-recursive/main.swift index 063f6cc..2d88dd4 100644 --- a/swift/darwinbuild-recursive/main.swift +++ b/swift/darwinbuild-recursive/main.swift @@ -31,7 +31,7 @@ import SwiftCLI fileprivate func readProcessOutput(commandName: String, arguments: [String]) -> String { let outputPipe = Pipe() - let task = Task(executable: commandName, arguments: arguments, stdout: WriteStream.for(fileHandle: outputPipe.fileHandleForWriting)) + let task = Task(executable: commandName, arguments: arguments, stdout: WriteStream.for(fileHandle: outputPipe.fileHandleForWriting), stderr: WriteStream.stderr) let exitCode = task.runSync() if exitCode != 0 { @@ -75,8 +75,8 @@ fileprivate struct RecursiveBuildContext { } } - let buildDependencies = splitLines(readProcessOutput(commandName: "darwinxref", arguments: ["dependencies", "-build", projectName])) - let headerDependencies = splitLines(readProcessOutput(commandName: "darwinxref", arguments: ["dependencies", "-header", projectName])) + let buildDependencies = splitLines(readProcessOutput(commandName: "/usr/local/bin/darwinxref", arguments: ["dependencies", "-build", projectName])) + let headerDependencies = splitLines(readProcessOutput(commandName: "/usr/local/bin/darwinxref", arguments: ["dependencies", "-header", projectName])) for dep in headerDependencies { buildProject(projectName: dep, isHeaderDependency: true) @@ -115,6 +115,7 @@ func main() { exit(1) } + CommandLine.workingDirectory = buildroot var context = RecursiveBuildContext() if CommandLine.arguments[1] == "-g" { From bbf2937b74927f01e1e68d34631f0e4e5c12775a Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 22 Jul 2019 16:31:47 -0400 Subject: [PATCH 266/382] Fix readProcessOutput() --- swift/darwinbuild-recursive/main.swift | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/swift/darwinbuild-recursive/main.swift b/swift/darwinbuild-recursive/main.swift index 2d88dd4..9c96f59 100644 --- a/swift/darwinbuild-recursive/main.swift +++ b/swift/darwinbuild-recursive/main.swift @@ -30,8 +30,8 @@ import Foundation import SwiftCLI fileprivate func readProcessOutput(commandName: String, arguments: [String]) -> String { - let outputPipe = Pipe() - let task = Task(executable: commandName, arguments: arguments, stdout: WriteStream.for(fileHandle: outputPipe.fileHandleForWriting), stderr: WriteStream.stderr) + let output = CaptureStream() + let task = Task(executable: commandName, arguments: arguments, stdout: output, stderr: WriteStream.stderr) let exitCode = task.runSync() if exitCode != 0 { @@ -39,8 +39,7 @@ fileprivate func readProcessOutput(commandName: String, arguments: [String]) -> exit(1) } - let data = outputPipe.fileHandleForReading.readDataToEndOfFile() - if let text = String(data: data, encoding: .utf8) { + if let text = String(data: output.readAllData(), encoding: .utf8) { return text } else { fatalError("could not decode tool output into UTF-8 string") From 7c94bfabdd12f9debb543417ad0f95659e60dfa0 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 22 Jul 2019 16:32:42 -0400 Subject: [PATCH 267/382] Use absolute path to darwinbuild --- swift/darwinbuild-recursive/main.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swift/darwinbuild-recursive/main.swift b/swift/darwinbuild-recursive/main.swift index 9c96f59..36e51c0 100644 --- a/swift/darwinbuild-recursive/main.swift +++ b/swift/darwinbuild-recursive/main.swift @@ -84,7 +84,7 @@ fileprivate struct RecursiveBuildContext { buildProject(projectName: dep, isHeaderDependency: false) } - let task = Task(executable: "darwinbuild", arguments: isHeaderDependency ? ["-header", projectName] : [projectName], stdout: WriteStream.stdout, stderr: WriteStream.stderr) + let task = Task(executable: "/usr/local/bin/darwinbuild", arguments: isHeaderDependency ? ["-header", projectName] : [projectName], stdout: WriteStream.stdout, stderr: WriteStream.stderr) let exitCode = task.runSync() if exitCode != 0 { print("darwinbuild \(isHeaderDependency ? "-header " : "")\(projectName) failed with code \(exitCode)", to: &standardError) From a64355b91f06d0058c21ace9fe84b30705cdbed6 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 22 Jul 2019 16:32:55 -0400 Subject: [PATCH 268/382] Fix darwinbuild flag typo --- swift/darwinbuild-recursive/main.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/swift/darwinbuild-recursive/main.swift b/swift/darwinbuild-recursive/main.swift index 36e51c0..4d19dc7 100644 --- a/swift/darwinbuild-recursive/main.swift +++ b/swift/darwinbuild-recursive/main.swift @@ -84,10 +84,10 @@ fileprivate struct RecursiveBuildContext { buildProject(projectName: dep, isHeaderDependency: false) } - let task = Task(executable: "/usr/local/bin/darwinbuild", arguments: isHeaderDependency ? ["-header", projectName] : [projectName], stdout: WriteStream.stdout, stderr: WriteStream.stderr) + let task = Task(executable: "/usr/local/bin/darwinbuild", arguments: isHeaderDependency ? ["-headers", projectName] : [projectName], stdout: WriteStream.stdout, stderr: WriteStream.stderr) let exitCode = task.runSync() if exitCode != 0 { - print("darwinbuild \(isHeaderDependency ? "-header " : "")\(projectName) failed with code \(exitCode)", to: &standardError) + print("darwinbuild \(isHeaderDependency ? "-headers " : "")\(projectName) failed with code \(exitCode)", to: &standardError) exit(1) } } From eb07b4a33f4f0b3c9c30352922cf0101c19aa877 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 22 Jul 2019 16:33:54 -0400 Subject: [PATCH 269/382] Use Swift implementation of darwinbuild-recursive --- darwinbuild.xcodeproj/project.pbxproj | 17 ++++-- darwinbuild/darwinbuild-recursive | 80 --------------------------- 2 files changed, 13 insertions(+), 84 deletions(-) delete mode 100755 darwinbuild/darwinbuild-recursive diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 1c15e6e..0841e15 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -77,6 +77,7 @@ buildPhases = ( ); dependencies = ( + 1FCA51AF22E6551E00D55269 /* PBXTargetDependency */, 1FA9FAFD22E61D9D0096A78D /* PBXTargetDependency */, 72C86C611096617500C66E90 /* PBXTargetDependency */, 725740971097B03D008AD4D7 /* PBXTargetDependency */, @@ -89,7 +90,6 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ - 1F12836121C89D2C00E3A732 /* darwinbuild-recursive in Copy Files */ = {isa = PBXBuildFile; fileRef = 1F12836021C89D2C00E3A732 /* darwinbuild-recursive */; }; 1F514C441F4A5CDA008D9341 /* fetch-from-github in Copy Files */ = {isa = PBXBuildFile; fileRef = 1F514C431F4A5CC0008D9341 /* fetch-from-github */; }; 1F7D730D22E52DFD003F8A67 /* SwiftCLI in Frameworks */ = {isa = PBXBuildFile; productRef = 1F7D730C22E52DFD003F8A67 /* SwiftCLI */; }; 1FA2A9EA22E62BF600F53888 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FA2A9E922E62BF600F53888 /* main.swift */; }; @@ -158,6 +158,13 @@ remoteGlobalIDString = 1FB1351322E522B5005E9A88; remoteInfo = "darwinbuild-codesign"; }; + 1FCA51AE22E6551E00D55269 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 726DD14910965C5700D5AEAB /* Project object */; + proxyType = 1; + remoteGlobalIDString = 1FA2A9E622E62BF600F53888; + remoteInfo = "darwinbuild-recursive"; + }; 3963011E1EAB4E01006081C7 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 726DD14910965C5700D5AEAB /* Project object */; @@ -627,7 +634,6 @@ 7227AD1D109A05FA00BE33D7 /* buildorder in Copy Files */, 7227AD1F109A05FA00BE33D7 /* synthfat in Copy Files */, 7227AD20109A05FA00BE33D7 /* thinFile in Copy Files */, - 1F12836121C89D2C00E3A732 /* darwinbuild-recursive in Copy Files */, 7227AD22109A05FA00BE33D7 /* darwinbuild.common in Copy Files */, ); name = "Copy Files"; @@ -636,7 +642,6 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 1F12836021C89D2C00E3A732 /* darwinbuild-recursive */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; name = "darwinbuild-recursive"; path = "darwinbuild/darwinbuild-recursive"; sourceTree = ""; }; 1F4A793721B9F123000FE4B5 /* conclusion.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = conclusion.html; path = installer/conclusion.html; sourceTree = ""; }; 1F4A793821B9F123000FE4B5 /* license.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = license.html; path = installer/license.html; sourceTree = ""; }; 1F4A793921B9F123000FE4B5 /* welcome.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = welcome.html; path = installer/welcome.html; sourceTree = ""; }; @@ -1036,7 +1041,6 @@ 72C86BD510965DC900C66E90 /* darwinbuild */ = { isa = PBXGroup; children = ( - 1F12836021C89D2C00E3A732 /* darwinbuild-recursive */, 1F514C431F4A5CC0008D9341 /* fetch-from-github */, 720BE2E9120C909E00B3C4A5 /* digest.c */, 7227AB871098A7BF00BE33D7 /* buildlist */, @@ -2338,6 +2342,11 @@ target = 1FB1351322E522B5005E9A88 /* darwinbuild-codesign */; targetProxy = 1FA9FAFC22E61D9D0096A78D /* PBXContainerItemProxy */; }; + 1FCA51AF22E6551E00D55269 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 1FA2A9E622E62BF600F53888 /* darwinbuild-recursive */; + targetProxy = 1FCA51AE22E6551E00D55269 /* PBXContainerItemProxy */; + }; 3963011D1EAB4E01006081C7 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 7257499F1097697300B13BC3 /* darwinxref */; diff --git a/darwinbuild/darwinbuild-recursive b/darwinbuild/darwinbuild-recursive deleted file mode 100755 index ebf17e6..0000000 --- a/darwinbuild/darwinbuild-recursive +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/env python3 - -import sys, os -import plistlib -import subprocess - -if len(sys.argv) < 3: - print('Internal tool used by darwinbuild, please do not invoke directly', file=sys.stderr) - exit(1) - -darwin_buildroot = os.getcwd() -if os.getenv('DARWIN_BUILDROOT') is not None: - darwin_buildroot = os.getenv('DARWIN_BUILDROOT') - os.chdir(darwin_buildroot) - -valid_buildroot = True -for name in ['Roots', 'Sources', 'Symbols', 'Headers', 'Logs']: - valid_buildroot = os.path.isdir(name) - -if not valid_buildroot: - print('ERROR: Could not find darwinbuild root, this is required', file=sys.stderr) - print('Please change your working directory to one initialized by:', file=sys.stderr) - print('\t$ darwinbuild -init ', file=sys.stderr) - print('Alternatively, you may set the DARWIN_BUILDROOT environment variable to the', file=sys.stderr) - print('absolute path of that directory.', file=sys.stderr) - exit(1) - -group_mode = False -input_name = sys.argv[2] - -if sys.argv[1] == '-g': - group_mode = True -elif sys.argv[1] != '-p': - print('ERROR: First argument must be either -g or -p', file=sys.stderr) - exit(1) - -header_deps_done = {} -build_deps_done = {} - -def recursive_build(project, is_header=False): - if project == '': return - - if is_header: - if project in header_deps_done: - return - else: - header_deps_done[project] = True - else: - if project in build_deps_done: - return - else: - build_deps_done[project] = True - - build_deps = subprocess.check_output(['darwinxref', 'dependencies', '-build', project], universal_newlines=True).split('\n') - header_deps = subprocess.check_output(['darwinxref', 'dependencies', '-header', project], universal_newlines=True).split('\n') - - for dep in header_deps: - recursive_build(dep, is_header=True) - for dep in build_deps: - recursive_build(dep, is_header=False) - - darwinbuild_argv = ['darwinbuild'] - if is_header: - darwinbuild_argv.append('-headers') - darwinbuild_argv.append(project) - - try: - subprocess.check_call(darwinbuild_argv, stdout=sys.stdout, stderr=sys.stderr) - except subprocess.CalledProcessError as e: - print(' '.join(darwinbuild_argv), 'failed with code', e.returncode, file=sys.stderr) - exit(1) - -if group_mode: - group_output = subprocess.check_output(['darwinxref', 'group', input_name], universal_newlines=True) - group_output = group_output.split('\n') - for line in group_output: - for project in line.split(' '): - recursive_build(project) -else: - recursive_build(input_name) From df387328aa21cc1d7eb2fc018be9cc3bb7ea0b3a Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 22 Jul 2019 16:35:15 -0400 Subject: [PATCH 270/382] Fix code signing --- darwinbuild.xcodeproj/project.pbxproj | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 0841e15..79531e5 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -2664,9 +2664,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_STYLE = Automatic; DEBUG_INFORMATION_FORMAT = dwarf; - DEVELOPMENT_TEAM = 3P242C9ES5; ENABLE_HARDENED_RUNTIME = YES; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_DYNAMIC_NO_PIC = NO; @@ -2681,6 +2679,7 @@ MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = macosx; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -2702,8 +2701,6 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 3P242C9ES5; ENABLE_HARDENED_RUNTIME = YES; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -2734,8 +2731,6 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 3P242C9ES5; ENABLE_HARDENED_RUNTIME = YES; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu11; From a053a04d5a09dba76b11e3be798548498702a037 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 22 Jul 2019 16:36:55 -0400 Subject: [PATCH 271/382] Install in correct location --- darwinbuild.xcodeproj/project.pbxproj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 79531e5..c34d89e 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -2675,6 +2675,7 @@ ); GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INSTALL_PATH = /usr/local/share/darwinbuild; MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; @@ -2706,6 +2707,7 @@ GCC_C_LANGUAGE_STANDARD = gnu11; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INSTALL_PATH = /usr/local/share/darwinbuild; MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; @@ -2736,6 +2738,7 @@ GCC_C_LANGUAGE_STANDARD = gnu11; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INSTALL_PATH = /usr/local/share/darwinbuild; MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; From 26c4f07f38186558bfcc26b928fe14d9c30ff3c2 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 22 Jul 2019 16:57:04 -0400 Subject: [PATCH 272/382] Add Swift implementation of fetch-from-github --- darwinbuild.xcodeproj/project.pbxproj | 179 ++++++++++++++++++++++++++ swift/fetch-from-github/main.swift | 116 +++++++++++++++++ 2 files changed, 295 insertions(+) create mode 100644 swift/fetch-from-github/main.swift diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index c34d89e..0054f21 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -96,6 +96,9 @@ 1FA2A9EF22E62BFE00F53888 /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FF4AFCB22E5237B002F09C6 /* Utilities.swift */; }; 1FA2A9F222E62C1900F53888 /* SwiftCLI in Frameworks */ = {isa = PBXBuildFile; productRef = 1FA2A9F122E62C1900F53888 /* SwiftCLI */; }; 1FB1351722E522B5005E9A88 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FB1351622E522B5005E9A88 /* main.swift */; }; + 1FCA51B722E6562800D55269 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FCA51B622E6562800D55269 /* main.swift */; }; + 1FCA51BC22E6562F00D55269 /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FF4AFCB22E5237B002F09C6 /* Utilities.swift */; }; + 1FCA51BF22E6563C00D55269 /* SwiftCLI in Frameworks */ = {isa = PBXBuildFile; productRef = 1FCA51BE22E6563C00D55269 /* SwiftCLI */; }; 1FECB5DF1FBBBD41002EA059 /* setXcodePlatform in Copy Files */ = {isa = PBXBuildFile; fileRef = 1FECB5DE1FBBBC09002EA059 /* setXcodePlatform */; }; 1FF4AFCC22E5237B002F09C6 /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FF4AFCB22E5237B002F09C6 /* Utilities.swift */; }; 3963011A1EAB4D60006081C7 /* source_sites.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86C0E10965EEA00C66E90 /* source_sites.c */; }; @@ -606,6 +609,15 @@ ); runOnlyForDeploymentPostprocessing = 1; }; + 1FCA51B222E6562800D55269 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = /usr/share/man/man1/; + dstSubfolderSpec = 0; + files = ( + ); + runOnlyForDeploymentPostprocessing = 1; + }; 7227AB3C1098977C00BE33D7 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 8; @@ -651,6 +663,8 @@ 1FA2A9E922E62BF600F53888 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; 1FB1351422E522B5005E9A88 /* darwinbuild-codesign */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "darwinbuild-codesign"; sourceTree = BUILT_PRODUCTS_DIR; }; 1FB1351622E522B5005E9A88 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; + 1FCA51B422E6562800D55269 /* fetch-from-github */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "fetch-from-github"; sourceTree = BUILT_PRODUCTS_DIR; }; + 1FCA51B622E6562800D55269 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; 1FD9F0CD21B9E90700FB866A /* build.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = build.sh; path = installer/build.sh; sourceTree = ""; }; 1FD9F0CF21B9EAA300FB866A /* distribution.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = distribution.xml; path = installer/distribution.xml; sourceTree = ""; }; 1FEA10392264FBCF008B675D /* notarize.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = notarize.sh; path = installer/notarize.sh; sourceTree = ""; }; @@ -773,6 +787,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 1FCA51B122E6562800D55269 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 1FCA51BF22E6563C00D55269 /* SwiftCLI in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 396301221EAB4E01006081C7 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -993,6 +1015,7 @@ 1FB1351522E522B5005E9A88 /* swift */ = { isa = PBXGroup; children = ( + 1FCA51B522E6562800D55269 /* fetch-from-github */, 1FA2A9E822E62BF600F53888 /* darwinbuild-recursive */, 1FB1351C22E522EA005E9A88 /* darwinbuild-codesign */, 1FF4AFCB22E5237B002F09C6 /* Utilities.swift */, @@ -1008,6 +1031,14 @@ path = "darwinbuild-codesign"; sourceTree = ""; }; + 1FCA51B522E6562800D55269 /* fetch-from-github */ = { + isa = PBXGroup; + children = ( + 1FCA51B622E6562800D55269 /* main.swift */, + ); + path = "fetch-from-github"; + sourceTree = ""; + }; 1FD9F0CE21B9E90C00FB866A /* installer */ = { isa = PBXGroup; children = ( @@ -1164,6 +1195,7 @@ 396301271EAB4E01006081C7 /* patch_sites.so */, 1FB1351422E522B5005E9A88 /* darwinbuild-codesign */, 1FA2A9E722E62BF600F53888 /* darwinbuild-recursive */, + 1FCA51B422E6562800D55269 /* fetch-from-github */, ); name = Products; sourceTree = ""; @@ -1250,6 +1282,26 @@ productReference = 1FB1351422E522B5005E9A88 /* darwinbuild-codesign */; productType = "com.apple.product-type.tool"; }; + 1FCA51B322E6562800D55269 /* fetch-from-github */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1FCA51B822E6562800D55269 /* Build configuration list for PBXNativeTarget "fetch-from-github" */; + buildPhases = ( + 1FCA51B022E6562800D55269 /* Sources */, + 1FCA51B122E6562800D55269 /* Frameworks */, + 1FCA51B222E6562800D55269 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "fetch-from-github"; + packageProductDependencies = ( + 1FCA51BE22E6563C00D55269 /* SwiftCLI */, + ); + productName = "fetch-from-github"; + productReference = 1FCA51B422E6562800D55269 /* fetch-from-github */; + productType = "com.apple.product-type.tool"; + }; 3963011C1EAB4E01006081C7 /* patch_sites */ = { isa = PBXNativeTarget; buildConfigurationList = 396301231EAB4E01006081C7 /* Build configuration list for PBXNativeTarget "patch_sites" */; @@ -1826,6 +1878,9 @@ 1FB1351322E522B5005E9A88 = { CreatedOnToolsVersion = 11.0; }; + 1FCA51B322E6562800D55269 = { + CreatedOnToolsVersion = 11.0; + }; }; }; buildConfigurationList = 726DD14C10965C5700D5AEAB /* Build configuration list for PBXProject "darwinbuild" */; @@ -1886,6 +1941,7 @@ 3963011C1EAB4E01006081C7 /* patch_sites */, 1FB1351322E522B5005E9A88 /* darwinbuild-codesign */, 1FA2A9E622E62BF600F53888 /* darwinbuild-recursive */, + 1FCA51B322E6562800D55269 /* fetch-from-github */, ); }; /* End PBXProject section */ @@ -2098,6 +2154,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 1FCA51B022E6562800D55269 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1FCA51BC22E6562F00D55269 /* Utilities.swift in Sources */, + 1FCA51B722E6562800D55269 /* main.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 3963011F1EAB4E01006081C7 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -2846,6 +2911,105 @@ }; name = Release; }; + 1FCA51B922E6562800D55269 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_HARDENED_RUNTIME = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INSTALL_PATH = /usr/local/share/darwinbuild; + MACOSX_DEPLOYMENT_TARGET = 10.15; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 1FCA51BA22E6562800D55269 /* Public */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + ENABLE_HARDENED_RUNTIME = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INSTALL_PATH = /usr/local/share/darwinbuild; + MACOSX_DEPLOYMENT_TARGET = 10.15; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_VERSION = 5.0; + }; + name = Public; + }; + 1FCA51BB22E6562800D55269 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + ENABLE_HARDENED_RUNTIME = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INSTALL_PATH = /usr/local/share/darwinbuild; + MACOSX_DEPLOYMENT_TARGET = 10.15; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; 396301241EAB4E01006081C7 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; @@ -4083,6 +4247,16 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Public; }; + 1FCA51B822E6562800D55269 /* Build configuration list for PBXNativeTarget "fetch-from-github" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1FCA51B922E6562800D55269 /* Debug */, + 1FCA51BA22E6562800D55269 /* Public */, + 1FCA51BB22E6562800D55269 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Public; + }; 396301231EAB4E01006081C7 /* Build configuration list for PBXNativeTarget "patch_sites" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -4487,6 +4661,11 @@ package = 1F7D730B22E52DFD003F8A67 /* XCRemoteSwiftPackageReference "SwiftCLI" */; productName = SwiftCLI; }; + 1FCA51BE22E6563C00D55269 /* SwiftCLI */ = { + isa = XCSwiftPackageProductDependency; + package = 1F7D730B22E52DFD003F8A67 /* XCRemoteSwiftPackageReference "SwiftCLI" */; + productName = SwiftCLI; + }; /* End XCSwiftPackageProductDependency section */ }; rootObject = 726DD14910965C5700D5AEAB /* Project object */; diff --git a/swift/fetch-from-github/main.swift b/swift/fetch-from-github/main.swift new file mode 100644 index 0000000..a78aab5 --- /dev/null +++ b/swift/fetch-from-github/main.swift @@ -0,0 +1,116 @@ +// +// Copyright (c) 2019 William Kent. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of +// its contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY ITS CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +// IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +import Foundation +import SwiftCLI + +class FetchSourcesCommand: Command { + let name = "fetch-from-github" + + private let plistFilename = Param.Required() + private let projectName = Param.Required() + private let projectVersion = Param.Required() + private let sourcesDir = Param.Required() + + func execute() throws { + let data = try Data(contentsOf: URL(fileURLWithPath: plistFilename.value)) + let darwinbuildPlist = try PropertyListSerialization.propertyList(from: data, options: [], format: nil) as! [String : Any] + + let projects = darwinbuildPlist["projects"] as! [String: Any] + if !projects.keys.contains(projectName.value) { + print("ERROR: Project \(projectName.value) not found", to: &standardError) + exit(1) + } + + let projectData = projects[projectName.value] as! [String: Any] + guard let githubData = projectData["github"] else { + return + } + + var downloadURL: String + var repoBasename: String + var tag: String + + if let githubRepoName = githubData as? String { + let repoParts = githubRepoName.components(separatedBy: "/") + repoBasename = repoParts[1] + tag = projectVersion.value + + downloadURL = "https://github.com/\(githubRepoName)/archive/\(projectVersion.value).tar.gz" + } else if let githubData = githubData as? [String: Any] { + let githubRepoName = githubData["repo"] as! String + let repoParts = githubRepoName.components(separatedBy: "/") + repoBasename = repoParts[1] + if let tagFromPlist = githubData["tag"] as? String { + tag = tagFromPlist + downloadURL = "https://github.com/\(githubRepoName)/archive/\(tag).tar.gz" + } else { + tag = projectVersion.value + downloadURL = "https://github.com/\(githubRepoName)/archive/\(projectVersion.value).tar.gz" + } + } else { + print("ERROR: github key must be of type string or dictionary", to: &standardError) + exit(1) + } + + let tarballFilename = projectName.value + "-" + projectVersion.value + ".tar.gz" + let downloadPath = joinPath(sourcesDir.value, tarballFilename) + print("Downloading \(downloadURL) ...") + + do { + try Task.run("/usr/bin/curl", arguments: ["-fLs", "-o", downloadPath, downloadURL]) + } catch is RunError { + // This can occur if the server returns a 404 or other error. + exit(1) + } + + if repoBasename != projectName.value || tag != projectVersion.value { + let fm = FileManager() + let tempDir = joinPath(fm.temporaryDirectory.path, "fetch-from-github") + try fm.createDirectory(at: URL(fileURLWithPath: tempDir), withIntermediateDirectories: true, attributes: nil) + + do { + try Task.run("/usr/bin/tar", arguments: ["xf", downloadPath], directory: tempDir) + try fm.moveItem(at: URL(fileURLWithPath: joinPath(tempDir, repoBasename + "-" + tag)), to: URL(fileURLWithPath: joinPath(tempDir, projectName.value + "-" + projectVersion.value))) + try Task.run("/usr/bin/tar", arguments: ["czf", tarballFilename, projectName.value + "-" + projectVersion.value], directory: tempDir) + + try? fm.removeItem(atPath: tempDir) + } catch is RunError { + try! fm.removeItem(atPath: tempDir) + exit(1) + } + } + } +} + +func main() { + let handler = CLI(singleCommand: FetchSourcesCommand()) + handler.goAndExit() +} + +main() From 42d9723251271b9bbbad4e8b27f5f39668e32065 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 22 Jul 2019 17:03:05 -0400 Subject: [PATCH 273/382] Use the Swift implementation of fetch-from-github --- darwinbuild.xcodeproj/project.pbxproj | 17 ++++++-- darwinbuild/fetch-from-github | 56 --------------------------- 2 files changed, 13 insertions(+), 60 deletions(-) delete mode 100755 darwinbuild/fetch-from-github diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 0054f21..0646f5f 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -77,6 +77,7 @@ buildPhases = ( ); dependencies = ( + 1FF1E7E322E65BC9002B8CAA /* PBXTargetDependency */, 1FCA51AF22E6551E00D55269 /* PBXTargetDependency */, 1FA9FAFD22E61D9D0096A78D /* PBXTargetDependency */, 72C86C611096617500C66E90 /* PBXTargetDependency */, @@ -90,7 +91,6 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ - 1F514C441F4A5CDA008D9341 /* fetch-from-github in Copy Files */ = {isa = PBXBuildFile; fileRef = 1F514C431F4A5CC0008D9341 /* fetch-from-github */; }; 1F7D730D22E52DFD003F8A67 /* SwiftCLI in Frameworks */ = {isa = PBXBuildFile; productRef = 1F7D730C22E52DFD003F8A67 /* SwiftCLI */; }; 1FA2A9EA22E62BF600F53888 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FA2A9E922E62BF600F53888 /* main.swift */; }; 1FA2A9EF22E62BFE00F53888 /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FF4AFCB22E5237B002F09C6 /* Utilities.swift */; }; @@ -168,6 +168,13 @@ remoteGlobalIDString = 1FA2A9E622E62BF600F53888; remoteInfo = "darwinbuild-recursive"; }; + 1FF1E7E222E65BC9002B8CAA /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 726DD14910965C5700D5AEAB /* Project object */; + proxyType = 1; + remoteGlobalIDString = 1FCA51B322E6562800D55269; + remoteInfo = "fetch-from-github"; + }; 3963011E1EAB4E01006081C7 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 726DD14910965C5700D5AEAB /* Project object */; @@ -640,7 +647,6 @@ dstPath = "$(DATDIR)/darwinbuild"; dstSubfolderSpec = 0; files = ( - 1F514C441F4A5CDA008D9341 /* fetch-from-github in Copy Files */, 1FECB5DF1FBBBD41002EA059 /* setXcodePlatform in Copy Files */, 7227AD1C109A05FA00BE33D7 /* buildlist in Copy Files */, 7227AD1D109A05FA00BE33D7 /* buildorder in Copy Files */, @@ -657,7 +663,6 @@ 1F4A793721B9F123000FE4B5 /* conclusion.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = conclusion.html; path = installer/conclusion.html; sourceTree = ""; }; 1F4A793821B9F123000FE4B5 /* license.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = license.html; path = installer/license.html; sourceTree = ""; }; 1F4A793921B9F123000FE4B5 /* welcome.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = welcome.html; path = installer/welcome.html; sourceTree = ""; }; - 1F514C431F4A5CC0008D9341 /* fetch-from-github */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = "fetch-from-github"; path = "darwinbuild/fetch-from-github"; sourceTree = ""; }; 1F9D9647226516AA0024E830 /* darwinxref.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = darwinxref.entitlements; path = darwinxref/darwinxref.entitlements; sourceTree = ""; }; 1FA2A9E722E62BF600F53888 /* darwinbuild-recursive */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "darwinbuild-recursive"; sourceTree = BUILT_PRODUCTS_DIR; }; 1FA2A9E922E62BF600F53888 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; @@ -1072,7 +1077,6 @@ 72C86BD510965DC900C66E90 /* darwinbuild */ = { isa = PBXGroup; children = ( - 1F514C431F4A5CC0008D9341 /* fetch-from-github */, 720BE2E9120C909E00B3C4A5 /* digest.c */, 7227AB871098A7BF00BE33D7 /* buildlist */, 7227AB881098A7BF00BE33D7 /* buildorder */, @@ -2412,6 +2416,11 @@ target = 1FA2A9E622E62BF600F53888 /* darwinbuild-recursive */; targetProxy = 1FCA51AE22E6551E00D55269 /* PBXContainerItemProxy */; }; + 1FF1E7E322E65BC9002B8CAA /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 1FCA51B322E6562800D55269 /* fetch-from-github */; + targetProxy = 1FF1E7E222E65BC9002B8CAA /* PBXContainerItemProxy */; + }; 3963011D1EAB4E01006081C7 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 7257499F1097697300B13BC3 /* darwinxref */; diff --git a/darwinbuild/fetch-from-github b/darwinbuild/fetch-from-github deleted file mode 100755 index 67c31cf..0000000 --- a/darwinbuild/fetch-from-github +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env python3 - -import sys, os -import plistlib -import subprocess -import tarfile -import tempfile -import shutil - -if len(sys.argv) < 5: - print('Internal tool used by darwinbuild, please do not invoke directly', file=sys.stderr) - exit(1) - -plist_filename = sys.argv[1] -project_name = sys.argv[2] -project_version = sys.argv[3] -sources_dir = sys.argv[4] -darwinbuild_plist = None - -with open(plist_filename, 'rb') as file: - darwinbuild_plist = plistlib.load(file) - -project_data = darwinbuild_plist['projects'][project_name] -if 'github' in project_data: - url = None - tag = project_version - repo_basename = None - - github_data = project_data['github'] - - if isinstance(github_data, str): - repo_parts = github_data.split('/') - repo_basename = repo_parts[1] - url = 'https://github.com/{}/archive/{}.tar.gz'.format(github_data, project_version) - elif isinstance(github_data, dict): - repo_parts = github_data['repo'].split('/') - repo_basename = repo_parts[1] - url = 'https://github.com/{}/archive/{}.tar.gz'.format(github_data['repo'], github_data['tag']) - tag = github_data['tag'] - else: - raise Exception('github data not string or dictionary') - - tarball_filename = project_name + '-' + project_version + '.tar.gz' - download_path = os.path.join(sources_dir, tarball_filename) - print('Downloading', url, '...') - curl_exitcode = subprocess.call(['/usr/bin/curl', '-fLs', '-o', download_path, url]) - if curl_exitcode != 0: - # This occurs if the server returned a 404 or other error. - exit(1) - - if repo_basename != project_name or tag != project_version: - temp_dir = tempfile.mkdtemp(prefix='darwinbuild-fetch-from-github') - subprocess.check_output(['/usr/bin/tar', 'xf', os.path.join(sources_dir, tarball_filename)], cwd=temp_dir) - shutil.move(os.path.join(temp_dir, repo_basename + '-' + tag), os.path.join(temp_dir, project_name + '-' + project_version)) - subprocess.check_output(['/usr/bin/tar', 'czf', os.path.join(sources_dir, tarball_filename), project_name + '-' + project_version], cwd=temp_dir) - shutil.rmtree(temp_dir, ignore_errors=True) From 6eca8e5b69db03e7afa6c8283539419f47113b8d Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 1 Aug 2019 19:45:31 -0400 Subject: [PATCH 274/382] Remove isysroot override from darwinbuild.xcconfig This was originally put into place to allow overriding the macOS system SDK with headers and libraries in the $(DEPROOT). However, I have since discovered that I can reference those files directly using compiler/linker flags, without having to recreate the entire SDK from the ground up. --- darwinbuild/darwinbuild.common | 3 --- 1 file changed, 3 deletions(-) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index 0ed4c56..2865b6c 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -552,8 +552,5 @@ function WriteDarwinbuildXcodeConfig() { cat <<-EOF > $SRCROOT/darwinbuild.xcconfig DEPROOT = $BuildRoot - - OTHER_LDFLAGS = \$(OTHER_LDFLAGS) -isysroot "\$(DEPROOT)" - OTHER_CFLAGS = \$(OTHER_CFLAGS) -isysroot "\$(DEPROOT)" EOF } From e058c0c1486bfdd27e50e0b425087c31a1292254 Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 1 Aug 2019 19:49:10 -0400 Subject: [PATCH 275/382] Retarget Xcode project to 10.14 Parts were set to target 10.15, due to my editing them from a Mac running the Catalina beta. --- darwinbuild.xcodeproj/project.pbxproj | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 0646f5f..7fee568 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -2750,7 +2750,6 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; INSTALL_PATH = /usr/local/share/darwinbuild; - MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -2782,7 +2781,6 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; INSTALL_PATH = /usr/local/share/darwinbuild; - MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -2813,7 +2811,6 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; INSTALL_PATH = /usr/local/share/darwinbuild; - MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -2849,7 +2846,6 @@ ); GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -2879,7 +2875,6 @@ GCC_C_LANGUAGE_STANDARD = gnu11; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -2909,7 +2904,6 @@ GCC_C_LANGUAGE_STANDARD = gnu11; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -2946,7 +2940,6 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; INSTALL_PATH = /usr/local/share/darwinbuild; - MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -2977,7 +2970,6 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; INSTALL_PATH = /usr/local/share/darwinbuild; - MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -3008,7 +3000,6 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; INSTALL_PATH = /usr/local/share/darwinbuild; - MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -3888,6 +3879,7 @@ GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; LD_OPENMP_FLAGS = ""; + MACOSX_DEPLOYMENT_TARGET = 10.14; STRIP_INSTALLED_PRODUCT = NO; STRIP_STYLE = "non-global"; WARNING_CFLAGS = "-Wall"; @@ -4072,6 +4064,7 @@ GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; LD_OPENMP_FLAGS = ""; + MACOSX_DEPLOYMENT_TARGET = 10.14; ONLY_ACTIVE_ARCH = YES; STRIP_INSTALLED_PRODUCT = NO; STRIP_STYLE = "non-global"; @@ -4135,6 +4128,7 @@ GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; LD_OPENMP_FLAGS = ""; + MACOSX_DEPLOYMENT_TARGET = 10.14; STRIP_INSTALLED_PRODUCT = NO; STRIP_STYLE = "non-global"; WARNING_CFLAGS = "-Wall"; From 04b95573b4f6c4f5133727d0896fe1f3cb21f514 Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 1 Aug 2019 20:10:01 -0400 Subject: [PATCH 276/382] Fix code signing/notarization errors --- darwinbuild.xcodeproj/project.pbxproj | 9 ---- notarization.log | 61 +++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 9 deletions(-) create mode 100644 notarization.log diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 7fee568..7001537 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -3042,7 +3042,6 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = digest; @@ -3055,7 +3054,6 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = digest; @@ -3068,7 +3066,6 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = digest; @@ -3108,7 +3105,6 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = manifest; @@ -3121,7 +3117,6 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = manifest; @@ -3134,7 +3129,6 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = manifest; @@ -3926,7 +3920,6 @@ buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; CODE_SIGN_ENTITLEMENTS = darwinxref/darwinxref.entitlements; - CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = "$(BINDIR)"; @@ -3947,7 +3940,6 @@ buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; CODE_SIGN_ENTITLEMENTS = darwinxref/darwinxref.entitlements; - CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = "$(BINDIR)"; @@ -3968,7 +3960,6 @@ buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; CODE_SIGN_ENTITLEMENTS = darwinxref/darwinxref.entitlements; - CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = "$(BINDIR)"; diff --git a/notarization.log b/notarization.log new file mode 100644 index 0000000..fc1d3f8 --- /dev/null +++ b/notarization.log @@ -0,0 +1,61 @@ +{ + "logFormatVersion": 1, + "jobId": "92faf4ce-170b-4e8d-a8d0-66e41980f698", + "status": "Invalid", + "statusSummary": "Archive contains critical validation errors", + "statusCode": 4000, + "archiveFilename": "darwinbuild-installer.pkg", + "uploadDate": "2019-08-02T00:04:40Z", + "sha256": "d4249b96ea9635deffaa141af336655485ac60846bc8948c2d011ed1b984e724", + "ticketContents": null, + "issues": [ + { + "severity": "error", + "code": null, + "path": "darwinbuild-installer.pkg/darwinbuild-component.pkg Contents/Payload/usr/local/bin/darwinxref", + "message": "The binary is not signed with a valid Developer ID certificate.", + "docUrl": null, + "architecture": "x86_64" + }, + { + "severity": "error", + "code": null, + "path": "darwinbuild-installer.pkg/darwinbuild-component.pkg Contents/Payload/usr/local/bin/darwinxref", + "message": "The signature does not include a secure timestamp.", + "docUrl": null, + "architecture": "x86_64" + }, + { + "severity": "error", + "code": null, + "path": "darwinbuild-installer.pkg/darwinbuild-component.pkg Contents/Payload/usr/local/share/darwinbuild/digest", + "message": "The binary is not signed with a valid Developer ID certificate.", + "docUrl": null, + "architecture": "x86_64" + }, + { + "severity": "error", + "code": null, + "path": "darwinbuild-installer.pkg/darwinbuild-component.pkg Contents/Payload/usr/local/share/darwinbuild/digest", + "message": "The signature does not include a secure timestamp.", + "docUrl": null, + "architecture": "x86_64" + }, + { + "severity": "error", + "code": null, + "path": "darwinbuild-installer.pkg/darwinbuild-component.pkg Contents/Payload/usr/local/share/darwinbuild/manifest", + "message": "The binary is not signed with a valid Developer ID certificate.", + "docUrl": null, + "architecture": "x86_64" + }, + { + "severity": "error", + "code": null, + "path": "darwinbuild-installer.pkg/darwinbuild-component.pkg Contents/Payload/usr/local/share/darwinbuild/manifest", + "message": "The signature does not include a secure timestamp.", + "docUrl": null, + "architecture": "x86_64" + } + ] +} \ No newline at end of file From 63866470c429781c996a480e9407b5072e19b159 Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 1 Aug 2019 20:22:46 -0400 Subject: [PATCH 277/382] Remove accidentally committed file --- notarization.log | 61 ------------------------------------------------ 1 file changed, 61 deletions(-) delete mode 100644 notarization.log diff --git a/notarization.log b/notarization.log deleted file mode 100644 index fc1d3f8..0000000 --- a/notarization.log +++ /dev/null @@ -1,61 +0,0 @@ -{ - "logFormatVersion": 1, - "jobId": "92faf4ce-170b-4e8d-a8d0-66e41980f698", - "status": "Invalid", - "statusSummary": "Archive contains critical validation errors", - "statusCode": 4000, - "archiveFilename": "darwinbuild-installer.pkg", - "uploadDate": "2019-08-02T00:04:40Z", - "sha256": "d4249b96ea9635deffaa141af336655485ac60846bc8948c2d011ed1b984e724", - "ticketContents": null, - "issues": [ - { - "severity": "error", - "code": null, - "path": "darwinbuild-installer.pkg/darwinbuild-component.pkg Contents/Payload/usr/local/bin/darwinxref", - "message": "The binary is not signed with a valid Developer ID certificate.", - "docUrl": null, - "architecture": "x86_64" - }, - { - "severity": "error", - "code": null, - "path": "darwinbuild-installer.pkg/darwinbuild-component.pkg Contents/Payload/usr/local/bin/darwinxref", - "message": "The signature does not include a secure timestamp.", - "docUrl": null, - "architecture": "x86_64" - }, - { - "severity": "error", - "code": null, - "path": "darwinbuild-installer.pkg/darwinbuild-component.pkg Contents/Payload/usr/local/share/darwinbuild/digest", - "message": "The binary is not signed with a valid Developer ID certificate.", - "docUrl": null, - "architecture": "x86_64" - }, - { - "severity": "error", - "code": null, - "path": "darwinbuild-installer.pkg/darwinbuild-component.pkg Contents/Payload/usr/local/share/darwinbuild/digest", - "message": "The signature does not include a secure timestamp.", - "docUrl": null, - "architecture": "x86_64" - }, - { - "severity": "error", - "code": null, - "path": "darwinbuild-installer.pkg/darwinbuild-component.pkg Contents/Payload/usr/local/share/darwinbuild/manifest", - "message": "The binary is not signed with a valid Developer ID certificate.", - "docUrl": null, - "architecture": "x86_64" - }, - { - "severity": "error", - "code": null, - "path": "darwinbuild-installer.pkg/darwinbuild-component.pkg Contents/Payload/usr/local/share/darwinbuild/manifest", - "message": "The signature does not include a secure timestamp.", - "docUrl": null, - "architecture": "x86_64" - } - ] -} \ No newline at end of file From 5b9b1e9539fe5de3f64c9fc12c652226e07841d3 Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 2 Aug 2019 12:21:22 -0400 Subject: [PATCH 278/382] Revert "Remove override of CODE_SIGN_IDENTITY" Apparently, when xcodebuild is run as root, it sometimes still cannot find the code-signing certificates in the keychain. This reverts commit 27e0a905067e49e9953c1600026424f884f27f73. --- darwinbuild/darwinbuild.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index bbad88d..662d525 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -663,6 +663,10 @@ if [ "$buildtool" == "xcodebuild" -a "$configuration" != "" ]; then build_string="$build_string -configuration \"$configuration\"" fi +if [ "$buildtool" == "xcodebuild" ]; then + build_string="$build_string CODE_SIGN_IDENTITY=-" +fi + ### ### Write out the xcconfig file to override the Xcode SDK. ### From 349f15525c84dcbfd15e6f3d161bf9e1414f6163 Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 2 Aug 2019 12:24:18 -0400 Subject: [PATCH 279/382] Use correct variable name in notarize.sh --- installer/notarize.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer/notarize.sh b/installer/notarize.sh index 40b48de..a74e871 100755 --- a/installer/notarize.sh +++ b/installer/notarize.sh @@ -48,7 +48,7 @@ if [[ $request_id =~ ^\{?[A-F0-9a-f]{8}-[A-F0-9a-f]{4}-[A-F0-9a-f]{4}-[A-F0-9a-f fi done - if [ "$status" != "success" ]; then + if [ "$notarization_status" != "success" ]; then echo "altool reported notarization error" 1>&2 exit 1 fi From 5c2689dea4448a99f9ddc47bdf56a521e09f435a Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 2 Aug 2019 12:24:38 -0400 Subject: [PATCH 280/382] Print log file URL before exiting with an error --- installer/notarize.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/installer/notarize.sh b/installer/notarize.sh index a74e871..14fe6da 100755 --- a/installer/notarize.sh +++ b/installer/notarize.sh @@ -48,14 +48,14 @@ if [[ $request_id =~ ^\{?[A-F0-9a-f]{8}-[A-F0-9a-f]{4}-[A-F0-9a-f]{4}-[A-F0-9a-f fi done + log_url=$(/usr/libexec/PlistBuddy -c "print :notarization-info:LogFileURL" $ALTOOL_LOG) + echo "Log file can be downloaded from: $log_url" + if [ "$notarization_status" != "success" ]; then echo "altool reported notarization error" 1>&2 exit 1 fi - log_url=$(/usr/libexec/PlistBuddy -c "print :notarization-info:LogFileURL" $ALTOOL_LOG) - echo "Log file can be downloaded from: $log_url" - xcrun stapler staple $MY_DIR/darwinbuild-installer.pkg xcrun stapler validate -v $MY_DIR/darwinbuild-installer.pkg if [ $@ -ne 0 ]; then From aa9e79f4ffe9cacee62c4a3492fcf98df217c108 Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 2 Aug 2019 12:29:04 -0400 Subject: [PATCH 281/382] Typo fix --- installer/notarize.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer/notarize.sh b/installer/notarize.sh index 14fe6da..3fa8f82 100755 --- a/installer/notarize.sh +++ b/installer/notarize.sh @@ -58,7 +58,7 @@ if [[ $request_id =~ ^\{?[A-F0-9a-f]{8}-[A-F0-9a-f]{4}-[A-F0-9a-f]{4}-[A-F0-9a-f xcrun stapler staple $MY_DIR/darwinbuild-installer.pkg xcrun stapler validate -v $MY_DIR/darwinbuild-installer.pkg - if [ $@ -ne 0 ]; then + if [ $? -ne 0 ]; then echo "validation of installer notarization failed" 1>&2 exit 1 fi From 251fc74be57ab7b68b08be25a988c96545e9a859 Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 2 Aug 2019 12:42:15 -0400 Subject: [PATCH 282/382] Fix path error in fetch-from-github tool --- swift/fetch-from-github/main.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swift/fetch-from-github/main.swift b/swift/fetch-from-github/main.swift index a78aab5..077f830 100644 --- a/swift/fetch-from-github/main.swift +++ b/swift/fetch-from-github/main.swift @@ -97,7 +97,7 @@ class FetchSourcesCommand: Command { do { try Task.run("/usr/bin/tar", arguments: ["xf", downloadPath], directory: tempDir) try fm.moveItem(at: URL(fileURLWithPath: joinPath(tempDir, repoBasename + "-" + tag)), to: URL(fileURLWithPath: joinPath(tempDir, projectName.value + "-" + projectVersion.value))) - try Task.run("/usr/bin/tar", arguments: ["czf", tarballFilename, projectName.value + "-" + projectVersion.value], directory: tempDir) + try Task.run("/usr/bin/tar", arguments: ["czf", downloadPath, projectName.value + "-" + projectVersion.value], directory: tempDir) try? fm.removeItem(atPath: tempDir) } catch is RunError { From 8291ae9171696011401f28a51d1dc8483b224bf8 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 11 Aug 2019 13:07:51 -0400 Subject: [PATCH 283/382] Reinstate default search paths in darwinbuild.xcconfig Their removal in aa08d5cb caused a lot of needless breakage. --- darwinbuild/darwinbuild.common | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index 2865b6c..4527c28 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -551,6 +551,9 @@ function WriteDarwinbuildXcodeConfig() { local SRCROOT="$2" cat <<-EOF > $SRCROOT/darwinbuild.xcconfig - DEPROOT = $BuildRoot +DEPROOT = $BuildRoot +SYSTEM_HEADER_SEARCH_PATHS = \$(DEPROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \$(DEPROOT)/usr/include \$(DEPROOT)/usr/local/include +FRAMEWORK_SEARCH_PATHS = \$(DEPROOT)/System/Library/Frameworks \$(DEPROOT)/System/Library/PrivateFrameworks +LIBRARY_SEARCH_PATHS = \$(DEPROOT)/usr/local/lib \$(DEPROOT)/usr/lib EOF } From 77408f09af940069b86d42ca0550b9303ada9f4a Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 7 Jan 2020 13:07:46 -0500 Subject: [PATCH 284/382] Resolve Xcode 11.3 update warnings --- darwinbuild.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/xcschemes/darwinbuild-codesign.xcscheme | 2 +- .../xcshareddata/xcschemes/darwinbuild-recursive.xcscheme | 2 +- darwinbuild.xcodeproj/xcshareddata/xcschemes/world.xcscheme | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 7001537..2b2aa7d 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -1873,7 +1873,7 @@ attributes = { BuildIndependentTargetsInParallel = YES; LastSwiftUpdateCheck = 1100; - LastUpgradeCheck = 1100; + LastUpgradeCheck = 1130; ORGANIZATIONNAME = "The DarwinBuild Project"; TargetAttributes = { 1FA2A9E622E62BF600F53888 = { diff --git a/darwinbuild.xcodeproj/xcshareddata/xcschemes/darwinbuild-codesign.xcscheme b/darwinbuild.xcodeproj/xcshareddata/xcschemes/darwinbuild-codesign.xcscheme index 163d70c..6a10089 100644 --- a/darwinbuild.xcodeproj/xcshareddata/xcschemes/darwinbuild-codesign.xcscheme +++ b/darwinbuild.xcodeproj/xcshareddata/xcschemes/darwinbuild-codesign.xcscheme @@ -1,6 +1,6 @@ Date: Tue, 7 Jan 2020 13:09:19 -0500 Subject: [PATCH 285/382] Support building multiple projects in darwinbuild-recursive --- swift/darwinbuild-recursive/main.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/swift/darwinbuild-recursive/main.swift b/swift/darwinbuild-recursive/main.swift index 4d19dc7..a0ecc5a 100644 --- a/swift/darwinbuild-recursive/main.swift +++ b/swift/darwinbuild-recursive/main.swift @@ -127,7 +127,9 @@ func main() { } } } else if CommandLine.arguments[1] == "-p" { - context.buildProject(projectName: CommandLine.arguments[2]) + for projectName in CommandLine.arguments[2...] { + context.buildProject(projectName: projectName) + } } else { print("ERROR: First argument must be either -g or -p", to: &standardError) exit(1) From 1705278ef343d327d0c080141af789c83e1e9b64 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 7 Jan 2020 13:14:50 -0500 Subject: [PATCH 286/382] Support passing multiple projects to darwinbuild-recursive --- darwinbuild/darwinbuild.in | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 662d525..d4b9a67 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -242,7 +242,7 @@ fi ### -source Extract, patch, and stage source ### -load Populate the BuildRoot with one project ### -loadonly Only load dependencies into the build root, but don't build. -### -recursive Build given project and all required dependencies +### -recursive Build given project(s) and all required dependencies ### -group Build all projects in the given darwinxref group, ### as with darwinbuild -recursive ### @@ -267,6 +267,11 @@ if [ "$DARWINBUILD_BUILD" != "" ]; then build="$DARWINBUILD_BUILD" fi +if [ "$1" == "-recursive" ]; then + shift + exec $DATADIR/darwinbuild-recursive -p "$@" +fi + for ARG in "$@"; do if [ "$projnam" == "" ]; then if [ "$ARG" == "-headers" ]; then @@ -280,7 +285,8 @@ for ARG in "$@"; do elif [ "$ARG" == "-source" ]; then action="source" elif [ "$ARG" = "-recursive" ]; then - action="recursive" + echo "Error: -recursive only supported as first argument to darwinbuild" 1>&2 + exit 1 elif [ "$ARG" = "-group" ]; then action="group" elif [ "${ARG/=*/}" == "-target" ]; then @@ -358,7 +364,7 @@ fi ### ### If we are doing a -load, install the root and exit. -### Also handle -recursive and -group here. +### Also handle -group here. ### if [ "$action" == "load" ]; then InstallRoot "$BuildRoot" "$projnam" "$depsbuild" @@ -366,8 +372,6 @@ if [ "$action" == "load" ]; then elif [ "$action" == "loadhdrs" ]; then InstallHeader "$BuildRoot" "$projnam" "$depsbuild" exit 0 -elif [ "$action" == "recursive" ]; then - exec $DATADIR/darwinbuild-recursive -p "$projnam" elif [ "$action" == "group" ]; then exec $DATADIR/darwinbuild-recursive -g "$projnam" fi From 5eba45a3ca04d8aa3ea983d640bcaf33a1f535cf Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 16 Feb 2020 14:56:29 -0500 Subject: [PATCH 287/382] Remove explicit SPM clone commands from script If xcodebuild is given a scheme (as opposed to a target), it will download the SPM dependencies automatically before building anything. --- installer/build.sh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/installer/build.sh b/installer/build.sh index 8f1dc2b..ab74d8e 100755 --- a/installer/build.sh +++ b/installer/build.sh @@ -5,15 +5,9 @@ set -e MY_DIR=$(cd `dirname $0` && pwd) cd $MY_DIR -mkdir -p $MY_DIR/../build/DependencyPackages -xcodebuild -resolvePackageDependencies \ - -project $MY_DIR/../darwinbuild.xcodeproj \ - -clonedSourcePackagesDirPath $MY_DIR/../build/DependencyPackages - xcodebuild install \ -project $MY_DIR/../darwinbuild.xcodeproj \ -scheme world -configuration Release \ - -clonedSourcePackagesDirPath $MY_DIR/../build/DependencyPackages \ DSTROOT=$MY_DIR/payload pkgbuild \ From b7c8f72ab55c0be0a3545320292c5971ec40a89e Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 16 Feb 2020 16:32:01 -0500 Subject: [PATCH 288/382] Remove 5-attempt limit from notarize.sh Notarization is slow. Sometimes it will take more than one minute to complete. --- installer/notarize.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/installer/notarize.sh b/installer/notarize.sh index 3fa8f82..34bf895 100755 --- a/installer/notarize.sh +++ b/installer/notarize.sh @@ -28,7 +28,6 @@ fi request_id=$(/usr/libexec/PlistBuddy -c "print :notarization-upload:RequestUUID" $ALTOOL_LOG) if [[ $request_id =~ ^\{?[A-F0-9a-f]{8}-[A-F0-9a-f]{4}-[A-F0-9a-f]{4}-[A-F0-9a-f]{4}-[A-F0-9a-f]{12}\}?$ ]]; then - attempts=5 while :; do echo "Sleeping 20 seconds before checking notarization status..." @@ -42,9 +41,6 @@ if [[ $request_id =~ ^\{?[A-F0-9a-f]{8}-[A-F0-9a-f]{4}-[A-F0-9a-f]{4}-[A-F0-9a-f if [ ! -z "$notarization_status" ]; then [ "$notarization_status" != "in progress" ] && break - else - (($attempts <= 0)) && break - ((attempts--)) fi done From 572169a32dfdb5d8b88346da1f6d6f501ea068d9 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 16 Feb 2020 16:33:42 -0500 Subject: [PATCH 289/382] Remove empty Copy Files build phases --- darwinbuild.xcodeproj/project.pbxproj | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 2b2aa7d..beeeecc 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -607,24 +607,6 @@ ); runOnlyForDeploymentPostprocessing = 1; }; - 1FA2A9E522E62BF600F53888 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = /usr/share/man/man1/; - dstSubfolderSpec = 0; - files = ( - ); - runOnlyForDeploymentPostprocessing = 1; - }; - 1FCA51B222E6562800D55269 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = /usr/share/man/man1/; - dstSubfolderSpec = 0; - files = ( - ); - runOnlyForDeploymentPostprocessing = 1; - }; 7227AB3C1098977C00BE33D7 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 8; @@ -1253,7 +1235,6 @@ buildPhases = ( 1FA2A9E322E62BF600F53888 /* Sources */, 1FA2A9E422E62BF600F53888 /* Frameworks */, - 1FA2A9E522E62BF600F53888 /* CopyFiles */, ); buildRules = ( ); @@ -1292,7 +1273,6 @@ buildPhases = ( 1FCA51B022E6562800D55269 /* Sources */, 1FCA51B122E6562800D55269 /* Frameworks */, - 1FCA51B222E6562800D55269 /* CopyFiles */, ); buildRules = ( ); From 56c2ff1df497f6edf5de1f9a8f177f33f79686b7 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 28 Apr 2020 17:26:10 -0400 Subject: [PATCH 290/382] Resolve Xcode 11.4 update warnings --- darwinbuild.xcodeproj/project.pbxproj | 22 +++++++++++++++++-- .../xcschemes/darwinbuild-codesign.xcscheme | 2 +- .../xcschemes/darwinbuild-recursive.xcscheme | 2 +- .../xcshareddata/xcschemes/world.xcscheme | 2 +- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index beeeecc..ac6ab6e 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -1851,9 +1851,8 @@ 726DD14910965C5700D5AEAB /* Project object */ = { isa = PBXProject; attributes = { - BuildIndependentTargetsInParallel = YES; LastSwiftUpdateCheck = 1100; - LastUpgradeCheck = 1130; + LastUpgradeCheck = 1140; ORGANIZATIONNAME = "The DarwinBuild Project"; TargetAttributes = { 1FA2A9E622E62BF600F53888 = { @@ -2718,6 +2717,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "-"; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_HARDENED_RUNTIME = YES; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -2755,6 +2755,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "-"; ENABLE_HARDENED_RUNTIME = YES; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -2785,6 +2786,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "-"; ENABLE_HARDENED_RUNTIME = YES; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -2815,6 +2817,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "-"; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_HARDENED_RUNTIME = YES; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -2850,6 +2853,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "-"; ENABLE_HARDENED_RUNTIME = YES; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -2879,6 +2883,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "-"; ENABLE_HARDENED_RUNTIME = YES; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -2908,6 +2913,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "-"; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_HARDENED_RUNTIME = YES; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -2944,6 +2950,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "-"; ENABLE_HARDENED_RUNTIME = YES; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -2974,6 +2981,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "-"; ENABLE_HARDENED_RUNTIME = YES; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -3022,6 +3030,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = digest; @@ -3034,6 +3043,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = digest; @@ -3046,6 +3056,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = digest; @@ -3085,6 +3096,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = manifest; @@ -3097,6 +3109,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = manifest; @@ -3109,6 +3122,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = manifest; @@ -3900,6 +3914,7 @@ buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; CODE_SIGN_ENTITLEMENTS = darwinxref/darwinxref.entitlements; + CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = "$(BINDIR)"; @@ -3920,6 +3935,7 @@ buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; CODE_SIGN_ENTITLEMENTS = darwinxref/darwinxref.entitlements; + CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = "$(BINDIR)"; @@ -3940,6 +3956,7 @@ buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; CODE_SIGN_ENTITLEMENTS = darwinxref/darwinxref.entitlements; + CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = "$(BINDIR)"; @@ -4102,6 +4119,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.14; STRIP_INSTALLED_PRODUCT = NO; STRIP_STYLE = "non-global"; + SWIFT_COMPILATION_MODE = wholemodule; WARNING_CFLAGS = "-Wall"; }; name = Release; diff --git a/darwinbuild.xcodeproj/xcshareddata/xcschemes/darwinbuild-codesign.xcscheme b/darwinbuild.xcodeproj/xcshareddata/xcschemes/darwinbuild-codesign.xcscheme index 6a10089..c67782e 100644 --- a/darwinbuild.xcodeproj/xcshareddata/xcschemes/darwinbuild-codesign.xcscheme +++ b/darwinbuild.xcodeproj/xcshareddata/xcschemes/darwinbuild-codesign.xcscheme @@ -1,6 +1,6 @@ Date: Fri, 1 May 2020 14:44:49 -0400 Subject: [PATCH 291/382] Resolve Xcode update warnings --- darwinbuild.xcodeproj/project.pbxproj | 20 ++++--------------- .../xcschemes/darwinbuild-codesign.xcscheme | 2 +- .../xcschemes/darwinbuild-recursive.xcscheme | 2 +- .../xcshareddata/xcschemes/world.xcscheme | 2 +- 4 files changed, 7 insertions(+), 19 deletions(-) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index beeeecc..1d49cbe 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -1851,9 +1851,8 @@ 726DD14910965C5700D5AEAB /* Project object */ = { isa = PBXProject; attributes = { - BuildIndependentTargetsInParallel = YES; LastSwiftUpdateCheck = 1100; - LastUpgradeCheck = 1130; + LastUpgradeCheck = 1140; ORGANIZATIONNAME = "The DarwinBuild Project"; TargetAttributes = { 1FA2A9E622E62BF600F53888 = { @@ -3121,7 +3120,6 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "-"; INSTALL_PATH = "$(BINDIR)"; PRODUCT_NAME = darwinmaster; }; @@ -3132,7 +3130,6 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "-"; INSTALL_PATH = "$(BINDIR)"; PRODUCT_NAME = darwinmaster; }; @@ -3143,7 +3140,6 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "-"; INSTALL_PATH = "$(BINDIR)"; PRODUCT_NAME = darwinmaster; }; @@ -3154,7 +3150,6 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "-"; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = packageRoots; }; @@ -3165,7 +3160,6 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "-"; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = packageRoots; }; @@ -3176,7 +3170,6 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "-"; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = packageRoots; }; @@ -3187,7 +3180,6 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "-"; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = thinPackages; }; @@ -3198,7 +3190,6 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "-"; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = thinPackages; }; @@ -3209,7 +3200,6 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "-"; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = thinPackages; }; @@ -3820,7 +3810,7 @@ CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "Developer ID Application"; + CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; @@ -3874,7 +3864,6 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "-"; INSTALL_PATH = "$(BINDIR)"; PRODUCT_NAME = darwinbuild; }; @@ -4001,7 +3990,7 @@ CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; @@ -4102,6 +4091,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.14; STRIP_INSTALLED_PRODUCT = NO; STRIP_STYLE = "non-global"; + SWIFT_COMPILATION_MODE = wholemodule; WARNING_CFLAGS = "-Wall"; }; name = Release; @@ -4111,7 +4101,6 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "-"; INSTALL_PATH = "$(BINDIR)"; PRODUCT_NAME = darwinbuild; }; @@ -4122,7 +4111,6 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "-"; INSTALL_PATH = "$(BINDIR)"; PRODUCT_NAME = darwinbuild; }; diff --git a/darwinbuild.xcodeproj/xcshareddata/xcschemes/darwinbuild-codesign.xcscheme b/darwinbuild.xcodeproj/xcshareddata/xcschemes/darwinbuild-codesign.xcscheme index 6a10089..c67782e 100644 --- a/darwinbuild.xcodeproj/xcshareddata/xcschemes/darwinbuild-codesign.xcscheme +++ b/darwinbuild.xcodeproj/xcshareddata/xcschemes/darwinbuild-codesign.xcscheme @@ -1,6 +1,6 @@ Date: Fri, 1 May 2020 14:46:11 -0400 Subject: [PATCH 292/382] Don't pass RC_ProjectSourceVersion and similar to Xcode ld is hard-coded to look for this environment variable and use it as the version number for the compiled binary, and there is no way to disable it. This causes builds to fail when the version number used is not in the format 1.2.3.4.5. --- darwinbuild/darwinbuild.in | 4 ---- 1 file changed, 4 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index d4b9a67..a0921d0 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -726,10 +726,6 @@ XREF_ENV=$($DARWINXREF environment $projnam) OLDIFS="$IFS" IFS=$'\n' for X in \ - "RC_ProjectName=$projnam" \ - "RC_ProjectSourceVersion=$version" \ - "RC_ProjectNameAndSourceVersion=$project" \ - "RC_ProjectBuildVersion=$build_version" \ $XREF_ENV ; do echo "echo '${X/=*/}: ${X/*=/}'" >> $SCRIPT eval "export -- \"$X\"" From f3c19da0f9dd64f6907e1dd67fc1c41722a9152f Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 1 May 2020 15:02:18 -0400 Subject: [PATCH 293/382] Fix signing errors that Xcode inserted --- darwinbuild.xcodeproj/project.pbxproj | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 2075908..1d49cbe 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -2717,7 +2717,6 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_IDENTITY = "-"; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_HARDENED_RUNTIME = YES; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -2755,7 +2754,6 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_IDENTITY = "-"; ENABLE_HARDENED_RUNTIME = YES; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -2786,7 +2784,6 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_IDENTITY = "-"; ENABLE_HARDENED_RUNTIME = YES; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -2817,7 +2814,6 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_IDENTITY = "-"; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_HARDENED_RUNTIME = YES; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -2853,7 +2849,6 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_IDENTITY = "-"; ENABLE_HARDENED_RUNTIME = YES; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -2883,7 +2878,6 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_IDENTITY = "-"; ENABLE_HARDENED_RUNTIME = YES; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -2913,7 +2907,6 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_IDENTITY = "-"; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_HARDENED_RUNTIME = YES; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -2950,7 +2943,6 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_IDENTITY = "-"; ENABLE_HARDENED_RUNTIME = YES; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -2981,7 +2973,6 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_IDENTITY = "-"; ENABLE_HARDENED_RUNTIME = YES; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -3030,7 +3021,6 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = digest; @@ -3043,7 +3033,6 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = digest; @@ -3056,7 +3045,6 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = digest; @@ -3096,7 +3084,6 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = manifest; @@ -3109,7 +3096,6 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = manifest; @@ -3122,7 +3108,6 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = manifest; @@ -3904,7 +3889,6 @@ buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; CODE_SIGN_ENTITLEMENTS = darwinxref/darwinxref.entitlements; - CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = "$(BINDIR)"; @@ -3925,7 +3909,6 @@ buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; CODE_SIGN_ENTITLEMENTS = darwinxref/darwinxref.entitlements; - CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = "$(BINDIR)"; @@ -3946,7 +3929,6 @@ buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; CODE_SIGN_ENTITLEMENTS = darwinxref/darwinxref.entitlements; - CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = "$(BINDIR)"; From b12c7642d597a78c7d23b60d0ebc035d4385a1f8 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 24 May 2020 21:52:22 -0400 Subject: [PATCH 294/382] Restore $RC_ProjectName Without this environment variable, certain projects (e.g. Libsyscall) would not build properly, as they are build aliases that test the value of this variable to determine which part of the project to build. --- darwinbuild/darwinbuild.in | 1 + 1 file changed, 1 insertion(+) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index a0921d0..33e3d79 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -726,6 +726,7 @@ XREF_ENV=$($DARWINXREF environment $projnam) OLDIFS="$IFS" IFS=$'\n' for X in \ + "RC_ProjectName=$projnam" \ $XREF_ENV ; do echo "echo '${X/=*/}: ${X/*=/}'" >> $SCRIPT eval "export -- \"$X\"" From daab8f2be7369ec2d7b7f5ccb7f40e838a4caadc Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 24 May 2020 21:54:57 -0400 Subject: [PATCH 295/382] Remove set -e from notarize.sh This caused the script to fail silently if the initial altool upload fails. The error handler never gets run, as the shell exits automatically. --- installer/notarize.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/installer/notarize.sh b/installer/notarize.sh index 34bf895..8d410ef 100755 --- a/installer/notarize.sh +++ b/installer/notarize.sh @@ -1,7 +1,5 @@ #!/bin/sh -set -e - MY_DIR=$(cd `dirname $0` && pwd) cd $MY_DIR From 0b16e68db6b0f1e99cf04de5fa693bc7e33f1e29 Mon Sep 17 00:00:00 2001 From: William Kent Date: Wed, 24 Jun 2020 22:56:14 -0400 Subject: [PATCH 296/382] Fix authoring errors in installer distribution file --- installer/distribution.xml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/installer/distribution.xml b/installer/distribution.xml index e405e64..93d1e90 100644 --- a/installer/distribution.xml +++ b/installer/distribution.xml @@ -1,15 +1,11 @@ - - - - + - - - + + darwinbuild-component.pkg From e6d7a3e7e9b8372f6259b3f3a7cda831a883c4e5 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 12 Jul 2020 12:43:30 -0400 Subject: [PATCH 297/382] Fix indentation error --- installer/distribution.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer/distribution.xml b/installer/distribution.xml index 93d1e90..59516a1 100644 --- a/installer/distribution.xml +++ b/installer/distribution.xml @@ -5,7 +5,7 @@ - + darwinbuild-component.pkg From ea66079982de47950bdf6fff882c6ba37406c4c9 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 2 Aug 2020 16:24:59 -0400 Subject: [PATCH 298/382] Add support for macOS Big Sur to setXcodePlatform script --- darwinbuild/setXcodePlatform | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/darwinbuild/setXcodePlatform b/darwinbuild/setXcodePlatform index 6648b83..110eba3 100755 --- a/darwinbuild/setXcodePlatform +++ b/darwinbuild/setXcodePlatform @@ -32,8 +32,9 @@ set -e -HOST_DARWIN_VERSION=$(sw_vers -productVersion | sed -Ee 's,(10\.[0-9]{2}).*,\1,') +HOST_DARWIN_VERSION=$(sw_vers -productVersion | sed -Ee 's,([0-9]+\.[0-9]{2}).*,\1,') +[[ "$HOST_DARWIN_VERSION" =~ ^11 ]] && echo 'macosx11.0' > $1/.build/platform [[ "$HOST_DARWIN_VERSION" =~ ^10.15 ]] && echo 'macosx10.15' > $1/.build/platform [[ "$HOST_DARWIN_VERSION" =~ ^10.14 ]] && echo 'macosx10.14' > $1/.build/platform [[ "$HOST_DARWIN_VERSION" =~ ^10.13 ]] && echo 'macosx10.13' > $1/.build/platform From ce407590dfb67e87b0db011337286a051eaf40fc Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 2 Aug 2020 16:29:47 -0400 Subject: [PATCH 299/382] Remove unused "Public" build configuration --- darwinbuild.xcodeproj/project.pbxproj | 610 ++------------------------ 1 file changed, 41 insertions(+), 569 deletions(-) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 1d49cbe..1de21d1 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -2740,36 +2740,6 @@ }; name = Debug; }; - 1FA2A9EC22E62BF600F53888 /* Public */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - ENABLE_HARDENED_RUNTIME = YES; - ENABLE_NS_ASSERTIONS = NO; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - INSTALL_PATH = /usr/local/share/darwinbuild; - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = macosx; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - SWIFT_VERSION = 5.0; - }; - name = Public; - }; 1FA2A9ED22E62BF600F53888 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { @@ -2835,35 +2805,6 @@ }; name = Debug; }; - 1FB1351922E522B5005E9A88 /* Public */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - ENABLE_HARDENED_RUNTIME = YES; - ENABLE_NS_ASSERTIONS = NO; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = macosx; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - SWIFT_VERSION = 5.0; - }; - name = Public; - }; 1FB1351A22E522B5005E9A88 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { @@ -2929,36 +2870,6 @@ }; name = Debug; }; - 1FCA51BA22E6562800D55269 /* Public */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - ENABLE_HARDENED_RUNTIME = YES; - ENABLE_NS_ASSERTIONS = NO; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - INSTALL_PATH = /usr/local/share/darwinbuild; - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = macosx; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - SWIFT_VERSION = 5.0; - }; - name = Public; - }; 1FCA51BB22E6562800D55269 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { @@ -2998,15 +2909,6 @@ }; name = Debug; }; - 396301251EAB4E01006081C7 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Public; - }; 396301261EAB4E01006081C7 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; @@ -3028,18 +2930,6 @@ }; name = Debug; }; - 720BE2F0120C90A700B3C4A5 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_STYLE = Manual; - INSTALL_PATH = "$(DATDIR)/darwinbuild"; - PRODUCT_NAME = digest; - PROVISIONING_PROFILE_SPECIFIER = ""; - }; - name = Public; - }; 720BE2F1120C90A700B3C4A5 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; @@ -3061,15 +2951,6 @@ }; name = Debug; }; - 7227AB3F1098977D00BE33D7 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - PRODUCT_NAME = tcl_plugins; - }; - name = Public; - }; 7227AB401098977D00BE33D7 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; @@ -3091,18 +2972,6 @@ }; name = Debug; }; - 7227AB7010989A9A00BE33D7 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_STYLE = Manual; - INSTALL_PATH = "$(DATDIR)/darwinbuild"; - PRODUCT_NAME = manifest; - PROVISIONING_PROFILE_SPECIFIER = ""; - }; - name = Public; - }; 7227AB7110989A9A00BE33D7 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; @@ -3125,16 +2994,6 @@ }; name = Debug; }; - 7227AC041098D78C00BE33D7 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - INSTALL_PATH = "$(BINDIR)"; - PRODUCT_NAME = darwinmaster; - }; - name = Public; - }; 7227AC051098D78C00BE33D7 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; @@ -3155,16 +3014,6 @@ }; name = Debug; }; - 7227AC111098D84600BE33D7 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - INSTALL_PATH = "$(DATDIR)/darwinbuild"; - PRODUCT_NAME = packageRoots; - }; - name = Public; - }; 7227AC121098D84600BE33D7 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; @@ -3185,16 +3034,6 @@ }; name = Debug; }; - 7227AC1A1098D8DB00BE33D7 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - INSTALL_PATH = "$(DATDIR)/darwinbuild"; - PRODUCT_NAME = thinPackages; - }; - name = Public; - }; 7227AC1B1098D8DB00BE33D7 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; @@ -3214,15 +3053,6 @@ }; name = Debug; }; - 7227AC331098DC4F00BE33D7 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - PRODUCT_NAME = darwinbuild_scripts; - }; - name = Public; - }; 7227AC341098DC4F00BE33D7 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; @@ -3240,14 +3070,6 @@ }; name = Debug; }; - 72573F7D1097A488008AD4D7 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - }; - name = Public; - }; 72573F7E1097A488008AD4D7 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; @@ -3264,14 +3086,6 @@ }; name = Debug; }; - 72573FD01097A4B7008AD4D7 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - }; - name = Public; - }; 72573FD11097A4B7008AD4D7 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; @@ -3288,14 +3102,6 @@ }; name = Debug; }; - 72573FD91097A538008AD4D7 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - }; - name = Public; - }; 72573FDA1097A538008AD4D7 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; @@ -3312,14 +3118,6 @@ }; name = Debug; }; - 72573FE21097A5A2008AD4D7 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - }; - name = Public; - }; 72573FE31097A5A2008AD4D7 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; @@ -3336,14 +3134,6 @@ }; name = Debug; }; - 72573FEB1097A5BA008AD4D7 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - }; - name = Public; - }; 72573FEC1097A5BA008AD4D7 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; @@ -3360,14 +3150,6 @@ }; name = Debug; }; - 72573FF41097A5D8008AD4D7 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - }; - name = Public; - }; 72573FF51097A5D8008AD4D7 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; @@ -3384,14 +3166,6 @@ }; name = Debug; }; - 725740031097A6CC008AD4D7 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - }; - name = Public; - }; 725740041097A6CC008AD4D7 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; @@ -3408,14 +3182,6 @@ }; name = Debug; }; - 725740111097AA25008AD4D7 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - }; - name = Public; - }; 725740121097AA25008AD4D7 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; @@ -3432,14 +3198,6 @@ }; name = Debug; }; - 7257401A1097AA5F008AD4D7 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - }; - name = Public; - }; 7257401B1097AA5F008AD4D7 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; @@ -3456,14 +3214,6 @@ }; name = Debug; }; - 725740221097AA6E008AD4D7 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - }; - name = Public; - }; 725740231097AA6E008AD4D7 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; @@ -3480,14 +3230,6 @@ }; name = Debug; }; - 7257402A1097AA79008AD4D7 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - }; - name = Public; - }; 7257402B1097AA79008AD4D7 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; @@ -3504,14 +3246,6 @@ }; name = Debug; }; - 725740341097AA95008AD4D7 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - }; - name = Public; - }; 725740351097AA95008AD4D7 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; @@ -3528,14 +3262,6 @@ }; name = Debug; }; - 7257403C1097AAA6008AD4D7 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - }; - name = Public; - }; 7257403D1097AAA6008AD4D7 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; @@ -3552,14 +3278,6 @@ }; name = Debug; }; - 725740441097AABA008AD4D7 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - }; - name = Public; - }; 725740451097AABA008AD4D7 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; @@ -3576,14 +3294,6 @@ }; name = Debug; }; - 7257404C1097ABDC008AD4D7 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - }; - name = Public; - }; 7257404D1097ABDC008AD4D7 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; @@ -3600,14 +3310,6 @@ }; name = Debug; }; - 725740541097AEC1008AD4D7 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - }; - name = Public; - }; 725740551097AEC1008AD4D7 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; @@ -3624,14 +3326,6 @@ }; name = Debug; }; - 7257405C1097AECC008AD4D7 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - }; - name = Public; - }; 7257405D1097AECC008AD4D7 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; @@ -3648,14 +3342,6 @@ }; name = Debug; }; - 725740641097AEDE008AD4D7 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - }; - name = Public; - }; 725740651097AEDE008AD4D7 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; @@ -3672,14 +3358,6 @@ }; name = Debug; }; - 7257406C1097AEF0008AD4D7 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - }; - name = Public; - }; 7257406D1097AEF0008AD4D7 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; @@ -3696,14 +3374,6 @@ }; name = Debug; }; - 725740741097AEFE008AD4D7 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - }; - name = Public; - }; 725740751097AEFE008AD4D7 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; @@ -3720,14 +3390,6 @@ }; name = Debug; }; - 7257407C1097AF0A008AD4D7 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - }; - name = Public; - }; 7257407D1097AF0A008AD4D7 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; @@ -3744,14 +3406,6 @@ }; name = Debug; }; - 725740841097AF30008AD4D7 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - }; - name = Public; - }; 725740851097AF30008AD4D7 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; @@ -3769,15 +3423,6 @@ }; name = Debug; }; - 7257409A1097B051008AD4D7 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - PRODUCT_NAME = darwinxref_plugins; - }; - name = Public; - }; 7257409B1097B051008AD4D7 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; @@ -3787,102 +3432,6 @@ }; name = Release; }; - 725749861097633500B13BC3 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "-"; - CODE_SIGN_STYLE = Manual; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEVELOPMENT_TEAM = 3P242C9ES5; - ENABLE_HARDENED_RUNTIME = YES; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_ENABLE_PASCAL_STRINGS = NO; - GCC_MODEL_TUNING = ""; - GCC_NO_COMMON_BLOCKS = YES; - GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; - GCC_TREAT_WARNINGS_AS_ERRORS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; - GCC_WARN_ABOUT_MISSING_NEWLINE = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; - GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES; - GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; - GCC_WARN_MISSING_PARENTHESES = YES; - GCC_WARN_MULTIPLE_DEFINITION_TYPES_FOR_SELECTOR = YES; - GCC_WARN_PROTOTYPE_CONVERSION = NO; - GCC_WARN_SIGN_COMPARE = NO; - GCC_WARN_STRICT_SELECTOR_MATCH = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNKNOWN_PRAGMAS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_LABEL = YES; - GCC_WARN_UNUSED_VALUE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - LD_OPENMP_FLAGS = ""; - MACOSX_DEPLOYMENT_TARGET = 10.14; - STRIP_INSTALLED_PRODUCT = NO; - STRIP_STYLE = "non-global"; - WARNING_CFLAGS = "-Wall"; - }; - name = Public; - }; - 725749871097633500B13BC3 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - PRODUCT_NAME = world; - }; - name = Public; - }; - 725749881097633500B13BC3 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - INSTALL_PATH = "$(BINDIR)"; - PRODUCT_NAME = darwinbuild; - }; - name = Public; - }; - 7257498B1097633500B13BC3 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_STYLE = Manual; - INSTALL_PATH = "$(DATDIR)/darwinbuild"; - "INSTALL_PATH[sdk=iphonesimulator*]" = "$(SDKROOT)$(DATDIR)/darwinbuild"; - LD_DYLIB_INSTALL_NAME = "$(DATDIR)/darwinbuild/darwintrace.dylib"; - PRODUCT_NAME = darwintrace; - PROVISIONING_PROFILE_SPECIFIER = ""; - }; - name = Public; - }; 725749A21097697300B13BC3 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; @@ -3903,26 +3452,6 @@ }; name = Debug; }; - 725749A31097697300B13BC3 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_ENTITLEMENTS = darwinxref/darwinxref.entitlements; - CODE_SIGN_STYLE = Manual; - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - INSTALL_PATH = "$(BINDIR)"; - OTHER_CFLAGS = ( - "-DHAVE_TCL_PLUGINS=1", - "-DDEFAULT_PLUGIN_PATH=\\\"$(DATDIR)/darwinxref/plugins\\\"", - "-DDEFAULT_DB_FILE=\\\".build/xref.db\\\"", - ); - PRODUCT_NAME = darwinxref; - PROVISIONING_PROFILE_SPECIFIER = ""; - PUBLIC_HEADERS_FOLDER_PATH = "$(INCDIR)/darwinbuild"; - }; - name = Public; - }; 725749A41097697300B13BC3 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; @@ -3951,14 +3480,6 @@ }; name = Debug; }; - 72574B5B1097A36400B13BC3 /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - }; - name = Public; - }; 72574B5C1097A36400B13BC3 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; @@ -4170,14 +3691,6 @@ }; name = Debug; }; - 72D05CB511D267C400B33EDD /* Public */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - }; - name = Public; - }; 72D05CB611D267C400B33EDD /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */; @@ -4193,411 +3706,370 @@ isa = XCConfigurationList; buildConfigurations = ( 1FA2A9EB22E62BF600F53888 /* Debug */, - 1FA2A9EC22E62BF600F53888 /* Public */, 1FA2A9ED22E62BF600F53888 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 1FB1351B22E522B5005E9A88 /* Build configuration list for PBXNativeTarget "darwinbuild-codesign" */ = { isa = XCConfigurationList; buildConfigurations = ( 1FB1351822E522B5005E9A88 /* Debug */, - 1FB1351922E522B5005E9A88 /* Public */, 1FB1351A22E522B5005E9A88 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 1FCA51B822E6562800D55269 /* Build configuration list for PBXNativeTarget "fetch-from-github" */ = { isa = XCConfigurationList; buildConfigurations = ( 1FCA51B922E6562800D55269 /* Debug */, - 1FCA51BA22E6562800D55269 /* Public */, 1FCA51BB22E6562800D55269 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 396301231EAB4E01006081C7 /* Build configuration list for PBXNativeTarget "patch_sites" */ = { isa = XCConfigurationList; buildConfigurations = ( 396301241EAB4E01006081C7 /* Debug */, - 396301251EAB4E01006081C7 /* Public */, 396301261EAB4E01006081C7 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 720BE2EE120C90A700B3C4A5 /* Build configuration list for PBXNativeTarget "digest" */ = { isa = XCConfigurationList; buildConfigurations = ( 720BE2EF120C90A700B3C4A5 /* Debug */, - 720BE2F0120C90A700B3C4A5 /* Public */, 720BE2F1120C90A700B3C4A5 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 7227AB4A109897E500BE33D7 /* Build configuration list for PBXAggregateTarget "tcl_plugins" */ = { isa = XCConfigurationList; buildConfigurations = ( 7227AB3E1098977D00BE33D7 /* Debug */, - 7227AB3F1098977D00BE33D7 /* Public */, 7227AB401098977D00BE33D7 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 7227AB7310989ACD00BE33D7 /* Build configuration list for PBXNativeTarget "manifest" */ = { isa = XCConfigurationList; buildConfigurations = ( 7227AB6F10989A9A00BE33D7 /* Debug */, - 7227AB7010989A9A00BE33D7 /* Public */, 7227AB7110989A9A00BE33D7 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 7227AC021098D78C00BE33D7 /* Build configuration list for PBXNativeTarget "darwinmaster" */ = { isa = XCConfigurationList; buildConfigurations = ( 7227AC031098D78C00BE33D7 /* Debug */, - 7227AC041098D78C00BE33D7 /* Public */, 7227AC051098D78C00BE33D7 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 7227AC0F1098D84600BE33D7 /* Build configuration list for PBXNativeTarget "packageRoots" */ = { isa = XCConfigurationList; buildConfigurations = ( 7227AC101098D84600BE33D7 /* Debug */, - 7227AC111098D84600BE33D7 /* Public */, 7227AC121098D84600BE33D7 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 7227AC181098D8DB00BE33D7 /* Build configuration list for PBXNativeTarget "thinPackages" */ = { isa = XCConfigurationList; buildConfigurations = ( 7227AC191098D8DB00BE33D7 /* Debug */, - 7227AC1A1098D8DB00BE33D7 /* Public */, 7227AC1B1098D8DB00BE33D7 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 7227AC451098DC9900BE33D7 /* Build configuration list for PBXAggregateTarget "darwinbuild_scripts" */ = { isa = XCConfigurationList; buildConfigurations = ( 7227AC321098DC4F00BE33D7 /* Debug */, - 7227AC331098DC4F00BE33D7 /* Public */, 7227AC341098DC4F00BE33D7 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 72573F7B1097A488008AD4D7 /* Build configuration list for PBXNativeTarget "dependencies" */ = { isa = XCConfigurationList; buildConfigurations = ( 72573F7C1097A488008AD4D7 /* Debug */, - 72573F7D1097A488008AD4D7 /* Public */, 72573F7E1097A488008AD4D7 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 72573FCE1097A4B7008AD4D7 /* Build configuration list for PBXNativeTarget "dot" */ = { isa = XCConfigurationList; buildConfigurations = ( 72573FCF1097A4B7008AD4D7 /* Debug */, - 72573FD01097A4B7008AD4D7 /* Public */, 72573FD11097A4B7008AD4D7 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 72573FD71097A538008AD4D7 /* Build configuration list for PBXNativeTarget "diff" */ = { isa = XCConfigurationList; buildConfigurations = ( 72573FD81097A538008AD4D7 /* Debug */, - 72573FD91097A538008AD4D7 /* Public */, 72573FDA1097A538008AD4D7 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 72573FE01097A5A2008AD4D7 /* Build configuration list for PBXNativeTarget "edit" */ = { isa = XCConfigurationList; buildConfigurations = ( 72573FE11097A5A2008AD4D7 /* Debug */, - 72573FE21097A5A2008AD4D7 /* Public */, 72573FE31097A5A2008AD4D7 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 72573FE91097A5BA008AD4D7 /* Build configuration list for PBXNativeTarget "environment" */ = { isa = XCConfigurationList; buildConfigurations = ( 72573FEA1097A5BA008AD4D7 /* Debug */, - 72573FEB1097A5BA008AD4D7 /* Public */, 72573FEC1097A5BA008AD4D7 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 72573FF21097A5D8008AD4D7 /* Build configuration list for PBXNativeTarget "exportFiles" */ = { isa = XCConfigurationList; buildConfigurations = ( 72573FF31097A5D8008AD4D7 /* Debug */, - 72573FF41097A5D8008AD4D7 /* Public */, 72573FF51097A5D8008AD4D7 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 725740011097A6CC008AD4D7 /* Build configuration list for PBXNativeTarget "exportIndex" */ = { isa = XCConfigurationList; buildConfigurations = ( 725740021097A6CC008AD4D7 /* Debug */, - 725740031097A6CC008AD4D7 /* Public */, 725740041097A6CC008AD4D7 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 7257400F1097AA25008AD4D7 /* Build configuration list for PBXNativeTarget "exportProject" */ = { isa = XCConfigurationList; buildConfigurations = ( 725740101097AA25008AD4D7 /* Debug */, - 725740111097AA25008AD4D7 /* Public */, 725740121097AA25008AD4D7 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 725740181097AA5F008AD4D7 /* Build configuration list for PBXNativeTarget "findFile" */ = { isa = XCConfigurationList; buildConfigurations = ( 725740191097AA5F008AD4D7 /* Debug */, - 7257401A1097AA5F008AD4D7 /* Public */, 7257401B1097AA5F008AD4D7 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 725740201097AA6E008AD4D7 /* Build configuration list for PBXNativeTarget "inherits" */ = { isa = XCConfigurationList; buildConfigurations = ( 725740211097AA6E008AD4D7 /* Debug */, - 725740221097AA6E008AD4D7 /* Public */, 725740231097AA6E008AD4D7 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 725740281097AA79008AD4D7 /* Build configuration list for PBXNativeTarget "loadDeps" */ = { isa = XCConfigurationList; buildConfigurations = ( 725740291097AA79008AD4D7 /* Debug */, - 7257402A1097AA79008AD4D7 /* Public */, 7257402B1097AA79008AD4D7 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 725740321097AA95008AD4D7 /* Build configuration list for PBXNativeTarget "loadFiles" */ = { isa = XCConfigurationList; buildConfigurations = ( 725740331097AA95008AD4D7 /* Debug */, - 725740341097AA95008AD4D7 /* Public */, 725740351097AA95008AD4D7 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 7257403A1097AAA6008AD4D7 /* Build configuration list for PBXNativeTarget "loadIndex" */ = { isa = XCConfigurationList; buildConfigurations = ( 7257403B1097AAA6008AD4D7 /* Debug */, - 7257403C1097AAA6008AD4D7 /* Public */, 7257403D1097AAA6008AD4D7 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 725740421097AABA008AD4D7 /* Build configuration list for PBXNativeTarget "mergeBuild" */ = { isa = XCConfigurationList; buildConfigurations = ( 725740431097AABA008AD4D7 /* Debug */, - 725740441097AABA008AD4D7 /* Public */, 725740451097AABA008AD4D7 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 7257404A1097ABDC008AD4D7 /* Build configuration list for PBXNativeTarget "original" */ = { isa = XCConfigurationList; buildConfigurations = ( 7257404B1097ABDC008AD4D7 /* Debug */, - 7257404C1097ABDC008AD4D7 /* Public */, 7257404D1097ABDC008AD4D7 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 725740521097AEC1008AD4D7 /* Build configuration list for PBXNativeTarget "patchfiles" */ = { isa = XCConfigurationList; buildConfigurations = ( 725740531097AEC1008AD4D7 /* Debug */, - 725740541097AEC1008AD4D7 /* Public */, 725740551097AEC1008AD4D7 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 7257405A1097AECC008AD4D7 /* Build configuration list for PBXNativeTarget "plist_sites" */ = { isa = XCConfigurationList; buildConfigurations = ( 7257405B1097AECC008AD4D7 /* Debug */, - 7257405C1097AECC008AD4D7 /* Public */, 7257405D1097AECC008AD4D7 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 725740621097AEDE008AD4D7 /* Build configuration list for PBXNativeTarget "register" */ = { isa = XCConfigurationList; buildConfigurations = ( 725740631097AEDE008AD4D7 /* Debug */, - 725740641097AEDE008AD4D7 /* Public */, 725740651097AEDE008AD4D7 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 7257406A1097AEF0008AD4D7 /* Build configuration list for PBXNativeTarget "resolveDeps" */ = { isa = XCConfigurationList; buildConfigurations = ( 7257406B1097AEF0008AD4D7 /* Debug */, - 7257406C1097AEF0008AD4D7 /* Public */, 7257406D1097AEF0008AD4D7 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 725740721097AEFE008AD4D7 /* Build configuration list for PBXNativeTarget "source_sites" */ = { isa = XCConfigurationList; buildConfigurations = ( 725740731097AEFE008AD4D7 /* Debug */, - 725740741097AEFE008AD4D7 /* Public */, 725740751097AEFE008AD4D7 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 7257407A1097AF0A008AD4D7 /* Build configuration list for PBXNativeTarget "target" */ = { isa = XCConfigurationList; buildConfigurations = ( 7257407B1097AF0A008AD4D7 /* Debug */, - 7257407C1097AF0A008AD4D7 /* Public */, 7257407D1097AF0A008AD4D7 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 725740821097AF30008AD4D7 /* Build configuration list for PBXNativeTarget "version" */ = { isa = XCConfigurationList; buildConfigurations = ( 725740831097AF30008AD4D7 /* Debug */, - 725740841097AF30008AD4D7 /* Public */, 725740851097AF30008AD4D7 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 725740A01097B08A008AD4D7 /* Build configuration list for PBXAggregateTarget "darwinxref_plugins" */ = { isa = XCConfigurationList; buildConfigurations = ( 725740991097B051008AD4D7 /* Debug */, - 7257409A1097B051008AD4D7 /* Public */, 7257409B1097B051008AD4D7 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 725749A61097699B00B13BC3 /* Build configuration list for PBXNativeTarget "darwinxref" */ = { isa = XCConfigurationList; buildConfigurations = ( 725749A21097697300B13BC3 /* Debug */, - 725749A31097697300B13BC3 /* Public */, 725749A41097697300B13BC3 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 72574B641097A38F00B13BC3 /* Build configuration list for PBXNativeTarget "configuration" */ = { isa = XCConfigurationList; buildConfigurations = ( 72574B5A1097A36400B13BC3 /* Debug */, - 72574B5B1097A36400B13BC3 /* Public */, 72574B5C1097A36400B13BC3 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 726DD14C10965C5700D5AEAB /* Build configuration list for PBXProject "darwinbuild" */ = { isa = XCConfigurationList; buildConfigurations = ( 726DD14A10965C5700D5AEAB /* Debug */, - 725749861097633500B13BC3 /* Public */, 726DD14B10965C5700D5AEAB /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 72C86C3D1096607A00C66E90 /* Build configuration list for PBXNativeTarget "darwinbuild" */ = { isa = XCConfigurationList; buildConfigurations = ( 72C86C3B1096607A00C66E90 /* Debug */, - 725749881097633500B13BC3 /* Public */, 72C86C3C1096607A00C66E90 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 72C86C55109660E900C66E90 /* Build configuration list for PBXNativeTarget "darwintrace" */ = { isa = XCConfigurationList; buildConfigurations = ( 72C86C53109660CB00C66E90 /* Debug */, - 7257498B1097633500B13BC3 /* Public */, 72C86C54109660CB00C66E90 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 72C86C591096616A00C66E90 /* Build configuration list for PBXAggregateTarget "world" */ = { isa = XCConfigurationList; buildConfigurations = ( 72C86C571096614C00C66E90 /* Debug */, - 725749871097633500B13BC3 /* Public */, 72C86C581096614C00C66E90 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; 72D05CB311D267C400B33EDD /* Build configuration list for PBXNativeTarget "query" */ = { isa = XCConfigurationList; buildConfigurations = ( 72D05CB411D267C400B33EDD /* Debug */, - 72D05CB511D267C400B33EDD /* Public */, 72D05CB611D267C400B33EDD /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Public; + defaultConfigurationName = Debug; }; /* End XCConfigurationList section */ From 38ad722b4dca910ebe4dc05f4ff17695862e61f0 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 2 Aug 2020 16:30:38 -0400 Subject: [PATCH 300/382] Resolve Xcode 12 update warnings --- darwinbuild.xcodeproj/project.pbxproj | 24 ++++++++++++++++++- .../xcschemes/darwinbuild-codesign.xcscheme | 2 +- .../xcschemes/darwinbuild-recursive.xcscheme | 2 +- .../xcshareddata/xcschemes/world.xcscheme | 2 +- 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 1de21d1..65d1b60 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -1852,7 +1852,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 1100; - LastUpgradeCheck = 1140; + LastUpgradeCheck = 1200; ORGANIZATIONNAME = "The DarwinBuild Project"; TargetAttributes = { 1FA2A9E622E62BF600F53888 = { @@ -2717,6 +2717,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "-"; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_HARDENED_RUNTIME = YES; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -2754,6 +2755,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "-"; ENABLE_HARDENED_RUNTIME = YES; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -2784,6 +2786,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "-"; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_HARDENED_RUNTIME = YES; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -2819,6 +2822,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "-"; ENABLE_HARDENED_RUNTIME = YES; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -2848,6 +2852,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "-"; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_HARDENED_RUNTIME = YES; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -2884,6 +2889,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "-"; ENABLE_HARDENED_RUNTIME = YES; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -2923,6 +2929,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = digest; @@ -2935,6 +2942,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = digest; @@ -2965,6 +2973,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = manifest; @@ -2977,6 +2986,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = manifest; @@ -2989,6 +2999,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; INSTALL_PATH = "$(BINDIR)"; PRODUCT_NAME = darwinmaster; }; @@ -2999,6 +3010,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; INSTALL_PATH = "$(BINDIR)"; PRODUCT_NAME = darwinmaster; }; @@ -3009,6 +3021,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = packageRoots; }; @@ -3019,6 +3032,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = packageRoots; }; @@ -3029,6 +3043,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = thinPackages; }; @@ -3039,6 +3054,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = thinPackages; }; @@ -3438,6 +3454,7 @@ buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; CODE_SIGN_ENTITLEMENTS = darwinxref/darwinxref.entitlements; + CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = "$(BINDIR)"; @@ -3458,6 +3475,7 @@ buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; CODE_SIGN_ENTITLEMENTS = darwinxref/darwinxref.entitlements; + CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = "$(BINDIR)"; @@ -3506,6 +3524,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -3571,6 +3590,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -3622,6 +3642,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; INSTALL_PATH = "$(BINDIR)"; PRODUCT_NAME = darwinbuild; }; @@ -3632,6 +3653,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; INSTALL_PATH = "$(BINDIR)"; PRODUCT_NAME = darwinbuild; }; diff --git a/darwinbuild.xcodeproj/xcshareddata/xcschemes/darwinbuild-codesign.xcscheme b/darwinbuild.xcodeproj/xcshareddata/xcschemes/darwinbuild-codesign.xcscheme index c67782e..f19a402 100644 --- a/darwinbuild.xcodeproj/xcshareddata/xcschemes/darwinbuild-codesign.xcscheme +++ b/darwinbuild.xcodeproj/xcshareddata/xcschemes/darwinbuild-codesign.xcscheme @@ -1,6 +1,6 @@ Date: Sun, 2 Aug 2020 16:44:54 -0400 Subject: [PATCH 301/382] Retarget entire project to 10.15 --- darwinbuild.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 65d1b60..d6bc742 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -3564,7 +3564,7 @@ GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; LD_OPENMP_FLAGS = ""; - MACOSX_DEPLOYMENT_TARGET = 10.14; + MACOSX_DEPLOYMENT_TARGET = 10.15; ONLY_ACTIVE_ARCH = YES; STRIP_INSTALLED_PRODUCT = NO; STRIP_STYLE = "non-global"; @@ -3629,7 +3629,7 @@ GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; LD_OPENMP_FLAGS = ""; - MACOSX_DEPLOYMENT_TARGET = 10.14; + MACOSX_DEPLOYMENT_TARGET = 10.15; STRIP_INSTALLED_PRODUCT = NO; STRIP_STYLE = "non-global"; SWIFT_COMPILATION_MODE = wholemodule; From 1a4649c0e0d8c522842efaf5fd23f33ee8519a8a Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 2 Aug 2020 16:53:49 -0400 Subject: [PATCH 302/382] Vendor Tcl Future versions of macOS will remove Tcl from the in-box SDK. So that darwinxref does not break, I must vendor a copy of libtcl8.6.dylib. I have chosen to copy this library from the tcl-tk Homebrew formula, which must now be present on the computer you are building darwinbuild on. --- darwinbuild.xcodeproj/project.pbxproj | 52 ++++++++++++++++++++++----- darwinxref/vendor-tcl.sh | 14 ++++++++ 2 files changed, 57 insertions(+), 9 deletions(-) create mode 100755 darwinxref/vendor-tcl.sh diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index d6bc742..c0c69a8 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 54; objects = { /* Begin PBXAggregateTarget section */ @@ -91,6 +91,7 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ + 1F7298EB24D75A200006E19E /* libsqlite3.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 1F7298EA24D759FF0006E19E /* libsqlite3.tbd */; }; 1F7D730D22E52DFD003F8A67 /* SwiftCLI in Frameworks */ = {isa = PBXBuildFile; productRef = 1F7D730C22E52DFD003F8A67 /* SwiftCLI */; }; 1FA2A9EA22E62BF600F53888 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FA2A9E922E62BF600F53888 /* main.swift */; }; 1FA2A9EF22E62BFE00F53888 /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FF4AFCB22E5237B002F09C6 /* Utilities.swift */; }; @@ -145,9 +146,7 @@ 725749AF10976A6300B13BC3 /* DBPlugin.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BEC10965E7500C66E90 /* DBPlugin.c */; }; 725749B010976A6300B13BC3 /* DBTclPlugin.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BEF10965E7500C66E90 /* DBTclPlugin.c */; }; 725749B110976A6300B13BC3 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BF010965E7500C66E90 /* main.c */; }; - 725749B610976AFE00B13BC3 /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 72C86CE310974CC800C66E90 /* libsqlite3.dylib */; }; 72574A1010977F7A00B13BC3 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 72574A0F10977F7A00B13BC3 /* CoreFoundation.framework */; }; - 72574A1510977FAD00B13BC3 /* libtcl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 72574A1410977FAD00B13BC3 /* libtcl.dylib */; }; 72574B5D1097A37600B13BC3 /* configuration.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BF510965EEA00C66E90 /* configuration.c */; }; 72C86C68109663D300C66E90 /* darwintrace.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BD910965E0A00C66E90 /* darwintrace.c */; }; 72D05CB811D2680500B33EDD /* query.c in Sources */ = {isa = PBXBuildFile; fileRef = 72D05CA911D2678F00B33EDD /* query.c */; }; @@ -645,6 +644,7 @@ 1F4A793721B9F123000FE4B5 /* conclusion.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = conclusion.html; path = installer/conclusion.html; sourceTree = ""; }; 1F4A793821B9F123000FE4B5 /* license.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = license.html; path = installer/license.html; sourceTree = ""; }; 1F4A793921B9F123000FE4B5 /* welcome.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = welcome.html; path = installer/welcome.html; sourceTree = ""; }; + 1F7298EA24D759FF0006E19E /* libsqlite3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.tbd; path = usr/lib/libsqlite3.tbd; sourceTree = SDKROOT; }; 1F9D9647226516AA0024E830 /* darwinxref.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = darwinxref.entitlements; path = darwinxref/darwinxref.entitlements; sourceTree = ""; }; 1FA2A9E722E62BF600F53888 /* darwinbuild-recursive */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "darwinbuild-recursive"; sourceTree = BUILT_PRODUCTS_DIR; }; 1FA2A9E922E62BF600F53888 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; @@ -654,6 +654,7 @@ 1FCA51B622E6562800D55269 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; 1FD9F0CD21B9E90700FB866A /* build.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = build.sh; path = installer/build.sh; sourceTree = ""; }; 1FD9F0CF21B9EAA300FB866A /* distribution.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = distribution.xml; path = installer/distribution.xml; sourceTree = ""; }; + 1FDE256A24D75B4900CBC605 /* vendor-tcl.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; name = "vendor-tcl.sh"; path = "darwinxref/vendor-tcl.sh"; sourceTree = ""; }; 1FEA10392264FBCF008B675D /* notarize.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = notarize.sh; path = installer/notarize.sh; sourceTree = ""; }; 1FECB5DE1FBBBC09002EA059 /* setXcodePlatform */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = setXcodePlatform; path = darwinbuild/setXcodePlatform; sourceTree = ""; }; 1FF4AFCB22E5237B002F09C6 /* Utilities.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utilities.swift; sourceTree = ""; }; @@ -698,7 +699,6 @@ 725740861097AF30008AD4D7 /* version.so */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.objfile"; includeInIndex = 0; path = version.so; sourceTree = BUILT_PRODUCTS_DIR; }; 725749A01097697300B13BC3 /* darwinxref */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = darwinxref; sourceTree = BUILT_PRODUCTS_DIR; }; 72574A0F10977F7A00B13BC3 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = ""; }; - 72574A1410977FAD00B13BC3 /* libtcl.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libtcl.dylib; path = /usr/lib/libtcl.dylib; sourceTree = ""; }; 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = c_plugins.xcconfig; sourceTree = ""; }; 72574B591097A36300B13BC3 /* configuration.so */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.objfile"; includeInIndex = 0; path = configuration.so; sourceTree = BUILT_PRODUCTS_DIR; }; 72C86BD910965E0A00C66E90 /* darwintrace.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = darwintrace.c; path = darwintrace/darwintrace.c; sourceTree = ""; }; @@ -746,7 +746,6 @@ 72C86C2E1096600B00C66E90 /* manifest.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = manifest.c; path = darwinbuild/manifest.c; sourceTree = ""; }; 72C86C381096607900C66E90 /* darwinbuild */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = darwinbuild; sourceTree = BUILT_PRODUCTS_DIR; }; 72C86C52109660CA00C66E90 /* darwintrace.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = darwintrace.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; - 72C86CE310974CC800C66E90 /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = /usr/lib/libsqlite3.dylib; sourceTree = ""; }; 72D05CA911D2678F00B33EDD /* query.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = query.c; sourceTree = ""; }; 72D05CB711D267C400B33EDD /* query.so */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.objfile"; includeInIndex = 0; path = query.so; sourceTree = BUILT_PRODUCTS_DIR; }; DF6BE300132C5EBD00793781 /* close-test */ = {isa = PBXFileReference; lastKnownFileType = text; path = "close-test"; sourceTree = ""; }; @@ -961,9 +960,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 725749B610976AFE00B13BC3 /* libsqlite3.dylib in Frameworks */, + 1F7298EB24D75A200006E19E /* libsqlite3.tbd in Frameworks */, 72574A1010977F7A00B13BC3 /* CoreFoundation.framework in Frameworks */, - 72574A1510977FAD00B13BC3 /* libtcl.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -991,6 +989,14 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 1F7298E924D759FF0006E19E /* Frameworks */ = { + isa = PBXGroup; + children = ( + 1F7298EA24D759FF0006E19E /* libsqlite3.tbd */, + ); + name = Frameworks; + sourceTree = ""; + }; 1FA2A9E822E62BF600F53888 /* darwinbuild-recursive */ = { isa = PBXGroup; children = ( @@ -1048,10 +1054,9 @@ 72C86BD510965DC900C66E90 /* darwinbuild */, 1FD9F0CE21B9E90C00FB866A /* installer */, 1FB1351522E522B5005E9A88 /* swift */, + 1F7298E924D759FF0006E19E /* Frameworks */, 72C86C391096607900C66E90 /* Products */, - 72C86CE310974CC800C66E90 /* libsqlite3.dylib */, 72574A0F10977F7A00B13BC3 /* CoreFoundation.framework */, - 72574A1410977FAD00B13BC3 /* libtcl.dylib */, 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */, ); sourceTree = ""; @@ -1088,6 +1093,7 @@ 72C86BEE10965E7500C66E90 /* DBPluginPriv.h */, 72C86BEF10965E7500C66E90 /* DBTclPlugin.c */, 72C86BF010965E7500C66E90 /* main.c */, + 1FDE256A24D75B4900CBC605 /* vendor-tcl.sh */, 1F9D9647226516AA0024E830 /* darwinxref.entitlements */, ); name = darwinxref; @@ -1764,6 +1770,7 @@ isa = PBXNativeTarget; buildConfigurationList = 725749A61097699B00B13BC3 /* Build configuration list for PBXNativeTarget "darwinxref" */; buildPhases = ( + 1FDE256B24D75BFD00CBC605 /* Vendor Tcl */, 7257499D1097697300B13BC3 /* Sources */, 7257499E1097697300B13BC3 /* Frameworks */, 7227AB69109899DE00BE33D7 /* Headers */, @@ -1994,6 +2001,25 @@ shellScript = "mkdir -p $DSTROOT/$DATDIR/darwinbuild\n/bin/cp $BUILT_PRODUCTS_DIR/thinPackages $DSTROOT/$DATDIR/darwinbuild/thinPackages"; showEnvVarsInLog = 0; }; + 1FDE256B24D75BFD00CBC605 /* Vendor Tcl */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 12; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Vendor Tcl"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "exec $SRCROOT/darwinxref/vendor-tcl.sh\n"; + }; 7227AB8F1098A89700BE33D7 /* Run Script */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -3458,14 +3484,17 @@ CODE_SIGN_STYLE = Manual; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = "$(BINDIR)"; + MACOSX_DEPLOYMENT_TARGET = 10.15; OTHER_CFLAGS = ( "-DHAVE_TCL_PLUGINS=1", "-DDEFAULT_PLUGIN_PATH=\\\"$(DATDIR)/darwinxref/plugins\\\"", "-DDEFAULT_DB_FILE=\\\".build/xref.db\\\"", ); + OTHER_LDFLAGS = "$(BUILT_PRODUCTS_DIR)/libtcl8.6.dylib"; PRODUCT_NAME = darwinxref; PROVISIONING_PROFILE_SPECIFIER = ""; PUBLIC_HEADERS_FOLDER_PATH = "$(INCDIR)/darwinbuild"; + SYSTEM_HEADER_SEARCH_PATHS = "/usr/local/opt/tcl-tk/include"; }; name = Debug; }; @@ -3479,14 +3508,17 @@ CODE_SIGN_STYLE = Manual; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = "$(BINDIR)"; + MACOSX_DEPLOYMENT_TARGET = 10.15; OTHER_CFLAGS = ( "-DHAVE_TCL_PLUGINS=1", "-DDEFAULT_PLUGIN_PATH=\\\"$(DATDIR)/darwinxref/plugins\\\"", "-DDEFAULT_DB_FILE=\\\".build/xref.db\\\"", ); + OTHER_LDFLAGS = "$(BUILT_PRODUCTS_DIR)/libtcl8.6.dylib"; PRODUCT_NAME = darwinxref; PROVISIONING_PROFILE_SPECIFIER = ""; PUBLIC_HEADERS_FOLDER_PATH = "$(INCDIR)/darwinbuild"; + SYSTEM_HEADER_SEARCH_PATHS = "/usr/local/opt/tcl-tk/include"; }; name = Release; }; @@ -3511,6 +3543,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = x86_64; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; @@ -3577,6 +3610,7 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = x86_64; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; diff --git a/darwinxref/vendor-tcl.sh b/darwinxref/vendor-tcl.sh new file mode 100755 index 0000000..e898c97 --- /dev/null +++ b/darwinxref/vendor-tcl.sh @@ -0,0 +1,14 @@ +#!/bin/zsh -e + +if [ ! -f $BUILT_PRODUCTS_DIR/libtcl8.6.dylib ]; then + cp /usr/local/opt/tcl-tk/lib/libtcl8.6.dylib $BUILT_PRODUCTS_DIR + chmod u+w $BUILT_PRODUCTS_DIR/libtcl8.6.dylib + install_name_tool -id '@loader_path/../share/darwinbuild/libtcl8.6.dylib' $BUILT_PRODUCTS_DIR/libtcl8.6.dylib +fi + +if [ "$ACTION" = "install" ]; then + mkdir -p $DSTROOT/usr/local/share/darwinbuild + install -o $INSTALL_OWNER -g $INSTALL_GROUP -m $INSTALL_MODE_FLAG \ + $BUILT_PRODUCTS_DIR/libtcl8.6.dylib \ + $DSTROOT/usr/local/share/darwinbuild +fi From 2ad3a6ccb5e384e7b47780a2292becba9d88b74c Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 2 Aug 2020 17:06:22 -0400 Subject: [PATCH 303/382] Add ~n suffixes before the filename extension This ensures that build log files will always in '.log', which enables the Finder and other applications to automaticllly recognize them as text files. Previously, the build number was appended at the end of the extension, resulting in filenames like "AvailabilityVersions-45.5.log~5". The new filename would be "AvailabilityVersions-45.5~5.log". I also made the same change to the .trace files emitted when you pass the -logdeps flag to darwinbuild, which now always end in '.deps.log'. --- darwinbuild/darwinbuild.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 33e3d79..d914eed 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -620,7 +620,7 @@ fi version="${project/$projnam-/}" build_version=$(($(GetBuildVersion $DARWIN_BUILDROOT/{Logs,Symbols,Headers,Roots}/$projnam/$project.*) + 1)) -LOG="$DARWIN_BUILDROOT/Logs/$projnam/$project.log~$build_version" +LOG="$DARWIN_BUILDROOT/Logs/$projnam/$project~${build_version}.log" TRACELOG="$BuildRoot/private/var/tmp/$projnam/$project.trace~$build_version" mkdir -p "$DARWIN_BUILDROOT/Logs/$projnam" @@ -872,7 +872,7 @@ if [ "$EXIT_STATUS" == "0" ]; then sort -u | \ "$DARWINXREF" loadDeps "$projnam" "$prefix" "$DARWINXREF" resolveDeps -commit "$projnam" - cp "$TRACELOG" $DARWIN_BUILDROOT/Logs/$projnam/$project.trace~$build_version + cp "$TRACELOG" $DARWIN_BUILDROOT/Logs/$projnam/$project~${build_version}.deps.log fi fi fi From 51ca0c250c998d483891ed36b032ae4972237233 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 3 Aug 2020 22:19:14 -0400 Subject: [PATCH 304/382] Install vendored copy of libtcl to share/darwinxref --- darwinxref/vendor-tcl.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/darwinxref/vendor-tcl.sh b/darwinxref/vendor-tcl.sh index e898c97..4709cb5 100755 --- a/darwinxref/vendor-tcl.sh +++ b/darwinxref/vendor-tcl.sh @@ -3,12 +3,12 @@ if [ ! -f $BUILT_PRODUCTS_DIR/libtcl8.6.dylib ]; then cp /usr/local/opt/tcl-tk/lib/libtcl8.6.dylib $BUILT_PRODUCTS_DIR chmod u+w $BUILT_PRODUCTS_DIR/libtcl8.6.dylib - install_name_tool -id '@loader_path/../share/darwinbuild/libtcl8.6.dylib' $BUILT_PRODUCTS_DIR/libtcl8.6.dylib + install_name_tool -id '@loader_path/../share/darwinxref/libtcl8.6.dylib' $BUILT_PRODUCTS_DIR/libtcl8.6.dylib fi if [ "$ACTION" = "install" ]; then - mkdir -p $DSTROOT/usr/local/share/darwinbuild + mkdir -p $DSTROOT/usr/local/share/darwinxref install -o $INSTALL_OWNER -g $INSTALL_GROUP -m $INSTALL_MODE_FLAG \ $BUILT_PRODUCTS_DIR/libtcl8.6.dylib \ - $DSTROOT/usr/local/share/darwinbuild + $DSTROOT/usr/local/share/darwinxref fi From f5976f662a3a7326ea4c453a81917f76d8f413d2 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 3 Aug 2020 22:24:57 -0400 Subject: [PATCH 305/382] Link binary darwinxref plugins against vendored libtcl --- darwinbuild.xcodeproj/project.pbxproj | 2 ++ darwinxref/plugins/c_plugins.xcconfig | 2 +- darwinxref/vendor-tcl.sh | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index c0c69a8..3a70b26 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -3484,6 +3484,7 @@ CODE_SIGN_STYLE = Manual; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = "$(BINDIR)"; + LD_RUNPATH_SEARCH_PATHS = "@loader_path/../share/darwinxref"; MACOSX_DEPLOYMENT_TARGET = 10.15; OTHER_CFLAGS = ( "-DHAVE_TCL_PLUGINS=1", @@ -3508,6 +3509,7 @@ CODE_SIGN_STYLE = Manual; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = "$(BINDIR)"; + LD_RUNPATH_SEARCH_PATHS = "@loader_path/../share/darwinxref"; MACOSX_DEPLOYMENT_TARGET = 10.15; OTHER_CFLAGS = ( "-DHAVE_TCL_PLUGINS=1", diff --git a/darwinxref/plugins/c_plugins.xcconfig b/darwinxref/plugins/c_plugins.xcconfig index 6054d37..8d211aa 100644 --- a/darwinxref/plugins/c_plugins.xcconfig +++ b/darwinxref/plugins/c_plugins.xcconfig @@ -41,7 +41,7 @@ GCC_WARN_UNUSED_LABEL = YES GCC_WARN_UNUSED_VALUE = YES GCC_WARN_UNUSED_VARIABLE = YES OTHER_CFLAGS = -OTHER_LDFLAGS = -framework CoreFoundation -ltcl -lsqlite3 +OTHER_LDFLAGS = -framework CoreFoundation -lsqlite3 $(BUILT_PRODUCTS_DIR)/libtcl8.6.dylib -rpath "@loader_path/.." PRODUCT_NAME = $(TARGET_NAME) WARNING_CFLAGS = -Werror -Wall PREFIX = /usr/local diff --git a/darwinxref/vendor-tcl.sh b/darwinxref/vendor-tcl.sh index 4709cb5..a0b1372 100755 --- a/darwinxref/vendor-tcl.sh +++ b/darwinxref/vendor-tcl.sh @@ -3,7 +3,7 @@ if [ ! -f $BUILT_PRODUCTS_DIR/libtcl8.6.dylib ]; then cp /usr/local/opt/tcl-tk/lib/libtcl8.6.dylib $BUILT_PRODUCTS_DIR chmod u+w $BUILT_PRODUCTS_DIR/libtcl8.6.dylib - install_name_tool -id '@loader_path/../share/darwinxref/libtcl8.6.dylib' $BUILT_PRODUCTS_DIR/libtcl8.6.dylib + install_name_tool -id '@rpath/libtcl8.6.dylib' $BUILT_PRODUCTS_DIR/libtcl8.6.dylib fi if [ "$ACTION" = "install" ]; then From ea11ba1d0b63d9671947246aec3ab34e43fa3773 Mon Sep 17 00:00:00 2001 From: William Kent Date: Wed, 5 Aug 2020 22:07:46 -0400 Subject: [PATCH 306/382] Fix signing errors in Xcode project Stupidly, Xcode insists on changing my signing settings from the working values I have set to a completely broken alternative that only works for bundled apps. This is not the first time this has happened. --- darwinbuild.xcodeproj/project.pbxproj | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 3a70b26..6c14ff4 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -2743,7 +2743,6 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_IDENTITY = "-"; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_HARDENED_RUNTIME = YES; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -2781,7 +2780,6 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_IDENTITY = "-"; ENABLE_HARDENED_RUNTIME = YES; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -2812,7 +2810,6 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_IDENTITY = "-"; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_HARDENED_RUNTIME = YES; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -2848,7 +2845,6 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_IDENTITY = "-"; ENABLE_HARDENED_RUNTIME = YES; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -2878,7 +2874,6 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_IDENTITY = "-"; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_HARDENED_RUNTIME = YES; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -2915,7 +2910,6 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_IDENTITY = "-"; ENABLE_HARDENED_RUNTIME = YES; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -2955,7 +2949,6 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = digest; @@ -2968,7 +2961,6 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = digest; @@ -2999,7 +2991,6 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = manifest; @@ -3012,7 +3003,6 @@ baseConfigurationReference = 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; INSTALL_PATH = "$(DATDIR)/darwinbuild"; PRODUCT_NAME = manifest; @@ -3480,7 +3470,6 @@ buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; CODE_SIGN_ENTITLEMENTS = darwinxref/darwinxref.entitlements; - CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = "$(BINDIR)"; @@ -3505,7 +3494,6 @@ buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; CODE_SIGN_ENTITLEMENTS = darwinxref/darwinxref.entitlements; - CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = "$(BINDIR)"; From 0ab7fafaebc1c1be8bc14723d9a86bd8a34a22fb Mon Sep 17 00:00:00 2001 From: William Kent Date: Wed, 5 Aug 2020 22:17:39 -0400 Subject: [PATCH 307/382] Install libtcl8.6.dylib using Xcode This change ensures that the binary is properly codesigned. --- .gitignore | 3 +++ darwinbuild.xcodeproj/project.pbxproj | 22 ++++++++++++++++++++-- darwinxref/plugins/c_plugins.xcconfig | 2 +- darwinxref/vendor-tcl.sh | 15 +++------------ 4 files changed, 27 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 99f4bf2..1864647 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,9 @@ build/ darwinbuild.xcodeproj/project.xcworkspace/ darwinbuild.xcodeproj/xcuserdata/ +# Build byproduct files +darwinxref/libtcl8.6.dylib + # Installer files *.pkg installer/payload diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 6c14ff4..116d965 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -100,6 +100,7 @@ 1FCA51B722E6562800D55269 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FCA51B622E6562800D55269 /* main.swift */; }; 1FCA51BC22E6562F00D55269 /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FF4AFCB22E5237B002F09C6 /* Utilities.swift */; }; 1FCA51BF22E6563C00D55269 /* SwiftCLI in Frameworks */ = {isa = PBXBuildFile; productRef = 1FCA51BE22E6563C00D55269 /* SwiftCLI */; }; + 1FDE55C024DB9DE1009ED847 /* libtcl8.6.dylib in Copy libtcl8.6.dylib */ = {isa = PBXBuildFile; fileRef = 1FDE55BD24DB9DBD009ED847 /* libtcl8.6.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 1FECB5DF1FBBBD41002EA059 /* setXcodePlatform in Copy Files */ = {isa = PBXBuildFile; fileRef = 1FECB5DE1FBBBC09002EA059 /* setXcodePlatform */; }; 1FF4AFCC22E5237B002F09C6 /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FF4AFCB22E5237B002F09C6 /* Utilities.swift */; }; 3963011A1EAB4D60006081C7 /* source_sites.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86C0E10965EEA00C66E90 /* source_sites.c */; }; @@ -606,6 +607,17 @@ ); runOnlyForDeploymentPostprocessing = 1; }; + 1FDE55BF24DB9DD1009ED847 /* Copy libtcl8.6.dylib */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 8; + dstPath = /usr/local/share/darwinxref; + dstSubfolderSpec = 0; + files = ( + 1FDE55C024DB9DE1009ED847 /* libtcl8.6.dylib in Copy libtcl8.6.dylib */, + ); + name = "Copy libtcl8.6.dylib"; + runOnlyForDeploymentPostprocessing = 1; + }; 7227AB3C1098977C00BE33D7 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 8; @@ -655,6 +667,7 @@ 1FD9F0CD21B9E90700FB866A /* build.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = build.sh; path = installer/build.sh; sourceTree = ""; }; 1FD9F0CF21B9EAA300FB866A /* distribution.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = distribution.xml; path = installer/distribution.xml; sourceTree = ""; }; 1FDE256A24D75B4900CBC605 /* vendor-tcl.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; name = "vendor-tcl.sh"; path = "darwinxref/vendor-tcl.sh"; sourceTree = ""; }; + 1FDE55BD24DB9DBD009ED847 /* libtcl8.6.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libtcl8.6.dylib; path = darwinxref/libtcl8.6.dylib; sourceTree = ""; }; 1FEA10392264FBCF008B675D /* notarize.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = notarize.sh; path = installer/notarize.sh; sourceTree = ""; }; 1FECB5DE1FBBBC09002EA059 /* setXcodePlatform */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = setXcodePlatform; path = darwinbuild/setXcodePlatform; sourceTree = ""; }; 1FF4AFCB22E5237B002F09C6 /* Utilities.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utilities.swift; sourceTree = ""; }; @@ -1094,6 +1107,7 @@ 72C86BEF10965E7500C66E90 /* DBTclPlugin.c */, 72C86BF010965E7500C66E90 /* main.c */, 1FDE256A24D75B4900CBC605 /* vendor-tcl.sh */, + 1FDE55BD24DB9DBD009ED847 /* libtcl8.6.dylib */, 1F9D9647226516AA0024E830 /* darwinxref.entitlements */, ); name = darwinxref; @@ -1774,6 +1788,7 @@ 7257499D1097697300B13BC3 /* Sources */, 7257499E1097697300B13BC3 /* Frameworks */, 7227AB69109899DE00BE33D7 /* Headers */, + 1FDE55BF24DB9DD1009ED847 /* Copy libtcl8.6.dylib */, ); buildRules = ( ); @@ -2010,15 +2025,18 @@ inputFileListPaths = ( ); inputPaths = ( + "$(SRCROOT)/darwinxref/vendor-tcl.sh", ); name = "Vendor Tcl"; outputFileListPaths = ( ); outputPaths = ( + "$(SRCROOT)/darwinxref/libtcl8.6.dylib", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "exec $SRCROOT/darwinxref/vendor-tcl.sh\n"; + showEnvVarsInLog = 0; }; 7227AB8F1098A89700BE33D7 /* Run Script */ = { isa = PBXShellScriptBuildPhase; @@ -3480,7 +3498,7 @@ "-DDEFAULT_PLUGIN_PATH=\\\"$(DATDIR)/darwinxref/plugins\\\"", "-DDEFAULT_DB_FILE=\\\".build/xref.db\\\"", ); - OTHER_LDFLAGS = "$(BUILT_PRODUCTS_DIR)/libtcl8.6.dylib"; + OTHER_LDFLAGS = "$(SRCROOT)/darwinxref/libtcl8.6.dylib"; PRODUCT_NAME = darwinxref; PROVISIONING_PROFILE_SPECIFIER = ""; PUBLIC_HEADERS_FOLDER_PATH = "$(INCDIR)/darwinbuild"; @@ -3504,7 +3522,7 @@ "-DDEFAULT_PLUGIN_PATH=\\\"$(DATDIR)/darwinxref/plugins\\\"", "-DDEFAULT_DB_FILE=\\\".build/xref.db\\\"", ); - OTHER_LDFLAGS = "$(BUILT_PRODUCTS_DIR)/libtcl8.6.dylib"; + OTHER_LDFLAGS = "$(SRCROOT)/darwinxref/libtcl8.6.dylib"; PRODUCT_NAME = darwinxref; PROVISIONING_PROFILE_SPECIFIER = ""; PUBLIC_HEADERS_FOLDER_PATH = "$(INCDIR)/darwinbuild"; diff --git a/darwinxref/plugins/c_plugins.xcconfig b/darwinxref/plugins/c_plugins.xcconfig index 8d211aa..3020e37 100644 --- a/darwinxref/plugins/c_plugins.xcconfig +++ b/darwinxref/plugins/c_plugins.xcconfig @@ -41,7 +41,7 @@ GCC_WARN_UNUSED_LABEL = YES GCC_WARN_UNUSED_VALUE = YES GCC_WARN_UNUSED_VARIABLE = YES OTHER_CFLAGS = -OTHER_LDFLAGS = -framework CoreFoundation -lsqlite3 $(BUILT_PRODUCTS_DIR)/libtcl8.6.dylib -rpath "@loader_path/.." +OTHER_LDFLAGS = -framework CoreFoundation -lsqlite3 $(SRCROOT)/darwinxref/libtcl8.6.dylib -rpath "@loader_path/.." PRODUCT_NAME = $(TARGET_NAME) WARNING_CFLAGS = -Werror -Wall PREFIX = /usr/local diff --git a/darwinxref/vendor-tcl.sh b/darwinxref/vendor-tcl.sh index a0b1372..d063a42 100755 --- a/darwinxref/vendor-tcl.sh +++ b/darwinxref/vendor-tcl.sh @@ -1,14 +1,5 @@ #!/bin/zsh -e -if [ ! -f $BUILT_PRODUCTS_DIR/libtcl8.6.dylib ]; then - cp /usr/local/opt/tcl-tk/lib/libtcl8.6.dylib $BUILT_PRODUCTS_DIR - chmod u+w $BUILT_PRODUCTS_DIR/libtcl8.6.dylib - install_name_tool -id '@rpath/libtcl8.6.dylib' $BUILT_PRODUCTS_DIR/libtcl8.6.dylib -fi - -if [ "$ACTION" = "install" ]; then - mkdir -p $DSTROOT/usr/local/share/darwinxref - install -o $INSTALL_OWNER -g $INSTALL_GROUP -m $INSTALL_MODE_FLAG \ - $BUILT_PRODUCTS_DIR/libtcl8.6.dylib \ - $DSTROOT/usr/local/share/darwinxref -fi +cp /usr/local/opt/tcl-tk/lib/libtcl8.6.dylib $SRCROOT/darwinxref +chmod 644 $SRCROOT/darwinxref/libtcl8.6.dylib +install_name_tool -id '@rpath/libtcl8.6.dylib' $SRCROOT/darwinxref/libtcl8.6.dylib From eacef6974c82cfe0f4923a442f4fbe3632812bb5 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 17 Aug 2020 13:37:04 -0400 Subject: [PATCH 308/382] Remove subversion integration No one uses subversion anymore. Certainly not us. --- darwinbuild/darwinbuild.common | 21 --------------------- darwinbuild/darwinbuild.in | 12 ------------ 2 files changed, 33 deletions(-) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index 4527c28..de0868e 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -89,27 +89,6 @@ function GetBuildVersion() { CURLARGS=${CURLARGS:-} -### -### Checkout or update a project from subversion repository -### -function CheckoutOrUpdate() { - local destination="$1" - local branch="$2" - local master_sites="$3" - - for master_site in $master_sites ; - do - if [ ! -d "$destination/.svn" ]; then - echo "Checking out working copy" - mkdir -p "$destination" - svn co "$master_site/$branch" "$destination" && break - else - echo "Updating working copy" - svn up "$destination" && break - fi - done -} - ### ### Download a .tar.gz file ### diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index d914eed..d7c5220 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -413,13 +413,6 @@ if [ "$project" == "" ]; then exit 1 fi -# check for the project being subversion based -branch=$($DARWINXREF branch $projnam) -if [ "$branch" != "" ]; then - # using subversion implies nosource - nosource="YES" -fi - ### ### Download the sources, ### and any applicable patches. @@ -511,11 +504,6 @@ if [ "$nosource" != "YES" ]; then fi fi -if [ "$branch" != "" ]; then - mkdir -p "$SRCROOT" "$OBJROOT" "$SYMROOT" "$DSTROOT" - CheckoutOrUpdate "$SRCROOT" "$branch" "$($DARWINXREF source_sites $projnam)" -fi - # you can avoid registering patches in the DB by using "xnu-792--patches.tar.gz" if [ -r "$SourceCache/$project-patches.tar.gz" -a "$nosource" != "YES" ]; then tar xzf "$SourceCache/$project-patches.tar.gz" From 52f0634daec9092162c5c25568fc7e87d87a6d28 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 17 Aug 2020 13:39:05 -0400 Subject: [PATCH 309/382] Error out if patch not downloaded This has bitten me many, many times. --- darwinbuild/darwinbuild.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index d7c5220..2388367 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -450,6 +450,11 @@ if [ "$nosource" != "YES" ]; then patchfilenames=$($DARWINXREF patchfiles $projnam) for p in $patchfilenames; do Download "$SourceCache" "$p" "$($DARWINXREF patch_sites $projnam)" + + if [ ! -f "$SourceCache/$p" ]; then + echo "ERROR: Patch could not be found: $p" 1>&2 + exit 1 + fi done ### If we are doing a -fetch, stop here. From 19ef143b5b1555190400525169db64097112a20b Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 17 Aug 2020 13:42:30 -0400 Subject: [PATCH 310/382] Remove branch command from darwinxref --- darwinbuild.xcodeproj/project.pbxproj | 4 ---- darwinxref/plugins/branch.tcl | 3 --- 2 files changed, 7 deletions(-) delete mode 100644 darwinxref/plugins/branch.tcl diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 116d965..d34a4eb 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -109,7 +109,6 @@ 61E0A6BD10A8DCC700DA7EBC /* exportIndex.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BFF10965EEA00C66E90 /* exportIndex.c */; }; 720BE2F4120C90C500B3C4A5 /* digest.c in Sources */ = {isa = PBXBuildFile; fileRef = 720BE2E9120C909E00B3C4A5 /* digest.c */; }; 7227AB41109897D500BE33D7 /* binary_sites.tcl in CopyFiles */ = {isa = PBXBuildFile; fileRef = 72C86BF310965EEA00C66E90 /* binary_sites.tcl */; }; - 7227AB42109897D500BE33D7 /* branch.tcl in CopyFiles */ = {isa = PBXBuildFile; fileRef = 72C86BF410965EEA00C66E90 /* branch.tcl */; }; 7227AB43109897D500BE33D7 /* currentBuild.tcl in CopyFiles */ = {isa = PBXBuildFile; fileRef = 72C86BF610965EEA00C66E90 /* currentBuild.tcl */; }; 7227AB44109897D500BE33D7 /* darwin.tcl in CopyFiles */ = {isa = PBXBuildFile; fileRef = 72C86BF710965EEA00C66E90 /* darwin.tcl */; }; 7227AB45109897D500BE33D7 /* group.tcl in CopyFiles */ = {isa = PBXBuildFile; fileRef = 72C86C0210965EEA00C66E90 /* group.tcl */; }; @@ -625,7 +624,6 @@ dstSubfolderSpec = 0; files = ( 7227AB41109897D500BE33D7 /* binary_sites.tcl in CopyFiles */, - 7227AB42109897D500BE33D7 /* branch.tcl in CopyFiles */, 7227AB43109897D500BE33D7 /* currentBuild.tcl in CopyFiles */, 396301291EAB5DBC006081C7 /* patch_sites.tcl in CopyFiles */, 7227AB44109897D500BE33D7 /* darwin.tcl in CopyFiles */, @@ -725,7 +723,6 @@ 72C86BEF10965E7500C66E90 /* DBTclPlugin.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = DBTclPlugin.c; path = darwinxref/DBTclPlugin.c; sourceTree = ""; }; 72C86BF010965E7500C66E90 /* main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = main.c; path = darwinxref/main.c; sourceTree = ""; }; 72C86BF310965EEA00C66E90 /* binary_sites.tcl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = binary_sites.tcl; sourceTree = ""; }; - 72C86BF410965EEA00C66E90 /* branch.tcl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = branch.tcl; sourceTree = ""; }; 72C86BF510965EEA00C66E90 /* configuration.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = configuration.c; sourceTree = ""; }; 72C86BF610965EEA00C66E90 /* currentBuild.tcl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = currentBuild.tcl; sourceTree = ""; }; 72C86BF710965EEA00C66E90 /* darwin.tcl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = darwin.tcl; sourceTree = ""; }; @@ -1127,7 +1124,6 @@ 396301281EAB5DB5006081C7 /* patch_sites.tcl */, 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */, 72C86BF310965EEA00C66E90 /* binary_sites.tcl */, - 72C86BF410965EEA00C66E90 /* branch.tcl */, 72C86BF510965EEA00C66E90 /* configuration.c */, 72C86BF610965EEA00C66E90 /* currentBuild.tcl */, 72C86BF710965EEA00C66E90 /* darwin.tcl */, diff --git a/darwinxref/plugins/branch.tcl b/darwinxref/plugins/branch.tcl deleted file mode 100644 index 94f66e7..0000000 --- a/darwinxref/plugins/branch.tcl +++ /dev/null @@ -1,3 +0,0 @@ -DBPluginSetName branch -DBPluginSetType property.project -DBPluginSetDatatype string From 9d708e5ba8256f5f156ca21245a3c5084047397a Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 17 Aug 2020 13:45:49 -0400 Subject: [PATCH 311/382] Do not use linker flags to link darwinxref with libtcl --- darwinbuild.xcodeproj/project.pbxproj | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index d34a4eb..42c502d 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -102,6 +102,7 @@ 1FCA51BF22E6563C00D55269 /* SwiftCLI in Frameworks */ = {isa = PBXBuildFile; productRef = 1FCA51BE22E6563C00D55269 /* SwiftCLI */; }; 1FDE55C024DB9DE1009ED847 /* libtcl8.6.dylib in Copy libtcl8.6.dylib */ = {isa = PBXBuildFile; fileRef = 1FDE55BD24DB9DBD009ED847 /* libtcl8.6.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 1FECB5DF1FBBBD41002EA059 /* setXcodePlatform in Copy Files */ = {isa = PBXBuildFile; fileRef = 1FECB5DE1FBBBC09002EA059 /* setXcodePlatform */; }; + 1FF3C41A24EAF989002A5356 /* libtcl8.6.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FDE55BD24DB9DBD009ED847 /* libtcl8.6.dylib */; }; 1FF4AFCC22E5237B002F09C6 /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FF4AFCB22E5237B002F09C6 /* Utilities.swift */; }; 3963011A1EAB4D60006081C7 /* source_sites.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86C0E10965EEA00C66E90 /* source_sites.c */; }; 396301211EAB4E01006081C7 /* patch_sites.c in Sources */ = {isa = PBXBuildFile; fileRef = 396301191EAB42B6006081C7 /* patch_sites.c */; }; @@ -972,6 +973,7 @@ files = ( 1F7298EB24D75A200006E19E /* libsqlite3.tbd in Frameworks */, 72574A1010977F7A00B13BC3 /* CoreFoundation.framework in Frameworks */, + 1FF3C41A24EAF989002A5356 /* libtcl8.6.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3488,13 +3490,16 @@ GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = "$(BINDIR)"; LD_RUNPATH_SEARCH_PATHS = "@loader_path/../share/darwinxref"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/darwinxref", + ); MACOSX_DEPLOYMENT_TARGET = 10.15; OTHER_CFLAGS = ( "-DHAVE_TCL_PLUGINS=1", "-DDEFAULT_PLUGIN_PATH=\\\"$(DATDIR)/darwinxref/plugins\\\"", "-DDEFAULT_DB_FILE=\\\".build/xref.db\\\"", ); - OTHER_LDFLAGS = "$(SRCROOT)/darwinxref/libtcl8.6.dylib"; PRODUCT_NAME = darwinxref; PROVISIONING_PROFILE_SPECIFIER = ""; PUBLIC_HEADERS_FOLDER_PATH = "$(INCDIR)/darwinbuild"; @@ -3512,13 +3517,16 @@ GCC_SYMBOLS_PRIVATE_EXTERN = NO; INSTALL_PATH = "$(BINDIR)"; LD_RUNPATH_SEARCH_PATHS = "@loader_path/../share/darwinxref"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/darwinxref", + ); MACOSX_DEPLOYMENT_TARGET = 10.15; OTHER_CFLAGS = ( "-DHAVE_TCL_PLUGINS=1", "-DDEFAULT_PLUGIN_PATH=\\\"$(DATDIR)/darwinxref/plugins\\\"", "-DDEFAULT_DB_FILE=\\\".build/xref.db\\\"", ); - OTHER_LDFLAGS = "$(SRCROOT)/darwinxref/libtcl8.6.dylib"; PRODUCT_NAME = darwinxref; PROVISIONING_PROFILE_SPECIFIER = ""; PUBLIC_HEADERS_FOLDER_PATH = "$(INCDIR)/darwinbuild"; From bae15fc16eb2ea730e6ed25aa0a6553865077148 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 17 Aug 2020 13:46:01 -0400 Subject: [PATCH 312/382] Minor cleanup --- darwinbuild.xcodeproj/project.pbxproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 42c502d..e74b128 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -669,6 +669,7 @@ 1FDE55BD24DB9DBD009ED847 /* libtcl8.6.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libtcl8.6.dylib; path = darwinxref/libtcl8.6.dylib; sourceTree = ""; }; 1FEA10392264FBCF008B675D /* notarize.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = notarize.sh; path = installer/notarize.sh; sourceTree = ""; }; 1FECB5DE1FBBBC09002EA059 /* setXcodePlatform */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = setXcodePlatform; path = darwinbuild/setXcodePlatform; sourceTree = ""; }; + 1FF3C41B24EAF9D2002A5356 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = ../../../../System/Library/Frameworks/CoreFoundation.framework; sourceTree = ""; }; 1FF4AFCB22E5237B002F09C6 /* Utilities.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utilities.swift; sourceTree = ""; }; 396301191EAB42B6006081C7 /* patch_sites.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = patch_sites.c; sourceTree = ""; }; 396301271EAB4E01006081C7 /* patch_sites.so */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.objfile"; includeInIndex = 0; path = patch_sites.so; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -1004,6 +1005,7 @@ 1F7298E924D759FF0006E19E /* Frameworks */ = { isa = PBXGroup; children = ( + 1FF3C41B24EAF9D2002A5356 /* CoreFoundation.framework */, 1F7298EA24D759FF0006E19E /* libsqlite3.tbd */, ); name = Frameworks; From a5d829d10bd85342aba1c20a3867bb8946230201 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 17 Aug 2020 14:26:42 -0400 Subject: [PATCH 313/382] Revert "Add ~n suffixes before the filename extension" This broke GetBuildVersion(), and many other things within darwinbuild, since it could no longer correctly determine the build number. This reverts commit 2ad3a6ccb5e384e7b47780a2292becba9d88b74c. --- darwinbuild/darwinbuild.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index d914eed..33e3d79 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -620,7 +620,7 @@ fi version="${project/$projnam-/}" build_version=$(($(GetBuildVersion $DARWIN_BUILDROOT/{Logs,Symbols,Headers,Roots}/$projnam/$project.*) + 1)) -LOG="$DARWIN_BUILDROOT/Logs/$projnam/$project~${build_version}.log" +LOG="$DARWIN_BUILDROOT/Logs/$projnam/$project.log~$build_version" TRACELOG="$BuildRoot/private/var/tmp/$projnam/$project.trace~$build_version" mkdir -p "$DARWIN_BUILDROOT/Logs/$projnam" @@ -872,7 +872,7 @@ if [ "$EXIT_STATUS" == "0" ]; then sort -u | \ "$DARWINXREF" loadDeps "$projnam" "$prefix" "$DARWINXREF" resolveDeps -commit "$projnam" - cp "$TRACELOG" $DARWIN_BUILDROOT/Logs/$projnam/$project~${build_version}.deps.log + cp "$TRACELOG" $DARWIN_BUILDROOT/Logs/$projnam/$project.trace~$build_version fi fi fi From 9186dfb9e45274cf5b808d7853e9eb471ae0c574 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 17 Aug 2020 22:31:24 -0400 Subject: [PATCH 314/382] Use CoreFoundation.framework from SDK --- darwinbuild.xcodeproj/project.pbxproj | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index e74b128..6a9b6d1 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -93,6 +93,7 @@ /* Begin PBXBuildFile section */ 1F7298EB24D75A200006E19E /* libsqlite3.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 1F7298EA24D759FF0006E19E /* libsqlite3.tbd */; }; 1F7D730D22E52DFD003F8A67 /* SwiftCLI in Frameworks */ = {isa = PBXBuildFile; productRef = 1F7D730C22E52DFD003F8A67 /* SwiftCLI */; }; + 1F8B4BA824EB74DC00CC07E5 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1F8B4BA724EB74DC00CC07E5 /* CoreFoundation.framework */; }; 1FA2A9EA22E62BF600F53888 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FA2A9E922E62BF600F53888 /* main.swift */; }; 1FA2A9EF22E62BFE00F53888 /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FF4AFCB22E5237B002F09C6 /* Utilities.swift */; }; 1FA2A9F222E62C1900F53888 /* SwiftCLI in Frameworks */ = {isa = PBXBuildFile; productRef = 1FA2A9F122E62C1900F53888 /* SwiftCLI */; }; @@ -147,7 +148,6 @@ 725749AF10976A6300B13BC3 /* DBPlugin.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BEC10965E7500C66E90 /* DBPlugin.c */; }; 725749B010976A6300B13BC3 /* DBTclPlugin.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BEF10965E7500C66E90 /* DBTclPlugin.c */; }; 725749B110976A6300B13BC3 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BF010965E7500C66E90 /* main.c */; }; - 72574A1010977F7A00B13BC3 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 72574A0F10977F7A00B13BC3 /* CoreFoundation.framework */; }; 72574B5D1097A37600B13BC3 /* configuration.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BF510965EEA00C66E90 /* configuration.c */; }; 72C86C68109663D300C66E90 /* darwintrace.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BD910965E0A00C66E90 /* darwintrace.c */; }; 72D05CB811D2680500B33EDD /* query.c in Sources */ = {isa = PBXBuildFile; fileRef = 72D05CA911D2678F00B33EDD /* query.c */; }; @@ -656,6 +656,7 @@ 1F4A793821B9F123000FE4B5 /* license.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = license.html; path = installer/license.html; sourceTree = ""; }; 1F4A793921B9F123000FE4B5 /* welcome.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = welcome.html; path = installer/welcome.html; sourceTree = ""; }; 1F7298EA24D759FF0006E19E /* libsqlite3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.tbd; path = usr/lib/libsqlite3.tbd; sourceTree = SDKROOT; }; + 1F8B4BA724EB74DC00CC07E5 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; 1F9D9647226516AA0024E830 /* darwinxref.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = darwinxref.entitlements; path = darwinxref/darwinxref.entitlements; sourceTree = ""; }; 1FA2A9E722E62BF600F53888 /* darwinbuild-recursive */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "darwinbuild-recursive"; sourceTree = BUILT_PRODUCTS_DIR; }; 1FA2A9E922E62BF600F53888 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; @@ -669,7 +670,6 @@ 1FDE55BD24DB9DBD009ED847 /* libtcl8.6.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libtcl8.6.dylib; path = darwinxref/libtcl8.6.dylib; sourceTree = ""; }; 1FEA10392264FBCF008B675D /* notarize.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = notarize.sh; path = installer/notarize.sh; sourceTree = ""; }; 1FECB5DE1FBBBC09002EA059 /* setXcodePlatform */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = setXcodePlatform; path = darwinbuild/setXcodePlatform; sourceTree = ""; }; - 1FF3C41B24EAF9D2002A5356 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = ../../../../System/Library/Frameworks/CoreFoundation.framework; sourceTree = ""; }; 1FF4AFCB22E5237B002F09C6 /* Utilities.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utilities.swift; sourceTree = ""; }; 396301191EAB42B6006081C7 /* patch_sites.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = patch_sites.c; sourceTree = ""; }; 396301271EAB4E01006081C7 /* patch_sites.so */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.objfile"; includeInIndex = 0; path = patch_sites.so; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -711,7 +711,6 @@ 7257407E1097AF0A008AD4D7 /* target.so */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.objfile"; includeInIndex = 0; path = target.so; sourceTree = BUILT_PRODUCTS_DIR; }; 725740861097AF30008AD4D7 /* version.so */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.objfile"; includeInIndex = 0; path = version.so; sourceTree = BUILT_PRODUCTS_DIR; }; 725749A01097697300B13BC3 /* darwinxref */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = darwinxref; sourceTree = BUILT_PRODUCTS_DIR; }; - 72574A0F10977F7A00B13BC3 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = ""; }; 72574B3E10979D6000B13BC3 /* c_plugins.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = c_plugins.xcconfig; sourceTree = ""; }; 72574B591097A36300B13BC3 /* configuration.so */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.objfile"; includeInIndex = 0; path = configuration.so; sourceTree = BUILT_PRODUCTS_DIR; }; 72C86BD910965E0A00C66E90 /* darwintrace.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = darwintrace.c; path = darwintrace/darwintrace.c; sourceTree = ""; }; @@ -972,8 +971,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 1F8B4BA824EB74DC00CC07E5 /* CoreFoundation.framework in Frameworks */, 1F7298EB24D75A200006E19E /* libsqlite3.tbd in Frameworks */, - 72574A1010977F7A00B13BC3 /* CoreFoundation.framework in Frameworks */, 1FF3C41A24EAF989002A5356 /* libtcl8.6.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1005,7 +1004,7 @@ 1F7298E924D759FF0006E19E /* Frameworks */ = { isa = PBXGroup; children = ( - 1FF3C41B24EAF9D2002A5356 /* CoreFoundation.framework */, + 1F8B4BA724EB74DC00CC07E5 /* CoreFoundation.framework */, 1F7298EA24D759FF0006E19E /* libsqlite3.tbd */, ); name = Frameworks; @@ -1070,7 +1069,6 @@ 1FB1351522E522B5005E9A88 /* swift */, 1F7298E924D759FF0006E19E /* Frameworks */, 72C86C391096607900C66E90 /* Products */, - 72574A0F10977F7A00B13BC3 /* CoreFoundation.framework */, 7227AB9C1098AAE100BE33D7 /* prefix.xcconfig */, ); sourceTree = ""; From 92d5339ae21f91301ae2c91ff7d09b8f3685277a Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 2 Oct 2020 13:04:31 -0400 Subject: [PATCH 315/382] Resolve Xcode update warnings --- darwinbuild.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/xcschemes/darwinbuild-codesign.xcscheme | 2 +- .../xcshareddata/xcschemes/darwinbuild-recursive.xcscheme | 2 +- darwinbuild.xcodeproj/xcshareddata/xcschemes/world.xcscheme | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 6a9b6d1..6025276 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -1872,7 +1872,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 1100; - LastUpgradeCheck = 1200; + LastUpgradeCheck = 1220; ORGANIZATIONNAME = "The DarwinBuild Project"; TargetAttributes = { 1FA2A9E622E62BF600F53888 = { diff --git a/darwinbuild.xcodeproj/xcshareddata/xcschemes/darwinbuild-codesign.xcscheme b/darwinbuild.xcodeproj/xcshareddata/xcschemes/darwinbuild-codesign.xcscheme index f19a402..0ff77fe 100644 --- a/darwinbuild.xcodeproj/xcshareddata/xcschemes/darwinbuild-codesign.xcscheme +++ b/darwinbuild.xcodeproj/xcshareddata/xcschemes/darwinbuild-codesign.xcscheme @@ -1,6 +1,6 @@ Date: Mon, 17 Aug 2020 17:01:49 -0400 Subject: [PATCH 316/382] Rewrite darwinbuild-codesign tool This tool is no longer intended to be invoked manually. It is now designed to be run by darwinbuild as a post- processing step after a build. It now locates its settings plist from within the DSTROOT, and no longer requires the path to the corresponding SRCROOT. (This was only needed to locate paths to *.entitlements files. I now know how to tell codesign to preserve the existing entitlements while re-signing everything else.) --- swift/darwinbuild-codesign/main.swift | 270 +++++++++----------------- 1 file changed, 92 insertions(+), 178 deletions(-) diff --git a/swift/darwinbuild-codesign/main.swift b/swift/darwinbuild-codesign/main.swift index c7b58d4..8ecbf43 100644 --- a/swift/darwinbuild-codesign/main.swift +++ b/swift/darwinbuild-codesign/main.swift @@ -46,9 +46,7 @@ internal extension Dictionary { class CodesignCommand: Command { let name = "darwinbuild-codesign" - private let dstroot = Key("--dstroot", "-d", description: "Code-sign the files in this directory") - private let srcroot = Key("--srcroot", "-s", description: "Path to the sources corresponding to the dstroot") - private let projectName = Key("--project", "-p", description: "Code-sign this darwinbuild output root") + private let dstroot = SwiftCLI.Parameter() private enum TimestampType { @@ -72,199 +70,115 @@ class CodesignCommand: Command { } public func execute() throws { - var dstroot = self.dstroot.value - var srcroot = self.srcroot.value - let fm = FileManager() + let dstroot = self.dstroot.value + let codesignPlistPath = joinPath(dstroot, "usr", "local", "darwinbuild", "darwinbuild-codesign.plist") + let data = try Data(contentsOf: URL(fileURLWithPath: codesignPlistPath)) + let codesignPlist = try PropertyListSerialization.propertyList(from: data, options: [], format: nil) as! [String: Any] - if let projectNameArgument = projectName.value { - let buildroot = CommandLine.Environment["DARWIN_BUILDROOT"] ?? CommandLine.workingDirectory - - if !(fm.directoryExists(atPath: joinPath(buildroot, "Roots")) && - fm.directoryExists(atPath: joinPath(buildroot, "Sources")) && - fm.directoryExists(atPath: joinPath(buildroot, "Symbols")) && - fm.directoryExists(atPath: joinPath(buildroot, "Headers")) && - fm.directoryExists(atPath: joinPath(buildroot, "Logs"))) { - print("ERROR: Could not find darwinbuild root, this is required when using --project", to: &standardError) - print("Please change your working directory to one initialized by:", to: &standardError) - print("darwinbuild -init ", to: &standardError) - print("Alternatively, you may set the DARWIN_BUILDROOT environment variable to the", to: &standardError) - print("absolute path of that directory.", to: &standardError) + guard let defaultCertificate: String = codesignPlist.get("certificate") else { + print("ERROR: Default certificate must be provided (use \"certificate\" key in top-level of plist", to: &standardError) + exit(1) + } - exit(1) - } + let defaultHardenedRuntime = codesignPlist.get("hardened_runtime") ?? false + let defaultPrefix: String? = codesignPlist.get("prefix") + let defaultTimestamp: TimestampType + if let timestampValue: Any = codesignPlist.get("timestamp") { + defaultTimestamp = try parseTimestampType(timestampValue) + } else { + defaultTimestamp = .apple + } - if let buildrootType = (try fm.attributesOfItem(atPath: joinPath(buildroot, "BuildRoot")))[.type] as? FileAttributeType?, buildrootType == FileAttributeType.typeSymbolicLink { - if !fm.directoryExists(atPath: try fm.destinationOfSymbolicLink(atPath: joinPath(buildroot, "BuildRoot"))) { - print("Attaching build root disk image...") + var signingMap: [Int: [Task]] = [:] + guard let fileMap: [String: Any] = codesignPlist.get("files") else { + print("Warning: Nothing to sign") + return + } - let task = Task(executable: "/usr/bin/hdiutil", arguments: [ - "attach", ".build/buildroot.sparsebundle", - "-readwrite", "-owners", "on" - ], directory: buildroot) - if task.runSync() != 0 { - print("Could not attach buildroot.sparsebundle", to: &standardError) - exit(1) - } + for (key, data) in fileMap { + let certificate: String + let identifier: String? + let prefix: String? + let hardenedRuntime: Bool + let dr: String? + let order: Int + let timestamp: TimestampType + + if let flag = data as? Bool { + if !flag { + print("Warning: false value interpreted as \"use all default values\"", to: &standardError) } - } - let projectName: String - let projectNameAndVersion: String - let projectBuild: String - if projectNameArgument.range(of: "~") != nil { - let parts = projectNameArgument.components(separatedBy: "~") - projectNameAndVersion = parts[0] - projectBuild = parts[1] - projectName = projectNameAndVersion.components(separatedBy: "-")[0] - } else { - projectNameAndVersion = projectNameArgument - projectName = projectNameAndVersion.components(separatedBy: "-")[0] - var largestBuildNumber = -1 - for subdir in try fm.contentsOfDirectory(atPath: joinPath(buildroot, "Roots", projectName)) { - if subdir.hasPrefix(projectNameAndVersion + ".root") { - let parts = subdir.components(separatedBy: "~") - if let buildNumber = Int(parts[1], radix: 10) { - if buildNumber > largestBuildNumber { - largestBuildNumber = buildNumber - } - } - } - } - - if largestBuildNumber == -1 { - print("Could not determine latest build for \(projectNameAndVersion)", to: &standardError) - if projectNameAndVersion.range(of: "-") == nil { - print("(Did you forget the version in the project name?)", to: &standardError) - } - exit(1) + certificate = defaultCertificate + identifier = nil + prefix = defaultPrefix + hardenedRuntime = defaultHardenedRuntime + dr = nil + order = 0xFFFF + timestamp = defaultTimestamp + } else if let data = data as? [String: Any] { + certificate = data.get("certificate") ?? defaultCertificate + identifier = data.get("identifier") + prefix = data.get("prefix") ?? defaultPrefix + hardenedRuntime = (data["hardened_runtime"] as? Bool) ?? defaultHardenedRuntime + dr = data.get("dr") + order = data.get("order") ?? 0xFFFF + if let timestampValue: Any = data.get("timestamp") { + timestamp = try parseTimestampType(timestampValue) + } else { + timestamp = defaultTimestamp } - - projectBuild = String(largestBuildNumber, radix: 10) + } else { + throw Exception.message("Values in \"files\" dictionary must be booleans or dictionaries only") } - dstroot = joinPath(buildroot, "Roots", projectName, projectNameAndVersion + ".root~" + projectBuild) - srcroot = joinPath(buildroot, "BuildRoot", "SourceCache", projectName, projectNameAndVersion) - } - - if let dstroot = dstroot, let srcroot = srcroot { - let data = try Data(contentsOf: URL(fileURLWithPath: joinPath(srcroot, "darwinbuild-codesign.plist"))) - let codesignPlist = try PropertyListSerialization.propertyList(from: data, options: [], format: nil) as! [String: Any] - - guard let defaultCertificate: String = codesignPlist.get("certificate") else { - print("ERROR: Default certificate must be provided (use \"certificate\" key in top-level of plist", to: &standardError) - exit(1) + var codesignArgv = ["-s", certificate, "-f", "--preserve-metadata=entitlements"] + if let identifier = identifier { + codesignArgv.append("-i") + codesignArgv.append(identifier) } - - let defaultHardenedRuntime = codesignPlist.get("hardened_runtime") ?? false - let defaultPrefix: String? = codesignPlist.get("prefix") - let defaultTimestamp: TimestampType - if let timestampValue: Any = codesignPlist.get("timestamp") { - defaultTimestamp = try parseTimestampType(timestampValue) - } else { - defaultTimestamp = .apple + if let prefix = prefix { + codesignArgv.append("--prefix") + codesignArgv.append(prefix) } - - var signingMap: [Int: [Task]] = [:] - guard let fileMap: [String: Any] = codesignPlist.get("files") else { - print("Warning: Nothing to sign") - return + if let dr = dr { + codesignArgv.append("-r") + codesignArgv.append(dr) } + if hardenedRuntime { + codesignArgv.append("-o") + codesignArgv.append("runtime") + } + switch timestamp { + case .apple: + codesignArgv.append("--timestamp") + case .disabled: + codesignArgv.append("--timestamp=none") + case .custom(let arg): + codesignArgv.append("--timestamp=\(arg)") + } + codesignArgv.append(joinPath(dstroot, key)) - for (key, data) in fileMap { - let certificate: String - let identifier: String? - let prefix: String? - let entitlements: String? - let hardenedRuntime: Bool - let dr: String? - let order: Int - let timestamp: TimestampType - - if let flag = data as? Bool { - if !flag { - print("Warning: false value interpreted as \"use all default values\"", to: &standardError) - } - - certificate = defaultCertificate - identifier = nil - prefix = defaultPrefix - entitlements = nil - hardenedRuntime = defaultHardenedRuntime - dr = nil - order = 0xFFFF - timestamp = defaultTimestamp - } else if let data = data as? [String: Any] { - certificate = data.get("certificate") ?? defaultCertificate - identifier = data.get("identifier") - prefix = data.get("prefix") ?? defaultPrefix - entitlements = data.get("entitlements") - hardenedRuntime = defaultHardenedRuntime - dr = data.get("dr") - order = data.get("order") ?? 0xFFFF - if let timestampValue: Any = data.get("timestamp") { - timestamp = try parseTimestampType(timestampValue) - } else { - timestamp = defaultTimestamp - } - } else { - throw Exception.message("Values in \"files\" dictionary must be booleans or dictionaries only") - } - - var codesignArgv = ["-s", certificate, "-f"] - if let identifier = identifier { - codesignArgv.append("-i") - codesignArgv.append(identifier) - } - if let prefix = prefix { - codesignArgv.append("--prefix") - codesignArgv.append(prefix) - } - if let dr = dr { - codesignArgv.append("-r") - codesignArgv.append(dr) - } - if let entitlements = entitlements { - codesignArgv.append("--entitlements") - codesignArgv.append(joinPath(srcroot, entitlements)) - } - if hardenedRuntime { - codesignArgv.append("-o") - codesignArgv.append("runtime") - } - switch timestamp { - case .apple: - codesignArgv.append("--timestamp") - case .disabled: - codesignArgv.append("--timestamp=none") - case .custom(let arg): - codesignArgv.append("--timestamp=\(arg)") - } - codesignArgv.append(joinPath(dstroot, key)) - - let task = Task(executable: "/usr/bin/codesign", arguments: codesignArgv, stdout: WriteStream.stdout, stderr: WriteStream.stderr) - if var orderDict = signingMap[order] { - orderDict.append(task) - signingMap[order] = orderDict - } else { - signingMap[order] = [task] - } + let task = Task(executable: "/usr/bin/codesign", arguments: codesignArgv, stdout: WriteStream.stdout, stderr: WriteStream.stderr) + if var orderDict = signingMap[order] { + orderDict.append(task) + signingMap[order] = orderDict + } else { + signingMap[order] = [task] } + } - let keyVector = signingMap.keys.sorted() - for index in keyVector { - if let tasks = signingMap[index] { - for task in tasks { - let exitCode = task.runSync() - if exitCode != 0 { - print("Signing command failed with code \(exitCode)", to: &standardError) - exit(1) - } + let keyVector = signingMap.keys.sorted() + for index in keyVector { + if let tasks = signingMap[index] { + for task in tasks { + let exitCode = task.runSync() + if exitCode != 0 { + print("Signing command failed with code \(exitCode)", to: &standardError) + exit(1) } } } - } else { - print("ERROR: Either -p, or both -d and -s must be specified", to: &standardError) - exit(1) } } } From 6c120cf292ffe37283a5fe6377ec967e60336684 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 17 Aug 2020 17:05:01 -0400 Subject: [PATCH 317/382] Update installation directory of darwinbuild-codesign --- darwinbuild.xcodeproj/project.pbxproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 6025276..81357d5 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -2837,6 +2837,7 @@ ); GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INSTALL_PATH = "$(DATDIR)/darwinbuild"; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -2866,6 +2867,7 @@ GCC_C_LANGUAGE_STANDARD = gnu11; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INSTALL_PATH = "$(DATDIR)/darwinbuild"; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_NAME = "$(TARGET_NAME)"; From 8f3ba1073e29dad48d3f2d79c926d362e419a6cf Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 17 Aug 2020 17:10:40 -0400 Subject: [PATCH 318/382] Add -codesign flag to darwinbuld --- darwinbuild/darwinbuild.in | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index de38432..1d5b8a7 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -85,6 +85,7 @@ action="install" target="" configuration="" version="" +codesign="NO" INSTALL_XCODE="NO" @@ -179,7 +180,7 @@ function PrintUsage() { usage: $(basename $0) [action] [options] [] actions: [-headers] [-fetch] [-source] [-load] [-loadonly] [-recursive] [-group] options: [-build=X] [-target=X] [-configuration=X] - [-logdeps] [-nopatch] [-noload] + [-logdeps] [-nopatch] [-noload] [-codesign] [-depsbuild=X [-depsbuild=Y]] [-nosource] EOF @@ -256,6 +257,7 @@ fi ### -configuration=X Specify the build configuration to use ### -build=X Specify the darwin build number to buld, e.g. 8B15 ### -depsbuild=X Specify the darwin build number to populate the BuildRoot +### -codesign Sign the built root, using darwinbuild-codesign.plist file under DSTROOT ### ### Parameters: ### The name of the project to build @@ -320,6 +322,8 @@ for ARG in "$@"; do elif [ "$ARG" == "-nosource" ]; then nosource="YES" nopatch="YES" + elif [ "$ARG" == "-codesign" ]; then + codesign="YES" elif [ "${ARG:0:1}" != "-" ]; then projnam="$ARG" else @@ -810,6 +814,23 @@ if [ $EXIT_STATUS -eq 0 ]; then fi fi +if [ "$EXIT_STATUS" == "0" -a "$action" != "installhdrs" -a "$codesign" == "YES" ]; then + if [ -f "$DSTROOT/usr/local/darwinbuild/darwinbuild-codesign.plist" ]; then + $DATADIR/darwinbuild-codesign "$DSTROOT" + EXIT_STATUS=$? + + if [ "$EXIT_STATUS" == "0" ]; then + # Delete the darwinbuild-codesign.plist file after the signing + # process has completed, so it isn't copied into the Root cache. + rm $DSTROOT/usr/local/darwinbuild/darwinbuild-codesign.plist + fi + else + echo "ERROR: /usr/local/darwinbuild/darwinbuild-codesign.plist not found under \$DSTROOT." 1>&2 + echo "Cannot sign build products." 1>&2 + exit 1 + fi +fi + if [ "$EXIT_STATUS" == "0" ]; then ### From 0af0f90280188d4d00fd1b5e844cccff1d542bb2 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 17 Aug 2020 17:26:29 -0400 Subject: [PATCH 319/382] Always ensure the signing prefix ends in a dot codesign will not do this for me. --- swift/darwinbuild-codesign/main.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/swift/darwinbuild-codesign/main.swift b/swift/darwinbuild-codesign/main.swift index 8ecbf43..f56f275 100644 --- a/swift/darwinbuild-codesign/main.swift +++ b/swift/darwinbuild-codesign/main.swift @@ -139,7 +139,12 @@ class CodesignCommand: Command { } if let prefix = prefix { codesignArgv.append("--prefix") - codesignArgv.append(prefix) + + if prefix.hasSuffix(".") { + codesignArgv.append(prefix) + } else { + codesignArgv.append(prefix + ".") + } } if let dr = dr { codesignArgv.append("-r") From 692d23056032cc669b86b48eaf439d61c1f1388b Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 17 Aug 2020 18:32:51 -0400 Subject: [PATCH 320/382] Make darwinbuild-codesign print status messages --- swift/darwinbuild-codesign/main.swift | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/swift/darwinbuild-codesign/main.swift b/swift/darwinbuild-codesign/main.swift index f56f275..35b38d2 100644 --- a/swift/darwinbuild-codesign/main.swift +++ b/swift/darwinbuild-codesign/main.swift @@ -89,7 +89,7 @@ class CodesignCommand: Command { defaultTimestamp = .apple } - var signingMap: [Int: [Task]] = [:] + var signingMap: [Int: [(String, Task)]] = [:] guard let fileMap: [String: Any] = codesignPlist.get("files") else { print("Warning: Nothing to sign") return @@ -166,20 +166,22 @@ class CodesignCommand: Command { let task = Task(executable: "/usr/bin/codesign", arguments: codesignArgv, stdout: WriteStream.stdout, stderr: WriteStream.stderr) if var orderDict = signingMap[order] { - orderDict.append(task) + orderDict.append((key, task)) signingMap[order] = orderDict } else { - signingMap[order] = [task] + signingMap[order] = [(key, task)] } } let keyVector = signingMap.keys.sorted() for index in keyVector { if let tasks = signingMap[index] { - for task in tasks { + for (path, task) in tasks { + print("Signing", path) + let exitCode = task.runSync() if exitCode != 0 { - print("Signing command failed with code \(exitCode)", to: &standardError) + print("Signing command failed with code", exitCode, to: &standardError) exit(1) } } From 8f899c4acd42d78fc973fd4c60aa71ec8cdffa02 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 17 Aug 2020 18:39:25 -0400 Subject: [PATCH 321/382] Update error message --- darwinbuild/darwinbuild.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 1d5b8a7..d4133d1 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -826,7 +826,7 @@ if [ "$EXIT_STATUS" == "0" -a "$action" != "installhdrs" -a "$codesign" == "YES" fi else echo "ERROR: /usr/local/darwinbuild/darwinbuild-codesign.plist not found under \$DSTROOT." 1>&2 - echo "Cannot sign build products." 1>&2 + echo "Cannot sign build products if this file is missing." 1>&2 exit 1 fi fi From 28a8cb2b39fe4ddd925b26781fe6ac0110e94334 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 18 Aug 2020 22:55:40 -0400 Subject: [PATCH 322/382] Change darwinbuild-codesign to take certificate name from command line --- swift/darwinbuild-codesign/main.swift | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/swift/darwinbuild-codesign/main.swift b/swift/darwinbuild-codesign/main.swift index 35b38d2..fbc9f7a 100644 --- a/swift/darwinbuild-codesign/main.swift +++ b/swift/darwinbuild-codesign/main.swift @@ -46,6 +46,7 @@ internal extension Dictionary { class CodesignCommand: Command { let name = "darwinbuild-codesign" + private let certificateName = Param.Required() private let dstroot = SwiftCLI.Parameter() private enum TimestampType @@ -75,11 +76,6 @@ class CodesignCommand: Command { let data = try Data(contentsOf: URL(fileURLWithPath: codesignPlistPath)) let codesignPlist = try PropertyListSerialization.propertyList(from: data, options: [], format: nil) as! [String: Any] - guard let defaultCertificate: String = codesignPlist.get("certificate") else { - print("ERROR: Default certificate must be provided (use \"certificate\" key in top-level of plist", to: &standardError) - exit(1) - } - let defaultHardenedRuntime = codesignPlist.get("hardened_runtime") ?? false let defaultPrefix: String? = codesignPlist.get("prefix") let defaultTimestamp: TimestampType @@ -109,7 +105,7 @@ class CodesignCommand: Command { print("Warning: false value interpreted as \"use all default values\"", to: &standardError) } - certificate = defaultCertificate + certificate = self.certificateName.value identifier = nil prefix = defaultPrefix hardenedRuntime = defaultHardenedRuntime @@ -117,7 +113,7 @@ class CodesignCommand: Command { order = 0xFFFF timestamp = defaultTimestamp } else if let data = data as? [String: Any] { - certificate = data.get("certificate") ?? defaultCertificate + certificate = data.get("certificate") ?? self.certificateName.value identifier = data.get("identifier") prefix = data.get("prefix") ?? defaultPrefix hardenedRuntime = (data["hardened_runtime"] as? Bool) ?? defaultHardenedRuntime From a338504217b83284bb7997061305ac0a6a6c671c Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 18 Aug 2020 22:57:03 -0400 Subject: [PATCH 323/382] Add -codesign flag to darwinbuild Note that this does not quite work yet, due to an unresolved issue with codesign identifying certificates when run as root. Radar FB8441177. --- darwinbuild/darwinbuild.in | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index d4133d1..b9833bf 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -85,7 +85,7 @@ action="install" target="" configuration="" version="" -codesign="NO" +codesign="-" INSTALL_XCODE="NO" @@ -180,7 +180,7 @@ function PrintUsage() { usage: $(basename $0) [action] [options] [] actions: [-headers] [-fetch] [-source] [-load] [-loadonly] [-recursive] [-group] options: [-build=X] [-target=X] [-configuration=X] - [-logdeps] [-nopatch] [-noload] [-codesign] + [-logdeps] [-nopatch] [-noload] [-codesign=] [-depsbuild=X [-depsbuild=Y]] [-nosource] EOF @@ -257,7 +257,7 @@ fi ### -configuration=X Specify the build configuration to use ### -build=X Specify the darwin build number to buld, e.g. 8B15 ### -depsbuild=X Specify the darwin build number to populate the BuildRoot -### -codesign Sign the built root, using darwinbuild-codesign.plist file under DSTROOT +### -codesign= Sign the built root, using the given CODE_SIGN_IDENTITY value ### ### Parameters: ### The name of the project to build @@ -322,8 +322,15 @@ for ARG in "$@"; do elif [ "$ARG" == "-nosource" ]; then nosource="YES" nopatch="YES" - elif [ "$ARG" == "-codesign" ]; then - codesign="YES" + elif [ "${ARG/=*/}" == "-codesign" ]; then + codesign=${ARG/*=/} + + # $codesign and $ARG will be equal if there is no '=' in $ARG. + if [ "$codesign" == "$ARG" -o "$codesign" == "" ]; then + echo "WARNING: Code signing identity not specified." 1>&2 + echo "Using default ad-hoc signing." 1>&2 + codesign=- + fi elif [ "${ARG:0:1}" != "-" ]; then projnam="$ARG" else @@ -665,7 +672,11 @@ if [ "$buildtool" == "xcodebuild" -a "$configuration" != "" ]; then fi if [ "$buildtool" == "xcodebuild" ]; then - build_string="$build_string CODE_SIGN_IDENTITY=-" + build_string="$build_string CODE_SIGN_IDENTITY=\"$codesign\"" + + if [ "$codesign" != "-" ]; then + build_string="$build_string CODE_SIGN_STYLE=Manual" + fi fi ### @@ -814,7 +825,7 @@ if [ $EXIT_STATUS -eq 0 ]; then fi fi -if [ "$EXIT_STATUS" == "0" -a "$action" != "installhdrs" -a "$codesign" == "YES" ]; then +if [ "$EXIT_STATUS" == "0" -a "$action" != "installhdrs" -a "$codesign" != "-" ]; then if [ -f "$DSTROOT/usr/local/darwinbuild/darwinbuild-codesign.plist" ]; then $DATADIR/darwinbuild-codesign "$DSTROOT" EXIT_STATUS=$? @@ -824,10 +835,6 @@ if [ "$EXIT_STATUS" == "0" -a "$action" != "installhdrs" -a "$codesign" == "YES" # process has completed, so it isn't copied into the Root cache. rm $DSTROOT/usr/local/darwinbuild/darwinbuild-codesign.plist fi - else - echo "ERROR: /usr/local/darwinbuild/darwinbuild-codesign.plist not found under \$DSTROOT." 1>&2 - echo "Cannot sign build products if this file is missing." 1>&2 - exit 1 fi fi From 26cf7b654d930299e8df809995732a178ce0b0dd Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 18 Aug 2020 23:04:11 -0400 Subject: [PATCH 324/382] Simplify syntax --- swift/darwinbuild-codesign/main.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swift/darwinbuild-codesign/main.swift b/swift/darwinbuild-codesign/main.swift index fbc9f7a..cc81dd4 100644 --- a/swift/darwinbuild-codesign/main.swift +++ b/swift/darwinbuild-codesign/main.swift @@ -47,7 +47,7 @@ class CodesignCommand: Command { let name = "darwinbuild-codesign" private let certificateName = Param.Required() - private let dstroot = SwiftCLI.Parameter() + private let dstroot = Param.Required() private enum TimestampType { From 7b2656279fed492c8ff9c220977a88a23e2d2f12 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 18 Aug 2020 23:05:18 -0400 Subject: [PATCH 325/382] Pass certificate name in darwinbuild script --- darwinbuild/darwinbuild.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index b9833bf..e954503 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -827,7 +827,7 @@ fi if [ "$EXIT_STATUS" == "0" -a "$action" != "installhdrs" -a "$codesign" != "-" ]; then if [ -f "$DSTROOT/usr/local/darwinbuild/darwinbuild-codesign.plist" ]; then - $DATADIR/darwinbuild-codesign "$DSTROOT" + $DATADIR/darwinbuild-codesign "$codesign" "$DSTROOT" EXIT_STATUS=$? if [ "$EXIT_STATUS" == "0" ]; then From da94af005715450385a58b412a91a6f2c8ab358b Mon Sep 17 00:00:00 2001 From: William Kent Date: Thu, 3 Sep 2020 21:16:47 -0400 Subject: [PATCH 326/382] Don't invoke darwinbuild-codesign if adhoc signing is used --- darwinbuild/darwinbuild.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index e954503..7583c82 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -826,7 +826,7 @@ if [ $EXIT_STATUS -eq 0 ]; then fi if [ "$EXIT_STATUS" == "0" -a "$action" != "installhdrs" -a "$codesign" != "-" ]; then - if [ -f "$DSTROOT/usr/local/darwinbuild/darwinbuild-codesign.plist" ]; then + if [ "$codesign" != "-" -a -f "$DSTROOT/usr/local/darwinbuild/darwinbuild-codesign.plist" ]; then $DATADIR/darwinbuild-codesign "$codesign" "$DSTROOT" EXIT_STATUS=$? From a2efd2b5d1aeda765981f457c4583334e79e98f7 Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 2 Oct 2020 14:10:29 -0400 Subject: [PATCH 327/382] Rename darwinbuild-codesign binary name to sign-tool --- darwinbuild.xcodeproj/project.pbxproj | 18 +++++++++--------- .../xcschemes/darwinbuild-codesign.xcscheme | 12 ++++++------ darwinbuild/darwinbuild.in | 2 +- swift/darwinbuild-codesign/main.swift | 2 +- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index 81357d5..f7feb84 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -660,7 +660,7 @@ 1F9D9647226516AA0024E830 /* darwinxref.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = darwinxref.entitlements; path = darwinxref/darwinxref.entitlements; sourceTree = ""; }; 1FA2A9E722E62BF600F53888 /* darwinbuild-recursive */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "darwinbuild-recursive"; sourceTree = BUILT_PRODUCTS_DIR; }; 1FA2A9E922E62BF600F53888 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; - 1FB1351422E522B5005E9A88 /* darwinbuild-codesign */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "darwinbuild-codesign"; sourceTree = BUILT_PRODUCTS_DIR; }; + 1FB1351422E522B5005E9A88 /* sign-root */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "sign-root"; sourceTree = BUILT_PRODUCTS_DIR; }; 1FB1351622E522B5005E9A88 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; 1FCA51B422E6562800D55269 /* fetch-from-github */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "fetch-from-github"; sourceTree = BUILT_PRODUCTS_DIR; }; 1FCA51B622E6562800D55269 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; @@ -1197,7 +1197,7 @@ 72D05CB711D267C400B33EDD /* query.so */, 720BE2F2120C90A700B3C4A5 /* digest */, 396301271EAB4E01006081C7 /* patch_sites.so */, - 1FB1351422E522B5005E9A88 /* darwinbuild-codesign */, + 1FB1351422E522B5005E9A88 /* sign-root */, 1FA2A9E722E62BF600F53888 /* darwinbuild-recursive */, 1FCA51B422E6562800D55269 /* fetch-from-github */, ); @@ -1266,9 +1266,9 @@ productReference = 1FA2A9E722E62BF600F53888 /* darwinbuild-recursive */; productType = "com.apple.product-type.tool"; }; - 1FB1351322E522B5005E9A88 /* darwinbuild-codesign */ = { + 1FB1351322E522B5005E9A88 /* sign-root */ = { isa = PBXNativeTarget; - buildConfigurationList = 1FB1351B22E522B5005E9A88 /* Build configuration list for PBXNativeTarget "darwinbuild-codesign" */; + buildConfigurationList = 1FB1351B22E522B5005E9A88 /* Build configuration list for PBXNativeTarget "sign-root" */; buildPhases = ( 1FB1351022E522B5005E9A88 /* Sources */, 1FB1351122E522B5005E9A88 /* Frameworks */, @@ -1277,12 +1277,12 @@ ); dependencies = ( ); - name = "darwinbuild-codesign"; + name = "sign-root"; packageProductDependencies = ( 1F7D730C22E52DFD003F8A67 /* SwiftCLI */, ); productName = "darwinbuild-codesign"; - productReference = 1FB1351422E522B5005E9A88 /* darwinbuild-codesign */; + productReference = 1FB1351422E522B5005E9A88 /* sign-root */; productType = "com.apple.product-type.tool"; }; 1FCA51B322E6562800D55269 /* fetch-from-github */ = { @@ -1942,7 +1942,7 @@ 7227AC151098D8DB00BE33D7 /* thinPackages */, 720BE2EA120C90A700B3C4A5 /* digest */, 3963011C1EAB4E01006081C7 /* patch_sites */, - 1FB1351322E522B5005E9A88 /* darwinbuild-codesign */, + 1FB1351322E522B5005E9A88 /* sign-root */, 1FA2A9E622E62BF600F53888 /* darwinbuild-recursive */, 1FCA51B322E6562800D55269 /* fetch-from-github */, ); @@ -2429,7 +2429,7 @@ /* Begin PBXTargetDependency section */ 1FA9FAFD22E61D9D0096A78D /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 1FB1351322E522B5005E9A88 /* darwinbuild-codesign */; + target = 1FB1351322E522B5005E9A88 /* sign-root */; targetProxy = 1FA9FAFC22E61D9D0096A78D /* PBXContainerItemProxy */; }; 1FCA51AF22E6551E00D55269 /* PBXTargetDependency */ = { @@ -3781,7 +3781,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; - 1FB1351B22E522B5005E9A88 /* Build configuration list for PBXNativeTarget "darwinbuild-codesign" */ = { + 1FB1351B22E522B5005E9A88 /* Build configuration list for PBXNativeTarget "sign-root" */ = { isa = XCConfigurationList; buildConfigurations = ( 1FB1351822E522B5005E9A88 /* Debug */, diff --git a/darwinbuild.xcodeproj/xcshareddata/xcschemes/darwinbuild-codesign.xcscheme b/darwinbuild.xcodeproj/xcshareddata/xcschemes/darwinbuild-codesign.xcscheme index 0ff77fe..26779f9 100644 --- a/darwinbuild.xcodeproj/xcshareddata/xcschemes/darwinbuild-codesign.xcscheme +++ b/darwinbuild.xcodeproj/xcshareddata/xcschemes/darwinbuild-codesign.xcscheme @@ -15,8 +15,8 @@ @@ -45,8 +45,8 @@ @@ -62,8 +62,8 @@ diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 7583c82..cf5670c 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -827,7 +827,7 @@ fi if [ "$EXIT_STATUS" == "0" -a "$action" != "installhdrs" -a "$codesign" != "-" ]; then if [ "$codesign" != "-" -a -f "$DSTROOT/usr/local/darwinbuild/darwinbuild-codesign.plist" ]; then - $DATADIR/darwinbuild-codesign "$codesign" "$DSTROOT" + $DATADIR/sign-root "$codesign" "$DSTROOT" EXIT_STATUS=$? if [ "$EXIT_STATUS" == "0" ]; then diff --git a/swift/darwinbuild-codesign/main.swift b/swift/darwinbuild-codesign/main.swift index cc81dd4..efc4e0f 100644 --- a/swift/darwinbuild-codesign/main.swift +++ b/swift/darwinbuild-codesign/main.swift @@ -44,7 +44,7 @@ internal extension Dictionary { } class CodesignCommand: Command { - let name = "darwinbuild-codesign" + let name = "sign-root" private let certificateName = Param.Required() private let dstroot = Param.Required() From 1fe73a84fa8665330c2a5f2a2c203ffcd64ecc04 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sat, 3 Oct 2020 19:07:09 -0400 Subject: [PATCH 328/382] Remove support for specifying a signing certificate per-file --- swift/darwinbuild-codesign/main.swift | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/swift/darwinbuild-codesign/main.swift b/swift/darwinbuild-codesign/main.swift index efc4e0f..dc52a57 100644 --- a/swift/darwinbuild-codesign/main.swift +++ b/swift/darwinbuild-codesign/main.swift @@ -92,7 +92,6 @@ class CodesignCommand: Command { } for (key, data) in fileMap { - let certificate: String let identifier: String? let prefix: String? let hardenedRuntime: Bool @@ -105,7 +104,6 @@ class CodesignCommand: Command { print("Warning: false value interpreted as \"use all default values\"", to: &standardError) } - certificate = self.certificateName.value identifier = nil prefix = defaultPrefix hardenedRuntime = defaultHardenedRuntime @@ -113,7 +111,6 @@ class CodesignCommand: Command { order = 0xFFFF timestamp = defaultTimestamp } else if let data = data as? [String: Any] { - certificate = data.get("certificate") ?? self.certificateName.value identifier = data.get("identifier") prefix = data.get("prefix") ?? defaultPrefix hardenedRuntime = (data["hardened_runtime"] as? Bool) ?? defaultHardenedRuntime @@ -128,7 +125,7 @@ class CodesignCommand: Command { throw Exception.message("Values in \"files\" dictionary must be booleans or dictionaries only") } - var codesignArgv = ["-s", certificate, "-f", "--preserve-metadata=entitlements"] + var codesignArgv = ["-s", self.certificateName.value, "-f", "--preserve-metadata=entitlements"] if let identifier = identifier { codesignArgv.append("-i") codesignArgv.append(identifier) From 8590f881db6ac3269197c6c550b598c449d8b3bb Mon Sep 17 00:00:00 2001 From: William Kent Date: Sat, 3 Oct 2020 19:08:49 -0400 Subject: [PATCH 329/382] Add documentation on how to use darwinbuild-codesign --- Documentation/code_signing.md | 79 +++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 Documentation/code_signing.md diff --git a/Documentation/code_signing.md b/Documentation/code_signing.md new file mode 100644 index 0000000..bd80ecd --- /dev/null +++ b/Documentation/code_signing.md @@ -0,0 +1,79 @@ +# Code Signing with darwinbuild + +darwinbuild supports Apple code signing, both automatically via Xcode, +and manually from the command line. Code signing is enabled by passing +the `-codesign` flag on the command line, like this: + +```shell +sudo darwinbuild -codesign='Developer ID Application' some_project +``` + +The string after the equals sign is the name of the certificate you want +Xcode to use. However, since darwinbuild must be run as root, it does not +have access to your personal keychain (which is where I presume you are storing +your signing materials). Therefore, you **must** run the steps under “Keychain +Preparation” below at least once before this will work, and ensure that the +DEVELOPER_TEAM property is set every time you build. You can either set this in +your project file, or via the `environment` key in the darwinbuild plist. +Passing the variable via `export` or `sudo env` will *not* work. + +## Format of darwinbuild-codesign.plist + +If you want to do manual code-signing (if your project is not built by Xcode, +for example), install a file called `darwinbuild-codesign.plist` in the +`/usr/local/darwinbuild` folder of your DSTROOT during the build. After the +build is complete, darwinbuild will locate the file, parse it, perform +the signing, and then delete it from the DSTROOT (so the codesign plists +do not collide, which would confuse darwinbuild no end). + +Here is a sample `darwinbuild-codesign.plist` file: + +```xml + + + + + hardened_runtime + + prefix + com.mycompany. + timestamp + + files + + /usr/local/bin/my_library + + /usr/local/lib/my_program + + identifier + com.mycompany.my_special_program + order + 1 + + + + +``` + +At the top level are keys that provide settings for all files. These are: + +* `hardened_runtime`: Boolean, default false. If true, `-o runtime` will be included in the codesign arguments. +* `prefix`: String, corresponds to the `--prefix` flag of codesign. If you provide a value, it must end in a `.`, or codesign will not create the signing identifier you expect (it won’t add the dot for you). +* `timestamp`: Either boolean or string. If `true` (default), use Apple’s timestamping service. If `false`, no timestamp server will be used. If a string, it will be interpreted as the URL of the timestamping server to use. + +The `files` dictionary contains as keys list of files to sign. These are usually +provided as absolute paths, but are treated relative to the DSTROOT. If the +value of the key is `true`, all default settings (at the top level of the plist) +will be used. Otherwise, it is interpreted as a dictionary with the following keys: + +* `identifier`: The code signing identifier. It will be used verbatim by codesign. Per the manual page, do **NOT** sign two different pieces of code with the same identifier. +* `hardened_runtime`: Overrides the default `hardened_runtime` setting, if present. +* `prefix`: Overrides the default `prefix` setting, if present. +* `dr`: The Designated Requirement for the code being signed. This is usually computed automatically during the sgning process. +* `order`: The order index at which the file will be signed. + +Every file in the `files` dictionary has an order index. By default, all files +have an order index of 65535. If you override this setting with another value, +you can control in which order the files are signed. This can be useful when +signing bundles that contain other bundles that also need to be signed. +Files with the lowest index values are signed first. From fc0e00570398800db281bcc81412ce3a4f78e117 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sat, 3 Oct 2020 19:11:28 -0400 Subject: [PATCH 330/382] Add session on keychain preparation to docs --- Documentation/code_signing.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Documentation/code_signing.md b/Documentation/code_signing.md index bd80ecd..31ebeae 100644 --- a/Documentation/code_signing.md +++ b/Documentation/code_signing.md @@ -77,3 +77,19 @@ have an order index of 65535. If you override this setting with another value, you can control in which order the files are signed. This can be useful when signing bundles that contain other bundles that also need to be signed. Files with the lowest index values are signed first. + +## Keychain Preparation + +By default, darwinbuild does not have access to your user keychain, because it +runs xcodebuild in a different user session than the sudo process provides. You +must therefore add the keychain with your signing materials (referred to below +as `$KEYCHAIN_PATH`); +For this to work properly, you will need to follow these steps first (assuming that $KEYCHAIN_PATH has been set to the full path to a keychain file that contains the necessary certificates and keys). + +1. `sudo su`; enter password +2. `security list-keychains -d user -s $KEYCHAIN_PATH /Library/Keychains/System.keychain` +3. `security unlock-keychain $KEYCHAIN_PATH`; enter password +4. `security list-keychains`; if `$KEYCHAIN_PATH` is listed in the output, you’re good to go. + +This should only need to be done once per Mac. Note that there is a possibility +that macOS updates will undo this change. If this ever happens, simply repeat the above steps. From 0a2c68aee5dbb99429a51bd601baf126e7f0ac86 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sat, 3 Oct 2020 19:12:07 -0400 Subject: [PATCH 331/382] Clean up grammar --- Documentation/code_signing.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Documentation/code_signing.md b/Documentation/code_signing.md index 31ebeae..fb7d3ee 100644 --- a/Documentation/code_signing.md +++ b/Documentation/code_signing.md @@ -83,8 +83,7 @@ Files with the lowest index values are signed first. By default, darwinbuild does not have access to your user keychain, because it runs xcodebuild in a different user session than the sudo process provides. You must therefore add the keychain with your signing materials (referred to below -as `$KEYCHAIN_PATH`); -For this to work properly, you will need to follow these steps first (assuming that $KEYCHAIN_PATH has been set to the full path to a keychain file that contains the necessary certificates and keys). +as `$KEYCHAIN_PATH`). Follow the below steps. 1. `sudo su`; enter password 2. `security list-keychains -d user -s $KEYCHAIN_PATH /Library/Keychains/System.keychain` From e1483c84ceb11a375f167c79c764c4bc655442e4 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 4 Oct 2020 13:30:23 -0400 Subject: [PATCH 332/382] Update instructions in README --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index f7122b3..424430f 100644 --- a/README +++ b/README @@ -52,7 +52,7 @@ You can install by checking out the source and building darwinbuild yourself. You would want to run the following two commands: % cd - % sudo xcodebuild install DSTROOT=/ + % sudo xcodebuild install DSTROOT=/ -scheme World This will install darwinbuild and its supporting tools into /usr/local/bin. From 1ace89d99a28efa4c3262fc0c70c7aa504aa928b Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 2 Oct 2020 22:36:14 -0400 Subject: [PATCH 333/382] Add CreatePureDarwinSDK function to darwinbuild.common --- darwinbuild/darwinbuild.common | 76 ++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index de0868e..dfc3579 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -536,3 +536,79 @@ FRAMEWORK_SEARCH_PATHS = \$(DEPROOT)/System/Library/Frameworks \$(DEPROOT)/Syste LIBRARY_SEARCH_PATHS = \$(DEPROOT)/usr/local/lib \$(DEPROOT)/usr/lib EOF } + +function _CreatePureDarwinSDKFile() { + OUR_SDK=$1 + APPLE_SDK=$(xcrun -sdk macosx --show-sdk-path) + + APPLE_FILE=$APPLE_SDK/$2 + OUR_FILE=$OUR_SDK/$2 + + if [ -e "$OUR_FILE" ]; then + return 0 + fi + + mkdir -p "$(dirname $OUR_FILE)" + pushd "$(dirname $OUR_FILE)" > /dev/null + ln -s $APPLE_FILE $(basename $OUR_FILE) + popd > /dev/null +} + +function CreatePureDarwinSDK() { + local OUR_SDK=$1 + local APPLE_SDK=$(xcrun -sdk macosx --show-sdk-path) + + mkdir -p $OUR_SDK + cp /usr/local/share/darwinbuild/PDSDKSettings.plist $OUR_SDK + + mkdir -p $OUR_SDK/usr/include + pushd $APPLE_SDK/usr/include > /dev/null + find . -name '*.h' -or -name '*.modulemap' -print > /tmp/sdk-usr-include.$$.txt + popd > /dev/null + + IFS=' +' + while read line; do + _CreatePureDarwinSDKFile $OUR_SDK "usr/include/$line" + done < /tmp/sdk-usr-include.$$.txt + rm -f /tmp/sdk-usr-include.$$.txt + + mkdir -p $OUR_SDK/usr/lib + pushd $APPLE_SDK/usr/lib > /dev/null + find . -name '*.tbd' -print > /tmp/sdk-usr-lib.$$.txt + echo ${APPLE_SDK}/usr/lib/swift >> /tmp/sdk-usr-lib.$$.txt + while read line; do + _CreatePureDarwinSDKFile $OUR_SDK "usr/lib/$base" + done < /tmp/sdk-usr-lib.$$.txt + rm -f /tmp/sdk-usr-lib.$$.txt + popd > /dev/null + + mkdir -p $OUR_SDK/System/Library/Frameworks + pushd System/Library/Frameworks > /dev/null + + # All the egrep -v's are here to filter out nested frameworks. + # This list needs to be kept in sync with the Apple SDK. + # Always include '/Versions' at the end, since we only want + # to symlink the top-level framework. + find . -name \*.framework | \ + egrep -v 'Accelerate\.framework/Versions' | \ + egrep -v 'ApplicationServices\.framework/Versions' | \ + egrep -v 'AutomaticAssessmentConfiguration\.framework/Versions' | \ + egrep -v 'Carbon\.framework/Versions' | \ + egrep -v 'CoreServices\.framework/Versions' | \ + egrep -v 'IMServicePlugIn\.framework/Versions' | \ + egrep -v 'MetalPerformanceShaders\.framework/Versions' | \ + egrep -v 'OpenDirectory\.framework/Versions' | \ + egrep -v 'Quartz\.framework/Versions' | \ + egrep -v 'WebKit\.framework/Versions' \ + > /tmp/sdk-sys.$$.txt + + mkdir -p $OUR_SDK/System/Library/Frameworks + mkdir -p $OUR_SDK/System/Library/PrivateFrameworks + while read line; do + _CreatePureDarwinSDKFile $OUR_SDK "System/Library/Frameworks/$line" + done < /tmp/sdk-sys.$$.txt + rm -f /tmp.sdk-sys.$$.txt + + popd > /dev/null +} From 19ee4f9168df3b7f4749a79da18dc304dde14440 Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 2 Oct 2020 22:38:02 -0400 Subject: [PATCH 334/382] Add PDSDKSettings.plist This file is an exact copy of the SDKSettings.plist file from the macOS Big Sur SDK, except that its name has been changed to puredarwin1.0. --- darwinbuild/PDSDKSettings.plist | 276 ++++++++++++++++++++++++++++++++ 1 file changed, 276 insertions(+) create mode 100644 darwinbuild/PDSDKSettings.plist diff --git a/darwinbuild/PDSDKSettings.plist b/darwinbuild/PDSDKSettings.plist new file mode 100644 index 0000000..a08a57f --- /dev/null +++ b/darwinbuild/PDSDKSettings.plist @@ -0,0 +1,276 @@ + + + + + CanonicalName + puredarwin1.0 + CustomProperties + + KERNEL_EXTENSION_HEADER_SEARCH_PATHS + $(KERNEL_FRAMEWORK)/PrivateHeaders $(KERNEL_FRAMEWORK_HEADERS) + + DebuggerOptions + + SupportsViewDebugging + YES + + DefaultDeploymentTarget + 11.0 + DefaultProperties + + AD_HOC_CODE_SIGNING_ALLOWED + YES + CODE_SIGNING_ALLOWED + YES + DEFAULT_COMPILER + com.apple.compilers.llvm.clang.1_0 + DEPLOYMENT_TARGET_SUGGESTED_VALUES + + 10.9 + 10.10 + 10.11 + 10.12 + 10.13 + 10.14 + 10.15 + 11.0 + + ENTITLEMENTS_DESTINATION + Signature + IOS_UNZIPPERED_TWIN_PREFIX_PATH + /System/iOSSupport + KASAN_DEFAULT_CFLAGS + -DKASAN=1 -fsanitize=address -mllvm -asan-globals-live-support -mllvm -asan-force-dynamic-shadow + MACOSX_DEPLOYMENT_TARGET + 11.0 + PLATFORM_NAME + macosx + TEST_FRAMEWORK_SEARCH_PATHS + $(inherited) $(PLATFORM_DIR)/Developer/$(TEST_FRAMEWORK_DEVELOPER_VARIANT_SUBPATH)Library/Frameworks + TEST_LIBRARY_SEARCH_PATHS + $(inherited) $(PLATFORM_DIR)/Developer/$(TEST_FRAMEWORK_DEVELOPER_VARIANT_SUBPATH)usr/lib + + DefaultVariant + macos + DisplayName + PureDarwin 11.0 + IsBaseSDK + YES + MaximumDeploymentTarget + 11.0.99 + MinimalDisplayName + 11.0 + PropertyConditionFallbackNames + + SupportedTargets + + iosmac + + Archs + + x86_64 + x86_64h + arm64 + arm64e + + BuildVersionPlatformID + 6 + DefaultDeploymentTarget + 14.0 + DeploymentTargetSettingName + IPHONEOS_DEPLOYMENT_TARGET + LLVMTargetTripleEnvironment + macabi + LLVMTargetTripleSys + ios + LLVMTargetTripleVendor + apple + MaximumDeploymentTarget + 14.2.99 + MinimumDeploymentTarget + 13.1 + ValidDeploymentTargets + + 13.1 + 13.2 + 13.3 + 13.3.1 + 13.4 + 13.5 + 14.0 + 14.1 + 14.2 + + + macosx + + Archs + + x86_64 + x86_64h + arm64 + arm64e + + BuildVersionPlatformID + 1 + DefaultDeploymentTarget + 11.0 + DeploymentTargetSettingName + MACOSX_DEPLOYMENT_TARGET + LLVMTargetTripleEnvironment + + LLVMTargetTripleSys + macosx + LLVMTargetTripleVendor + apple + MaximumDeploymentTarget + 11.0.99 + MinimumDeploymentTarget + 10.9 + PlatformFamilyName + macOS + ValidDeploymentTargets + + 10.9 + 10.10 + 10.11 + 10.12 + 10.13 + 10.14 + 10.15 + 11.0 + + + + Variants + + + BuildSettings + + CODE_SIGN_IDENTITY + $(CODE_SIGN_IDENTITY_$(_DEVELOPMENT_TEAM_IS_EMPTY)) + CODE_SIGN_IDENTITY_NO + Apple Development + CODE_SIGN_IDENTITY_YES + - + IPHONEOS_DEPLOYMENT_TARGET + 14.0 + LLVM_TARGET_TRIPLE_OS_VERSION + $(LLVM_TARGET_TRIPLE_OS_VERSION_$(_MACOSX_DEPLOYMENT_TARGET_IS_EMPTY)) + LLVM_TARGET_TRIPLE_OS_VERSION_NO + macos$(MACOSX_DEPLOYMENT_TARGET) + LLVM_TARGET_TRIPLE_OS_VERSION_YES + macos11.0 + LLVM_TARGET_TRIPLE_SUFFIX + + _BOOL_ + NO + _BOOL_NO + NO + _BOOL_YES + YES + _DEVELOPMENT_TEAM_IS_EMPTY + $(_BOOL_$(_IS_EMPTY_$(DEVELOPMENT_TEAM))) + _IS_EMPTY_ + YES + _MACOSX_DEPLOYMENT_TARGET_IS_EMPTY + $(_BOOL_$(_IS_EMPTY_$(MACOSX_DEPLOYMENT_TARGET))) + + Name + macos + + + BuildSettings + + CODE_SIGN_IDENTITY + Apple Development + ENABLE_HARDENED_RUNTIME + YES + IPHONEOS_DEPLOYMENT_TARGET + 14.0 + LIBRARY_SEARCH_PATHS + $(inherited) $(SDKROOT)$(IOS_UNZIPPERED_TWIN_PREFIX_PATH)/usr/lib $(TOOLCHAIN_DIR)/usr/lib/swift/maccatalyst + LLVM_TARGET_TRIPLE_OS_VERSION + $(LLVM_TARGET_TRIPLE_OS_VERSION_$(_IPHONEOS_DEPLOYMENT_TARGET_IS_EMPTY)) + LLVM_TARGET_TRIPLE_OS_VERSION_NO + ios$(IPHONEOS_DEPLOYMENT_TARGET) + LLVM_TARGET_TRIPLE_OS_VERSION_YES + ios14.0 + LLVM_TARGET_TRIPLE_SUFFIX + -macabi + RESOURCES_MINIMUM_DEPLOYMENT_TARGET + $(IPHONEOS_DEPLOYMENT_TARGET) + RESOURCES_PLATFORM_NAME + macosx + RESOURCES_UI_FRAMEWORK_FAMILY + uikit + SWIFT_DEPLOYMENT_TARGET + $(IPHONEOS_DEPLOYMENT_TARGET) + SWIFT_PLATFORM_TARGET_PREFIX + ios + SYSTEM_FRAMEWORK_SEARCH_PATHS + $(inherited) $(SDKROOT)$(IOS_UNZIPPERED_TWIN_PREFIX_PATH)/System/Library/Frameworks + SYSTEM_HEADER_SEARCH_PATHS + $(inherited) $(SDKROOT)$(IOS_UNZIPPERED_TWIN_PREFIX_PATH)/usr/include + TARGETED_DEVICE_FAMILY + 2 + _BOOL_ + NO + _BOOL_NO + NO + _BOOL_YES + YES + _IPHONEOS_DEPLOYMENT_TARGET_IS_EMPTY + $(_BOOL_$(_IS_EMPTY_$(IPHONEOS_DEPLOYMENT_TARGET))) + _IS_EMPTY_ + YES + + Name + iosmac + + + Version + 11.0 + VersionMap + + iOSMac_macOS + + 13.1 + 10.15 + 13.2 + 10.15.1 + 13.3 + 10.15.2 + 13.3.1 + 10.15.3 + 13.4 + 10.15.4 + 13.5 + 10.15.5 + 14.0 + 11.0 + 14.1 + 11.0 + 14.2 + 11.0 + + macOS_iOSMac + + 10.15 + 13.1 + 10.15.1 + 13.2 + 10.15.2 + 13.3 + 10.15.3 + 13.3.1 + 10.15.4 + 13.4 + 10.15.5 + 13.5 + 11.0 + 14.0 + + + + From 290221f451272126800241fa4b21c3cd6bac1eaf Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 2 Oct 2020 22:38:53 -0400 Subject: [PATCH 335/382] Install PDSDKSettings.plist --- darwinbuild.xcodeproj/project.pbxproj | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/darwinbuild.xcodeproj/project.pbxproj b/darwinbuild.xcodeproj/project.pbxproj index f7feb84..a466c2b 100644 --- a/darwinbuild.xcodeproj/project.pbxproj +++ b/darwinbuild.xcodeproj/project.pbxproj @@ -101,6 +101,7 @@ 1FCA51B722E6562800D55269 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FCA51B622E6562800D55269 /* main.swift */; }; 1FCA51BC22E6562F00D55269 /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FF4AFCB22E5237B002F09C6 /* Utilities.swift */; }; 1FCA51BF22E6563C00D55269 /* SwiftCLI in Frameworks */ = {isa = PBXBuildFile; productRef = 1FCA51BE22E6563C00D55269 /* SwiftCLI */; }; + 1FDAA0F525281B7700B92892 /* PDSDKSettings.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1FDAA0F425281B7500B92892 /* PDSDKSettings.plist */; }; 1FDE55C024DB9DE1009ED847 /* libtcl8.6.dylib in Copy libtcl8.6.dylib */ = {isa = PBXBuildFile; fileRef = 1FDE55BD24DB9DBD009ED847 /* libtcl8.6.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 1FECB5DF1FBBBD41002EA059 /* setXcodePlatform in Copy Files */ = {isa = PBXBuildFile; fileRef = 1FECB5DE1FBBBC09002EA059 /* setXcodePlatform */; }; 1FF3C41A24EAF989002A5356 /* libtcl8.6.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FDE55BD24DB9DBD009ED847 /* libtcl8.6.dylib */; }; @@ -607,6 +608,16 @@ ); runOnlyForDeploymentPostprocessing = 1; }; + 1FDAA0F325281B5D00B92892 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 8; + dstPath = /usr/local/share/darwinbuild; + dstSubfolderSpec = 0; + files = ( + 1FDAA0F525281B7700B92892 /* PDSDKSettings.plist in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 1; + }; 1FDE55BF24DB9DD1009ED847 /* Copy libtcl8.6.dylib */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 8; @@ -666,6 +677,7 @@ 1FCA51B622E6562800D55269 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; 1FD9F0CD21B9E90700FB866A /* build.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = build.sh; path = installer/build.sh; sourceTree = ""; }; 1FD9F0CF21B9EAA300FB866A /* distribution.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = distribution.xml; path = installer/distribution.xml; sourceTree = ""; }; + 1FDAA0F425281B7500B92892 /* PDSDKSettings.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PDSDKSettings.plist; path = darwinbuild/PDSDKSettings.plist; sourceTree = ""; }; 1FDE256A24D75B4900CBC605 /* vendor-tcl.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; name = "vendor-tcl.sh"; path = "darwinxref/vendor-tcl.sh"; sourceTree = ""; }; 1FDE55BD24DB9DBD009ED847 /* libtcl8.6.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libtcl8.6.dylib; path = darwinxref/libtcl8.6.dylib; sourceTree = ""; }; 1FEA10392264FBCF008B675D /* notarize.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = notarize.sh; path = installer/notarize.sh; sourceTree = ""; }; @@ -1076,6 +1088,7 @@ 72C86BD510965DC900C66E90 /* darwinbuild */ = { isa = PBXGroup; children = ( + 1FDAA0F425281B7500B92892 /* PDSDKSettings.plist */, 720BE2E9120C909E00B3C4A5 /* digest.c */, 7227AB871098A7BF00BE33D7 /* buildlist */, 7227AB881098A7BF00BE33D7 /* buildorder */, @@ -1821,6 +1834,7 @@ 7227AB8F1098A89700BE33D7 /* Run Script */, 7227ABE61098D5E400BE33D7 /* Run Script */, 1F06C5B52023EB1D003EBE6C /* ShellScript */, + 1FDAA0F325281B5D00B92892 /* CopyFiles */, ); buildRules = ( ); @@ -1963,7 +1977,7 @@ ); runOnlyForDeploymentPostprocessing = 1; shellPath = /bin/sh; - shellScript = "mkdir -p $DSTROOT/usr/local/bin\n/bin/cp $BUILT_PRODUCTS_DIR/darwinbuild $DSTROOT/usr/local/bin"; + shellScript = "mkdir -p $DSTROOT/usr/local/bin\n/bin/cp $BUILT_PRODUCTS_DIR/darwinbuild $DSTROOT/usr/local/bin\n"; showEnvVarsInLog = 0; }; 1F71A4FE2030F7A700020E2F /* ShellScript */ = { @@ -2066,7 +2080,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/cp $DERIVED_FILE_DIR/darwinbuild $BUILT_PRODUCTS_DIR/darwinbuild"; + shellScript = "/bin/cp $DERIVED_FILE_DIR/darwinbuild $BUILT_PRODUCTS_DIR/darwinbuild\n"; }; 7227AC001098D78C00BE33D7 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; From df283cbf2e5dc6134330e8520f81a67da9e475ef Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 2 Oct 2020 22:42:21 -0400 Subject: [PATCH 336/382] Add code to darwinbuild to create the SDK --- darwinbuild/darwinbuild.in | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index cf5670c..1c2c673 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -679,6 +679,21 @@ if [ "$buildtool" == "xcodebuild" ]; then fi fi +### +### Create the PureDarwin Xcode SDK. +### +mkdir -p $BuildRoot/Developer/SDKs +if [ ! -f "$BuildRoot/Developer/PureDarwinSDK.stamp" ]; then + CreatePureDarwinSDK "$BuildRoot/Developer/SDKs/PureDarwin.sdk" + + # This is necessary to squelch an Xcode warning. + pushd "$BuildRoot/Developer/SDKs" > /dev/null + ln -s PureDarwin.sdk MacOSX.sdk + popd > /dev/null + + touch "$BuildRoot/Developer/CreatedPureDarwinSDK.stamp" +fi + ### ### Write out the xcconfig file to override the Xcode SDK. ### From c644581b02362ab2d261ab31ea811f8931c38532 Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 2 Oct 2020 22:43:14 -0400 Subject: [PATCH 337/382] Write SDKROOT settings into darwinbuild.xcconfig --- darwinbuild/darwinbuild.common | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index dfc3579..e0065a1 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -530,10 +530,8 @@ function WriteDarwinbuildXcodeConfig() { local SRCROOT="$2" cat <<-EOF > $SRCROOT/darwinbuild.xcconfig -DEPROOT = $BuildRoot -SYSTEM_HEADER_SEARCH_PATHS = \$(DEPROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \$(DEPROOT)/usr/include \$(DEPROOT)/usr/local/include -FRAMEWORK_SEARCH_PATHS = \$(DEPROOT)/System/Library/Frameworks \$(DEPROOT)/System/Library/PrivateFrameworks -LIBRARY_SEARCH_PATHS = \$(DEPROOT)/usr/local/lib \$(DEPROOT)/usr/lib +SDKROOT = $BuildRoot/Developer/SDKs/MacOSX.sdk +ADDITIONAL_SDKS = $BuildRoot/Developer/SDKs/MacOSX.sdk EOF } From 11f6f6468d0ac0f680d744769f2d03f6b06492c7 Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 2 Oct 2020 22:46:21 -0400 Subject: [PATCH 338/382] Ditto into PureDarwin.sdk This ensures that symlinks to the Apple-provided SDK are overwritten. --- darwinbuild/darwinbuild.common | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index e0065a1..7ccf50d 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -206,7 +206,7 @@ function InstallRoot() { # install a self-built root, or a prebuilt root, or nothing if [ $InstallSelfBuiltRoot -eq 1 ]; then echo "Copying $Project from $SelfBuiltRoot ..." - ditto "$SelfBuiltRoot" "$BuildRoot" + ditto "$SelfBuiltRoot" "$BuildRoot/Developer/SDKs/PureDarwin.sdk" "$DARWINXREF" register "$Project" "$SelfBuiltRoot" > /dev/null TouchReceipt "$BuildRoot" "$Project" "root" @@ -330,13 +330,13 @@ function InstallHeader() { # install a self-built root, or a prebuilt root, or nothing if [ $InstallSelfBuiltHeader -eq 1 ]; then echo "Copying $Project from $SelfBuiltHeader ..." - ditto "$SelfBuiltHeader" "$BuildRoot" + ditto "$SelfBuiltHeader" "$BuildRoot/Developer/SDKs/PureDarwin.sdk" "$DARWINXREF" register "$Project" "$SelfBuiltHeader" > /dev/null TouchReceipt "$BuildRoot" "$Project" "hdrs" return 0 elif [ $InstallSelfBuiltRoot -eq 1 ]; then echo "Copying $Project from $SelfBuiltRoot ..." - ditto "$SelfBuiltRoot" "$BuildRoot" + ditto "$SelfBuiltRoot" "$BuildRoot/Developer/SDKs/PureDarwin.sdk" "$DARWINXREF" register "$Project" "$SelfBuiltRoot" > /dev/null TouchReceipt "$BuildRoot" "$Project" "root" return 0 From 787d49986d285848bc6277a5f137b74d7691ab1e Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 2 Oct 2020 22:47:31 -0400 Subject: [PATCH 339/382] Use BuildCache instead of var/tmp The use of private/var/tmp to store darwinbuild artifacts was a relic from the chroot era. --- darwinbuild/darwinbuild.in | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 1c2c673..03ac169 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -474,13 +474,7 @@ if [ "$nosource" != "YES" ]; then fi fi -### -### We do our building in private/var/tmp since it's -### likely to be out of the way of our dependencies -### and is supposed to be writable by everyone. -### - -vartmp="private/var/tmp" +vartmp="BuildCache" mkdir -p "$BuildRoot/$vartmp" chmod 1777 "$BuildRoot/$vartmp" From 5392ce82cabb4ef004a17510f9003f9a58396f24 Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 2 Oct 2020 22:48:53 -0400 Subject: [PATCH 340/382] Show clang version instead of cctools On modern systems, "as" and "gcc" are both links to clang. There is therefore no need to print the same version twice. --- darwinbuild/darwinbuild.in | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 03ac169..0306e88 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -711,9 +711,7 @@ cat <<-EOF > $SCRIPT echo ' Build action: $action' echo " Build number: $build" echo " Host kernel version: \$(uname -v 2>/dev/null)" - echo " cc version: \$(gcc -v 2>&1 | grep version 2>/dev/null)" - # Panther cctools unlinks -o target, so don't use /dev/null - echo " cctools version: \$(as -v -o /.devnull < /dev/null 2>&1 | grep version | grep -v dwarf-version 2>/dev/null)" + echo " clang version: \$(clang -v 2>&1 | grep version 2>/dev/null)" EOF if [ "$buildtool" == "xcodebuild" ]; then From 08a808e4408aa2f63cbaa1d4c43994cd018166c5 Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 2 Oct 2020 22:50:07 -0400 Subject: [PATCH 341/382] Remove RC_BuildRoot I don't think this is used anywhere anymore. --- darwinbuild/darwinbuild.in | 3 --- 1 file changed, 3 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 0306e88..f8d9dc4 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -749,9 +749,6 @@ for X in \ done IFS="$OLDIFS" -export RC_BuildRoot=$BuildRoot -build_string="$build_string \"RC_BuildRoot=$BuildRoot\"" - cat <<-EOF >> $SCRIPT echo '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++' echo 'Environment variables:' From 1b5838984e668f08be0c253cf9dbdbeb553a1956 Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 2 Oct 2020 22:51:06 -0400 Subject: [PATCH 342/382] Reinstate DEPROOT This is for backwards compatibility. --- darwinbuild/darwinbuild.common | 5 +++-- darwinbuild/darwinbuild.in | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index 7ccf50d..25f6711 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -530,8 +530,9 @@ function WriteDarwinbuildXcodeConfig() { local SRCROOT="$2" cat <<-EOF > $SRCROOT/darwinbuild.xcconfig -SDKROOT = $BuildRoot/Developer/SDKs/MacOSX.sdk -ADDITIONAL_SDKS = $BuildRoot/Developer/SDKs/MacOSX.sdk +DEPROOT = $BuildRoot/Developer/SDKs/MacOSX.sdk +SDKROOT = \$(DEPROOT) +ADDITIONAL_SDKS = \$(DEPROOT) EOF } diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index f8d9dc4..789b3f2 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -654,7 +654,7 @@ elif [ "$target" != "" ]; then fi if [ "$buildtool" == "make" ]; then - build_string="$build_string DEPROOT=$BuildRoot" + build_string="$build_string DEPROOT=$BuildRoot/Developer/SDKs/PureDarwin.sdk" fi # From 6aee0dbb807a11b375bf51cd6c783e74acaf8f1d Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 2 Oct 2020 22:53:37 -0400 Subject: [PATCH 343/382] Typo fix --- darwinbuild/darwinbuild.common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index 25f6711..2883d0f 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -583,7 +583,7 @@ function CreatePureDarwinSDK() { popd > /dev/null mkdir -p $OUR_SDK/System/Library/Frameworks - pushd System/Library/Frameworks > /dev/null + pushd $APPLE_SDK/System/Library/Frameworks > /dev/null # All the egrep -v's are here to filter out nested frameworks. # This list needs to be kept in sync with the Apple SDK. From 3e3cdaee2cb89bb99dfe8d913b425d2ab54f43b5 Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 2 Oct 2020 23:00:33 -0400 Subject: [PATCH 344/382] Fix copying of .h files --- darwinbuild/darwinbuild.common | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index 2883d0f..c6eea38 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -562,7 +562,8 @@ function CreatePureDarwinSDK() { mkdir -p $OUR_SDK/usr/include pushd $APPLE_SDK/usr/include > /dev/null - find . -name '*.h' -or -name '*.modulemap' -print > /tmp/sdk-usr-include.$$.txt + find . -name '*.h' -print > /tmp/sdk-usr-include.$$.txt + find . -name '*.modulemap' -print >> /tmp/sdk-usr-include.$$.txt popd > /dev/null IFS=' From 8c8d0992c786b377936c5bfdb3c393769363b6a1 Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 2 Oct 2020 23:01:00 -0400 Subject: [PATCH 345/382] Fix if test, add status message --- darwinbuild/darwinbuild.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 789b3f2..ec8a1c1 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -677,7 +677,8 @@ fi ### Create the PureDarwin Xcode SDK. ### mkdir -p $BuildRoot/Developer/SDKs -if [ ! -f "$BuildRoot/Developer/PureDarwinSDK.stamp" ]; then +if [ ! -f "$BuildRoot/Developer/.CreatedPureDarwinSDK" ]; then + echo "*** Creating fresh PureDarwin SDK, this may take a while ..." CreatePureDarwinSDK "$BuildRoot/Developer/SDKs/PureDarwin.sdk" # This is necessary to squelch an Xcode warning. @@ -685,7 +686,7 @@ if [ ! -f "$BuildRoot/Developer/PureDarwinSDK.stamp" ]; then ln -s PureDarwin.sdk MacOSX.sdk popd > /dev/null - touch "$BuildRoot/Developer/CreatedPureDarwinSDK.stamp" + touch "$BuildRoot/Developer/.CreatedPureDarwinSDK" fi ### From 85382a63734abef2a8870c3004ab71dd5e4a3c42 Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 2 Oct 2020 23:03:40 -0400 Subject: [PATCH 346/382] Fix filename --- darwinbuild/darwinbuild.common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index c6eea38..2413661 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -558,7 +558,7 @@ function CreatePureDarwinSDK() { local APPLE_SDK=$(xcrun -sdk macosx --show-sdk-path) mkdir -p $OUR_SDK - cp /usr/local/share/darwinbuild/PDSDKSettings.plist $OUR_SDK + cp /usr/local/share/darwinbuild/PDSDKSettings.plist $OUR_SDK/SDKSettings.plist mkdir -p $OUR_SDK/usr/include pushd $APPLE_SDK/usr/include > /dev/null From 2eb60c3e46f93e836a41145847e5c960e7c6c587 Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 2 Oct 2020 23:12:32 -0400 Subject: [PATCH 347/382] Fix SDKROOT value This was verified as working as of Xcode 12.2 build 12B5018i. --- darwinbuild/darwinbuild.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index ec8a1c1..4382dfe 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -738,6 +738,10 @@ EOF ### build_string="$build_string \"SRCROOT=$SRCROOT\" \"OBJROOT=$OBJROOT\" \"SYMROOT=$SYMROOT\" \"DSTROOT=$DSTROOT\"" +if [ "$buildtool" == "xcodebuild" ]; then + build_string="$build_string SDKROOT=puredarwin1.0 ADDITIONAL_SDKS=$BuildRoot/Developer/SDKs/MacOSX.sdk" +fi + XREF_ENV=$($DARWINXREF environment $projnam) OLDIFS="$IFS" IFS=$'\n' From a9b2ac21b1150905689c008ae0f935af0771fade Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 2 Oct 2020 23:15:01 -0400 Subject: [PATCH 348/382] Typo fix --- darwinbuild/darwinbuild.common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index 2413661..aa6de6f 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -578,7 +578,7 @@ function CreatePureDarwinSDK() { find . -name '*.tbd' -print > /tmp/sdk-usr-lib.$$.txt echo ${APPLE_SDK}/usr/lib/swift >> /tmp/sdk-usr-lib.$$.txt while read line; do - _CreatePureDarwinSDKFile $OUR_SDK "usr/lib/$base" + _CreatePureDarwinSDKFile $OUR_SDK "usr/lib/$line" done < /tmp/sdk-usr-lib.$$.txt rm -f /tmp/sdk-usr-lib.$$.txt popd > /dev/null From 1b7e87483d068b484635a9cc95a612f96c81c007 Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 2 Oct 2020 23:21:24 -0400 Subject: [PATCH 349/382] Delete stale symlinks to avoid following them Doing so may corrupt Xcode. That's bad. --- darwinbuild/darwinbuild.common | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index aa6de6f..3d09cfc 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -549,6 +549,12 @@ function _CreatePureDarwinSDKFile() { mkdir -p "$(dirname $OUR_FILE)" pushd "$(dirname $OUR_FILE)" > /dev/null + + if [ -L $(basename $OUR_FILE) ]; then + # Delete any old symlinks, so we don't follow them. + rm -f $(basename $OUR_FILE) + fi + ln -s $APPLE_FILE $(basename $OUR_FILE) popd > /dev/null } From 5e05db2820787d639d659b56ac465d474b65813d Mon Sep 17 00:00:00 2001 From: William Kent Date: Sat, 3 Oct 2020 12:13:23 -0400 Subject: [PATCH 350/382] Mark variables as local --- darwinbuild/darwinbuild.common | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index 3d09cfc..bd35c6f 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -537,11 +537,11 @@ EOF } function _CreatePureDarwinSDKFile() { - OUR_SDK=$1 - APPLE_SDK=$(xcrun -sdk macosx --show-sdk-path) + local OUR_SDK=$1 + local APPLE_SDK=$(xcrun -sdk macosx --show-sdk-path) - APPLE_FILE=$APPLE_SDK/$2 - OUR_FILE=$OUR_SDK/$2 + local APPLE_FILE=$APPLE_SDK/$2 + local OUR_FILE=$OUR_SDK/$2 if [ -e "$OUR_FILE" ]; then return 0 From ac14d941f49e0282384c09f492e13c4be6724f95 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sat, 3 Oct 2020 12:14:35 -0400 Subject: [PATCH 351/382] Reduce the number of basename and dirname calls --- darwinbuild/darwinbuild.common | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index bd35c6f..0e53eeb 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -543,19 +543,22 @@ function _CreatePureDarwinSDKFile() { local APPLE_FILE=$APPLE_SDK/$2 local OUR_FILE=$OUR_SDK/$2 + local OUR_FILE_DIR=$(dirname $OUR_FILE) + local OUR_FILE_BASE=$(basename $OUR_FILE) + if [ -e "$OUR_FILE" ]; then return 0 fi - mkdir -p "$(dirname $OUR_FILE)" - pushd "$(dirname $OUR_FILE)" > /dev/null + mkdir -p "$OUR_FILE_DIR" + pushd "$OUR_FILE_DIR" > /dev/null - if [ -L $(basename $OUR_FILE) ]; then + if [ -L $OUR_FILE_BASE ]; then # Delete any old symlinks, so we don't follow them. - rm -f $(basename $OUR_FILE) + rm -f $OUR_FILE_BASE fi - ln -s $APPLE_FILE $(basename $OUR_FILE) + ln -s $APPLE_FILE $OUR_FILE_BASE popd > /dev/null } From fc804a2abe36c45755b9b0134cbeac3f951d9ac2 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sat, 3 Oct 2020 12:18:18 -0400 Subject: [PATCH 352/382] Symlink darwinbuild receipts folder This allows darwinbuild to show the proper list of installed roots during a build. --- darwinbuild/darwinbuild.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 4382dfe..6a61fe1 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -681,6 +681,11 @@ if [ ! -f "$BuildRoot/Developer/.CreatedPureDarwinSDK" ]; then echo "*** Creating fresh PureDarwin SDK, this may take a while ..." CreatePureDarwinSDK "$BuildRoot/Developer/SDKs/PureDarwin.sdk" + rmdir "$BuildRoot/usr/local/darwinbuild/receipts" || : + pushd "$BuildRoot/usr/local/darwinbuild" > /dev/null + ln -s ../../../Developer/SDKs/PureDarwin.sdk/usr/local/darwinbuild/receipts + popd > /dev/null + # This is necessary to squelch an Xcode warning. pushd "$BuildRoot/Developer/SDKs" > /dev/null ln -s PureDarwin.sdk MacOSX.sdk From c1e59d68c455d655fbef0bb86b79973bdd213ad6 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sat, 3 Oct 2020 12:20:16 -0400 Subject: [PATCH 353/382] Save and restore $IFS --- darwinbuild/darwinbuild.common | 2 ++ 1 file changed, 2 insertions(+) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index 0e53eeb..4b34716 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -575,6 +575,7 @@ function CreatePureDarwinSDK() { find . -name '*.modulemap' -print >> /tmp/sdk-usr-include.$$.txt popd > /dev/null + OLD_IFS=$IFS IFS=' ' while read line; do @@ -620,4 +621,5 @@ function CreatePureDarwinSDK() { rm -f /tmp.sdk-sys.$$.txt popd > /dev/null + IFS=$OLD_IFS } From b1a21bd22562dca10cf89016ab5901010ef46299 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sat, 3 Oct 2020 12:38:49 -0400 Subject: [PATCH 354/382] Use cp instead of ditto ditto refuses to overwrite a symlink with a directory. --- darwinbuild/darwinbuild.common | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index 4b34716..7f9d096 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -206,7 +206,7 @@ function InstallRoot() { # install a self-built root, or a prebuilt root, or nothing if [ $InstallSelfBuiltRoot -eq 1 ]; then echo "Copying $Project from $SelfBuiltRoot ..." - ditto "$SelfBuiltRoot" "$BuildRoot/Developer/SDKs/PureDarwin.sdk" + cp -afPR $SelfBuiltRoot/ "$BuildRoot/Developer/SDKs/PureDarwin.sdk" || exit 2 "$DARWINXREF" register "$Project" "$SelfBuiltRoot" > /dev/null TouchReceipt "$BuildRoot" "$Project" "root" @@ -330,13 +330,13 @@ function InstallHeader() { # install a self-built root, or a prebuilt root, or nothing if [ $InstallSelfBuiltHeader -eq 1 ]; then echo "Copying $Project from $SelfBuiltHeader ..." - ditto "$SelfBuiltHeader" "$BuildRoot/Developer/SDKs/PureDarwin.sdk" + cp -afPR $SelfBuiltHeader/ "$BuildRoot/Developer/SDKs/PureDarwin.sdk" || exit 2 "$DARWINXREF" register "$Project" "$SelfBuiltHeader" > /dev/null TouchReceipt "$BuildRoot" "$Project" "hdrs" return 0 elif [ $InstallSelfBuiltRoot -eq 1 ]; then echo "Copying $Project from $SelfBuiltRoot ..." - ditto "$SelfBuiltRoot" "$BuildRoot/Developer/SDKs/PureDarwin.sdk" + cp -afPR $SelfBuiltRoot/ "$BuildRoot/Developer/SDKs/PureDarwin.sdk" || exit 2 "$DARWINXREF" register "$Project" "$SelfBuiltRoot" > /dev/null TouchReceipt "$BuildRoot" "$Project" "root" return 0 From 531ec9ed7df02e39344b16d226fba909f600e63d Mon Sep 17 00:00:00 2001 From: William Kent Date: Sat, 3 Oct 2020 12:48:38 -0400 Subject: [PATCH 355/382] Do not symlink frameworks when creating SDK This will cause endless problems later, because neither cp nor ditto will remove a symbolic link to replace it with a directory. --- darwinbuild/darwinbuild.common | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index 7f9d096..0c10c8d 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -593,32 +593,8 @@ function CreatePureDarwinSDK() { rm -f /tmp/sdk-usr-lib.$$.txt popd > /dev/null - mkdir -p $OUR_SDK/System/Library/Frameworks - pushd $APPLE_SDK/System/Library/Frameworks > /dev/null - - # All the egrep -v's are here to filter out nested frameworks. - # This list needs to be kept in sync with the Apple SDK. - # Always include '/Versions' at the end, since we only want - # to symlink the top-level framework. - find . -name \*.framework | \ - egrep -v 'Accelerate\.framework/Versions' | \ - egrep -v 'ApplicationServices\.framework/Versions' | \ - egrep -v 'AutomaticAssessmentConfiguration\.framework/Versions' | \ - egrep -v 'Carbon\.framework/Versions' | \ - egrep -v 'CoreServices\.framework/Versions' | \ - egrep -v 'IMServicePlugIn\.framework/Versions' | \ - egrep -v 'MetalPerformanceShaders\.framework/Versions' | \ - egrep -v 'OpenDirectory\.framework/Versions' | \ - egrep -v 'Quartz\.framework/Versions' | \ - egrep -v 'WebKit\.framework/Versions' \ - > /tmp/sdk-sys.$$.txt - mkdir -p $OUR_SDK/System/Library/Frameworks mkdir -p $OUR_SDK/System/Library/PrivateFrameworks - while read line; do - _CreatePureDarwinSDKFile $OUR_SDK "System/Library/Frameworks/$line" - done < /tmp/sdk-sys.$$.txt - rm -f /tmp.sdk-sys.$$.txt popd > /dev/null IFS=$OLD_IFS From 1ad36fdeee577685235f93e0a06c5de25ff760fa Mon Sep 17 00:00:00 2001 From: William Kent Date: Sat, 3 Oct 2020 12:48:50 -0400 Subject: [PATCH 356/382] Ensure the SDK is created before it is used --- darwinbuild/darwinbuild.in | 42 +++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 6a61fe1..37c454e 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -486,6 +486,27 @@ OBJROOT="$BuildRoot/$vartmp/$projnam/$project.obj" SYMROOT="$BuildRoot/$vartmp/$projnam/$project.sym" DSTROOT="$BuildRoot/$vartmp/$projnam/$project.root" +### +### Create the PureDarwin Xcode SDK. +### +mkdir -p $BuildRoot/Developer/SDKs +if [ ! -f "$BuildRoot/Developer/.CreatedPureDarwinSDK" ]; then + echo "*** Creating fresh PureDarwin SDK, this may take a while ..." + CreatePureDarwinSDK "$BuildRoot/Developer/SDKs/PureDarwin.sdk" + + rmdir "$BuildRoot/usr/local/darwinbuild/receipts" || : + pushd "$BuildRoot/usr/local/darwinbuild" > /dev/null + ln -sfh ../../../Developer/SDKs/PureDarwin.sdk/usr/local/darwinbuild/receipts receipts + popd > /dev/null + + # This is necessary to squelch an Xcode warning. + pushd "$BuildRoot/Developer/SDKs" > /dev/null + ln -s PureDarwin.sdk MacOSX.sdk + popd > /dev/null + + touch "$BuildRoot/Developer/.CreatedPureDarwinSDK" +fi + if [ "$nosource" != "YES" ]; then ### ### Remove any pre-existing directories that might be in the way @@ -673,27 +694,6 @@ if [ "$buildtool" == "xcodebuild" ]; then fi fi -### -### Create the PureDarwin Xcode SDK. -### -mkdir -p $BuildRoot/Developer/SDKs -if [ ! -f "$BuildRoot/Developer/.CreatedPureDarwinSDK" ]; then - echo "*** Creating fresh PureDarwin SDK, this may take a while ..." - CreatePureDarwinSDK "$BuildRoot/Developer/SDKs/PureDarwin.sdk" - - rmdir "$BuildRoot/usr/local/darwinbuild/receipts" || : - pushd "$BuildRoot/usr/local/darwinbuild" > /dev/null - ln -s ../../../Developer/SDKs/PureDarwin.sdk/usr/local/darwinbuild/receipts - popd > /dev/null - - # This is necessary to squelch an Xcode warning. - pushd "$BuildRoot/Developer/SDKs" > /dev/null - ln -s PureDarwin.sdk MacOSX.sdk - popd > /dev/null - - touch "$BuildRoot/Developer/.CreatedPureDarwinSDK" -fi - ### ### Write out the xcconfig file to override the Xcode SDK. ### From e985d408195b242084e65bc880e7c709fc5b42ff Mon Sep 17 00:00:00 2001 From: William Kent Date: Sat, 3 Oct 2020 12:49:10 -0400 Subject: [PATCH 357/382] Add extra safety check --- darwinbuild/darwinbuild.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 37c454e..0686903 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -501,7 +501,7 @@ if [ ! -f "$BuildRoot/Developer/.CreatedPureDarwinSDK" ]; then # This is necessary to squelch an Xcode warning. pushd "$BuildRoot/Developer/SDKs" > /dev/null - ln -s PureDarwin.sdk MacOSX.sdk + ln -sfh PureDarwin.sdk MacOSX.sdk popd > /dev/null touch "$BuildRoot/Developer/.CreatedPureDarwinSDK" From 91d67822e788a4aa02d4654f129d769b0158cb74 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sat, 3 Oct 2020 13:15:09 -0400 Subject: [PATCH 358/382] Fix path error --- darwinbuild/darwinbuild.common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index 0c10c8d..3dc0df5 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -586,7 +586,7 @@ function CreatePureDarwinSDK() { mkdir -p $OUR_SDK/usr/lib pushd $APPLE_SDK/usr/lib > /dev/null find . -name '*.tbd' -print > /tmp/sdk-usr-lib.$$.txt - echo ${APPLE_SDK}/usr/lib/swift >> /tmp/sdk-usr-lib.$$.txt + echo swift >> /tmp/sdk-usr-lib.$$.txt while read line; do _CreatePureDarwinSDKFile $OUR_SDK "usr/lib/$line" done < /tmp/sdk-usr-lib.$$.txt From f016f9e7383fb994f81bce4e427ade00cfeaea06 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sat, 3 Oct 2020 13:18:49 -0400 Subject: [PATCH 359/382] Remove "exit 2" debugging aids; remove extra popd --- darwinbuild/darwinbuild.common | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index 3dc0df5..cd9e100 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -206,7 +206,7 @@ function InstallRoot() { # install a self-built root, or a prebuilt root, or nothing if [ $InstallSelfBuiltRoot -eq 1 ]; then echo "Copying $Project from $SelfBuiltRoot ..." - cp -afPR $SelfBuiltRoot/ "$BuildRoot/Developer/SDKs/PureDarwin.sdk" || exit 2 + cp -afPR $SelfBuiltRoot/ "$BuildRoot/Developer/SDKs/PureDarwin.sdk" "$DARWINXREF" register "$Project" "$SelfBuiltRoot" > /dev/null TouchReceipt "$BuildRoot" "$Project" "root" @@ -330,13 +330,13 @@ function InstallHeader() { # install a self-built root, or a prebuilt root, or nothing if [ $InstallSelfBuiltHeader -eq 1 ]; then echo "Copying $Project from $SelfBuiltHeader ..." - cp -afPR $SelfBuiltHeader/ "$BuildRoot/Developer/SDKs/PureDarwin.sdk" || exit 2 + cp -afPR $SelfBuiltHeader/ "$BuildRoot/Developer/SDKs/PureDarwin.sdk" "$DARWINXREF" register "$Project" "$SelfBuiltHeader" > /dev/null TouchReceipt "$BuildRoot" "$Project" "hdrs" return 0 elif [ $InstallSelfBuiltRoot -eq 1 ]; then echo "Copying $Project from $SelfBuiltRoot ..." - cp -afPR $SelfBuiltRoot/ "$BuildRoot/Developer/SDKs/PureDarwin.sdk" || exit 2 + cp -afPR $SelfBuiltRoot/ "$BuildRoot/Developer/SDKs/PureDarwin.sdk" "$DARWINXREF" register "$Project" "$SelfBuiltRoot" > /dev/null TouchReceipt "$BuildRoot" "$Project" "root" return 0 @@ -586,12 +586,10 @@ function CreatePureDarwinSDK() { mkdir -p $OUR_SDK/usr/lib pushd $APPLE_SDK/usr/lib > /dev/null find . -name '*.tbd' -print > /tmp/sdk-usr-lib.$$.txt - echo swift >> /tmp/sdk-usr-lib.$$.txt while read line; do _CreatePureDarwinSDKFile $OUR_SDK "usr/lib/$line" done < /tmp/sdk-usr-lib.$$.txt rm -f /tmp/sdk-usr-lib.$$.txt - popd > /dev/null mkdir -p $OUR_SDK/System/Library/Frameworks mkdir -p $OUR_SDK/System/Library/PrivateFrameworks From 2818e37e4e6055edbf38a217994fa45b75b7985d Mon Sep 17 00:00:00 2001 From: William Kent Date: Sat, 3 Oct 2020 13:35:01 -0400 Subject: [PATCH 360/382] Add special-case handling for /usr/lib/swift/ --- darwinbuild/darwinbuild.common | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index cd9e100..11639a0 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -591,6 +591,10 @@ function CreatePureDarwinSDK() { done < /tmp/sdk-usr-lib.$$.txt rm -f /tmp/sdk-usr-lib.$$.txt + # Swift requires special handling, since there are more than tbd's in there. + rm -rf ${OUR_SDK}/usr/lib/swift + ditto ${APPLE_SDK}/usr/lib/swift ${OUR_SDK}/usr/lib/swift + mkdir -p $OUR_SDK/System/Library/Frameworks mkdir -p $OUR_SDK/System/Library/PrivateFrameworks From fdf6c271e54b846d4837572120836a3b82016792 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sun, 18 Oct 2020 22:21:34 -0400 Subject: [PATCH 361/382] Add -nosdk flag --- darwinbuild/darwinbuild.in | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 0686903..31f1b8f 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -86,6 +86,7 @@ target="" configuration="" version="" codesign="-" +use_sdkroot="true" INSTALL_XCODE="NO" @@ -181,7 +182,7 @@ function PrintUsage() { actions: [-headers] [-fetch] [-source] [-load] [-loadonly] [-recursive] [-group] options: [-build=X] [-target=X] [-configuration=X] [-logdeps] [-nopatch] [-noload] [-codesign=] - [-depsbuild=X [-depsbuild=Y]] [-nosource] + [-depsbuild=X [-depsbuild=Y]] [-nosource] [-nosdk] EOF exit 1 @@ -331,6 +332,8 @@ for ARG in "$@"; do echo "Using default ad-hoc signing." 1>&2 codesign=- fi + elif [ "${ARG}" == "-nosdk" ]; then + use_sdkroot="false" elif [ "${ARG:0:1}" != "-" ]; then projnam="$ARG" else @@ -743,7 +746,7 @@ EOF ### build_string="$build_string \"SRCROOT=$SRCROOT\" \"OBJROOT=$OBJROOT\" \"SYMROOT=$SYMROOT\" \"DSTROOT=$DSTROOT\"" -if [ "$buildtool" == "xcodebuild" ]; then +if [ "$buildtool" == "xcodebuild" -a "$use_sdkroot" == "true" ]; then build_string="$build_string SDKROOT=puredarwin1.0 ADDITIONAL_SDKS=$BuildRoot/Developer/SDKs/MacOSX.sdk" fi From 4b64f585980f8e371955bf0b039b9b8c750c54f4 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 27 Oct 2020 15:59:58 -0400 Subject: [PATCH 362/382] Don't create the SDK if -nosdk is specified --- darwinbuild/darwinbuild.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 31f1b8f..53fb80d 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -493,7 +493,7 @@ DSTROOT="$BuildRoot/$vartmp/$projnam/$project.root" ### Create the PureDarwin Xcode SDK. ### mkdir -p $BuildRoot/Developer/SDKs -if [ ! -f "$BuildRoot/Developer/.CreatedPureDarwinSDK" ]; then +if [ ! -f "$BuildRoot/Developer/.CreatedPureDarwinSDK" -a "$use_sdkroot" == "true" ]; then echo "*** Creating fresh PureDarwin SDK, this may take a while ..." CreatePureDarwinSDK "$BuildRoot/Developer/SDKs/PureDarwin.sdk" From 6894e5929704d0645010b19f0e3729dd71a8ef4f Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 27 Oct 2020 16:07:14 -0400 Subject: [PATCH 363/382] Make CreatePureDarwinSDK more efficient --- darwinbuild/darwinbuild.common | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index 11639a0..55c94d2 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -538,10 +538,10 @@ EOF function _CreatePureDarwinSDKFile() { local OUR_SDK=$1 - local APPLE_SDK=$(xcrun -sdk macosx --show-sdk-path) + local APPLE_SDK=$2 - local APPLE_FILE=$APPLE_SDK/$2 - local OUR_FILE=$OUR_SDK/$2 + local APPLE_FILE=$APPLE_SDK/$3 + local OUR_FILE=$OUR_SDK/$3 local OUR_FILE_DIR=$(dirname $OUR_FILE) local OUR_FILE_BASE=$(basename $OUR_FILE) @@ -579,7 +579,7 @@ function CreatePureDarwinSDK() { IFS=' ' while read line; do - _CreatePureDarwinSDKFile $OUR_SDK "usr/include/$line" + _CreatePureDarwinSDKFile $OUR_SDK $APPLE_SDK "usr/include/$line" done < /tmp/sdk-usr-include.$$.txt rm -f /tmp/sdk-usr-include.$$.txt @@ -587,7 +587,7 @@ function CreatePureDarwinSDK() { pushd $APPLE_SDK/usr/lib > /dev/null find . -name '*.tbd' -print > /tmp/sdk-usr-lib.$$.txt while read line; do - _CreatePureDarwinSDKFile $OUR_SDK "usr/lib/$line" + _CreatePureDarwinSDKFile $OUR_SDK $APPLE_SDK "usr/lib/$line" done < /tmp/sdk-usr-lib.$$.txt rm -f /tmp/sdk-usr-lib.$$.txt From e9db182743426a7a844e10a8a61e8a97edb6b7c9 Mon Sep 17 00:00:00 2001 From: William Kent Date: Tue, 27 Oct 2020 16:07:43 -0400 Subject: [PATCH 364/382] Simplify specification of alternate SDK I have verified that this approach works on Xcode 12.2 beta 2. --- darwinbuild/darwinbuild.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 53fb80d..63552e7 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -747,7 +747,7 @@ EOF build_string="$build_string \"SRCROOT=$SRCROOT\" \"OBJROOT=$OBJROOT\" \"SYMROOT=$SYMROOT\" \"DSTROOT=$DSTROOT\"" if [ "$buildtool" == "xcodebuild" -a "$use_sdkroot" == "true" ]; then - build_string="$build_string SDKROOT=puredarwin1.0 ADDITIONAL_SDKS=$BuildRoot/Developer/SDKs/MacOSX.sdk" + build_string="$build_string SDKROOT=$BuildRoot/Developer/SDKs/PureDarwin.sdk" fi XREF_ENV=$($DARWINXREF environment $projnam) From 46e82417bc8f57f05e99d50a8f4b94aa0c9361e6 Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 20 Nov 2020 15:24:57 -0500 Subject: [PATCH 365/382] Revert "Do not symlink frameworks when creating SDK" I have come up with a better way to accomplish this. This reverts commit 531ec9ed7df02e39344b16d226fba909f600e63d. --- darwinbuild/darwinbuild.common | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index 55c94d2..9b3d88f 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -595,8 +595,32 @@ function CreatePureDarwinSDK() { rm -rf ${OUR_SDK}/usr/lib/swift ditto ${APPLE_SDK}/usr/lib/swift ${OUR_SDK}/usr/lib/swift + mkdir -p $OUR_SDK/System/Library/Frameworks + pushd $APPLE_SDK/System/Library/Frameworks > /dev/null + + # All the egrep -v's are here to filter out nested frameworks. + # This list needs to be kept in sync with the Apple SDK. + # Always include '/Versions' at the end, since we only want + # to symlink the top-level framework. + find . -name \*.framework | \ + egrep -v 'Accelerate\.framework/Versions' | \ + egrep -v 'ApplicationServices\.framework/Versions' | \ + egrep -v 'AutomaticAssessmentConfiguration\.framework/Versions' | \ + egrep -v 'Carbon\.framework/Versions' | \ + egrep -v 'CoreServices\.framework/Versions' | \ + egrep -v 'IMServicePlugIn\.framework/Versions' | \ + egrep -v 'MetalPerformanceShaders\.framework/Versions' | \ + egrep -v 'OpenDirectory\.framework/Versions' | \ + egrep -v 'Quartz\.framework/Versions' | \ + egrep -v 'WebKit\.framework/Versions' \ + > /tmp/sdk-sys.$$.txt + mkdir -p $OUR_SDK/System/Library/Frameworks mkdir -p $OUR_SDK/System/Library/PrivateFrameworks + while read line; do + _CreatePureDarwinSDKFile $OUR_SDK "System/Library/Frameworks/$line" + done < /tmp/sdk-sys.$$.txt + rm -f /tmp.sdk-sys.$$.txt popd > /dev/null IFS=$OLD_IFS From cfa0120fe9df8f4c191b6c5eb73e7ba4f158cca6 Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 20 Nov 2020 16:15:04 -0500 Subject: [PATCH 366/382] Use different method to copy roots into the BuildRoot --- darwinbuild/darwinbuild.common | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index 9b3d88f..238b71b 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -155,6 +155,32 @@ function Download() { done } +function _CopyRoot() { + local src="$1" + local dstroot="$2" + + find $src -print0 | xargs -0 -L 1 echo | while read line; do + line=$(echo $line | sed -Ee "s,$src/?,,g") + + if [ -d "$src/$line" ]; then + mkdir -p $dstroot/$line + else + if [ -L "$line" ]; then + dirname=$(dirname $line) + basename=$(basename $line) + + pushd $dstroot/$dirname > /dev/null + rm $basename + ln -s "$(readlink $src/$line)" $basename + popd > /dev/null + else + mkdir -p $(dirname $dstroot/$line) + ditto $src/$line $dstroot/$line + fi + fi + done +} + ### ### Installs a root into the BuildRoot. Mediates between ### receipts, pre-built roots, and self-built roots, so that @@ -206,7 +232,7 @@ function InstallRoot() { # install a self-built root, or a prebuilt root, or nothing if [ $InstallSelfBuiltRoot -eq 1 ]; then echo "Copying $Project from $SelfBuiltRoot ..." - cp -afPR $SelfBuiltRoot/ "$BuildRoot/Developer/SDKs/PureDarwin.sdk" + _CopyRoot "$SelfBuiltRoot" "$BuildRoot/Developer/SDKs/PureDarwin.sdk" "$DARWINXREF" register "$Project" "$SelfBuiltRoot" > /dev/null TouchReceipt "$BuildRoot" "$Project" "root" From 9db2da03736a2b5983154451352bc4bc81fedf7b Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 20 Nov 2020 16:37:02 -0500 Subject: [PATCH 367/382] Fix symlinking of SDK frameworks --- darwinbuild/darwinbuild.common | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index 238b71b..a66caa3 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -624,27 +624,11 @@ function CreatePureDarwinSDK() { mkdir -p $OUR_SDK/System/Library/Frameworks pushd $APPLE_SDK/System/Library/Frameworks > /dev/null - # All the egrep -v's are here to filter out nested frameworks. - # This list needs to be kept in sync with the Apple SDK. - # Always include '/Versions' at the end, since we only want - # to symlink the top-level framework. - find . -name \*.framework | \ - egrep -v 'Accelerate\.framework/Versions' | \ - egrep -v 'ApplicationServices\.framework/Versions' | \ - egrep -v 'AutomaticAssessmentConfiguration\.framework/Versions' | \ - egrep -v 'Carbon\.framework/Versions' | \ - egrep -v 'CoreServices\.framework/Versions' | \ - egrep -v 'IMServicePlugIn\.framework/Versions' | \ - egrep -v 'MetalPerformanceShaders\.framework/Versions' | \ - egrep -v 'OpenDirectory\.framework/Versions' | \ - egrep -v 'Quartz\.framework/Versions' | \ - egrep -v 'WebKit\.framework/Versions' \ - > /tmp/sdk-sys.$$.txt - + find . -name \*.framework -depth 1 > /tmp/sdk-sys.$$.txt mkdir -p $OUR_SDK/System/Library/Frameworks mkdir -p $OUR_SDK/System/Library/PrivateFrameworks while read line; do - _CreatePureDarwinSDKFile $OUR_SDK "System/Library/Frameworks/$line" + _CreatePureDarwinSDKFile $OUR_SDK $APPLE_SDK "System/Library/Frameworks/$line" done < /tmp/sdk-sys.$$.txt rm -f /tmp.sdk-sys.$$.txt From 4682660a57ac919b8c7f1116f676e6cf5a63dde3 Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 20 Nov 2020 16:39:42 -0500 Subject: [PATCH 368/382] Squelch pointless Xcode warning --- darwinbuild/darwinbuild.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 63552e7..a3c18ad 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -678,7 +678,7 @@ elif [ "$target" != "" ]; then fi if [ "$buildtool" == "make" ]; then - build_string="$build_string DEPROOT=$BuildRoot/Developer/SDKs/PureDarwin.sdk" + build_string="$build_string DEPROOT=$BuildRoot/Developer/SDKs/MacOSX.sdk" fi # @@ -747,7 +747,7 @@ EOF build_string="$build_string \"SRCROOT=$SRCROOT\" \"OBJROOT=$OBJROOT\" \"SYMROOT=$SYMROOT\" \"DSTROOT=$DSTROOT\"" if [ "$buildtool" == "xcodebuild" -a "$use_sdkroot" == "true" ]; then - build_string="$build_string SDKROOT=$BuildRoot/Developer/SDKs/PureDarwin.sdk" + build_string="$build_string SDKROOT=$BuildRoot/Developer/SDKs/MacOSX.sdk" fi XREF_ENV=$($DARWINXREF environment $projnam) From a6b4e7dfc70a63a926cb00a05234fb23c683c64f Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 20 Nov 2020 16:42:44 -0500 Subject: [PATCH 369/382] Fix installation of header roots --- darwinbuild/darwinbuild.common | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index a66caa3..86f1a64 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -356,13 +356,13 @@ function InstallHeader() { # install a self-built root, or a prebuilt root, or nothing if [ $InstallSelfBuiltHeader -eq 1 ]; then echo "Copying $Project from $SelfBuiltHeader ..." - cp -afPR $SelfBuiltHeader/ "$BuildRoot/Developer/SDKs/PureDarwin.sdk" + _CopyRoot $SelfBuiltHeader/ "$BuildRoot/Developer/SDKs/PureDarwin.sdk" "$DARWINXREF" register "$Project" "$SelfBuiltHeader" > /dev/null TouchReceipt "$BuildRoot" "$Project" "hdrs" return 0 elif [ $InstallSelfBuiltRoot -eq 1 ]; then echo "Copying $Project from $SelfBuiltRoot ..." - cp -afPR $SelfBuiltRoot/ "$BuildRoot/Developer/SDKs/PureDarwin.sdk" + _CopyRoot $SelfBuiltRoot/ "$BuildRoot/Developer/SDKs/PureDarwin.sdk" "$DARWINXREF" register "$Project" "$SelfBuiltRoot" > /dev/null TouchReceipt "$BuildRoot" "$Project" "root" return 0 From 240526dd8dc846785fab613e2c374a6dd0495490 Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 20 Nov 2020 16:50:53 -0500 Subject: [PATCH 370/382] Simplify root-copying code significantly --- darwinbuild/darwinbuild.common | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index 86f1a64..86f42c1 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -159,7 +159,11 @@ function _CopyRoot() { local src="$1" local dstroot="$2" - find $src -print0 | xargs -0 -L 1 echo | while read line; do + OLD_IFS=$IFS + IFS=' +' + find $src > /tmp/root.$$.txt + while read line; do line=$(echo $line | sed -Ee "s,$src/?,,g") if [ -d "$src/$line" ]; then @@ -178,7 +182,10 @@ function _CopyRoot() { ditto $src/$line $dstroot/$line fi fi - done + done < /tmp/root.$$.txt + rm /tmp/root.$$.txt + + IFS=$OLD_IFS } ### From e63d991a79288122a54f1a9abdcb37d552fa7a4e Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 20 Nov 2020 16:51:01 -0500 Subject: [PATCH 371/382] Typo fix --- darwinbuild/darwinbuild.common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index 86f42c1..75e617c 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -637,7 +637,7 @@ function CreatePureDarwinSDK() { while read line; do _CreatePureDarwinSDKFile $OUR_SDK $APPLE_SDK "System/Library/Frameworks/$line" done < /tmp/sdk-sys.$$.txt - rm -f /tmp.sdk-sys.$$.txt + rm -f /tmp/sdk-sys.$$.txt popd > /dev/null IFS=$OLD_IFS From f4e987121a32420f8e9b8086d3b6c34ea5d84bf1 Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 20 Nov 2020 17:00:35 -0500 Subject: [PATCH 372/382] Don't follow symlinks into Xcode Doing so requires that I reinstall Xcode. That's bad. --- darwinbuild/darwinbuild.common | 1 + 1 file changed, 1 insertion(+) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index 75e617c..f0b08b2 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -179,6 +179,7 @@ function _CopyRoot() { popd > /dev/null else mkdir -p $(dirname $dstroot/$line) + rm -f $dstroot/$line ditto $src/$line $dstroot/$line fi fi From 18e0d28ca7d34f2460dbe936c814d51f7e7d0e2c Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 20 Nov 2020 17:02:57 -0500 Subject: [PATCH 373/382] Add extra safety check --- darwinbuild/darwinbuild.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index a3c18ad..b9268fa 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -495,6 +495,12 @@ DSTROOT="$BuildRoot/$vartmp/$projnam/$project.root" mkdir -p $BuildRoot/Developer/SDKs if [ ! -f "$BuildRoot/Developer/.CreatedPureDarwinSDK" -a "$use_sdkroot" == "true" ]; then echo "*** Creating fresh PureDarwin SDK, this may take a while ..." + + # Remove the entire old SDK, to guarantee that we don't + # mistakenly follow a symlink into Apple's SDK and overwrite + # files provided by Apple. If this happens, Xcode must be + # reinstalled, and that takes a long time. + rm -rf "$BuildRoot/Developer/SDKs/PureDarwin.sdk" CreatePureDarwinSDK "$BuildRoot/Developer/SDKs/PureDarwin.sdk" rmdir "$BuildRoot/usr/local/darwinbuild/receipts" || : From 39145eef44c12becc8dd61f6dd9f411bd6b40bb5 Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 20 Nov 2020 17:17:19 -0500 Subject: [PATCH 374/382] Delete symlinks (if any) before making directories --- darwinbuild/darwinbuild.common | 1 + 1 file changed, 1 insertion(+) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index f0b08b2..1dab208 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -167,6 +167,7 @@ function _CopyRoot() { line=$(echo $line | sed -Ee "s,$src/?,,g") if [ -d "$src/$line" ]; then + rm -f $dstroot/$line mkdir -p $dstroot/$line else if [ -L "$line" ]; then From 43ff5ac32c4abdb7661fc92d67e48ba790f6bc18 Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 20 Nov 2020 17:18:51 -0500 Subject: [PATCH 375/382] Keep failing rm call from stopping darwinbuild rm -f directory/ will cause rm to exit with an error, even if -f is passed. We need to ignore this error manually. --- darwinbuild/darwinbuild.common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index 1dab208..e46388b 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -167,7 +167,7 @@ function _CopyRoot() { line=$(echo $line | sed -Ee "s,$src/?,,g") if [ -d "$src/$line" ]; then - rm -f $dstroot/$line + rm -f $dstroot/$line || : mkdir -p $dstroot/$line else if [ -L "$line" ]; then From 17248896cb0678813b11f05a664180c63b3bc7d6 Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 20 Nov 2020 17:53:44 -0500 Subject: [PATCH 376/382] Prevent spurious rm error message --- darwinbuild/darwinbuild.common | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index e46388b..2b304a5 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -167,7 +167,10 @@ function _CopyRoot() { line=$(echo $line | sed -Ee "s,$src/?,,g") if [ -d "$src/$line" ]; then - rm -f $dstroot/$line || : + if [ -L $dstroot/$line ]; then + rm $dstroot/$line + fi + mkdir -p $dstroot/$line else if [ -L "$line" ]; then From 7078f5be70492df2b6b9006f7bf4c30cf3f32ce7 Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 20 Nov 2020 17:54:07 -0500 Subject: [PATCH 377/382] Fix indentation error This has bugged me for a long time. --- darwinbuild/darwinbuild.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index b9268fa..d522476 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -869,7 +869,7 @@ if [ "$EXIT_STATUS" == "0" ]; then ### if [ "$action" == "installhdrs" ]; then - ### Output the manifest + ### Output the manifest MANIFEST="/tmp/$projnam.$$" "$DARWINXREF" register "$projnam" "$DSTROOT" | tee "$MANIFEST" SHA1=$(cat "$MANIFEST" | $DIGEST) From 0e8f15560b562ac8cec5ad4f4a2a673a7c4359ed Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 20 Nov 2020 18:33:39 -0500 Subject: [PATCH 378/382] Copy symlinks before creating directories This fixes copying of framework bundles, which contain several internal symlinks that must be preserved. --- darwinbuild/darwinbuild.common | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index 2b304a5..69c174d 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -166,21 +166,21 @@ function _CopyRoot() { while read line; do line=$(echo $line | sed -Ee "s,$src/?,,g") - if [ -d "$src/$line" ]; then - if [ -L $dstroot/$line ]; then - rm $dstroot/$line - fi - - mkdir -p $dstroot/$line + if [ -L "$src/$line" ]; then + dirname=$(dirname $line) + basename=$(basename $line) + + pushd $dstroot/$dirname > /dev/null + rm $basename + ln -s "$(readlink $src/$line)" $basename + popd > /dev/null else - if [ -L "$line" ]; then - dirname=$(dirname $line) - basename=$(basename $line) - - pushd $dstroot/$dirname > /dev/null - rm $basename - ln -s "$(readlink $src/$line)" $basename - popd > /dev/null + if [ -d "$src/$line" ]; then + if [ -L $dstroot/$line ]; then + rm $dstroot/$line + fi + + mkdir -p $dstroot/$line else mkdir -p $(dirname $dstroot/$line) rm -f $dstroot/$line From bce66511d052489933e7a321fb7dc8ac3aa892b4 Mon Sep 17 00:00:00 2001 From: William Kent Date: Fri, 20 Nov 2020 20:26:10 -0500 Subject: [PATCH 379/382] Process links separately than other files This is necessary to ensure that the internal symbolic links inside frameworks are created correctly. --- darwinbuild/darwinbuild.common | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index 69c174d..1e2cbe5 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -162,18 +162,13 @@ function _CopyRoot() { OLD_IFS=$IFS IFS=' ' - find $src > /tmp/root.$$.txt + find $src '!' -type l > /tmp/root.$$.txt while read line; do line=$(echo $line | sed -Ee "s,$src/?,,g") if [ -L "$src/$line" ]; then - dirname=$(dirname $line) - basename=$(basename $line) - - pushd $dstroot/$dirname > /dev/null - rm $basename - ln -s "$(readlink $src/$line)" $basename - popd > /dev/null + echo "Error: We should not see any symbolic links here" + exit 1 else if [ -d "$src/$line" ]; then if [ -L $dstroot/$line ]; then @@ -190,6 +185,21 @@ function _CopyRoot() { done < /tmp/root.$$.txt rm /tmp/root.$$.txt + # Symbolic links must be processed last, so that their + # targets are all created beforehand. + find $src -type l > /tmp/root-links.$$.txt + while read line; do + line=$(echo $line | sed -Ee "s,$src/?,,g") + dirname=$(dirname $line) + basename=$(basename $line) + + pushd $dstroot/$dirname > /dev/null + rm -f $basename + ln -s "$(readlink $src/$line)" $basename + popd > /dev/null + done < /tmp/root-links.$$.txt + rm /tmp/root-links.$$.txt + IFS=$OLD_IFS } From 4818ff9a309a7f3a84a5768160226268881448a8 Mon Sep 17 00:00:00 2001 From: William Kent Date: Sat, 21 Nov 2020 18:08:10 -0500 Subject: [PATCH 380/382] Silence file-not-found message --- darwinbuild/darwinbuild.common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.common b/darwinbuild/darwinbuild.common index 1e2cbe5..9faf072 100644 --- a/darwinbuild/darwinbuild.common +++ b/darwinbuild/darwinbuild.common @@ -198,7 +198,7 @@ function _CopyRoot() { ln -s "$(readlink $src/$line)" $basename popd > /dev/null done < /tmp/root-links.$$.txt - rm /tmp/root-links.$$.txt + rm -f /tmp/root-links.$$.txt IFS=$OLD_IFS } From acc2413ea7fae4843dd54ee2d654b59d6b45425d Mon Sep 17 00:00:00 2001 From: John Date: Mon, 18 Jan 2021 18:10:11 -0500 Subject: [PATCH 381/382] Fix ugly perl dependancy What 'ls' couldn't do can be done with 'find' --- darwinbuild/darwinbuild.in | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index cf5670c..951eb66 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -761,25 +761,13 @@ cat <<-EOF >> $SCRIPT echo '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++' echo 'Installed Roots:' EOF -# I didn't really want to use perl(1) here, but ls(1) doesn't support this. +# Print symlinks to receipts without relying on perl RECEIPTS=$DARWIN_BUILDROOT/BuildRoot/usr/local/darwinbuild/receipts -perl -e "opendir(DIR,\"$RECEIPTS\"); - @files = sort(readdir(DIR)); - my %seen; - foreach my \$x (@files) { - if ( -l \"$RECEIPTS/\$x\" ) { - \$seen{readlink(\"$RECEIPTS/\$x\")} = 1; - } - } - foreach my \$x (@files) { - my \$str = undef; - if ( -l \"$RECEIPTS/\$x\" ) { - \$str = sprintf \"%-20s -> %s\", \"\$x\", readlink(\"$RECEIPTS/\$x\"); - } elsif (!exists(\$seen{\$x})) { - \$str = sprintf \"%-24s%s\", \"\", \"\$x\"; - } - print \"echo \\\"\$str\\\"\n\" if \$str; - } closedir(DIR);" | tail +3 >> $SCRIPT +exec find $RECEIPTS -maxdepth 1 -type l -exec sh -c ' + for f do + printf "echo \"%-30s -> \t $(readlink $f)\" \n" $(basename -- "$f"); + done' \ +sh {} + >> $SCRIPT cat <<-EOF >> $SCRIPT echo '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++' echo $buildtool $action '$build_string' \< /dev/null From 7d38cb0906cea8125fa2132fec74d611aac9dcd3 Mon Sep 17 00:00:00 2001 From: William Kent Date: Mon, 18 Jan 2021 19:13:59 -0500 Subject: [PATCH 382/382] Fix find invocation `exec find` causes darwinbuild to stop after running the find command. This is not useful. Also added `-H` flag to ensure that the receipts are still read even if the receipts directory itself is a symlink. --- darwinbuild/darwinbuild.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwinbuild/darwinbuild.in b/darwinbuild/darwinbuild.in index 951eb66..4eca4a0 100644 --- a/darwinbuild/darwinbuild.in +++ b/darwinbuild/darwinbuild.in @@ -763,7 +763,7 @@ cat <<-EOF >> $SCRIPT EOF # Print symlinks to receipts without relying on perl RECEIPTS=$DARWIN_BUILDROOT/BuildRoot/usr/local/darwinbuild/receipts -exec find $RECEIPTS -maxdepth 1 -type l -exec sh -c ' +find -H $RECEIPTS -maxdepth 1 -type l -exec sh -c ' for f do printf "echo \"%-30s -> \t $(readlink $f)\" \n" $(basename -- "$f"); done' \