Skip to content

Conversation

@djbe
Copy link
Contributor

@djbe djbe commented Oct 3, 2021

  • Have you followed the guidelines for contributing?
  • Have you ensured that your commits follow the commit style guide?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

Release of SwiftGen/SwiftGen#881

brew audit --strict --online swiftgen doesn't want to work, it keeps complaining about:

  • HEAD: Use branch: "stable" to specify the default branch

Once I set it to stable, the audit passes. The problem is, our "head" branch is develop, not stable. In our last release we set it to develop, but someone else changed the formula to point at stable for some reason.

@BrewTestBot BrewTestBot added macos-only Formula depends on macOS no ARM bottle Formula has no ARM bottle ruby Ruby use is a significant feature of the PR or issue labels Oct 3, 2021
@djbe
Copy link
Contributor Author

djbe commented Oct 3, 2021

Seems like there are 2 issues:

  • Non-executables were installed to "/usr/local/opt/swiftgen/bin".
    The offending files are:
    /usr/local/opt/swiftgen/bin/SwiftGen_SwiftGenCLI.bundle
  • Unexpected universal binaries were found.
    The offending files are:
    /usr/local/Cellar/swiftgen/6.5.0/bin/swiftgen

The second one is kinda minor, it's weird that only 11 is complaining and not 11-arm64 or any of the other tests, because we now always build universal binaries. I can change our build script to only build the active architecture if needed.

The first one is a much bigger issue. This is how SPM binaries with resources work, we're not allowed to move those bundles to another place, it'll break the path of Bundle.module. And there's no way for us to check if Bundle.module will work, it'll just crash. Is there a way to silence this error in Homebrew?

@branchv branchv added CI-force-arm [DEPRECATED] Don't pass --skip-unbottled-arm to brew test-bot. CI-no-fail-fast Continue CI tests despite failing GitHub Actions matrix builds. labels Oct 4, 2021
@branchv
Copy link
Member

branchv commented Oct 4, 2021

it's weird that only 11 is complaining and not 11-arm64

ARM was being skipped, I've added the CI-force-arm label to correct that

The second one is kinda minor

We can try the following:

diff --git a/Formula/swiftgen.rb b/Formula/swiftgen.rb
index 7f200071516..d8ec22ade49 100644
--- a/Formula/swiftgen.rb
+++ b/Formula/swiftgen.rb
@@ -53,6 +53,9 @@ class Swiftgen < Formula
       "#{fixtures}/Generated/XCAssets/swift5/all.swift"                   => "xcassets.swift",
       "#{fixtures}/Generated/YAML/inline-swift5/all.swift"                => "yaml.swift",
     })
+
+    # Replace universal binaries with their native slices
+    deuniversalize_machos
   end
 
   test do

The first one is a much bigger issue. [...] Is there a way to silence this error in Homebrew?

Sorry, I'm honestly not sure. I'll let others chime in here.

@carlocab
Copy link
Member

carlocab commented Oct 4, 2021

Passing a flag to the build to build only native binaries would be preferable to using deuniversalize_machos. (Though this should work too.)

Re the location of SwiftGen_SwiftGenCLI.bundle: let's install everything into libexec and then just symlink what we want to expose to users into bin, lib, etc.

@djbe
Copy link
Contributor Author

djbe commented Oct 4, 2021

I've updated the formula to install in libexec as suggested.

For now I'm also using deuniversalize_machos. It isn't ideal, but I'm working on an update to our build scripts, should be implemented in the next SwiftGen version.

@djbe
Copy link
Contributor Author

djbe commented Oct 4, 2021

Nice the checks pass now 🎉

Any thoughts on the HEAD: Use branch: "stable" to specify the default branch issue mentioned in the first comment?

@SMillerDev
Copy link
Member

The default branch is stable, if that is not the branch that people should regard as the default branch when checking out the project I would recommend changing the default branch to develop.

@djbe
Copy link
Contributor Author

djbe commented Oct 4, 2021

The homebrew documentation mentions that head is for "the development cutting edge". Our stable branch only contains our releases, so head should point to develop.

My issue is that brew audit --strict --online swiftgen keeps complaining about this:

  • HEAD: Use branch: "stable" to specify the default branch

Note: homebrew version info

Homebrew 3.2.14-51-g1909d89
Homebrew/homebrew-core (git revision 6e1f8e9; last commit 2021-10-04)
Homebrew/homebrew-cask (git revision 8a108c4; last commit 2021-10-04)

@carlocab
Copy link
Member

carlocab commented Oct 4, 2021

Nice the checks pass now 🎉

Any thoughts on the HEAD: Use branch: "stable" to specify the default branch issue mentioned in the first comment?

@nandahkrishna, thoughts here? (I think you implemented this audit -- apologies if I'm misremembering.)

@djbe
Copy link
Contributor Author

djbe commented Oct 4, 2021

From the git history for the formula, seems like @chenrui333 made the change to stable if that helps?

@BrewTestBot
Copy link
Contributor

🤖 A scheduled task has triggered a merge.

@djbe djbe deleted the swiftgen-6.5.0 branch October 4, 2021 15:14
@github-actions github-actions bot added the outdated PR was locked due to age label Nov 4, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

CI-force-arm [DEPRECATED] Don't pass --skip-unbottled-arm to brew test-bot. CI-no-fail-fast Continue CI tests despite failing GitHub Actions matrix builds. macos-only Formula depends on macOS no ARM bottle Formula has no ARM bottle outdated PR was locked due to age ruby Ruby use is a significant feature of the PR or issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants