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

git-annex isn't available on M1 Macs #5701

Closed
adswa opened this issue May 28, 2021 · 26 comments
Closed

git-annex isn't available on M1 Macs #5701

adswa opened this issue May 28, 2021 · 26 comments
Labels
platform-osx Issue concerned with MacOSX

Comments

@adswa
Copy link
Member

adswa commented May 28, 2021

I don't have a machine to verify or test this, but a group of M1 Mac users just reported that they can't install git-annex. The workaround that they found is recorded here. To cite the relevant parts:

So the problem is that git-annex is not available for M1 macs, natively.

Solution:

1- Install Rosetta 2: Open a terminal and execute

/usr/sbin/softwareupdate --install-rosetta --agree-to-license

2- Download the git-annex DMG file from here: https://downloads.kitenet.net/git-annex/OSX/current/10.10_Yosemite/git-annex.dmg

3- Open the DMG file. Drag and drop the git-annex app to the /Applications folder.

4- In the terminal, run:

/Applications/git-annex.app/Contents/MacOS/git-annex

Once you do that, a message will appear saying that you can't execute that.

5- Open the System Preferences. Go to Security & Privacy. In the general tab, click on "Open anyway". Another message will apear, click open.

6- In the terminal, run:

/Applications/git-annex.app/Contents/MacOS/git-annex

You should see the output of git-annex.

7- Create a symbolic link so it's always on the path.

cd /usr/local/bin
sudo ln -s /Applications/git-annex.app/Contents/MacOS/git-annex

@yarikoptic
Copy link
Member

FWIW, filed datalad/git-annex#61 to eventually/hopefully provide a native build (if that is what is needed)

@adswa
Copy link
Member Author

adswa commented May 28, 2021

thanks!

@adswa
Copy link
Member Author

adswa commented Jul 21, 2021

I vaguely recall @yarikoptic reporting that this was fixed... Did I dream this, or is there indeed git-annex for M1 macs now?

@mih
Copy link
Member

mih commented Jul 21, 2021

@adswa
Copy link
Member Author

adswa commented Oct 8, 2021

I think its ok to close this issue. It does not so much belong into datalad, and while not optimal, there are some ways to get git-annex for M1 users. Its apparently possible to use it via Rosetta2, and homebrew (which has become available for M1 macs) has bottled all git-annex dependencies. Maybe it even bottles git-annex itself soon.

@adswa adswa closed this as completed Oct 8, 2021
@JoshuaDietz
Copy link

6- In the terminal, run:

/Applications/git-annex.app/Contents/MacOS/git-annex

