nim-lang / nimble

Package manager for the Nim programming language.
Other
1.25k stars 188 forks source link

Installation on Mac M1 (ARM) fails #1252

Open Clonkk opened 1 month ago

Clonkk commented 1 month ago

Happens on OSX, on a Mac M1. Some kind of error around checksums not being found

nimble install nimble                                                                                                                                                      ✔ 17:41:56
Downloading https://github.com/nim-lang/nimble using git
   Warning: Package 'nimble' has an incorrect structure. It should contain a single directory hierarchy for source files, named 'nimble', but file 'forge_aliases.nim' is in a directory named 'nimblepkg' instead. This will be an error in the future.
      Hint: If 'nimblepkg' contains source files for building 'nimble', rename it to 'nimble'. Otherwise, prevent its installation by adding `skipDirs = @["nimblepkg"]` to the .nimble file.
  Warning:  No nimblemeta.json file found in /Users/regis.caillaud/.nimble/pkgs2/ddgrep-0.1.0-4f44eb545676a55550cfbb14d6d7a132ddf97ae9
  Verifying dependencies for nimble@0.16.0
     Info:  Dependency on sat@any version already satisfied
  Verifying dependencies for sat@0.1.0
     Info:  Dependency on checksums@any version already satisfied
  Verifying dependencies for checksums@0.1.0
 Installing nimble@0.16.0
   Building nimble/nimble using c backend
/opt/homebrew/Cellar/nim/2.0.8/nim/compiler/nimblecmd.nim(18, 39) Error: cannot open file: ../dist/checksums/src/checksums/sha1
Downloading https://github.com/nim-lang/nimble using git
  Verifying dependencies for nimble@0.16.0
     Info:  Dependency on sat@any version already satisfied
  Verifying dependencies for sat@0.1.0
     Info:  Dependency on checksums@any version already satisfied
  Verifying dependencies for checksums@0.1.0
 Installing nimble@0.16.0
   Building nimble/nimble using c backend
jmgomez commented 1 month ago

I couldnt repro it. Not sure if this may be a brew issue though. Can you try to repro it with the latest changes? Also could you also try to see what happens when you do nimble install nimble --solver:sat? (It uses a cache instead of a temp folder for downloads)

Clonkk commented 1 month ago

This is the result of the following command :

~ ❯ nimble install nimble --solver:sat                                                                                                                                                                          
Downloading https://github.com/nim-lang/nimble using git
   Warning: Package 'nimble' has an incorrect structure. It should contain a single directory hierarchy for source files, named 'nimble', but file 'forge_aliases.nim' is in a directory named 'nimblepkg' instead. This will be an error in the future.
      Hint: If 'nimblepkg' contains source files for building 'nimble', rename it to 'nimble'. Otherwise, prevent its installation by adding `skipDirs = @["nimblepkg"]` to the .nimble file.
  Warning:  No nimblemeta.json file found in /Users/regis.caillaud/.nimble/pkgs2/ddgrep-0.1.0-4f44eb545676a55550cfbb14d6d7a132ddf97ae9
     Info:  Dependency on sat@any version already satisfied
     Info:  Dependency on checksums@any version already satisfied
 Installing nimble@0.16.0
   Building nimble/nimble using c backend
/opt/homebrew/Cellar/nim/2.0.8/nim/compiler/nimblecmd.nim(18, 39) Error: cannot open file: ../dist/checksums/src/checksums/sha1
Downloading https://github.com/nim-lang/nimble using git
  Verifying dependencies for nimble@0.16.0
     Info:  Dependency on sat@any version already satisfied
  Verifying dependencies for sat@0.1.0
     Info:  Dependency on checksums@any version already satisfied
  Verifying dependencies for checksums@0.1.0
 Installing nimble@0.16.0
   Building nimble/nimble using c backend
/opt/homebrew/Cellar/nim/2.0.8/nim/compiler/nimblecmd.nim(18, 39) Error: cannot open file: ../dist/checksums/src/checksums/sha1
       Tip: 19 messages have been suppressed, use --verbose to show them.
nimble.nim(304)          buildFromDir

    Error:  Build failed for the package: nimble
~ ❯ which nim                                                                                                                                                                                               
/opt/homebrew/bin/nim
~ ❯ nim -v                                                                                                                                                                                                       
Nim Compiler Version 2.0.8 [MacOSX: arm64]
Compiled at 2024-07-03
Copyright (c) 2006-2023 by Andreas Rumpf

active boot switches: -d:release -d:nimUseLinenoise
~ ❯ which nimble                                                                                                                                                                                                 
/opt/homebrew/bin/nimble
~ ❯ nimble --version                                                                                                                                                                                             
nimble v0.14.2 compiled at 2024-07-03 00:48:51
git hash: couldn't determine git hash

If I do the same using a local installation, it works so it's probably something related to how brew install nim & nimble :

~/Workspace/local ❯ source ./env                                                                                                                                                                     
~/Workspace/local ❯ which nim                                                                                                                                                                            
/Users/regis.caillaud/Workspace/local/nim-devel/bin/nim
~/Workspace/local ❯ which nimble                                                                                                                                                                         
/Users/regis.caillaud/Workspace/local/nim-devel/bin/nimble
~/Workspace/local ❯ nimble --version                                                                                                                                                                     
nimble v0.14.2 compiled at 2024-07-09 14:01:22
git hash: 3b119f6fa135429a704f9c60f0b8944906398eea
~/Workspace/local ❯ nimble install nimble                                                                                                                                                               
Downloading https://github.com/nim-lang/nimble using git
  Warning:  No nimblemeta.json file found in /Users/regis.caillaud/.nimble/pkgs2/ddgrep-0.1.0-4f44eb545676a55550cfbb14d6d7a132ddf97ae9
  Verifying dependencies for nimble@0.16.0
     Info:  Dependency on sat@any version already satisfied
  Verifying dependencies for sat@0.1.0
     Info:  Dependency on checksums@any version already satisfied
  Verifying dependencies for checksums@0.1.0
 Installing nimble@0.16.0
   Building nimble/nimble using c backend
  Success:  nimble installed successfully.