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

Add config to generate binaries for the build cmd line tool #30

Merged
merged 2 commits into from
Nov 16, 2024

Conversation

spwoodcock
Copy link
Contributor

Fixes #29

As discussed this adds binaries for the build command line, so the user should be able to download and run:
`tilepack -url-template https://some.tms.url.com/{z}/{x}/{y} -dsn 'mytiles.mbtiles'

We did not discuss the proposal to remove mattn/go-sqlite3 in favour of modernc.org/sqlite, so CGO is enabled during the build and SQLite is bundled.

Hopefully this builds and helps someone! 🤞

@iandees iandees merged commit fd9e5ed into tilezen:master Nov 16, 2024
@spwoodcock spwoodcock deleted the ci/build-binaries branch November 16, 2024 17:03
@spwoodcock
Copy link
Contributor Author

Hmm, I wonder why this triggered on merge?

Hopefully this works fine in tag creation though!

@iandees
Copy link
Member

iandees commented Nov 16, 2024

Looks like the build failed with something related to CGO: https://github.com/tilezen/go-tilepacks/actions/runs/11872649486/job/33086593280

@spwoodcock
Copy link
Contributor Author

Ah right! Related to the Linux build 😅

Easy fix would be to remove this one, as it's very much a nice to have (the others should work fine).

But first I'll attempt a fix on my fork to see if it's a quick one. Will update with a PR 👍

@iandees
Copy link
Member

iandees commented Nov 17, 2024

There's a fairly good description of what's needed here, I think: https://www.bytebase.com/blog/how-to-cross-compile-with-cgo-use-goreleaser-and-github-action/

It's quite complicated, though! Let me know what you figure out.

@spwoodcock
Copy link
Contributor Author

spwoodcock commented Nov 17, 2024

I have used this config in a few projects and everything works fine, except the new addition of the Android build here.

It allows running the binary in apps like Termux on Android, which is hardly essential.

Option 1:

  • Keep the CGO config but remove android as a target.

Option 2:

  • Replace usage of CGO sqlite with modernc.org/sqlite alternative, then disable CGO.
  • This would allow building for Android too.

I think Option 1 is the way go, unless replacing C sqlite is an acceptable change.

edit: typo 🤦‍♂️ Linux --> Android

@iandees
Copy link
Member

iandees commented Nov 19, 2024

I think it's useful to keep Linux as a target (I've used this plenty of times on a Linux arm64 machine in EC2), but I agree that we don't need to specifically target Android.

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

Successfully merging this pull request may close these issues.

Interest in providing pre-built binaries
2 participants