The Wayback Machine - https://web.archive.org/web/20230320023037/https://github.com/realm/SwiftLint/pull/4603
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

Use a binary target for the build tool plugin #4603

Merged
merged 12 commits into from Nov 29, 2022

Conversation

tonyarnold
Copy link
Contributor

@tonyarnold tonyarnold commented Nov 29, 2022

This will save users of the build tool plugin from having to compile the CLI tool before running the plugin.

I'm still having a look at how to automate the updating of the binary details in the Package description.

@SwiftLintBot
Copy link

1 Message
📖 Skipping OSSCheck because SwiftLint hasn't changed compared to 'main'

Generated by 🚫 Danger

@tonyarnold tonyarnold marked this pull request as ready for review November 29, 2022 03:09
.binaryTarget(
name: "SwiftLintBinary",
url: "https://github.com/realm/SwiftLint/releases/download/0.50.1/SwiftLintBinary-macos.artifactbundle.zip",
checksum: "487c57b5a39b80d64a20a2d052312c3f5ff1a4ea28e3cf5556e43c5b9a184c0c"
Copy link
Collaborator

Choose a reason for hiding this comment

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

There’s a chicken and egg problem here. We won’t know the checksum until after the artifact is created.

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 is very, very correct. I need to do some reading, because this seems like a thing that Apple would have thought of.

SwiftPM probably allows a local binary target at a path within the repository.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Technically I guess you could build the binary, update this file, tag it, and still add the binary to the release tag even though it was built from 1 commit before the actual tag ¯_(ツ)_/¯

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's true.

What's the release process look like now? Is it automated?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yep, I can see the "Releasing.md" file.

I'll propose some updates to the Makefile to calculate the checksum and pipe it into the Package description as part of the release process.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, I've just pushed a few commits that resolve an infinite recursion bug for filesystems that don't have a configuration, and quietened the output so that Xcode only prints violations, not the checked files.

Copy link
Collaborator

Choose a reason for hiding this comment

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

There’s a lint failure due to a long line and a build failure on Linux. If you don’t get around to fixing those I can do that later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All done, let's see if it passes CI now 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's your call, but it might be worth cutting a release for that infinite recursion bug that I fixed. That's present in 0.50.1, as well.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I’ll keep it in mind. Frequent releases means frequent cache invalidations, which impacts all users, not just the ones that would be impacted by this bug.

jpsim and others added 11 commits November 29, 2022 12:55
Instead of running `make push_version "0.2.0: Tumble Dry"` and then
`make release`, now run `make release "0.2.0: Tumble Dry"`, which will
build the release artifacts and update/push the new version to GitHub.

This allows the artifacts to use the new version, update the artifact
bundle checksum in the package manifest, then tag the release.

The Releasing.md instructions were updated to reflect this new workflow.
This shouldn’t trigger sandbox violations, I hope…
@jpsim jpsim merged commit ab14368 into realm:main Nov 29, 2022
13 checks passed
@tonyarnold tonyarnold deleted the binary-plugin branch November 29, 2022 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants