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

Swift Package Manager and M1 Support #9507

Merged
merged 85 commits into from
Jan 31, 2022
Merged

Swift Package Manager and M1 Support #9507

merged 85 commits into from
Jan 31, 2022

Conversation

nbhasin2
Copy link
Contributor

@nbhasin2 nbhasin2 commented Nov 15, 2021

added:

  • added references to specific components to compile
  • added spm related nightly, beta and prod builds to bitrise
  • added content_blocker_update.sh script to update shavar content blocker
  • added swiftkeychain wrapper (MZSwiftKeychain) to RustFxAClient
  • added a workaround run-script to each apex (application extension) target to remove any framework that isn't required in the archive to avoid nested dependency
  • added rust places and sdwebimage framework to XCUitest
  • added M1 simulator work
  • added all dependencies as a part of swift package manager

moved:

  • moved app services to swift packages
  • moved all app services related static dependency to dlyb frameworks to avoid cyclic dependency until SPM is ready for nested frameworks in multiple targets

updated:

  • updated and moved sdk_generator.sh to /bin folrder repo and removed references to getting it from a-s
  • updated A~S v90.0.2 (main branch) and added Client / Storage test libs
  • updated Glean package to 43.0.2 (latest)
  • fixed test dependencies
  • updated Firefox and Firefox beta scheme to support dependency order and find implicit dependency
  • updated readme to mention that we support XCode 13.2.1
  • updated bootstrap.sh to not have any carthage related item and use content_blocker_update.sh
  • updated gitignore to ignore shavar prod list

removed:

  • removed bitrise step for moving, copying sdk_generator (should be for main branch only)
  • removed carthage and moved all dependencies to swift package manager
  • removed stale 1password related framework and code. If required we will revisit to cleanup more

todo:

  • update: MozillaRustComponents to support direct version instead of a special branch on a fork
  • update: Fuzi spm package to support direct version instead of a fork
  • update: MappaMundi spm package and move changes from fork to the actual branch
  • update: GCDWebservier spm package to support direct version instead of a fork
  • update: need to update BR for unit tests
  • remove: any un-used workaround script and just use static frameworks once SPM supports nested frameworks

Note:

  • Not all frameworks are required to be code signed and copy framework step on purpose so we can add it later if required

Follow-up bug where A~S is not showing the a login screen: https://mozilla-hub.atlassian.net/browse/FXIOS-3695

@nbhasin2 nbhasin2 added the Do Not Merge ⛔️ This issue is a work in progress and is not ready to land label Nov 15, 2021
@nbhasin2 nbhasin2 force-pushed the spm branch 6 times, most recently from 977633e to 6353feb Compare November 18, 2021 21:38
@mergify
Copy link
Contributor

mergify bot commented Nov 19, 2021

This pull request has conflicts when rebasing. Could you fix it @nbhasin2?

@mergify
Copy link
Contributor

mergify bot commented Dec 3, 2021

This pull request has conflicts when rebasing. Could you fix it @nbhasin2?

@nbhasin2 nbhasin2 removed the Do Not Merge ⛔️ This issue is a work in progress and is not ready to land label Jan 27, 2022
@nbhasin2 nbhasin2 requested a review from yoanarios January 27, 2022 22:10
@nbhasin2
Copy link
Contributor Author

Sample Firefox Beta upload:

https://app.bitrise.io/build/47dd4ee5-66c1-4ba7-8de4-8da98ec387f6#?tab=log - Passed

@isabelrios
Copy link
Contributor

isabelrios commented Jan 28, 2022

@nbhasin2 even though the tests are marked above as passed, that's wrong, they don't even run. There is a step in Bitrise at the very beginning failing and all the other steps, build and tests among them, are skipped. Do you want me to comment what to fix for Bitrise to run as in regular PRs or do you want to address that later? I don't want to add more noise here.
Thanks!

@isabelrios
Copy link
Contributor

@nbhasin2 even though the tests are marked above as passed, that's wrong, they don't even run. There is a step in Bitrise at the very beginning failing and all the other steps, build and tests among them, are skipped. Do you want me to comment what to fix for Bitrise to run as in regular PRs or do you want to address that later? I don't want to add more noise here. Thanks!

I'm modifying bitrise.yml file in a different PR to try things out and give you the final solution once everything works.
In that one, I got the build successfully built but unit tests fail to run
I'm experiencing similar issues when trying to run tests from command line, I'm investigating 👀

@nbhasin2
Copy link
Contributor Author

@isabelrios sounds good, yeah I figured you would be the best person to take a look at tests and modify them accordingly. Let me know if I can help in any way.

@isabelrios
Copy link
Contributor

@isabelrios sounds good, yeah I figured you would be the best person to take a look at tests and modify them accordingly. Let me know if I can help in any way.

I'm a bit stuck with the tests :/ . I'm trying to run them from command line to emulate the way the would run on Bitrise, but:

  • For Unit Tests: I can't run them either from command line or Xcode UI. I get errors like:
Undefined symbol: nominal type descriptor for Places.HistoryHighlight
Undefined symbol: type metadata for Places.HistoryHighlight
Undefined symbol: protocol conformance descriptor for Places.DocumentType : Swift.Equatable in Places

Just curious @nbhasin2 can you run the tests locally?

  • For XCUITests: I can run them from command line using:
    xcodebuild test -target Client -scheme Fennec_Enterprise_XCUITests -destination 'platform=iOS Simulator,name=iPhone 11' -testPlan: SmokeXCUITests
    but that always fails on Bitrise with error:
Linking SDWebImage
❌  Undefined symbols for architecture x86_64
> Symbol: ___llvm_profile_runtime
> Referenced from: ___llvm_profile_runtime_user in SDWebImage.o

I saw that locally but got to fix it by building and then running the tests. On Bitrise even though I clear cache and build before running the tests, I can't fix that.

I will keep working on this, but if something comes to your mind in the meantime about the issue that we may be facing, I appreciate your help. Thanks!

@nbhasin2
Copy link
Contributor Author

@isabelrios I added the missing framework, let me know if that helps

Copy link
Contributor

@nishant2718 nishant2718 left a comment

Choose a reason for hiding this comment

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

🥇

@mergify
Copy link
Contributor

mergify bot commented Jan 31, 2022

This pull request has conflicts when rebasing. Could you fix it @nbhasin2?

Copy link
Contributor

@lmarceau lmarceau left a comment

Choose a reason for hiding this comment

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

🙌

@nbhasin2 nbhasin2 changed the title SPM + M1 Support Swift Package Manager and M1 Support Jan 31, 2022
@nbhasin2 nbhasin2 requested a review from dnarcese January 31, 2022 21:27
Copy link
Contributor

@skhamis skhamis left a comment

Choose a reason for hiding this comment

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

YESSSSS! 🚀

@lmarceau
Copy link
Contributor

Linking Github issue: #9859

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants