Skip to content
This repository has been archived by the owner on Aug 14, 2022. It is now read-only.

Commit

Permalink
Merge pull request #133 from vgorloff/develop
Browse files Browse the repository at this point in the history
RC 1.0.74
  • Loading branch information
vgorloff authored Oct 2, 2021
2 parents b308e8b + 20ad7de commit 2ba678c
Show file tree
Hide file tree
Showing 15 changed files with 196 additions and 48 deletions.
4 changes: 4 additions & 0 deletions Automation.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const SPMBuilder = require("./lib/Builders/SPMBuilder");
const SAPBuilder = require("./lib/Builders/SAPBuilder");
const YAMSBuilder = require("./lib/Builders/YAMSBuilder");
const SwiftDriverBuilder = require("./lib/Builders/SwiftDriverBuilder");
const SwiftCryptoBuilder = require("./lib/Builders/SwiftCryptoBuilder");

module.exports = class Automation extends Tool {
run() {
Expand Down Expand Up @@ -140,6 +141,8 @@ module.exports = class Automation extends Tool {
new YAMSBuilder().runAction(action);
} else if (component == "sd") {
new SwiftDriverBuilder().runAction(action);
} else if (component == "sc") {
new SwiftCryptoBuilder().runAction(action);
} else {
this.logError(`! Unknown component \"${component}\".`);
this.usage();
Expand Down Expand Up @@ -170,6 +173,7 @@ module.exports = class Automation extends Tool {
this.runComponentAction("tsc", "make")
this.runComponentAction("llb", "make")
this.runComponentAction("sd", "make")
this.runComponentAction("sc", "make")
this.runComponentAction("spm", "make")
}

Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.74] - 2021-09-25
* #129 Updated to use Swift 5.5.0

## [1.0.73] - 2021-09-19
* #128 Updated to use Swift 5.4.3

Expand Down
13 changes: 13 additions & 0 deletions Patches/swift/stdlib/private/CMakeLists.txt.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/stdlib/private/CMakeLists.txt b/stdlib/private/CMakeLists.txt
index 181aec48a9e2dec76b489c94939cb66d0f2f92a2..0ff445fbafc92b9c197a6494e5eec5e70f2053e3 100644
--- a/stdlib/private/CMakeLists.txt
+++ b/stdlib/private/CMakeLists.txt
@@ -10,7 +10,7 @@ if(SWIFT_BUILD_SDK_OVERLAY)
endif()
endif()

-if(SWIFT_BUILD_SDK_OVERLAY OR SWIFT_BUILD_TEST_SUPPORT_MODULES)
+if(SWIFT_INCLUDE_TESTS AND (SWIFT_BUILD_SDK_OVERLAY OR SWIFT_BUILD_TEST_SUPPORT_MODULES))
add_subdirectory(RuntimeUnittest)
add_subdirectory(StdlibUnicodeUnittest)
add_subdirectory(StdlibCollectionUnittest)
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.73
1.0.74
7 changes: 5 additions & 2 deletions lib/Builders/LLVMBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module.exports = class LLVMBuilder extends Builder {
executeConfigure() {
var cFlags = "";
// cFlags += " -v -Xcc -v ";
cFlags += `-isystem ${this.paths.xcToolchainPath}/usr/include/c++/v1 -isysroot ${this.paths.xcMacOsSdkPath}`
cFlags += `-isystem ${this.paths.xcToolchainPath}/usr/include/c++/v1 -isysroot ${this.paths.xcMacOsSdkPath}`;
var cmd = `
cd ${this.paths.builds} && cmake
-G Ninja
Expand All @@ -47,6 +47,9 @@ module.exports = class LLVMBuilder extends Builder {
-D LLVM_BUILD_TOOLS=false
-D LLVM_INSTALL_BINUTILS_SYMLINKS=false
# See: https://github.com/vgorloff/swift-everywhere-toolchain/issues/129#issuecomment-932609469
-D LLVM_ENABLE_LIBXML2=FALSE
# See also: https://groups.google.com/forum/#!topic/llvm-dev/5qSTO3VUUe4
-D LLVM_TARGETS_TO_BUILD="ARM;AArch64;X86"
Expand All @@ -71,7 +74,7 @@ module.exports = class LLVMBuilder extends Builder {
executeBuild() {
// https://github.com/vgorloff/swift-everywhere-toolchain/issues/81
// We need to include clang for SPM.
var targets = "clang llvm-tblgen clang-tblgen llvm-libraries clang-libraries"
var targets = "clang llvm-tblgen clang-tblgen llvm-libraries clang-libraries";
// targets += " llvm-bcanalyzer" // Just for developmnt purpose.
this.execute(`cd ${this.paths.builds} && ninja -C ${this.paths.builds} -j${this.numberOfJobs} ${targets}`);
}
Expand Down
21 changes: 12 additions & 9 deletions lib/Builders/SPMBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@
var Builder = require("../Builder");
var Component = require("../Components");
var Archs = require("../Archs");
const LLBBuilder = require("./LLBBuilder")
const SwiftTSCBuilder = require("./SwiftTSCBuilder")
const SAPBuilder = require("./SAPBuilder")
const SwiftDriverBuilder = require("./SwiftDriverBuilder")
const LLBBuilder = require("./LLBBuilder");
const SwiftTSCBuilder = require("./SwiftTSCBuilder");
const SAPBuilder = require("./SAPBuilder");
const SwiftDriverBuilder = require("./SwiftDriverBuilder");
const SwiftCryptoBuilder = require("./SwiftCryptoBuilder");

module.exports = class SPMBuilder extends Builder {
constructor() {
Expand All @@ -37,10 +38,11 @@ module.exports = class SPMBuilder extends Builder {

// See: ToolChain/Sources/spm/Utilities/build-using-cmake
executeConfigure() {
const llb = new LLBBuilder()
const tsc = new SwiftTSCBuilder()
const sap = new SAPBuilder()
const sd = new SwiftDriverBuilder()
const llb = new LLBBuilder();
const tsc = new SwiftTSCBuilder();
const sap = new SAPBuilder();
const sd = new SwiftDriverBuilder();
const sc = new SwiftCryptoBuilder();
var cmd = `
cd ${this.paths.builds} && cmake
-G Ninja
Expand All @@ -50,6 +52,7 @@ module.exports = class SPMBuilder extends Builder {
-D LLBuild_DIR=${llb.paths.builds}/cmake/modules
-D ArgumentParser_DIR=${sap.paths.builds}/cmake/modules
-D SwiftDriver_DIR=${sd.paths.builds}/cmake/modules
-D SwiftCrypto_DIR=${sc.paths.builds}/cmake/modules
-D USE_CMAKE_INSTALL=TRUE
-D CMAKE_BUILD_WITH_INSTALL_RPATH=true
-D CMAKE_INSTALL_PREFIX=/
Expand All @@ -67,7 +70,7 @@ module.exports = class SPMBuilder extends Builder {
}

configurePatches(/** @type {Boolean} */ shouldEnable) {
this.configurePatch(`${this.paths.patches}/Sources/Build/BuildPlan.swift.diff`, shouldEnable)
this.configurePatch(`${this.paths.patches}/Sources/Build/BuildPlan.swift.diff`, shouldEnable);
//> Below not needed starting from v1.0.69. See also option `USE_CMAKE_INSTALL`
// this.configurePatch(`${this.paths.patches}/Sources/Build/CMakeLists.txt.diff`, shouldEnable)
// this.configurePatch(`${this.paths.patches}/Sources/Commands/CMakeLists.txt.diff`, shouldEnable)
Expand Down
6 changes: 5 additions & 1 deletion lib/Builders/SwiftBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ module.exports = class SwiftBuilder extends Builder {
-D SWIFT_ENABLE_LLD_LINKER=FALSE
-D SWIFT_ENABLE_GOLD_LINKER=TRUE
# See: https://github.com/vgorloff/swift-everywhere-toolchain/issues/129#issuecomment-932598732
-D SWIFT_ENABLE_DISPATCH=false
# Disabling builds of Darwin Overlays.
-D SWIFT_OVERLAY_TARGETS=''
Expand Down Expand Up @@ -163,7 +166,8 @@ module.exports = class SwiftBuilder extends Builder {
}

configurePatches(/** @type {Boolean} */ shouldEnable) {
this.configurePatch(`${this.paths.patches}/stdlib/cmake/modules/AddSwiftStdlib.cmake.diff`, shouldEnable)
// Below is not needed since v1.0.74.
// this.configurePatch(`${this.paths.patches}/stdlib/cmake/modules/AddSwiftStdlib.cmake.diff`, shouldEnable)
}

executeBuild() {
Expand Down
52 changes: 52 additions & 0 deletions lib/Builders/SwiftCryptoBuilder.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* The MIT License
*
* Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

var Builder = require("../Builder");
var Component = require("../Components");
var Archs = require("../Archs");

module.exports = class SwiftCryptoBuilder extends Builder {
constructor() {
super(Component.sc, Archs.host);
}

executeConfigure() {
var cmd = `
cd ${this.paths.builds} && cmake
-G Ninja
-D CMAKE_INSTALL_PREFIX=/
-D CMAKE_BUILD_TYPE=Release
${this.paths.sources}
`;
this.executeCommands(cmd);
}

executeBuild() {
this.execute(`cd ${this.paths.builds} && ninja -j${this.numberOfJobs}`);
}

executeInstall() {
this.execute(`DESTDIR=${this.paths.installs} cmake --build ${this.paths.builds} --target install`);
}
};
18 changes: 14 additions & 4 deletions lib/Builders/SwiftStdLibBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,12 @@ module.exports = class SwiftStdLibBuilder extends Builder {
-D SWIFT_BUILD_DYNAMIC_SDK_OVERLAY=TRUE
-D SWIFT_BUILD_STATIC_SDK_OVERLAY=FALSE
# See: https://github.com/vgorloff/swift-everywhere-toolchain/issues/129#issuecomment-932616250
-D SWIFT_BUILD_TEST_SUPPORT_MODULES=FALSE
# build just the standard library
-D SWIFT_INCLUDE_TOOLS=NO
-D SWIFT_INCLUDE_TESTS=NO
-D SWIFT_INCLUDE_TESTS=FALSE
-D SWIFT_INCLUDE_DOCS=NO
-D SWIFT_BUILD_SYNTAXPARSERLIB=NO
Expand All @@ -94,6 +97,9 @@ module.exports = class SwiftStdLibBuilder extends Builder {
-D SWIFT_ENABLE_LLD_LINKER=FALSE
-D SWIFT_ENABLE_GOLD_LINKER=TRUE
# See: https://github.com/vgorloff/swift-everywhere-toolchain/issues/129#issuecomment-932615036
-D SWIFT_ENABLE_DISPATCH=false
-D SWIFT_ANDROID_${this.arch.swiftArch}_ICU_UC=${icu.paths.lib}/libicuucswift.so
-D SWIFT_ANDROID_${this.arch.swiftArch}_ICU_UC_INCLUDE=${icu.paths.sources}/source/common
-D SWIFT_ANDROID_${this.arch.swiftArch}_ICU_I18N=${icu.paths.lib}/libicui18nswift.so
Expand All @@ -119,17 +125,21 @@ module.exports = class SwiftStdLibBuilder extends Builder {
this.executeCommands(cmd);
}

configurePatches(/** @type {Boolean} */ shouldEnable) {
this.configurePatch(`${this.paths.patches}/stdlib/private/CMakeLists.txt.diff`, shouldEnable);
}

executeBuild() {
this.execute(`cd ${this.paths.builds} && ninja -j${this.numberOfJobs}`);
}

executeInstall() {
this.execute(`DESTDIR=${this.paths.installs} cmake --build ${this.paths.builds} --target install`);
var libs = this.findLibs(`${this.paths.installs}/lib/swift/android`)
libs.forEach((item) => this.execute(`mv -f "${item}" "${path.dirname(item)}/${this.arch.swiftArch}"`))
var libs = this.findLibs(`${this.paths.installs}/lib/swift/android`);
libs.forEach((item) => this.execute(`mv -f "${item}" "${path.dirname(item)}/${this.arch.swiftArch}"`));
}

get libs() {
return this.findLibs(`${this.paths.installs}/lib/swift/android/${this.arch.swiftArch}`)
return this.findLibs(`${this.paths.installs}/lib/swift/android/${this.arch.swiftArch}`);
}
};
32 changes: 17 additions & 15 deletions lib/Components.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,23 @@
* THE SOFTWARE.
*/

var LLVMComponent = require("./Components/LLVMComponent");
var SwiftStdLibComponent = require("./Components/SwiftStdLibComponent");
var ICUCompoment = require("./Components/ICUCompoment");
var SwiftComponent = require("./Components/SwiftComponent");
var CMarkComponent = require("./Components/CMarkComponent");
var DispatchComponent = require("./Components/DispatchComponent");
var FoundationComponent = require("./Components/FoundationComponent");
var XMLComponent = require("./Components/XMLComponent");
var CURLComponent = require("./Components/CURLComponent");
var SSLComponent = require("./Components/SSLComponent");
var SPMComponent = require("./Components/SPMComponent");
var LLBComponent = require("./Components/LLBComponent");
var SwiftTSCComponent = require("./Components/SwiftTSCComponent");
var SAPComponent = require("./Components/SAPComponent");
var YAMSComponent = require("./Components/YAMSComponent");
const LLVMComponent = require("./Components/LLVMComponent");
const SwiftStdLibComponent = require("./Components/SwiftStdLibComponent");
const ICUCompoment = require("./Components/ICUCompoment");
const SwiftComponent = require("./Components/SwiftComponent");
const CMarkComponent = require("./Components/CMarkComponent");
const DispatchComponent = require("./Components/DispatchComponent");
const FoundationComponent = require("./Components/FoundationComponent");
const XMLComponent = require("./Components/XMLComponent");
const CURLComponent = require("./Components/CURLComponent");
const SSLComponent = require("./Components/SSLComponent");
const SPMComponent = require("./Components/SPMComponent");
const LLBComponent = require("./Components/LLBComponent");
const SwiftTSCComponent = require("./Components/SwiftTSCComponent");
const SAPComponent = require("./Components/SAPComponent");
const YAMSComponent = require("./Components/YAMSComponent");
const SwiftDriverComponent = require("./Components/SwiftDriverComponent");
const SwiftCryptoComponent = require("./Components/SwiftCryptoComponent");

module.exports = {
llvm: new LLVMComponent(),
Expand All @@ -56,4 +57,5 @@ module.exports = {
sap: new SAPComponent(),
yams: new YAMSComponent(),
sd: new SwiftDriverComponent(),
sc: new SwiftCryptoComponent(),
};
38 changes: 38 additions & 0 deletions lib/Components/SwiftCryptoComponent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* The MIT License
*
* Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

var Component = require("./Component");
var Revision = require("../Git/Revision");
var Repo = require("../Git/Repo");

module.exports = class SwiftCryptoComponent extends Component {
constructor() {
super();
this.sources = "swift-crypto";
this.name = "swift-crypto";
this.revision = Revision.sc;
this.repository = Repo.sc;
this.patches = this.name;
}
};
2 changes: 2 additions & 0 deletions lib/Git/Checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ module.exports = class Checkout extends Tool {
this.checkoutIfNeeded(Components.sap);
this.checkoutIfNeeded(Components.yams);
this.checkoutIfNeeded(Components.sd);
this.checkoutIfNeeded(Components.sc);
}

fetch() {
Expand All @@ -71,6 +72,7 @@ module.exports = class Checkout extends Tool {
this.fetchIfNeeded(Components.sap);
this.fetchIfNeeded(Components.yams);
this.fetchIfNeeded(Components.sd);
this.fetchIfNeeded(Components.sc);
}

/** @private */
Expand Down
4 changes: 2 additions & 2 deletions lib/Git/Repo.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
// See also: $ToolChain/Sources/swift/utils/update_checkout/update-checkout-config.json

module.exports = {

swift: "https://github.com/apple/swift.git",
dispatch: "https://github.com/apple/swift-corelibs-libdispatch.git",
foundation: "https://github.com/apple/swift-corelibs-foundation.git",
Expand All @@ -40,5 +39,6 @@ module.exports = {
tsc: "https://github.com/apple/swift-tools-support-core.git",
sap: "https://github.com/apple/swift-argument-parser",
yams: "https://github.com/jpsim/Yams",
sd: "https://github.com/apple/swift-driver"
sd: "https://github.com/apple/swift-driver",
sc: "https://github.com/apple/swift-crypto",
};
Loading

0 comments on commit 2ba678c

Please sign in to comment.