forked from phusion/traveling-ruby
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from YOU54F/alpine
Alpine
- Loading branch information
Showing
45 changed files
with
1,492 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Alpine Musl - arm64 - build from dockerhub builder | ||
# Broken on GitHub Actions with QEMU | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ main, alpine ] | ||
# pull_request: | ||
# branches: [ main ] | ||
|
||
env: | ||
PKG_DATE: 20240215 | ||
|
||
jobs: | ||
make-alpine-arm64: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
ruby-version: [3.1.4, 3.2.3, 3.3.0] | ||
fail-fast: false | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: "Set up Ruby" | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby-version }} | ||
- name: package | ||
run: | | ||
docker run --privileged --rm tonistiigi/binfmt --install all | ||
cd alpine | ||
rake | ||
ls | ||
env: | ||
ARCHITECTURES: "arm64" | ||
RUBY_VERSIONS: ${{ matrix.ruby-version }} | ||
- name: package gems | ||
run: ./scripts/package-gems.sh | ||
env: | ||
PLATFORM: alpine | ||
- name: 'Upload Artifact - linux arm64' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: traveling-ruby-${{ env.PKG_DATE }}-${{ matrix.ruby-version }}-linux-musl-arm64.tar.gz | ||
path: alpine/traveling-ruby*.tar.gz | ||
- name: test | ||
run: | | ||
cd alpine | ||
rake test_docker | ||
env: | ||
ARCHITECTURES: "arm64" | ||
RUBY_VERSIONS: ${{ matrix.ruby-version }} |
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,49 @@ | ||
name: Alpine Musl - x86_64 - build from dockerhub builder | ||
|
||
on: | ||
push: | ||
branches: [ main, alpine ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
env: | ||
PKG_DATE: 20240215 | ||
|
||
jobs: | ||
make-alpine-x86_64: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
ruby-version: [3.1.4, 3.2.3, 3.3.0] | ||
fail-fast: false | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: "Set up Ruby" | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby-version }} | ||
- name: package | ||
run: | | ||
cd alpine | ||
rake | ||
ls | ||
env: | ||
ARCHITECTURES: "x86_64" | ||
RUBY_VERSIONS: ${{ matrix.ruby-version }} | ||
- name: package gems | ||
run: ./scripts/package-gems.sh | ||
env: | ||
PLATFORM: alpine | ||
- name: 'Upload Artifact - linux x86_64' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: traveling-ruby-${{ env.PKG_DATE }}-${{ matrix.ruby-version }}-linux-musl-x86_64.tar.gz | ||
path: alpine/traveling-ruby*.tar.gz | ||
- name: test | ||
run: | | ||
cd alpine | ||
rake test_docker | ||
env: | ||
ARCHITECTURES: "x86_64" | ||
RUBY_VERSIONS: ${{ matrix.ruby-version }} |
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 |
---|---|---|
|
@@ -7,7 +7,7 @@ on: | |
branches: [ main ] | ||
|
||
env: | ||
PKG_DATE: 20240205 | ||
PKG_DATE: 20240215 | ||
PLATFORM: osx | ||
ARCHITECTURES: arm64 | ||
DEVELOPER_DIR: /Applications/Xcode_14.3.1.app/Contents/Developer | ||
|
@@ -22,10 +22,6 @@ jobs: | |
fail-fast: false | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
# - name: Cancel Previous Runs | ||
# uses: styfle/[email protected] | ||
# with: | ||
# all_but_latest: true | ||
- uses: actions/checkout@v3 | ||
- name: download osx arm64 runtime | ||
run: ./scripts/download-osx-runtime.sh | ||
|
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 |
---|---|---|
|
@@ -7,7 +7,7 @@ on: | |
branches: [ main ] | ||
|
||
env: | ||
PKG_DATE: 20240205 | ||
PKG_DATE: 20240215 | ||
PLATFORM: osx | ||
ARCHITECTURES: x86_64 | ||
DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer | ||
|
@@ -22,10 +22,6 @@ jobs: | |
fail-fast: false | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
# - name: Cancel Previous Runs | ||
# uses: styfle/[email protected] | ||
# with: | ||
# all_but_latest: true | ||
- uses: actions/checkout@v3 | ||
- name: download osx x86_64 runtime | ||
run: ./scripts/download-osx-runtime.sh | ||
|
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 |
---|---|---|
|
@@ -15,10 +15,6 @@ jobs: | |
fail-fast: false | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
# - name: Cancel Previous Runs | ||
# uses: styfle/[email protected] | ||
# with: | ||
# all_but_latest: true | ||
- uses: actions/checkout@v3 | ||
- name: "Set up Ruby" | ||
uses: ruby/setup-ruby@v1 | ||
|
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 |
---|---|---|
|
@@ -8,7 +8,7 @@ on: | |
# branches: [ main ] | ||
|
||
env: | ||
PKG_DATE: 20240205 | ||
PKG_DATE: 20240215 | ||
|
||
jobs: | ||
make-ubuntu-arm64: | ||
|
@@ -19,10 +19,6 @@ jobs: | |
fail-fast: false | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
# - name: Cancel Previous Runs | ||
# uses: styfle/[email protected] | ||
# with: | ||
# all_but_latest: true | ||
- uses: actions/checkout@v3 | ||
- name: "Set up Ruby" | ||
uses: ruby/setup-ruby@v1 | ||
|
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 |
---|---|---|
|
@@ -15,10 +15,6 @@ jobs: | |
fail-fast: false | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
# - name: Cancel Previous Runs | ||
# uses: styfle/[email protected] | ||
# with: | ||
# all_but_latest: true | ||
- uses: actions/checkout@v3 | ||
- name: "Set up Ruby" | ||
uses: ruby/setup-ruby@v1 | ||
|
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 |
---|---|---|
|
@@ -7,7 +7,7 @@ on: | |
branches: [ main ] | ||
|
||
env: | ||
PKG_DATE: 20240205 | ||
PKG_DATE: 20240215 | ||
|
||
jobs: | ||
make-ubuntu-x86_64: | ||
|
@@ -18,10 +18,6 @@ jobs: | |
fail-fast: false | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
# - name: Cancel Previous Runs | ||
# uses: styfle/[email protected] | ||
# with: | ||
# all_but_latest: true | ||
- uses: actions/checkout@v3 | ||
- name: "Set up Ruby" | ||
uses: ruby/setup-ruby@v1 | ||
|
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 |
---|---|---|
|
@@ -6,7 +6,7 @@ on: | |
branches: [ main ] | ||
|
||
env: | ||
PKG_DATE: 20240205 | ||
PKG_DATE: 20240215 | ||
|
||
jobs: | ||
make-windows: | ||
|
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 @@ | ||
3.2.3 |
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 |
---|---|---|
@@ -1 +1 @@ | ||
20240205 | ||
20240215 |
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,3 @@ | ||
runtime | ||
output | ||
*.tar.gz |
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,42 @@ | ||
# Traveling Ruby Linux build system | ||
|
||
The `linux/` directory contains the build system for building Traveling Ruby binaries for Linux. | ||
|
||
## Building binaries | ||
|
||
The build system requires Docker and Rake. To build binaries, run: | ||
|
||
cd linux | ||
rake | ||
|
||
This will produce a `traveling-ruby-XXXXX.tar.gz` file which contains the Ruby binaries, and a `traveling-ruby-gems-XXXXX` directory which contains the native extensions. | ||
|
||
## How it works | ||
|
||
### Build environment (Docker image) | ||
|
||
The build system runs inside a Docker container. The Docker image is called [phusion/traveling-ruby-builder](https://registry.hub.docker.com/r/phusion/traveling-ruby-builder/), and it's built from the sources in `linux/image/`. | ||
|
||
The image contains a controlled build environment with a specific compiler toolchain and specific libraries, allowing us to compile binaries that can run on a large number of Linux systems. It's based on [Holy Build Box](http://FooBarWidget.github.io/holy-build-box/). | ||
|
||
The image can be built with `rake image`. | ||
|
||
### Build script | ||
|
||
The build script is the component that actually compiles Ruby. It assumes that the build environment is already available. | ||
|
||
The build script consists of two parts: | ||
|
||
1. `linux/build-ruby.sh` is the entrypoint for users. It spawns a Docker container, based on the build environment Docker image. Inside the container, it runs `linux/internal/build-ruby.sh`. | ||
|
||
2. `linux/internal/build-ruby.sh` is the script that contains most of the actual build logic. It: | ||
|
||
* Builds Ruby. It extracts the Ruby source tarball and runs `./configure`, `make` and `make install`. | ||
* Builds the native extensions that Traveling Ruby supports. It runs `bundle install` on the Gemfile located in the `shared/` directory in the Traveling Ruby repository. | ||
* Performs various postprocessing tasks, such as stripping debugging symbols from the binaries and running various sanity checks. | ||
|
||
You can kick off the build script with `rake build`. The build outputs are saved to the `output` directory. | ||
|
||
### Package script | ||
|
||
Once binaries are compiled, once can package the files by invoking `rake package`. This script packages files inside the `output` directory into various tarballs. |
Oops, something went wrong.