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

Bring back xcframework based Carthage support for MapboxCoreNavigation #3031

Merged
merged 12 commits into from
Jun 4, 2021

Conversation

S2Ler
Copy link
Contributor

@S2Ler S2Ler commented May 26, 2021

Description

Our Carthage support is broken currently. This PR fixes it for MapboxCoreNavigation framework.
We can't add support for MapboxNavigation at the moment, because it depends on https://github.com/mapbox/mapbox-maps-ios, which doesn't support Carthage distribution at the moment. Tracking issue: mapbox/mapbox-maps-ios#66.

Implementation

  • Use xcframeworks for MapboxNavigationNative and MapboxCommon.
  • MapboxNavigation shared scheme removed.
  • SPMTest project removed because breaks Carthage build.
  • Carthage updated to 0.38.0 on CI.
  • Update CI config.

@S2Ler S2Ler added build Issues related to builds and dependency management. dependency management labels May 26, 2021
@S2Ler S2Ler added this to the v2.0.0 (RC) milestone May 26, 2021
@S2Ler S2Ler requested a review from a team May 26, 2021 10:43
@S2Ler S2Ler self-assigned this May 26, 2021
@S2Ler S2Ler requested a review from 1ec5 May 27, 2021 11:38
S2Ler added a commit that referenced this pull request May 28, 2021
The motivation for migrating to new snapshot testing library is described here: #2791 (comment).

Main consequence is that we test only on one device.

The env for current snapshots are: iPhone 12 Pro Max, iOS 14.5.

Xcode based project isn't updated yet because the work depends on #3031.
@S2Ler S2Ler mentioned this pull request May 31, 2021
2 tasks
@S2Ler S2Ler force-pushed the s2ler/fix-carthage branch 3 times, most recently from 748cead to a15918e Compare June 3, 2021 11:16
@S2Ler S2Ler requested a review from 1ec5 June 3, 2021 11:26
@@ -4,12 +4,11 @@ step-library:
- &restore-cache
restore_cache:
keys:
- nav-cache-v5-{{ .Environment.CIRCLE_JOB }}-{{ checksum "Cartfile.resolved" }}
- nav-cache-v5-{{ .Environment.CIRCLE_JOB }} # used if checksum fails
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This line broke the cache for me. See https://app.circleci.com/pipelines/github/mapbox/mapbox-navigation-ios/3758/workflows/d308c9bd-af8a-4a23-8298-cbd9c24345d8/jobs/34125 run.

@1ec5 Can you please clarify what it does and if I can remove it?

Copy link
Contributor

Choose a reason for hiding this comment

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

This step restores the Carthage folder (with all the checkouts and build products) from a cache from the previous build. It’s based on a checksum of the resolved file, so that any time a dependency version changes, there’s a cache miss. It’s also possible to force a cache miss by incrementing the v5 to a different version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As far as I see the cache with a key - nav-cache-v5-{{ .Environment.CIRCLE_JOB }} # used if checksum fails isn't saved anywhere.

@S2Ler S2Ler force-pushed the s2ler/fix-carthage branch from 4d60765 to 78e74ac Compare June 3, 2021 15:24
@S2Ler
Copy link
Contributor Author

S2Ler commented Jun 3, 2021

Wiki PR:

git clone --branch s2ler/carthage-migration https://github.com/mapbox/mapbox-navigation-ios.wiki.git
git diff 611aa2596fbb62b5b107bbe37b6b72ef7e403059^! 

@1ec5 1ec5 force-pushed the s2ler/fix-carthage branch from 2030753 to b48924a Compare June 3, 2021 19:03
@1ec5 1ec5 force-pushed the s2ler/fix-carthage branch from b48924a to 3891c5f Compare June 3, 2021 19:58
S2Ler added 8 commits June 4, 2021 09:25
It is partially replaced with #3030.
This scheme depends on mapbox/mapbox-maps-ios, which doesn't support
Carthage yet. Tracking issue: mapbox/mapbox-maps-ios#66.
So, to keep Carthage happy for MapboxCoreNavigation, which works
with Carthage, we must remove other unbuildable framework schemes.
- We don't need a workaround anymore.
- Update Carthage to 0.38.0 with xcframework support.
This will allow you to reset caches by changing CARTHAGE_CACHE_VERSION
environment variable.
- Remove the mention of the v1 from documentations. Motivation: the
requirements and installation steps for v1 and v2 becomes so different
that it hards to maintain. We should have separate docs for v1 anyway.

- Update minimum Carthage version to 0.38
- Remove duplicates information from `custom-navigation.md`
- Update CHANGELOG.md
The motivation for keeping this script is have backward compatibility.
The developers who uses this script for workaround won't need to change
anything to use new distribution.
@S2Ler S2Ler force-pushed the s2ler/fix-carthage branch from 3891c5f to bbdd21f Compare June 4, 2021 06:26
@S2Ler S2Ler merged commit da0e858 into release-v2.0 Jun 4, 2021
@S2Ler S2Ler deleted the s2ler/fix-carthage branch June 4, 2021 07:02
S2Ler added a commit that referenced this pull request Jun 4, 2021
The motivation for migrating to new snapshot testing library is described here: #2791 (comment).

Main consequence is that we test only on one device.

The env for current snapshots are: iPhone 12 Pro Max, iOS 14.5.

Xcode based project isn't updated yet because the work depends on #3031.
S2Ler added a commit that referenced this pull request Jun 11, 2021
The motivation for migrating to new snapshot testing library is described here: #2791 (comment).

The env for current snapshots are:
- iPhone 12 Pro Max, iOS 14.4
- iPhone 11 Pro Max, iOS 13.7

Xcode based project isn't updated yet because the work depends on #3031.

Fix regression in test due to global dependency on applied Theme in tests.

Some tests change the global theme. To return it to the expected state,
we apply the needed theme in our snapshot tests.

Temporary fix to InstructionLabel clear cache functionality

Check #3043 (comment)
for more info.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues related to builds and dependency management.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants