Configure homebrew to compile with specific clang version - clang

I need to use the llvm.org version of clang, rather than the Apple version of clang, as the compiler for a specific Homebrew formula. I installed llvm37 with
brew tap homebrew/versions
brew install llvm37
so I have clang-3.7 at /usr/local/bin. But HOMEBREW_CC can't be set to this path:
HOMEBREW_CC=clang-3.7 HOMEBREW_CXX=clang++-3.7 brew install --build-from-source <formula>
Error: Invalid value for HOMEBREW_CC: clang-3.7
What are some alternative ways to try forcing Homebrew to use this version of clang in its build environment?

Related

Unable to Upgrade Dart SDK from 2.18.7 to 2.19.0 using Homebrew

I am trying to upgrade my Dart SDK from 2.18.7 to 2.19.0 using homebrew formula brew upgrade dart.
However, the command always returns the same result
Warning: dart-lang/dart/dart 2.18.7 already installed.
brew info dart command shows:
==> dart-lang/dart/dart: stable 2.18.7, HEAD
SDK
https://dart.dev
Conflicts with:
dart-beta (because dart-beta ships the same binaries)
/usr/local/Cellar/dart/2.18.7 (921 files, 497MB) *
Built from source on 2023-01-29 at 02:33:36
From: https://github.com/dart-lang/homebrew-dart/blob/HEAD/Formula/dart.rb
==> Options
--HEAD
Install HEAD version
==> Caveats
Please note the path to the Dart SDK:
/usr/local/opt/dart/libexec
I also have tried:
brew uinstall dart<br>
brew install dart<br>
brew upgrade dart
brew upgrade dart --devel --force
resulting `Error: invalid option: --devel`
Please, kindly suggest me any other solutions that could help.
The issue occurred as the homebrew formula for dart 2.18.7 is missing in the homebrew core formula commit history:
https://github.com/Homebrew/homebrew-core/commits/master/Formula/dart-sdk.rb
However, my dart version upgraded to 2.18.7 from 2.18.6 by an unintentional brew upgrade command resulting the issue.

Homebrew's formula is not recognized

I just installed Homebrew in macOS Mojave. When trying:
$ brew install --fresh imagemagick --with-perl
there appears an output explanatory text about the usage of brew formulas, finishing by:
Error: invalid option: --fresh
Similarly, $ brew install imagemagick --with-perl gives out the forementioned text finishing by: Error: invalid option: --with-perl
(On the other hand, $ brew install imagemagick works, but there fails the perl interface, so that I wished to install it with the perl option as above).
There is no option --fresh to the brew command. If you want to reinstall a package, you do:
brew uninstall PACKAGE
brew install PACKAGE
All packages in homebrew-core no longer have any options - it was too onerous on the maintainers. Now all packages contain a core, broad set of options and that is what you get.
If you want to see how your ImageMagick is configured, use:
magick identify -list configure

Warnings of brew cleanup

I got the following warnings when I did brew cleanup. How can I fix them?
$ brew cleanup
Warning: Skipping ant: most recent version 1.9.7 not installed
Warning: Skipping atk: most recent version 2.20.0 not installed
...
(continued)
This seems like a nondeterministic bug when a formula is built from source using:
brew install {{formula}} --HEAD
Messages like this:
Warning: Skipping llvm: most recent version 3.8.1 not installed
Warning: Skipping tidy-html5: most recent version 5.2.0 not installed
brew doctor can't fix this because it looks like some version finder code is trying to load the version number for HEAD formulas and indicating confusion.
Submit a minimal bug to the brew issue tracker which reproduces it consistently (using a small, quick-building, stable package).
Usually, you only need to update to the latest version,
brew upgrade ant
and
brew upgrade atk
*In your example
If it doesn't work, check how to update the version to the relevant package

Trouble with brew install devil

RGBDSLAM install is asking for devil
$ rosdep install rgbdslam
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
rgbdslam: No definition of [libdevil-dev] for OS [osx]
But when I try to install devil I'm getting this:
$ brew install devil
Error: devil cannot be built with any available compilers.
To install this formula, you may need to:
brew install gcc
$ brew install gcc
Warning: gcc-5.3.0 already installed
How can I get around this?
Note: I have xcode installed accompanied with the command line tools.
** EDIT libdevIL installed **
for some reason gcc 5 doesn't register when devIL is looking for gcc so I had to downgrade to 4.9.
$ brew rm gcc // removes 5
$ brew install gcc49 // installs 4.9
$ brew install devil // works
$ brew install gcc // two gcc installed? this might be interesting
rgbdslam still isn't detecting libdevIL though, not sure what the deal is.
Here's some helpful notes from answers.ros.org
I set siftgpu_disable_devil = 0 in SiftGPU/makefile and
set(ENV{SIFT_GPU_MODE} 0) in CMakeLists.txt with no avail. I'm
still seeing rgbdslam: No definition of [libdevil-dev] for OS [osx]
Commenting devIL out in package.xml put me a little further but
into some seemingly OSX specific issues, trying to resolve those via
github. Will respond here once I have a solution. Thanks for your
assistance.

Homebrew updates and app self updates

How does homebrew/cask's updates work if the app auto updates itself.
Example: Chrome or Firefox
These two apps auto update themselves.
But what happens when you run a brew update?
Does it detect that it is already updated or does it check an internal list of apps it installed (misses that it is already updated) and reupdates the app>
brew cask upgrade is possible as of version 1.3.9
The Homebrew Cask repository is technically a Homebrew Tap.
This means:
It will pull down the latest Casks every time you issue the Homebrew command brew update
You can check for outdated Casks with brew cask outdated and install the outdated Casks with brew cask upgrade
Most importantly for this question, applications that update themselves include auto_updates true. This means that these casks are ignored by brew cask outdated and brew cask upgrade. This can be overridden by adding --greedy to the command.
See the Firefox cask as an example:
url "https://download-installer.cdn.mozilla.net/pub/firefox/releases/#{version}/mac/#{language}/Firefox%20#{version}.dmg"
appcast 'https://www.macupdater.net/cgi-bin/check_urls/check_url_redirect.cgi?url=https://download.mozilla.org/%3Fproduct=firefox-latest-ssl%26os=osx'
name 'Mozilla Firefox'
homepage 'https://www.mozilla.org/firefox/'
auto_updates true
Further reference is here.
Homebrew doesn't follow a new version of cask apps automatically, and you can leave such apps to their own auto updates as Homebrew intends to leave it to their own upgrade systems and e.g.
brew upgrade google-chrome
does nothing even when google-chrome has got a new update.
N.B. Now with Homebrew 2.5.5, brew cask was deprecated and integrated to the normal brew.
If you want to do for cask explicitly, you may want --cask
brew upgrade --cask google-chrome
but all the same basically.
Should you want to follow the latest version on your Homebrew proper, you can run such a command as
brew upgrade --greedy google-chrome
Also you can check a diff between the latest and your local with
brew upgrade --greedy --dry-run google-chrome
This way however is mostly for cask apps without their own upgrade systems and you don't need these commands for those with the upgrade systems as long as you're not concerned about your version numbers on Homebrew.
No. There is no brew cask upgrade.

Resources