jsnjack / grm

An experimental package manager for GitHub Releases
16 stars 2 forks source link

ARM binary is broken for me #10

Closed patrick-5546 closed 5 months ago

patrick-5546 commented 5 months ago

Thanks for creating this tool, it is exactly what I was looking for!

I tried to install this on my m1 macbook pro, but the darwin_arm64 binary gives this error when trying to run it:

$ ./grm --version
zsh: exec form error: ./grm

or in bash

# ./grm --version
bash: ./grm: cannot execute binary file
jsnjack commented 5 months ago

Hi!

Weird, I don't have any macs myself, but I was told that it works! (checked today). Is there a chance you might have downloaded a binary for a different system / architecture? Or has it stopped working after update? :thinking:

patrick-5546 commented 5 months ago

I believe I downloaded the right binary, this is what I did:

$ curl -s https://api.github.com/repos/jsnjack/grm/releases/latest | jq -r '.assets[2].browser_download_url'                                 
https://github.com/jsnjack/grm/releases/download/v0.54.1/grm_darwin_arm64.tar.gz

$ curl -s https://api.github.com/repos/jsnjack/grm/releases/latest | jq -r '.assets[2].browser_download_url' | xargs curl -LOs && mv grm_darwin_arm64.tar.gz grm && chmod +x grm

$ ./grm version
zsh: exec format error: ./grm

I got the same error using the version where the arm build target was introduced: https://github.com/jsnjack/grm/releases/tag/v0.51.6. @Lilja was there anything else that you had to do to install grm on your m1 macbook pro?

I was able to build to build the arm target locally when I cloned the repository on my machine with make bin/grm_darwin_arm64, but get this error when running the tests

$ make test
cd cmd && go test
--- FAIL: TestInstall_filterSuitableAssets_empty_filter (0.00s)
    install_test.go:68: Unexpected amount of items in <output>: got 1 want 3
--- FAIL: TestInstall_filterSuitableAssets_extended_filter (0.00s)
    install_test.go:119: Expected hugo_extended_0.80.0_Linux-64bit.tar.gz to be in <output>
--- FAIL: TestInstall_filterSuitableAssets_extended_tar_filter (0.00s)
    install_test.go:165: Expected hugo_extended_0.80.0_Linux-64bit.tar.gz to be in <output>
--- FAIL: TestInstall_filterSuitableAssets_no_arm (0.00s)
    install_test.go:194: Expected go-mod-upgrade_0.9.0_Linux_x86_64.tar.gz to be in <output>
FAIL
exit status 1
FAIL    github.com/patrick-5546/grm/cmd 0.322s
make: *** [test] Error 1

The value of <output> on line 68 on my machine is [hugo_0.80.0_Linux-ARM64.tar.gz], not sure if this is relevant though

Any idea what might be happening?

Lilja commented 5 months ago

@patrick-5546 mv grm_darwin_arm64.tar.gz grm in the install instruction, is that a correct way to untar a tar archive?

I installed it locally just fine:

lilja in ~/D/grm-test λ wget https://github.com/jsnjack/grm/releases/download/v0.54.1/grm_darwin_arm64.tar.gz
...<omitted>
grm_darwin_arm64.tar.gz                                   100%[=====================================================================================================================================>]   7.68M  43.8MB/s    in 0.2s

2024-04-22 12:08:59 (43.8 MB/s) - ‘grm_darwin_arm64.tar.gz’ saved [8052413/8052413]

lilja in ~/D/grm-test λ ls -l
total 15728
-rw-r--r--@ 1 lilja  staff  8052413 Sep  5  2023 grm_darwin_arm64.tar.gz
lilja in ~/D/grm-test λ tar -xf grm_darwin_arm64.tar.gz
lilja in ~/D/grm-test λ ls -l
total 45392
-rwxr-xr-x@ 1 lilja  staff  15185234 Sep  5  2023 grm*
-rw-r--r--@ 1 lilja  staff   8052413 Sep  5  2023 grm_darwin_arm64.tar.gz
lilja in ~/D/grm-test λ ./grm version
0.54.1
lilja in ~/D/grm-test λ
patrick-5546 commented 5 months ago

Thanks that worked, I don't know what I was thinking. I originally tried the grm binary in releases, but now see that is for linux amd64