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

[Homebrew] Error: swiftgen has been disabled because it does not build! #1104

Closed
batkov opened this issue Feb 24, 2024 · 10 comments
Closed

[Homebrew] Error: swiftgen has been disabled because it does not build! #1104

batkov opened this issue Feb 24, 2024 · 10 comments

Comments

@batkov
Copy link

batkov commented Feb 24, 2024

Homebrew is not installing swiftgen.

I've tried installing older formulas, like brew install swiftgen@6.6.0, but it is not helping.

$ brew update
Already up-to-date.
$ brew install swiftgen
Error: swiftgen has been disabled because it does not build!
@isgallagher
Copy link

Try this. #1030 (comment)

@batkov
Copy link
Author

batkov commented Feb 25, 2024

@isgallagher this workaround worked.

Copying for other unfortunate devs:

curl -Lo /tmp/swiftgen.rb https://raw.githubusercontent.com/iMichka/homebrew-core/17ae00b4bf1640cc544eae5f6eec03775c09420b/Formula/swiftgen.rb && brew install /tmp/swiftgen.rb && rm /tmp/swiftgen.rb

@muradtries
Copy link

@isgallagher this workaround worked.

Copying for other unfortunate devs:

curl -Lo /tmp/swiftgen.rb https://raw.githubusercontent.com/iMichka/homebrew-core/17ae00b4bf1640cc544eae5f6eec03775c09420b/Formula/swiftgen.rb && brew install /tmp/swiftgen.rb && rm /tmp/swiftgen.rb

I've tried to replace brew install swiftgen with this command. However receiving an error and warning on the console:

Error: Failed to load cask: /tmp/swiftgen.rb
Cask 'swiftgen' is unreadable: wrong constant name #<Class:0x000000010ff17768>
Warning: Treating /tmp/swiftgen.rb as a formula.

How can I resolve this issue?

@gongzhang
Copy link

@isgallagher this workaround worked.
Copying for other unfortunate devs:

curl -Lo /tmp/swiftgen.rb https://raw.githubusercontent.com/iMichka/homebrew-core/17ae00b4bf1640cc544eae5f6eec03775c09420b/Formula/swiftgen.rb && brew install /tmp/swiftgen.rb && rm /tmp/swiftgen.rb

I've tried to replace brew install swiftgen with this command. However receiving an error and warning on the console:

Error: Failed to load cask: /tmp/swiftgen.rb
Cask 'swiftgen' is unreadable: wrong constant name #<Class:0x000000010ff17768>
Warning: Treating /tmp/swiftgen.rb as a formula.

How can I resolve this issue?

Already installed? Try ... && brew reinstall /tmp/swiftgen.rb && ... 😉

@lhoracek
Copy link

lhoracek commented Feb 27, 2024

We've replaced it with mint install.
brew install mint
mint install SwiftGen/SwiftGen

@VicenteAlbert
Copy link

We've replaced it with mint install. brew install mint mint install SwiftGen/SwiftGen

Although this worked for me also, my project setup couldn't find the "swiftgen" command, even if I could run it from terminal. If you need specific homebrew installation, this worked for me:

1. disable homebrew's check update 'export HOMEBREW_NO_INSTALL_FROM_API=1', otherwise the installation will overwrite the file edited below
2. Manually change the repository file 'brew edit swiftgen', which will automatically edit the repository file using vim
3. find 'disable! date: "xxxx", because: xxxx', add # before it, comment out this line
4. ':wq' Save and exit edit
5. 'brew install swiftgen' to install

@teejayhh
Copy link

brew install swiftgen

is part of our ci pipeline and I dont really want to make the curl solution the permanent fix. Will this be resolved so we can use brew again ? I tried mint but I had issues using swiftgen afterwards.

@isgallagher
Copy link

We've replaced it with mint install. brew install mint mint install SwiftGen/SwiftGen

I am not able to get mint's install to actually work.

SwiftGenCLI/resource_bundle_accessor.swift:11: Fatal error: could not load resource bundle: from /Users/removed/.mint/bin/SwiftGen_SwiftGenCLI.bundle or /private/var/folders/_8/cr5ngqns1n38s7l4tg3crv2m0000gn/T/mint/github.com_SwiftGen_SwiftGen/.build/arm64-apple-macosx/release/SwiftGen_SwiftGenCLI.bundle zsh: trace trap ~/.mint/bin/swiftgen

But it works when I use the curl brew install method.

@Liquidsoul
Copy link
Member

Problem should be fixed once the homebrew-core PR gets merged 🤞

Sorry for the inconvenience.

@batkov
Copy link
Author

batkov commented Mar 3, 2024

brew install swiftgen works now. Thanks

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

No branches or pull requests

8 participants