-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The previous release generated Windows binaries that were broken (GH-53) and Linux binaries that were unintentionally dynamic (GH-48). This commit provides an updated Makefile and GitHub workflow which provides multiple build options for both dynamic and static linking, but defaults to the previous dynamically linked behavior. The GitHub Workflow jobs based on the Makefile build tasks use a 20 minute timeout vs the 10 minute timeout used previously. The Makefile build options now explicitly enable the `CGO_ENABLED` environment variable so that all builds have the required cgo functionality enabled. A `docker` Makefile recipe is provided to generate binaries using new Docker images from the `atc0005/go-ci` project based on the official Golang Alpine Linux image. The result is statically linked binaries based on the musl C library instead of glibc. The intent is to help prevent licensing issues surround the GNU C library's LGPL licensing (which I do not fully understand). Multiple build tags are specified for static builds which enable Go-specific replacements for common glibc-provided features: - `osusergo` - `netgo` and a build tag specific to disabling SQLite extensions, which we do not use with this specific project: - `sqlite_omit_load_extension` Minor documentation updates have been included which update the build requirements and specific steps for building binaries for this project. Further updates are likely needed to add polish. A Docker Compose file has been included for kicking off multiple static binary builds in parallel, but it may end up getting tossed in a later PR if we don't make sufficient use of it. - refs GH-48 - refs golang/go 38789 - refs golang/go 26492 - refs atc0005/go-ci#85
- Loading branch information
Showing
6 changed files
with
324 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
# Copyright 2020 Adam Chalkley | ||
# | ||
# https://github.com/atc0005/mysql2sqlite | ||
# | ||
# Licensed under the MIT License. See LICENSE file in the project root for | ||
# full license information. | ||
|
||
# Purpose: Batch build static binaries from this project's source code. | ||
|
||
# Usage: | ||
# | ||
# Copy this file to the root of the repo and run it via `docker-compose up`. | ||
# This will kick off two parallel builds and thoroughly thrash the build | ||
# system. The upside is that this *may* better utilize multiple cores vs | ||
# spinning up one container at a time. | ||
|
||
version: "2" | ||
|
||
services: | ||
mysql2sqlite-x86: | ||
image: atc0005/go-ci:go-ci-stable-alpine-buildx86 | ||
volumes: | ||
- "./:/src" | ||
working_dir: "/src" | ||
entrypoint: ["make", "windows-x86-static", "linux-x86-static"] | ||
|
||
mysql2sqlite-x64: | ||
image: atc0005/go-ci:go-ci-stable-alpine-buildx64 | ||
volumes: | ||
- "./:/src" | ||
working_dir: "/src" | ||
entrypoint: ["make", "windows-x64-static", "linux-x64-static"] |
Oops, something went wrong.