When I do this step I just get
dyld[1525]: Library not loaded: @executable_path/B Referenced from: /Applications/git-annex.app/Contents/MacOS/bundle/git-annex Reason: tried: '/Applications/git-annex.app/Contents/MacOS/bundle/B' (code signature invalid (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x000FC4A0, codeBlobSize=0x00006700 for '/Applications/git-annex.app/Contents/MacOS/bundle/usr/lib/libiconv.2.dylib'), '/usr/local/lib/B' (no such file), '/usr/lib/B' (no such file) zsh: abort /Applications/git-annex.app/Contents/MacOS/git-annex

any idea on how to fix this?

@adswa
Copy link
Member Author

adswa commented Nov 4, 2021

I personally have no idea, and also no hardware to try this myself. Sadly, brew also hasn't bottled it up: https://formulae.brew.sh/formula/git-annex#default. I'll reopen the issue in hopes of someone with M1/mac experience to come by.

@adswa adswa reopened this Nov 4, 2021
@adswa adswa added the platform-osx Issue concerned with MacOSX label Dec 10, 2021
@adswa
Copy link
Member Author

adswa commented Jan 14, 2022

Saving a collection of links from the chat on updates with brew (sadly, no steps forward):

judging from Homebrew/brew#7857, the brew team has troubles to bottle the haskell compiler (but that list may be outdated, because it looks like there is a formula: https://formulae.brew.sh/formula/ghc). As far as I know, Rosetta2 is the official way to get support for x86-64 applications when there is no Apple Silicon alternative.
I think the latest attempt to bottle was Homebrew/homebrew-core#88995, but stalled. I guess someone with haskell knowledge is needed, or, as @mslw said, someone with homebrew / compiling knowlege. Looking back at it, in addition to the attempt to change the build instructions you mention, the build for the latest version bump Homebrew/homebrew-core#92348 still fails on M1 with what looks like 🤷‍♂️some mismatch in the build environment 🤷‍♂️ (logs are under "Files changed")

@yarikoptic
Copy link
Member

yarikoptic commented Jan 14, 2022

to contribute I guess we would need some M1 box. I guess I could buy one (and provide ssh access), or here are some virtual providers:

update1: macstadium gave us an instance for an open source project. Waiting for details on setup

@carlocab
Copy link

carlocab commented Jan 29, 2022

Hi there -- I've tried a few times to get git-annex built on M1 macOS: Homebrew/homebrew-core#88995, Homebrew/homebrew-core#93863

Homebrew CI always attempts to build a binary package on version bumps, so you'll see several other attempts here: https://github.com/Homebrew/homebrew-core/pulls?q=is%3Apr+is%3Aclosed+in%3Atitle+git-annex

The build invariably fails with an error like

ghc: could not execute: opt

I don't really understand why, since opt (provided by LLVM) should be in PATH during the build. Attempting to add it again to PATH during the build does not work either.

I also saw a suggestion in the GHCUp repo to export the environment variable OPT for a similar problem, but that didn't seem to work.

I have one last idea, and if that fails, I'll try to crank up the verbosity of the build. I know Homebrew well, but know next to little about Haskell, so I'll need a little help here if I'm still unsuccessful.

Many other Haskell builds on M1 require an LLVM installation (they fail when it's not available), but none of the others fail in this way, so I'm not really sure what the problem is here. I recall a user having reported being able to successfully build git-annex from source using Homebrew on M1 macOS, though.

@carlocab
Copy link

So I tried setting --with-llc and --with-opt, but that didn't work (cabal didn't recognise the options), I also set --extra-prog-path to the location where llc and opt can be found, along with LLC and OPT in the environment. That didn't work too. See Homebrew/homebrew-core#94060.

I then upped the verbosity of the logs. It didn't get much more informative than

ghc: could not execute: llc
/opt/homebrew/opt/ghc/bin/ghc returned ExitFailure 1

which isn't helpful. Still, here's the log in case I missed something: arm.log.tar.gz (N.B. ~14M uncompressed)

@angerman, if you don't mind taking a look at this, I'd appreciate it.

@yarikoptic
Copy link
Member

Thank you @carlocab for taking a stab at it!

@adswa
Copy link
Member Author

adswa commented Jan 31, 2022

Also from my side thanks a lot for looking in to it, @carlocab!

@adswa
Copy link
Member Author

adswa commented Feb 9, 2022

@yarikoptic could you add information on the new virtual M1 mac somewhere (sorry if I missed this)?

@yarikoptic
Copy link
Member

Where? Do you want access @adswa ?

@adswa
Copy link
Member Author

adswa commented Feb 9, 2022

yes please. @mslw probably too?

@mslw
Copy link
Contributor

mslw commented Feb 9, 2022

Yes, I'd be interested - not immediately, but I'd happily give it a try in the near future.

@yarikoptic
Copy link
Member

@adswa you should have access now, please add @mslw ssh key into the mix

@yarikoptic
Copy link
Member

linking issue in datalad/git-annex: datalad/git-annex#61 (comment) : @jwodder:

@yarikoptic It looks like Haskell Stack (which is used to build git-annex) doesn't properly support M1 Macs yet.

@adswa
Copy link
Member Author

adswa commented Feb 9, 2022

I had a few minutes and tried to build git-annex on that M1, here's what I did so far:
Anything stack (setup, build) segfaulted immediately, under all shells.

Then I went for cabal instead of stack.
I got until cabal install -j --only-dependencies in the git-annex source repository.
This fails like this:

Downloaded   DAV-1.3.4

Failed to build IfElse-0.85.
Build log ( /Users/datalad/.cabal/logs/ghc-8.10.7/IfEls-0.85-f16560f7.log ):
Configuring IfElse-0.85...
Preprocessing library for IfElse-0.85..
Building library for IfElse-0.85..
[1 of 1] Compiling Control.Monad.IfElse ( Control/Monad/IfElse.hs, dist/build/Control/Monad/IfElse.o, dist/build/Control/Monad/IfElse.dyn_o )

Control/Monad/IfElse.hs:159:11: warning: [-Winline-rule-shadowing]
    Rule "maybeMP/id" may never fire
      because ‘maybeMP’ might inline first
    Probable fix: add an INLINE[n] or NOINLINE[n] pragma for ‘maybeMP’
    |
159 | {-# RULES "maybeMP/id" maybeMP = id #-}
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)
ghc: could not execute: opt

Failed to build Only-0.1.
Build log ( /Users/datalad/.cabal/logs/ghc-8.10.7/Only-0.1-0872098c.log ):
Configuring library for Only-0.1..
Preprocessing library for Only-0.1..
Building library for Only-0.1..
[1 of 1] Compiling Data.Tuple.Only  ( src/Data/Tuple/Only.hs, dist/build/Data/Tuple/Only.o, dist/build/Data/Tuple/Only.dyn_o )

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)
ghc: could not execute: opt

