Skip to content

Conversation

mokagio
Copy link
Contributor

@mokagio mokagio commented Jun 11, 2025

See https://linear.app/a8c/issue/AINFRA-449

Test

Checkout locally and run bundle install && bundle exec pod install && bundle exec rake lint

You should see something like, possibly with additional logs such as removing SwiftLint from your pods.

image

Note

The UI tests failure is a long standing issue and unrelated with the changes in this PR.

Review

(Required) Add instructions for reviewers. For example:

Only one developer required to review these changes, but anyone can perform the review.

Release

These changes do not require release notes.

mokagio added 2 commits June 11, 2025 13:23
Notice no source changes were required. All the code already complies
with the configuration and any new rule from the newer version.
@mokagio mokagio added this to the Future milestone Jun 11, 2025
@mokagio mokagio added the tooling Related to anything that supports the building & maintaining of the project. label Jun 11, 2025
@mokagio mokagio self-assigned this Jun 11, 2025
@mokagio mokagio requested a review from a team June 11, 2025 03:46
@wpmobilebot
Copy link
Collaborator

App Icon📲 You can test the changes from this Pull Request in Simplenote Prototype Build by scanning the QR code below to install the corresponding build.
App NameSimplenote Prototype Build
Build Number1285
VersionPR #1712
Bundle IDcom.codality.NotationalFlow.Alpha
Commit70de778
Installation URL6qvpgbvottb8g
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

Copy link
Contributor

@AliSoftware AliSoftware left a comment

Choose a reason for hiding this comment

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

Approving to unblock and because it worked on my machine, but left a note about running rake lint from the Xcode shell script build phase and its potential issues depending on developers' setup

runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "[ $CI ] && exit 0\n./Pods/SwiftLint/swiftlint\n";
shellScript = "[ $CI ] && exit 0\nrake lint\n";
Copy link
Contributor

Choose a reason for hiding this comment

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

I was wary of if running rake from an Xcode build phase would work as expected, given that:

  • When Xcode runs shell scripts it runs them in a separate shell that might not have the same env / settings as your Terminal.app's shell (e.g. $PATH and where rake is installed)
  • That shell script runs in /bin/sh, while macOS users are using zsh, so all their customization and setup of their shell is in .zshrc and not .bashrc. So again, any custom $PATH or rbenv and bundle-related config etc might be set up properly in .zshrc but not in .bashrc for the /bin/sh shell to pick up, which could lead to this rake lint command to fail
  • Notice how you run rake lint, not bundle exec rake lint. Which means one might accidentally run this command with a different version of rake than the one in the Gemfile.lock bundle of this repo. Probably not a big deal (the most important thing is for swiftlint to be using the right version, and rake doesn't have that many updates anyway, and if it does, nothing likely breaking anything) but still inconsistent.

It still worked when I tested building the project with Xcode on my Mac:
image

But I think that might be a happy coincidence in how my Mac is set up, and that might not be the case for every developer? I wonder if switching to shellPath = /bin/zsh; and using bundle exec rake lint wouldn't be better (maybe with a need to source ~/.zshrc explicitly first, in case Xcode running this shell in non-interactive mode would prevent that from loading… not sure, always confused with the rc files and when they're loaded wrt to interactive vs non-interactive shells etc)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I remember looking into this with Jeremy a while back and coming to the conclusion that calling rake from Xcode works because of a number of happy coincidences in how Apple set up Ruby in macOS.

In the long run, consistently with our goal of removing Ruby from day-to-day DX, I think we'd be better off using make which we know would be consistent without depending on Ruby setup.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved this discussion internally to paaHJt-8yZ-p2

@mokagio mokagio merged commit d2b6966 into trunk Jun 12, 2025
10 of 12 checks passed
@mokagio mokagio deleted the ainfra-449-provision-swiftlint-via-swiftpm branch June 12, 2025 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tooling Related to anything that supports the building & maintaining of the project.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants