dustin / gopro

Tools for making the most out of GoPro Plus.
http://dustin.sallings.org/2020/04/29/gopro-plus.html
BSD 3-Clause "New" or "Revised" License
91 stars 12 forks source link

Installing on Mac M1 #15

Closed tymmej closed 3 months ago

tymmej commented 1 year ago

During stack install I get same issue as in https://gitlab.haskell.org/ghc/ghc/-/issues/20592

I see that it is fixed on newer GHC version so I pass --resolver ghc-9.2.4 (I also have tried nightly).

Then I get multiple errors about dependencies:

Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for aeson-2.0.3.0:
[...]
In the dependencies for x509-validation-1.6.12:
    asn1-encoding must match >=0.9 && <0.10, but the stack configuration has no specified version  (latest matching
                  version is 0.9.6)
    asn1-types must match >=0.3 && <0.4, but the stack configuration has no specified version  (latest matching version
               is 0.3.4)
    x509 must match >=1.7.5, but the stack configuration has no specified version  (latest matching version is 1.7.7)
needed due to gopro-0.1.0.0 -> x509-validation-1.6.12

Some different approaches to resolving this:

  * Recommended action: try adding the following to your extra-deps in /Users/xxx/code/gopro/stack.yaml:

- RSA-2.4.1@sha256:b52a764965cd10756646cc39eadcbc566e131181a75f2a13c621697f4b06d76b,2467
- ...

So I do as recommended.

Finally, I get following error:

gpmf > Building executable 'gpmf' for gpmf-0.1.1.1..
gpmf > [1 of 2] Compiling Main
gpmf >
gpmf > /private/var/folders/k7/s7p_419d4x91m_mbj6ggxtqw0000gn/T/stack-b3826990cd58aa9d/gpmf-0.1.1.1/app/Main.hs:14:24: error:
gpmf >     Not in scope: ‘BL.putStrLn’
gpmf >     Perhaps you meant one of these:
gpmf >       ‘BL.putStr’ (imported from Data.ByteString.Lazy),
gpmf >       ‘BS.putStr’ (imported from Data.ByteString)
gpmf >     Module ‘Data.ByteString.Lazy’ does not export ‘putStrLn’.
gpmf >    |
gpmf > 14 |   either print (mapM_ (BL.putStrLn . maybe "" showDEVC . uncurry mkDEVC)) . parseGPMF =<< BS.readFile fn
gpmf >    |                        ^^^^^^^^^^^
Progress 1/2

Is it possible to use this script on Mac OS with M1 processor? I installed it on x86_64 Linux without problem but I prefer Mac OS.

dustin commented 1 year ago

I mostly run it on an x86_64 linux, but I do all my development on an M1 mac, so it definitely works, but probably depends on where your tooling came from.

The gpmf lib thing is interesting. That's a function used in a demo app that's deprecated in stackage LTS (which is on 9.0.4) and I suppose has been removed. I'll fix that, but that's a different library.

I've been getting my toolchain from nix since before the M1 came out, so I'm not sure how else things come about. I've just tried forgetting nix in a shell and building with ghcup and the compiler doesn't work at all, so I'm guessing that's not what you're running into.

Can you describe how you got stack at least this functional?

tymmej commented 1 year ago

I tried brew install haskell-stack and curl -sSL https://get.haskellstack.org/ | sh (with brew version uninstalled) - both ended with same result.

I've read bug report again and found another workaround: https://gitlab.haskell.org/ghc/ghc/-/issues/20592#note_403426

I added extra-include-dirs to stack.yaml and now it works on LTS GHC 👍

dustin commented 1 year ago

Oh weird. I've not used homebrew in a while. I'm glad you made some progress and sorry the tooling is a bit complicated.

I see ghcup recommended quite often, but I've not been able to get that work. nix has been the easiest thing for me for a while now, but not everyone uses it.