Failed to build SafeSemaphore-0.10.1.
Build log ( /Users/datalad/.cabal/logs/ghc-8.10.7/SfSmphr-0.10.1-3754866f.log
):
Configuring library for SafeSemaphore-0.10.1..
Preprocessing library for SafeSemaphore-0.10.1..
Building library for SafeSemaphore-0.10.1..

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)
[1 of 8] Compiling Control.Concurrent.FairRWLock ( src/Control/Concurrent/FairRWLock.hs, dist/build/Control/Concurrent/FairRWLock.o, dist/build/Control/Concurrent/FairRWLock.dyn_o )

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)
ghc: could not execute: opt

Failed to build StateVar-1.2.2.
Build log ( /Users/datalad/.cabal/logs/ghc-8.10.7/SttVr-1.2.2-e7f4b195.log ):
Configuring library for StateVar-1.2.2..
Preprocessing library for StateVar-1.2.2..
Building library for StateVar-1.2.2..

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)
[1 of 1] Compiling Data.StateVar    ( src/Data/StateVar.hs, dist/build/Data/StateVar.o, dist/build/Data/StateVar.dyn_o )

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)
ghc: could not execute: opt

Failed to build bloomfilter-2.0.1.0.
Build log ( /Users/datalad/.cabal/logs/ghc-8.10.7/blmfltr-2.0.1.0-4c5322a4.log
):
Configuring library for bloomfilter-2.0.1.0..
Preprocessing library for bloomfilter-2.0.1.0..
Building library for bloomfilter-2.0.1.0..

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)
[1 of 7] Compiling Data.BloomFilter.Array ( Data/BloomFilter/Array.hs, dist/build/Data/BloomFilter/Array.o, dist/build/Data/BloomFilter/Array.dyn_o )

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)
ghc: could not execute: opt

Failed to build blaze-builder-0.4.2.2.
Build log (
/Users/datalad/.cabal/logs/ghc-8.10.7/blz-bldr-0.4.2.2-b180ed46.log ):
Configuring library for blaze-builder-0.4.2.2..
Preprocessing library for blaze-builder-0.4.2.2..
Building library for blaze-builder-0.4.2.2..

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)
[ 1 of 11] Compiling Blaze.ByteString.Builder.Internal.Write ( Blaze/ByteString/Builder/Internal/Write.hs, dist/build/Blaze/ByteString/Builder/Internal/Write.o, dist/build/Blaze/ByteString/Builder/Internal/Write.dyn_o )

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)
ghc: could not execute: opt

Failed to build base-compat-0.12.1.
Build log ( /Users/datalad/.cabal/logs/ghc-8.10.7/bs-cmpt-0.12.1-83764adf.log
):
Configuring library for base-compat-0.12.1..
Preprocessing library for base-compat-0.12.1..
Building library for base-compat-0.12.1..

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)
[  1 of 122] Compiling Control.Concurrent.Compat ( src/Control/Concurrent/Compat.hs, dist/build/Control/Concurrent/Compat.o, dist/build/Control/Concurrent/Compat.dyn_o )

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)
ghc: could not execute: opt

Failed to build base-orphans-0.8.6.
Build log ( /Users/datalad/.cabal/logs/ghc-8.10.7/bs-rphns-0.8.6-9ea8782d.log
):
Configuring library for base-orphans-0.8.6..
Preprocessing library for base-orphans-0.8.6..
Building library for base-orphans-0.8.6..

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)
[1 of 2] Compiling Data.Orphans.Prelude ( src/Data/Orphans/Prelude.hs, dist/build/Data/Orphans/Prelude.o, dist/build/Data/Orphans/Prelude.dyn_o )

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)
ghc: could not execute: opt

Failed to build base16-bytestring-1.0.2.0.
Build log (
/Users/datalad/.cabal/logs/ghc-8.10.7/bs16-bytstrng-1.0.2.0-3e8ba8f7.log ):
Configuring library for base16-bytestring-1.0.2.0..
Preprocessing library for base16-bytestring-1.0.2.0..
Building library for base16-bytestring-1.0.2.0..

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)
[1 of 3] Compiling Data.ByteString.Base16.Internal ( Data/ByteString/Base16/Internal.hs, dist/build/Data/ByteString/Base16/Internal.o, dist/build/Data/ByteString/Base16/Internal.dyn_o )

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)
ghc: could not execute: opt
cabal: Failed to build IfElse-0.85. See the build log above for details.
Failed to build Only-0.1 (which is required by criterion-1.5.13.0). See the
build log above for details.
Failed to build SafeSemaphore-0.10.1. See the build log above for details.
Failed to build StateVar-1.2.2 (which is required by DAV-1.3.4). See the build
log above for details.
Failed to build bloomfilter-2.0.1.0. See the build log above for details.
Failed to build blaze-builder-0.4.2.2 (which is required by
yesod-static-1.6.1.0, yesod-1.6.1.2 and others). See the build log above for
details.
Failed to build base-compat-0.12.1 (which is required by yesod-1.6.1.2,
persistent-sqlite-2.13.1.0 and others). See the build log above for details.
Failed to build base-orphans-0.8.6 (which is required by yesod-1.6.1.2,
persistent-sqlite-2.13.1.0 and others). See the build log above for details.
Failed to build base16-bytestring-1.0.2.0 (which is required by aws-0.22). See
the build log above for details.

Based on

Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)

I checked the LLVM version.
brew (if I understand it correctly) said that LLVM is preinstalled on macOS

datalad@26696 git-annex % brew info llvm                                               
llvm: stable 13.0.0 (bottled), HEAD [keg-only]
Next-gen compiler infrastructure
https://llvm.org/
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/llvm.rb
License: Apache-2.0 with LLVM-exception
==> Dependencies
Build: cmake ✘, swig ✘
Required: python@3.10 ✘
==> Options
--HEAD
	Install HEAD version
==> Caveats
To use the bundled libc++ please add the following LDFLAGS:
  LDFLAGS="-L/opt/homebrew/opt/llvm/lib -Wl,-rpath,/opt/homebrew/opt/llvm/lib"

llvm is keg-only, which means it was not symlinked into /opt/homebrew,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.

==> Analytics
install: 37,461 (30 days), 104,782 (90 days), 332,272 (365 days)
install-on-request: 22,691 (30 days), 61,686 (90 days), 224,768 (365 days)
build-error: 2,621 (30 days)

I'm not sure what "is not symlinked" means in practice.

It seems the system has it installed (if llvm-gcc is the correct thing here, I'm really not sure):

datalad@26696 git-annex % llvm-gcc --version                                           
Apple clang version 13.0.0 (clang-1300.0.29.30)
Target: arm64-apple-darwin21.2.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
datalad@26696 git-annex % which llvm-gcc
/usr/bin/llvm-gcc

but adding any of those paths into $PATH does not resolve the problem.

@carlocab
Copy link

carlocab commented Feb 9, 2022

GHC does not work with LLVM 13. You need to brew install llvm@12 and then add /opt/homebrew/opt/llvm@12/bin to your PATH. (Not symlinked roughly means it is not added to your PATH to avoid conflicts with Apple-installed software. Emphasis on "roughly" -- it means slightly more than that.)

@adswa
Copy link
Member Author

adswa commented Feb 9, 2022

thanks much!

@mvdoc
Copy link
Contributor

mvdoc commented Jul 17, 2022

I just wanted to provide one more data point. Today I managed to install git-annex painlessly with homebrew, running

brew install --build-from-source git-annex

it took about 25 minutes, but then git-annex test passes without problems.

@carlocab
Copy link

Yes, we've had reports at Homebrew about users being able to build git-annex successfully from source. Unfortunately, it does not work in our CI for some reason.

@carlocab
Copy link

Just an FYI: the git-annex build for M1 macOS was fixed recently at Homebrew, so you can now do brew install git-annex. You may need to brew update if you've disabled auto-update and haven't done brew update in a while.

It seems the issue was a process leak in GHC 8.10. We were able to build git-annex successfully using GHC 9.2 (+ some patches).

@mslw
Copy link
Contributor

mslw commented Sep 30, 2022

This is great news, thanks for the update @carlocab !

I think we can close this issue now.

@mslw mslw closed this as completed Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform-osx Issue concerned with MacOSX
Projects
None yet
Development

No branches or pull requests

7 participants