Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from Carthage:master #322

Open
wants to merge 151 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
8830b6f
Check for and create binaries directory. (#2952)
jonnybach Mar 17, 2020
f132af8
Update README guide for Xcode 11 changes (#2938)
yhkaplan Mar 18, 2020
3ba1ee6
Update Carthage version to match production (#2966)
DavidBrunow Apr 10, 2020
9f71dda
Fix integration test that is failing on newer versions of Xcode (#2967)
DavidBrunow Apr 11, 2020
f656edf
Prevent directory traversal (in more piecemeal way) allowing «project…
jdhealy Apr 28, 2020
249aabd
Prevent directory traversal (along piecemeal way, with minor fix.)
jdhealy Jun 17, 2020
37b09c7
Revert "Fix fetching race condition (#2832)"
jdhealy Jun 17, 2020
d0dd930
Revert "Improve submodule performance when --use-submodules is not us…
jdhealy Jun 17, 2020
d45f019
Comment on ‘alternative codepath’ nature of current Mach Header parsi…
jdhealy Jun 17, 2020
68d7760
Support `SUPPORTED_PLATFORMS` dynamically with intelligent parsing fr…
jdhealy Jun 17, 2020
5ce8cae
Add single missing `return` to appease Xcode 10.1.
jdhealy Jun 17, 2020
ade92cc
Remove `carthage cleanup` command — existing on-master, but unshipped…
jdhealy Jun 17, 2020
d337254
Remove (depreciated immediately) `XCDBLD.Platform` and the non-dynami…
jdhealy Jun 17, 2020
c7550f8
Bump version to 0.35.0
jdhealy Jun 18, 2020
a33d348
Fix erroneously re-throwing reduce (on Swift 5.3 pre-release) within …
eofs Jun 30, 2020
031819e
Revert «copy-framework»’s temp-file architecture stripping strategy, …
jdhealy Jul 2, 2020
5d438e5
Reduce, using repeating flag combo, multiple invocations of architect…
jdhealy Jul 2, 2020
4248c33
sort (#3015)
peteranny Jul 21, 2020
38c2dcb
Spell fix for README (#3021)
thomasaw Jul 27, 2020
0143edc
Remove the cache if unarchiving was failed (#3035)
tattn Aug 25, 2020
db5f94e
Fix makefile (#3024)
cfelder Sep 10, 2020
643bc51
Locate project schemes concurrently
elliottwilliams Sep 11, 2020
d8800d9
Skip enumeration into directories which ProjectLocator is ignoring
elliottwilliams Sep 11, 2020
555718a
Update README to reflect the build requirements (#3045)
chrstphrchvz Sep 14, 2020
43431f9
Don't use replaceItem if source and dest are on different filesystems…
rudedogdhc Sep 16, 2020
01b95b4
prevent re-downloading module stable binaries (#3040)
justAnotherDev Sep 16, 2020
80b3cfa
Support no_proxy/NO_PROXY environment variables (#2991)
okaverin Sep 16, 2020
0d324cb
Attempt to remove invalid archs by intersecting VALID_ARCHS and ARCHS…
jerbob92 Sep 16, 2020
da3becb
Bump version to 0.35.1
tmspzz Sep 16, 2020
d70b5ba
Bump up the CarthageKitVersion to 0.35.1 (#3049)
nixnoughtnothing Sep 18, 2020
16e84b1
Update createTemporaryDirectoryWithTemplate to create temp dirs on th…
rudedogdhc Sep 18, 2020
d392daf
Merge branch 'master' of https://github.com/Carthage/Carthage
tmspzz Sep 18, 2020
499c9cf
Bump version to 0.36.0
tmspzz Sep 18, 2020
81a27c4
Create XCFrameworks when necessary
elliottwilliams Sep 26, 2020
f7cbe1d
Write and validate xcframeworks in version files
elliottwilliams Sep 30, 2020
63d1797
Keep only one architecturesInPackage (#3065)
tmspzz Oct 7, 2020
545be4d
Fix merge
tmspzz Oct 7, 2020
1824912
Merge branch 'master' into jdhealy/untested-reduce-lipo-invocation-re…
tmspzz Oct 7, 2020
8246130
Revert "Update createTemporaryDirectoryWithTemplate to create temp di…
tmspzz Oct 7, 2020
87904bc
Fix Tests
tmspzz Oct 7, 2020
158dacd
Merge pull request #3066 from Carthage/jdhealy/untested-reduce-lipo-i…
tmspzz Oct 8, 2020
c92290c
Create Xcode12Workaround.md
olejnjak Oct 9, 2020
ab318d4
Merge pull request #3069 from olejnjak/xcode12_workaround_guide
tmspzz Oct 9, 2020
baa4f23
Add Link to Xcode >= 12 workaround to Readme
tmspzz Oct 10, 2020
1aa44d3
Merge pull request #3070 from tmspzz/docs/xcode-12-workaround
tmspzz Oct 10, 2020
ad666b9
Bug fixes
elliottwilliams Oct 10, 2020
a9a7135
[wip] Update CarthageKitTests for api changes
elliottwilliams Sep 30, 2020
60d1d2a
Extract xcframeworks when building to support existing projects
elliottwilliams Oct 10, 2020
cc74fef
Fix compiler error
elliottwilliams Oct 10, 2020
f7ab6ad
Merge builds from all platforms into one xcframework
elliottwilliams Oct 12, 2020
93059bf
Add --no-create-xcframework flag
elliottwilliams Oct 12, 2020
bc875e6
Rewrite version file creation logic for combined xcframeworks
elliottwilliams Oct 12, 2020
795e50e
Update VersionFileTests
elliottwilliams Oct 13, 2020
c3e1bf5
Revert FrameworkExtensions change
elliottwilliams Oct 13, 2020
991735f
Merge branch 'master' into xcframeworks
elliottwilliams Oct 13, 2020
461ef25
Default createXCFramework to false to allow tests to pass on Xcode<12…
elliottwilliams Oct 13, 2020
9d543c6
Revert VersionFile.swift changes that are no longer needed
elliottwilliams Oct 13, 2020
9970edc
Name the xcframework based on product name, not dependency name
elliottwilliams Oct 16, 2020
52ea475
Fail command parsing if --create-xcframeworks is passed on an unsuppo…
elliottwilliams Nov 12, 2020
18991ec
Avoid extracting dSYM information from static libraries
Oct 27, 2020
a196b7a
Update README.md
elliottwilliams Nov 12, 2020
ee5afe0
Fix Apple Silicon Typo in Xcode12Workaround.md
Nov 17, 2020
1b6b79c
Merge pull request #3080 from philipphofmann/patch-1
tmspzz Nov 20, 2020
8f8bbc6
frameworkSwiftVersion: Load dSYMs from inside xcframeworks
elliottwilliams Nov 24, 2020
2f9e431
Fix Apple Silicon Typo in Xcode12Workaround.md
daisuke-t-jp Nov 25, 2020
5aeba04
Merge pull request #3085 from daisuke-t-jp/fix-typo
tmspzz Nov 25, 2020
bfbf585
Clean up extractedXCFrameworksDir
elliottwilliams Dec 2, 2020
5693fd1
Always default to --no-create-xcframework
elliottwilliams Dec 6, 2020
5c55e35
Only extract xcframeworks if a target links against Carthage frameworks
elliottwilliams Dec 13, 2020
fcbcc34
Update README.md to reflect new default arguments
elliottwilliams Dec 16, 2020
edc4976
Rename --create-xcframework -> --use-xcframeworks
elliottwilliams Dec 18, 2020
05ef87a
Detect when lipo fails and device and simulator slices have architect…
elliottwilliams Dec 18, 2020
5c4d4bb
Merge pull request #3071 from elliottwilliams/xcframeworks
tmspzz Dec 18, 2020
3884820
Fix Xcode 12 refusing to link fat binaries
tmspzz Dec 18, 2020
cdc5eaa
Merge pull request #3095 from tmspzz/fix/xcode-12-fat-binary-linkage
elliottwilliams Dec 18, 2020
3239c30
Bump version to 0.37.0
elliottwilliams Jan 13, 2021
3302df2
Avoid FileManager.replaceItem so that replacements can happen across …
elliottwilliams Jan 13, 2021
3dfed08
Add README section on migrating to XCFrameworks
elliottwilliams Jan 23, 2021
0cec60a
Avoid using url(for:in:) and replaceItemAt APIs
elliottwilliams Jan 23, 2021
00a50cb
Update README.md
elliottwilliams Jan 29, 2021
58551c0
[copy-frameworks] Fix issue under no-architectures-to-remove scenario.
Feb 1, 2021
0668de4
Merge pull request #3106 from elliottwilliams/release_0.37.0
elliottwilliams Feb 1, 2021
11ee044
Allow XCFramework prebuilt binaries
Feb 4, 2021
1b939b0
Ignore XCFramework binaries when doing architecture checks
Feb 4, 2021
0c5ee02
Install XCFrameworks in root of Build
Feb 4, 2021
d489007
Add FrameworkSuffix enum for framework type checks
Feb 17, 2021
014ca18
Remove FrameworkSuffix header
Feb 17, 2021
b4b8bb1
Fix indentation
Feb 23, 2021
e0de8f4
Merge branch 'master' into locate_schemes_concurrently
elliottwilliams Feb 23, 2021
9e40dd8
Fix xcframework extraction when a project refers to a missing build d…
elliottwilliams Feb 24, 2021
709b82a
Merge pull request #3076 from elliottwilliams/locate_schemes_concurre…
elliottwilliams Feb 26, 2021
83c4a46
Apply framework compatibility fix from elliotwilliams
Feb 28, 2021
932eccf
Tidy framework suffix handling
Mar 1, 2021
30dc6fd
Remove unnecessary guard
Mar 1, 2021
b06a5dd
unarchiveAndCopyBinaryFrameworks: don't copy debug info from xcframew…
elliottwilliams Mar 3, 2021
999ac19
refactor to remove unreachable code
elliottwilliams Mar 3, 2021
94c77f4
Merge pull request #3135 from elliottwilliams/extract-when-partial-sy…
elliottwilliams Mar 4, 2021
07df005
Map xcframework loading error to .readFailed()
elliottwilliams Mar 19, 2021
5347dee
Merge pull request #3123 from igstewart3/xcframework-prebuilt-binaries
elliottwilliams Mar 19, 2021
cd69d41
downloadMatchingBinaries: prefer artifacts named ".xcframework" when …
elliottwilliams Mar 19, 2021
f7e8fcf
Bump version to 0.38.0
elliottwilliams Mar 19, 2021
d1c78a8
Case insensitive comparisons, check xcframework first
elliottwilliams Mar 24, 2021
6b5c662
Don't say ".framework" when printing binary download events
elliottwilliams Mar 24, 2021
3ced67c
Prioritize assets by name instead of picking _only_ xcframeworks or f…
elliottwilliams Mar 24, 2021
86229d8
Fix Xcode 10.1 compilation in binaryAssetPrioritizingReducer
elliottwilliams Mar 24, 2021
19a7f97
Fix invalid lipo command in stripArchitectures() when embedding dSYMs…
chriseplettsonos Mar 25, 2021
082faaf
Parse and prioritize multiple assets from binary framework URLs
elliottwilliams Apr 30, 2021
b07198b
Refactor filter into a separate function, update tests
elliottwilliams Apr 30, 2021
0ac9138
Update Artifacts.md documenting alt URLS
elliottwilliams May 5, 2021
4e38790
Update README.md with github release xcframework information
elliottwilliams May 5, 2021
bde37b9
Cache binary dependencies using a hash of the download URL
elliottwilliams May 5, 2021
545f3f2
Fix tests
elliottwilliams May 5, 2021
130e0f1
binaryAssetPrioritization: allow assets which don't pass the name filter
elliottwilliams May 5, 2021
43cfb1a
downloadURLToCachedBinaryDependency: use Swift 4 APIs, retab
elliottwilliams May 5, 2021
3cc9238
"one zip file" -> "zip files"
elliottwilliams May 6, 2021
25df81e
README.md: update anchor
elliottwilliams May 6, 2021
a2c65ae
BinaryProject parsing: pull more state into the reduce() block
elliottwilliams May 7, 2021
bd35aef
Fix non-https logic
elliottwilliams May 7, 2021
9a3d179
Merge pull request #3152 from elliottwilliams/release/0.38.0
elliottwilliams May 7, 2021
32ed725
Add: --use-xcframeworks check
ryu1sazae Jun 16, 2021
0100538
Merge pull request #3204 from ryu1sazae/add-xcframeworks-flag
elliottwilliams Jun 29, 2021
024d11f
Fix typo in fileReadCorruptFile error description
TTOzzi Sep 21, 2021
b70d10d
Merge pull request #3231 from TTOzzi/master
tmspzz Oct 21, 2021
bd7c5f7
README.md: HTTP => HTTPS
Schweinepriester Nov 28, 2021
4e9dbe1
Merge pull request #3244 from Schweinepriester/patch-1
tmspzz Nov 29, 2021
55107a4
Update Xcode12Workaround.md (#3248)
Huang-Libo Jan 10, 2022
d89afef
Use modern Alamofire version in README (#3200)
jshier Jan 10, 2022
cfd5426
Fix issue where Carthage doesn’t build for watchOS or tvOS if bitcode…
daltonclaybrook Jul 19, 2022
a91d086
Merge pull request #3293 from daltonclaybrook/dalton/xcode-14-bitcode
giginet Nov 12, 2022
8af2299
Bump up version to 0.39.0
giginet Jan 15, 2023
187a78c
Merge pull request #3318 from giginet/release-0.39.0
giginet Jan 28, 2023
2d62055
Support visionOS by using `-destination xros/xrsimulator`. Make addit…
klundberg Jun 27, 2023
0dc17e7
Fix Makefile to only pass `-static-stdlib` to `swiftc` when the old l…
jdhealy Sep 11, 2023
1c0f79d
Use `Nimble.Predicate` with the module name spelled out in spots in «…
jdhealy Sep 15, 2023
f03c474
Bump Quick to `v2.2.1` and Nimble to `8.1.2`.
jdhealy Sep 13, 2023
b5c1bec
Improve Makefile.
jdhealy Sep 13, 2023
52e3d78
Tests: Change our URLComponents invalid url example — in one test var…
jdhealy Sep 14, 2023
bd25e34
Tests: Use `example.com` in `BinaryProjectSpecs` and `ProjectSpec` te…
jdhealy Sep 15, 2023
890ddf6
Tests: Prevent the XCTest agent from dying if xcodebuild dies during …
jdhealy Sep 15, 2023
fa47bca
Tests: Remove a test which provided limited value — it was titled `"s…
jdhealy Sep 15, 2023
2de64f5
Tests: Comment on already existing coverage of most/some of `!SWIFT_P…
jdhealy Sep 15, 2023
f80a77e
Tests: Remove (just for one commit) test which will be fully supersed…
jdhealy Sep 15, 2023
89251a6
Tests: XcodeSpec: Move majority of `XcodeSpec` to using `SampleMultip…
jdhealy Sep 15, 2023
b6ddf91
Describe that with Travis' macOS specifics in the included link, our …
jdhealy Sep 18, 2023
a990817
Makefile: In `uninstall` section, re-implement rm of one particular f…
jdhealy Sep 18, 2023
edf085c
Bump version to 0.39.1
jdhealy Sep 18, 2023
6ea0853
Fix: 1 typo in MachHeader.swift
RoboSchmied Mar 22, 2024
87fedfb
[Untested, May Be Reverted] No longer (under Xcode 16 and above) pref…
jdhealy Jun 14, 2024
cf06392
[Untested, May Be Reverted] Due to Xcode 16.0 beta 1 — for `xcodebuil…
jdhealy Jun 17, 2024
9e2006a
Update `-showBuildSettings` “Found no destinations for the scheme” pa…
prassyy Sep 9, 2024
e33e133
Bump version to 0.40.0
jdhealy Sep 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ disabled_rules:
- no_fallthrough_only # https://github.com/realm/SwiftLint/issues/2276
- redundant_string_enum_value
- superfluous_disable_command
- large_tuple
- switch_case_on_newline

included:
- Source
Expand Down
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ cache:
directories:
- .build/checkouts # SwiftPM
- .build/repositories # SwiftPM
- script # With Travis’ macOS specifics in the following link, the below no longer launches any Travis runs: https://www.travis-ci.com/blog/2020-11-02-travis-ci-new-billing/
- Logo # For our future use on other CI platforms, I’ve included `for_use_during_unit_testing_for_carthage_on_intel_host_os.xcconfig` scripting.
branches:
only:
- master
Expand All @@ -14,6 +16,8 @@ matrix:
language: objective-c
osx_image: xcode10.1
script:
- echo 'NON_BLANK_FOR_XCODE_VERSION_MAJOR_0100=YES•NON_BLANK_FOR_XCODE_VERSION_MAJOR_0200=YES•NON_BLANK_FOR_XCODE_VERSION_MAJOR_0300=YES•NON_BLANK_FOR_XCODE_VERSION_MAJOR_0400=YES•NON_BLANK_FOR_XCODE_VERSION_MAJOR_0500=YES•NON_BLANK_FOR_XCODE_VERSION_MAJOR_0600=YES•NON_BLANK_FOR_XCODE_VERSION_MAJOR_0700=YES•NON_BLANK_FOR_XCODE_VERSION_MAJOR_0800=YES•NON_BLANK_FOR_XCODE_VERSION_MAJOR_0900=YES•NON_BLANK_FOR_XCODE_VERSION_MAJOR_1000=YES•NON_BLANK_FOR_XCODE_VERSION_MAJOR_1100=YES•NON_BLANK_FOR_XCODE_VERSION_MAJOR_0000=YES•THIS_SPOT_LEFT_BLANK_IF_XCODE_12_OR_HIGHER=$(NON_BLANK_FOR_XCODE_VERSION_MAJOR_$(XCODE_VERSION_MAJOR))•EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__THIS_SPOT_LEFT_BLANK_IF_XCODE_12_OR_HIGHER___NATIVE_ARCH_64_BIT_x86_64=arm64 arm64e armv7 armv7s armv6 armv8•EXCLUDED_ARCHS=$(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__THIS_SPOT_LEFT_BLANK_IF_XCODE_12_OR_HIGHER_$(THIS_SPOT_LEFT_BLANK_IF_XCODE_12_OR_HIGHER)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT))' | tr • '\n' | tee ~/for_use_during_unit_testing_for_carthage_on_intel_host_os.xcconfig
- export XCODE_XCCONFIG_FILE=~/for_use_during_unit_testing_for_carthage_on_intel_host_os.xcconfig
- make test
env: JOB=CI_TEST_10_1
- os: osx
Expand All @@ -23,6 +27,8 @@ matrix:
- brew uninstall carthage
- HOMEBREW_NO_AUTO_UPDATE=1 brew install bats
- make install
- echo 'NON_BLANK_FOR_XCODE_VERSION_MAJOR_0100=YES•NON_BLANK_FOR_XCODE_VERSION_MAJOR_0200=YES•NON_BLANK_FOR_XCODE_VERSION_MAJOR_0300=YES•NON_BLANK_FOR_XCODE_VERSION_MAJOR_0400=YES•NON_BLANK_FOR_XCODE_VERSION_MAJOR_0500=YES•NON_BLANK_FOR_XCODE_VERSION_MAJOR_0600=YES•NON_BLANK_FOR_XCODE_VERSION_MAJOR_0700=YES•NON_BLANK_FOR_XCODE_VERSION_MAJOR_0800=YES•NON_BLANK_FOR_XCODE_VERSION_MAJOR_0900=YES•NON_BLANK_FOR_XCODE_VERSION_MAJOR_1000=YES•NON_BLANK_FOR_XCODE_VERSION_MAJOR_1100=YES•NON_BLANK_FOR_XCODE_VERSION_MAJOR_0000=YES•THIS_SPOT_LEFT_BLANK_IF_XCODE_12_OR_HIGHER=$(NON_BLANK_FOR_XCODE_VERSION_MAJOR_$(XCODE_VERSION_MAJOR))•EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__THIS_SPOT_LEFT_BLANK_IF_XCODE_12_OR_HIGHER___NATIVE_ARCH_64_BIT_x86_64=arm64 arm64e armv7 armv7s armv6 armv8•EXCLUDED_ARCHS=$(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__THIS_SPOT_LEFT_BLANK_IF_XCODE_12_OR_HIGHER_$(THIS_SPOT_LEFT_BLANK_IF_XCODE_12_OR_HIGHER)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT))' | tr • '\n' | tee ~/for_use_during_unit_testing_for_carthage_on_intel_host_os.xcconfig
- export XCODE_XCCONFIG_FILE=~/for_use_during_unit_testing_for_carthage_on_intel_host_os.xcconfig
- bats IntegrationTests
env:
- JOB=CI_INTEGRATION_TESTS
Expand Down
12 changes: 11 additions & 1 deletion Documentation/Artifacts.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,22 @@ For dependencies that do not have source code available, a binary project specif
* The version **must** be a semantic version. Git branches, tags and commits are not valid.
* The location **must** be an `https` url.

#### Publish an XCFramework build alongside the framework build using an `alt=` query parameter

To support users who build with `--use-xcframework`, create two zips: one containing the framework bundle(s) for your dependency, the other containing xcframework(s). Include "framework" or "xcframework" in the names of the zips, for example: `MyFramework.framework.zip` and `MyFramework.xcframework.zip`. In your project specification, join the two URLs into one using a query string:

https://my.domain.com/release/1.0.0/MyFramework.framework.zip?alt=https://my.domain.com/release/1.0.0/MyFramework.xcframework.zip

Starting in version 0.38.0, Carthage extracts any `alt=` URLs from the version specification. When `--use-xcframeworks` is passed, it prefers downloading URLs with "xcframework" in the name.

**For backwards compatibility,** provide the plain frameworks build _first_ (i.e. not as an alt URL), so that older versions of Carthage use it. Carthage versions prior to 0.38.0 fail to download and extract XCFrameworks.

#### Example binary project specification

```
{
"1.0": "https://my.domain.com/release/1.0.0/framework.zip",
"1.0.1": "https://my.domain.com/release/1.0.1/framework.zip"
"1.0.1": "https://my.domain.com/release/1.0.1/MyFramework.framework.zip?alt=https://my.domain.com/release/1.0.1/MyFramework.xcframework.zip"
}

```
59 changes: 59 additions & 0 deletions Documentation/Xcode12Workaround.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Using Carthage with Xcode 12

As Carthage doesn't work out of the box with Xcode 12, this document will guide through a workaround that works for most cases.

## Why Carthage compilation fails

Well, shortly, Carthage builds fat frameworks, which means that the framework contains binaries for all supported architectures.
Until Apple Silicon was introduced it all worked just fine, but now there is a conflict as there are duplicate architectures (arm64 for devices and arm64 for simulator).
This means that Carthage cannot link architecture specific frameworks to a single fat framework.

You can find more info in [respective issue #3019](https://github.com/Carthage/Carthage/issues/3019).

## Workaround

As a workaround you can invoke carthage using this script, it will remove the arm64 architecture for simulator, so the above mentioned conflict doesn't exist.

## How to make it work

1. place this script somewhere to your `PATH` (I personally have it in `/usr/local/bin/carthage.sh`)
2. make it the script executable, so open your _Terminal_ and run
```bash
chmod +x /usr/local/bin/carthage.sh
```
3. from now on instead of running e.g.
```
carthage bootstrap --platform iOS --cache-builds
```
you need to run our script
```
carthage.sh bootstrap --platform iOS --cache-builds
```

### Workaround script

This script has a known limitation - it will remove arm64 simulator architecture from compiled framework, so frameworks compiled using it cannot be used on Macs running Apple Silicon.

```bash
# carthage.sh
# Usage example: ./carthage.sh build --platform iOS

set -euo pipefail

xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)
trap 'rm -f "$xcconfig"' INT TERM HUP EXIT

# For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise
# the build will fail on lipo due to duplicate architectures.

CURRENT_XCODE_VERSION="$(xcodebuild -version | grep "Xcode" | cut -d' ' -f2 | cut -d'.' -f1)00"
CURRENT_XCODE_BUILD=$(xcodebuild -version | grep "Build version" | cut -d' ' -f3)

echo "EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_${CURRENT_XCODE_VERSION}__BUILD_${CURRENT_XCODE_BUILD} = arm64 arm64e armv7 armv7s armv6 armv8" >> $xcconfig

echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_'${CURRENT_XCODE_VERSION}' = $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_$(XCODE_VERSION_MAJOR)__BUILD_$(XCODE_PRODUCT_BUILD_VERSION))' >> $xcconfig
echo 'EXCLUDED_ARCHS = $(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT)__XCODE_$(XCODE_VERSION_MAJOR))' >> $xcconfig

export XCODE_XCCONFIG_FILE="$xcconfig"
carthage "$@"
```
1 change: 1 addition & 0 deletions ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Are you using `--use-submodules`?
* Are you using `--cache-builds`?
* Are you using `--new-resolver`?
* Are you using `--use-xcframeworks`?

**Cartfile**
```
Expand Down
2 changes: 1 addition & 1 deletion IntegrationTests/copy-frameworks.bats
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ teardown() {
run carthage update --platform ios
[ "$status" -eq 0 ]

run xcodebuild clean build-for-testing -scheme CarthageCopyFrameworksFixture -sdk iphonesimulator -destination "name=iPhone 6s"
run xcodebuild clean build-for-testing -scheme CarthageCopyFrameworksFixture -sdk iphonesimulator -destination "name=iPhone 8"
[ "$status" -eq 0 ]

ARCHIVE_APP_DIR=CarthageCopyFrameworksFixture.xcarchive/Products/Applications
Expand Down
21 changes: 21 additions & 0 deletions IntegrationTests/relink-conflicting-not-checked-in-symlink.bats
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,24 @@ carthage-and-check-project-symlink() {
carthage-and-check-project-symlink update --no-build --no-use-binaries

}

@test "with conflicting not-checked-in symlink in «Carthage/Checkouts» of dependency pathologically named «...git», carthage «bootstrap, update, update» should — sanitizing throughout — unlink, then write symlink there" {

mv "${extracted_directory:?}/SourceRepos/TestFramework1" "${extracted_directory}/SourceRepos/...git"

rm Cartfile

cat > Cartfile <<-EOF
git "file://${extracted_directory}/SourceRepos/...git" "relink-conflicting-not-checked-in-syminks"
EOF

carthage bootstrap --no-build --no-use-binaries
check-symlink "$(project_directory)/Carthage/Checkouts/../Carthage/Checkouts/TestFramework2"
# carthage should have sanitized the former «TestFramework1» from «...git» to non–path-traversing «..»…

carthage update --no-build --no-use-binaries
check-symlink "$(project_directory)/Carthage/Checkouts/../Carthage/Checkouts/TestFramework2"

carthage update --no-build --no-use-binaries
check-symlink "$(project_directory)/Carthage/Checkouts/../Carthage/Checkouts/TestFramework2"
}
40 changes: 27 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,38 +1,50 @@
#!/usr/bin/xcrun make -f

CARTHAGE_TEMPORARY_FOLDER?=/tmp/Carthage.dst
export CARTHAGE_TEMPORARY_FOLDER
PREFIX?=/usr/local
export PREFIX

INTERNAL_PACKAGE=CarthageApp.pkg
OUTPUT_PACKAGE=Carthage.pkg

CARTHAGE_EXECUTABLE=./.build/release/carthage
BINARIES_FOLDER=/usr/local/bin
BINARIES_FOLDER=$(PREFIX)/bin
export BINARIES_FOLDER

SWIFT_BUILD_FLAGS=--configuration release -Xswiftc -suppress-warnings
SWIFT_TEST_FLAGS=--skip-update

SWIFTPM_DISABLE_SANDBOX_SHOULD_BE_FLAGGED:=$(shell test -n "$${HOMEBREW_SDKROOT}" && echo should_be_flagged)
ifeq ($(SWIFTPM_DISABLE_SANDBOX_SHOULD_BE_FLAGGED), should_be_flagged)
SWIFT_BUILD_FLAGS+= --disable-sandbox
endif
SWIFT_STATIC_STDLIB_SHOULD_BE_FLAGGED:=$(shell test -d $$(dirname $$(xcrun --find swift))/../lib/swift_static/macosx && echo should_be_flagged)
SWIFT_BUILD_SHOULD_BE_FLAGGED_VERY_VERBOSE:=$(shell (/usr/bin/xcrun --find swift-package | /bin/zsh --no-globalrcs --no-rcs -c '/usr/bin/strings "$$(cat)"' | grep --quiet -e '^veryVerbose') && echo should_be_flagged)
ifeq ($(SWIFT_BUILD_SHOULD_BE_FLAGGED_VERY_VERBOSE), should_be_flagged)
SWIFT_BUILD_FLAGS+= --very-verbose
SWIFT_TEST_FLAGS+= --very-verbose
endif
SWIFT_STATIC_STDLIB_SHOULD_BE_FLAGGED:=$(shell test -d $$(dirname $$(xcrun --find swift))/../lib/swift_static/macosx && (./script/strings_of_xcrun_find_ld.zsh | grep --quiet -e '^only one snapshot supported') && echo should_be_flagged)
ifeq ($(SWIFT_STATIC_STDLIB_SHOULD_BE_FLAGGED), should_be_flagged)
SWIFT_BUILD_FLAGS+= -Xswiftc -static-stdlib
endif

# ZSH_COMMAND · run single command in `zsh` shell, ignoring most `zsh` startup files.
ZSH_COMMAND := ZDOTDIR='/var/empty' zsh -o NO_GLOBAL_RCS -c
ZSH_COMMAND = ZDOTDIR='/var/empty' zsh --no-globalrcs --no-rcs -c
# RM_SAFELY · `rm -rf` ensuring first and only parameter is non-null, contains more than whitespace, non-root if resolving absolutely.
RM_SAFELY := $(ZSH_COMMAND) '[[ ! $${1:?} =~ "^[[:space:]]+\$$" ]] && [[ $${1:A} != "/" ]] && [[ $${\#} == "1" ]] && noglob rm -rf $${1:A}' --
RM_SAFELY = $(ZSH_COMMAND) '[[ ! $${1:?} =~ "^[[:space:]]+\$$" ]] && [[ $${1:A} != "/" ]] && [[ $${\#} == "1" ]] && noglob rm -rf $${1:A}' --

VERSION_STRING=$(shell git describe --abbrev=0 --tags)
DISTRIBUTION_PLIST=Source/carthage/Distribution.plist

RM=rm -f
MKDIR=mkdir -p
SUDO=sudo
CP=cp

ifdef DISABLE_SUDO
override SUDO=
endif

.PHONY: all clean install package test uninstall xcconfig xcodeproj

all: installables
Expand All @@ -46,19 +58,20 @@ test:
$(CP) -R Tests/CarthageKitTests/Resources ./.build/debug/CarthagePackageTests.xctest/Contents
$(CP) Tests/CarthageKitTests/fixtures/CartfilePrivateOnly.zip ./.build/debug/CarthagePackageTests.xctest/Contents/Resources
script/copy-fixtures ./.build/debug/CarthagePackageTests.xctest/Contents/Resources
swift test --skip-build
swift test --skip-build $(SWIFT_TEST_FLAGS)

installables:
swift build $(SWIFT_BUILD_FLAGS)
/bin/zsh --no-globalrcs --no-rcs -c 'set -x; print -r "$${CARTHAGE_TEMPORARY_FOLDER:?}$${BINARIES_FOLDER:?}"'

package: installables
$(MKDIR) "$(CARTHAGE_TEMPORARY_FOLDER)$(BINARIES_FOLDER)"
$(CP) "$(CARTHAGE_EXECUTABLE)" "$(CARTHAGE_TEMPORARY_FOLDER)$(BINARIES_FOLDER)"
/bin/zsh --no-globalrcs --no-rcs -c 'set -x; mkdir -p "$${CARTHAGE_TEMPORARY_FOLDER:?}$${BINARIES_FOLDER:?}"'
$(CP) -v "$(CARTHAGE_EXECUTABLE)" "$${CARTHAGE_TEMPORARY_FOLDER:?}$${BINARIES_FOLDER:?}"

pkgbuild \
--identifier "org.carthage.carthage" \
--install-location "/" \
--root "$(CARTHAGE_TEMPORARY_FOLDER)" \
--root "$${CARTHAGE_TEMPORARY_FOLDER:?}" \
--version "$(VERSION_STRING)" \
"$(INTERNAL_PACKAGE)"

Expand All @@ -68,14 +81,15 @@ package: installables
"$(OUTPUT_PACKAGE)"

prefix_install: installables
$(MKDIR) "$(PREFIX)/bin"
$(CP) -f "$(CARTHAGE_EXECUTABLE)" "$(PREFIX)/bin/"
/bin/zsh --no-globalrcs --no-rcs -c 'set -x; mkdir -p "$${BINARIES_FOLDER:?}"'
$(CP) -v -f "$(CARTHAGE_EXECUTABLE)" "$${BINARIES_FOLDER:?}"

install: installables
$(SUDO) $(CP) -f "$(CARTHAGE_EXECUTABLE)" "$(BINARIES_FOLDER)"
if [ ! -d "$${BINARIES_FOLDER:?}" ]; then $(SUDO) mkdir -p "$${BINARIES_FOLDER:?}"; fi
$(SUDO) $(CP) -v -f "$(CARTHAGE_EXECUTABLE)" "$${BINARIES_FOLDER:?}"

uninstall:
$(RM) "$(BINARIES_FOLDER)/carthage"
/bin/zsh --no-globalrcs --no-rcs -c 'set -x; rm -f -v "$${BINARIES_FOLDER:?}/carthage"'

xcodeproj:
swift package generate-xcodeproj
8 changes: 4 additions & 4 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"repositoryURL": "https://github.com/Quick/Nimble.git",
"state": {
"branch": null,
"revision": "f8657642dfdec9973efc79cc68bcef43a653a2bc",
"version": "8.0.2"
"revision": "7a46a5fc86cb917f69e3daf79fcb045283d8f008",
"version": "8.1.2"
}
},
{
Expand All @@ -42,8 +42,8 @@
"repositoryURL": "https://github.com/Quick/Quick.git",
"state": {
"branch": null,
"revision": "94df9b449508344667e5afc7e80f8bcbff1e4c37",
"version": "2.1.0"
"revision": "09b3becb37cb2163919a3842a4c5fa6ec7130792",
"version": "2.2.1"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ let package = Package(
.package(url: "https://github.com/ReactiveCocoa/ReactiveSwift.git", from: "5.0.0"),
.package(url: "https://github.com/mdiep/Tentacle.git", from: "0.13.1"),
.package(url: "https://github.com/thoughtbot/Curry.git", from: "4.0.2"),
.package(url: "https://github.com/Quick/Quick.git", from: "2.1.0"),
.package(url: "https://github.com/Quick/Nimble.git", from: "8.0.1"),
.package(url: "https://github.com/Quick/Quick.git", from: "2.2.1"),
.package(url: "https://github.com/Quick/Nimble.git", from: "8.0.9"),
],
targets: [
.target(
Expand Down
Loading