Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contribution: Fail to compile Glance #20

Closed
bpisano opened this issue Jun 29, 2022 · 4 comments
Closed

Contribution: Fail to compile Glance #20

bpisano opened this issue Jun 29, 2022 · 4 comments

Comments

@bpisano
Copy link
Contributor

bpisano commented Jun 29, 2022

Hi everyone, I've been using Glance for a long time and I'm considering to contribute to this project since it is now open source ! I've tried to design a set of icons for the app to make it better match with the new Big Sur style of macOS. I wanted to try it in the app but I'm having trouble to compile it.

I've read the contribution section in the README, but I still fail to launch the app on my computer. I've installed go and I'm using Xcode 13.4.1. When compiling the Glance target, I'm facing this issue:

fatal error: lipo: can't open input file: htmlconverter-amd64.a (No such file or directory)
cp: htmlconverter-amd64.h: No such file or directory
Command PhaseScriptExecution failed with a nonzero exit code

This output comes from the QLPlugin script in its build phase:

cd ./HTMLConverter/
GOOS=darwin GOARCH=amd64 CGO_ENABLED=1 go build --buildmode=c-archive -ldflags "-s -w" -o ./htmlconverter-amd64.a
GOOS=darwin GOARCH=arm64 CGO_ENABLED=1 go build --buildmode=c-archive -ldflags "-s -w" -o ./htmlconverter-arm64.a
lipo -create -output htmlconverter.a htmlconverter-amd64.a htmlconverter-arm64.a
cp htmlconverter-amd64.h htmlconverter.h

This script fails to run even if go is installed and working on my Mac. Is there any step I've been missing to make it work ?

@chamburr
Copy link
Owner

Hello, could you let me know the output of the go build … commands?

@bpisano
Copy link
Contributor Author

bpisano commented Jun 30, 2022

It seems that the go command could not be found.

Capture d’écran 2022-06-30 à 09 01 12

But typing go version in the terminal is working fine.

Capture d’écran 2022-06-30 à 09 02 51

@chamburr
Copy link
Owner

You would want to either symlink go to /usr/local/bin/go, or change $PATH in Xcode, or replace go with an absolute path.

@bpisano
Copy link
Contributor Author

bpisano commented Jun 30, 2022

Thanks for your help. I installed Go using homebrew. On M1 Mac, you need to change the $PATH in Xcode so it can load the command. The script now looks like this:

export PATH="$PATH:/opt/homebrew/bin"

cd ./HTMLConverter/
GOOS=darwin GOARCH=amd64 CGO_ENABLED=1 go build --buildmode=c-archive -ldflags "-s -w" -o ./htmlconverter-amd64.a
GOOS=darwin GOARCH=arm64 CGO_ENABLED=1 go build --buildmode=c-archive -ldflags "-s -w" -o ./htmlconverter-arm64.a
lipo -create -output htmlconverter.a htmlconverter-amd64.a htmlconverter-arm64.a
cp htmlconverter-amd64.h htmlconverter.h

@bpisano bpisano closed this as completed Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants