yonaskolb / Mint

A package manager that installs and runs executable Swift packages

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build failed on M1

rgigger opened this issue · comments

rick@Rick-M1 personal % git clone https://github.com/yonaskolb/Mint.git
Cloning into 'Mint'...
remote: Enumerating objects: 36, done.
remote: Counting objects: 100% (36/36), done.
remote: Compressing objects: 100% (28/28), done.
remote: Total 1952 (delta 10), reused 17 (delta 6), pack-reused 1916
Receiving objects: 100% (1952/1952), 357.89 KiB | 1.93 MiB/s, done.
Resolving deltas: 100% (1113/1113), done.

rick@Rick-M1 personal % cd Mint 

rick@Rick-M1 Mint % swift run mint install yonaskolb/mint
Fetching https://github.com/kylef/PathKit.git
Fetching https://github.com/mxcl/Version.git
Fetching https://github.com/jakeheis/SwiftCLI.git
Fetching https://github.com/onevcat/Rainbow.git
Fetching https://github.com/kylef/Spectre.git
Cloning https://github.com/onevcat/Rainbow.git
Resolving https://github.com/onevcat/Rainbow.git at 3.1.5
Cloning https://github.com/mxcl/Version.git
Resolving https://github.com/mxcl/Version.git at 1.1.2
Cloning https://github.com/jakeheis/SwiftCLI.git
Resolving https://github.com/jakeheis/SwiftCLI.git at 6.0.1
Cloning https://github.com/kylef/PathKit.git
Resolving https://github.com/kylef/PathKit.git at 1.0.0
Cloning https://github.com/kylef/Spectre.git
Resolving https://github.com/kylef/Spectre.git at 0.9.0
[70/70] Linking mint
🌱 Finding latest version of mint
🌱 Cloning mint 0.16.0
🌱 Resolving package
🌱 Building package
Error: You don’t have permission to save the file “0.16.0” in the folder “build”.

Also got a failure using make

rick@Rick-M1 personal % git clone https://github.com/yonaskolb/Mint.git 
Cloning into 'Mint'...
remote: Enumerating objects: 36, done.
remote: Counting objects: 100% (36/36), done.
remote: Compressing objects: 100% (28/28), done.
remote: Total 1952 (delta 10), reused 17 (delta 6), pack-reused 1916
Receiving objects: 100% (1952/1952), 357.89 KiB | 1.83 MiB/s, done.
Resolving deltas: 100% (1113/1113), done.

rick@Rick-M1 personal % cd Mint 

rick@Rick-M1 Mint % make
swift build --disable-sandbox -c release --arch arm64 --arch x86_64
Fetching https://github.com/mxcl/Version.git
Fetching https://github.com/kylef/Spectre.git
Fetching https://github.com/kylef/PathKit.git
Fetching https://github.com/onevcat/Rainbow.git
Fetching https://github.com/jakeheis/SwiftCLI.git
Cloning https://github.com/kylef/PathKit.git
Resolving https://github.com/kylef/PathKit.git at 1.0.0
Cloning https://github.com/onevcat/Rainbow.git
Resolving https://github.com/onevcat/Rainbow.git at 3.1.5
Cloning https://github.com/mxcl/Version.git
Resolving https://github.com/mxcl/Version.git at 1.1.2
Cloning https://github.com/jakeheis/SwiftCLI.git
Resolving https://github.com/jakeheis/SwiftCLI.git at 6.0.1
Cloning https://github.com/kylef/Spectre.git
Resolving https://github.com/kylef/Spectre.git at 0.9.0
0%: CreateBuildDirectory /Users/rick/code/personal/Mint/.build/apple/Intermediates.noindex
0%: CreateBuildDirectory /Users/rick/code/personal/Mint/.build/apple/Products
0%: Write Version.modulemap
0%: Write Version.o.SwiftFileList (arm64)
0%: Write Version.o.LinkFileList (x86_64)
0%: Write Version.o.LinkFileList (arm64)
0%: Write Version-OutputFileMap.json (arm64)

....


78%: Copy Mint.swiftsourceinfo (arm64)
98%: Create universal binary mint
98%: Generate mint.dSYM
98%: Register execution policy exception for mint
100%: Build succeeded
mkdir -p /usr/local/bin
cp -f .build/apple/Products/Release/mint /usr/local/bin/mint
cp: /usr/local/bin/mint: Permission denied
make: *** [install] Error 1

This is easily remedied by a simple permissions change on /usr/local/bin but it might be good to acknowledge that this might be required.

I got it installed with make after giving my user permission to write to /usr/local/bin but it still can't build anything:

rick@Rick-M1 ~ % mint install realm/SwiftLint 
🌱 Finding latest version of SwiftLint
🌱 Cloning SwiftLint 0.42.0
🌱 Resolving package
🌱 Building package
Error: You don’t have permission to save the file “0.42.0” in the folder “build”.

I'm sure it's just a permissions issue with the build folder but I have no idea what folder it's even talking about or where mint stores any of it's files.

ok, had I read the instructions closer I would have realized that the default MINT_PATH was /usr/local/lib/mint. For whatever reason /usr/local/lib was not present on my system and /usr/local is not writable by default to my user. Creating /usr/local/lib/mint manually make making it writing to me solved this problem.

If the error message had said where the "build" folder was it would have been easier to track down what was going on.