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

Figure out CI process for builds #8

Open
fergalwalsh opened this issue Jan 20, 2023 · 2 comments
Open

Figure out CI process for builds #8

fergalwalsh opened this issue Jan 20, 2023 · 2 comments
Labels
algohelp List issue on https://algohelp.awesomealgo.com/

Comments

@fergalwalsh
Copy link
Collaborator

fergalwalsh commented Jan 20, 2023

AlgoJig uses a binary compiled from Go package (gojig). This Go package depends on go-algorand. Because go-algorand has complicated dependencies itself it cannot be built like a normal Go package. This complicates the building of gojig and AlgoJig.

My workflow so far has been the following (on Mac OS 12.3 M1 Pro):
Initial setup:

New releases:

  • When go-algroand is updated I checkout a specific tag. eg. git checkout v3.13.2-stable
  • I usually don't do anything further in go-algorand
  • From the gojig directory: go mod tidy
  • From the gojig directory: go build -o ../algojig/algojig_arm64 .
  • Sometimes I get errors and have to manually modify main.go to update for breaking changes.
  • If there are significant changes to the go-algorand dependencies there may be further build steps required.

I repeat all these steps on a Intel Mac to produce the algojig_x86_64 binary.

Normally Go supports cross compiling for other architectures but unfortunately that doesn't seem to work in this case because of the dependencies of go-algorand.

Ideally I'd like to be able to automate production of Python wheel packages containing the arch specific binaries for Mac OS and Linux on common architectures.

Note: I use replace in go.mod with an absolute path because it was the only way I could find to make this work. Ideally there would be better way that allows others to build locally without manually changing that line. I don't know enough about Go packaging unfortunately.

Pinging @aorumbayev because he is interested in looking at this.
Also adding algohelp label for https://algohelp.awesomealgo.com/

@fergalwalsh fergalwalsh added the algohelp List issue on https://algohelp.awesomealgo.com/ label Jan 20, 2023
@aorumbayev
Copy link
Contributor

thanks for outlining manual steps ill see what i can do with initial ci setup for this

@aorumbayev
Copy link
Contributor

just dumping this here to avoid potential duplication from other potential contributors,
https://github.com/aorumbayev/algojig/blob/main/.github/workflows/build.yaml

basic ubuntu based build is done - polishing is needed, unfortunately busy this weekend but once i get a build matrix setup to have it compiled on other platforms ready - will have a pr with all details supplied.

Additional stages that i will add:

  1. other platforms (build matrix)
  2. dumping artifacts to a github release (need to evaluate good bots for releases)

Afterwards you won't have any need for storing them in git and instead - setup.py can be expanded to pull out the artifacts from gh releases based on version tags and have it packaged during pip install (that's out of scope for this issue i guess we can have separate issue for it after this is done)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
algohelp List issue on https://algohelp.awesomealgo.com/
Projects
None yet
Development

No branches or pull requests

2 participants