Opened 4 months ago

Last modified 4 months ago

#69076 new defect

git-annex @10.20230321: error: Warning: Couldn't figure out LLVM version!

Reported by: Jaharmi (Jeremy Reichman) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: Cc:
Port: git-annex

Description (last modified by ryandesign (Ryan Carsten Schmidt))

Summary

Installing git-annex fails with what appears to be a GHC error.

Expected results

git-annex should install with "sudo port install git-annex" on macOS 14.2 with Xcode 15.1 and MacPorts 2.8.1 installed on Apple Silicon (M1 Max). This is the first port installed on the computer.

Actual results

git-annex does not install. The main.log indicates a problem with GHC. Multiple versions of GHC may have been installed: 9.6.3_0 and 8.10.7.

It looks like the error comes from ghc 8.10.7.

Attachments (4)

macports-2.8.1-port-git-annex-main-log-20240108.log (47.9 KB) - added by Jaharmi (Jeremy Reichman) 4 months ago.
main.log from installation attempt on 2024-01-08
macports-2.8.1-port-git-annex-main-log-portfile-fork-20240110.log (35.3 KB) - added by Jaharmi (Jeremy Reichman) 4 months ago.
Portfile (1.2 KB) - added by Jaharmi (Jeremy Reichman) 4 months ago.
Fork of git-annex Portfile, trying some different options, related to macports-2.8.1-port-git-annex-main-log-portfile-fork-20240110.log installation attempt
main.log (43.7 KB) - added by dirkz 4 months ago.
git annex build log (apple M2, macOS 14.2.1, xcode 15.1), only one ghc installed (9.6.3), triggered by sudo port install git-annex, which is _not_ used by the stack setup for git-annex

Download all attachments as: .zip

Change History (13)

Changed 4 months ago by Jaharmi (Jeremy Reichman)

main.log from installation attempt on 2024-01-08

comment:1 Changed 4 months ago by Jaharmi (Jeremy Reichman)

Cleaning the port with

sudo port clean git-annex 

followed by

sudo port install git-annex

did not resolve the issue.

I did not find this issue in the Problem Hotlist or in existing tickets.

comment:2 Changed 4 months ago by Jaharmi (Jeremy Reichman)

The error:

Warning: Couldn't figure out LLVM version!

appears related to GHC 8.10.7 vs 9.x, per GitHub issue #667.

comment:3 Changed 4 months ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Summary: git-annex port fails with GHC errorgit-annex @10.20230321: error: Warning: Couldn't figure out LLVM version!

It builds for me on macOS 12 x86_64, or at least it gets past the problem you saw; I canceled the build after 7 minutes because I didn't want to wait.

I see a new version of git-annex is available. Maybe updating the port would help, or hurt.

comment:4 Changed 4 months ago by Jaharmi (Jeremy Reichman)

I was trying MacPorts since most other sources seem to be x86_64 and I was hoping to get a native ARM version.

I'll try again.

comment:5 Changed 4 months ago by Jaharmi (Jeremy Reichman)

I've duplicated the git-annex Portfile and set it up locally to try with these options:

haskell_stack.system_ghc no

as well as:

use_xcode yes haskell_stack.system_ghc no

This hasn't worked / changed the error I've gotten.

I've also made sure that DEVELOPER_DIR was set to use Xcode rather than the Command Line Tools. Also doesn't work.

comment:6 Changed 4 months ago by Jaharmi (Jeremy Reichman)

I am still not clear how/where the older ghc is brought in and why it ends up being used. I guess it's some dependency somewhere. I don't know if that can be overridden or updated, since I don't know enough about MacPorts / Portfiles or ghc.

I'm also unclear why this Portfile ends up installing so much, including three major versions of Python, amongst other things. I mean, sure, it's dependencies and dependencies of dependencies, but this seems excessive.

Changed 4 months ago by Jaharmi (Jeremy Reichman)

Changed 4 months ago by Jaharmi (Jeremy Reichman)

Attachment: Portfile added

Fork of git-annex Portfile, trying some different options, related to macports-2.8.1-port-git-annex-main-log-portfile-fork-20240110.log installation attempt

Changed 4 months ago by dirkz

Attachment: main.log added

git annex build log (apple M2, macOS 14.2.1, xcode 15.1), only one ghc installed (9.6.3), triggered by sudo port install git-annex, which is _not_ used by the stack setup for git-annex

comment:7 Changed 4 months ago by dirkz

Building the current master of git-annex (5540f42e21afce6947d5410c5f18b178de6c336a) with stack uses ghc 9.6.3.

comment:8 Changed 4 months ago by dirkz

stack setup --system-ghc
stack build --system-ghc

This builds it (with the ghc provided by macports), but install (make install-home BUILDER=stack) will require further patching. stack run --system-ghc is successful, so the build looks correct.

Last edited 4 months ago by dirkz (previous) (diff)

comment:9 Changed 4 months ago by dirkz

With the following patch of the Makefile:

diff --git a/Makefile b/Makefile
index 06ebebdea3..26f60d1557 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@ all=git-annex git-annex-shell mans docs
 # set to "./Setup" if you lack a cabal program. Or can be set to "stack"
 BUILDER?=cabal
 ifeq ($(BUILDER),stack)
-GHC?=stack ghc --
+GHC?=stack ghc --system-ghc --
 else
 GHC?=ghc
 endif

It's possible to install to $HOME:

make install-home BUILDER=stack BUILDERCOMMONOPTIONS="--system-ghc"

I have not tested the other install options.

Note: See TracTickets for help on using tickets.