-
Notifications
You must be signed in to change notification settings - Fork 123
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
Feat: Upgrade to Ruby 3.1.2 / Support ARM64 OSX/Linux #132
Changes from all commits
75afdff
03c08c3
b5fb0ad
4fd8c3a
240c3fe
fc16fd5
ff9c059
70f7153
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
/linux/runtime | ||
/linux/output | ||
/linux/traveling-ruby-gems* | ||
/osx/runtime | ||
/osx/output | ||
/osx/work | ||
/windows/cache | ||
/windows/output | ||
*.sublime-workspace | ||
*.tar.gz | ||
.DS_Store |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.17.3 | ||
2.3.17 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2.4.10 | ||
3.1.2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
20210206 | ||
20230504 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
IMAGE_VERSION = "1.0" | ||
VERSION = File.read("../VERSION.txt").strip | ||
RUBY_VERSIONS = File.read("../RUBY_VERSIONS.txt").strip.split(/\s+/) | ||
ARCHITECTURES = ["x86_64"] | ||
CONCURRENCY = `./internal/cpucount`.to_i | ||
ARCHITECTURES = ["x86_64",'arm64'] | ||
CONCURRENCY = `./internal/cpucount`.to_i + 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why +1? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure! I pulled that change in from this fork 75afdff#diff-fe8ec1b2975d083dd6bc6eaf2fca4dba61a6466d1991a1cbaf3c9dd27b841941L5 I imagine the internal cpu count, is going to be the max, so adding one doesn't make sense, will remove and retest |
||
|
||
task :default => :package | ||
|
||
|
@@ -41,7 +41,7 @@ ARCHITECTURES.each do |arch| | |
|
||
desc "Build the #{arch} Docker image" | ||
task "image:#{arch}" do | ||
sh "docker build --pull" \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why no --pull? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ahh I think that was from testing, I wasn't certain it was using the built image and not pulling the published versioned I had created with the same tag, I added that back in, in the I'll add it back in |
||
sh "docker build" \ | ||
" -t phusion/traveling-ruby-builder-#{arch}:#{IMAGE_VERSION}" \ | ||
" -f image/Dockerfile-#{arch} image" | ||
end | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM --platform=linux/arm64 phusion/holy-build-box:3.0 | ||
FooBarWidget marked this conversation as resolved.
Show resolved
Hide resolved
|
||
ADD . /tr_build | ||
RUN env ARCHITECTURE=arm64 /tr_build/install.sh |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
FROM phusion/holy-build-box-64:3.0 | ||
FROM --platform=linux/amd64 phusion/holy-build-box:3.0 | ||
ADD . /tr_build | ||
RUN env ARCHITECTURE=x86_64 /tr_build/install.sh |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ OUTPUT_DIR= | |
RUBY_VERSION=${RUBY_VERSIONS[0]} | ||
WORKDIR= | ||
OWNS_WORKDIR=true | ||
CONCURRENCY=4 | ||
CONCURRENCY=$(sysctl -n hw.ncpu) | ||
GEMFILE="$SELFDIR/../shared/gemfiles" | ||
SETUP_SOURCE=true | ||
COMPILE=true | ||
|
@@ -230,6 +230,11 @@ fi | |
|
||
header "Preparing Ruby source code..." | ||
|
||
# To many warnings, suppress them all (disable in case of troubleshooting) | ||
export CPPFLAGS="-w" | ||
export CXXFLAGS="-w" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This disables optimizations. You should add back at least -O or -O2. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shall try both an see what happens :) |
||
export CFLAGS="-w" | ||
|
||
export PATH="$RUNTIME_DIR/bin:$PATH" | ||
export LIBRARY_PATH="$RUNTIME_DIR/lib" | ||
export PKG_CONFIG_PATH="$RUNTIME_DIR/lib/pkgconfig:/usr/lib/pkgconfig" | ||
|
@@ -255,12 +260,13 @@ echo | |
|
||
if $SETUP_SOURCE; then | ||
header "Configuring..." | ||
# NOTE: the option --disable-install-doc is a conjunction of --disable-install-rdoc and --disable-install-capi | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to 3.2.2's But I agree that disable-install-rdoc and disable-install-capi can be removed. Just disable-install-doc is enough. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fab thanks |
||
# NOTE: the options --disable-install-doc and --disable-install-rdoc have been removed | ||
# to support the presence of document coders | ||
./configure \ | ||
--prefix "$TMPBUILDROOT" \ | ||
--disable-install-doc \ | ||
--disable-install-rdoc \ | ||
--disable-install-capi \ | ||
--with-out-ext=tk,sdbm,gdbm,dbm,dl,coverage \ | ||
--disable-install-capi \ | ||
--with-openssl-dir="$RUNTIME_DIR" | ||
echo | ||
fi | ||
|
@@ -325,9 +331,9 @@ if [[ "$GEMFILE" != "" ]]; then | |
|
||
# Install Bundler, either from cache or directly. | ||
if [[ -e "$RUNTIME_DIR/vendor/cache/bundler-$BUNDLER_VERSION.gem" ]]; then | ||
run "$TMPBUILDROOT/bin/gem" install "$RUNTIME_DIR/vendor/cache/bundler-$BUNDLER_VERSION.gem" --no-rdoc --no-ri | ||
run "$TMPBUILDROOT/bin/gem" install "$RUNTIME_DIR/vendor/cache/bundler-$BUNDLER_VERSION.gem" --no-document | ||
else | ||
run "$TMPBUILDROOT/bin/gem" install bundler -v $BUNDLER_VERSION --no-rdoc --no-ri | ||
run "$TMPBUILDROOT/bin/gem" install bundler -v $BUNDLER_VERSION --no-document | ||
run mkdir -p "$RUNTIME_DIR/vendor/cache" | ||
run cp "$TMPBUILDROOT"/lib/ruby/gems/$RUBY_COMPAT_VERSION/cache/bundler-$BUNDLER_VERSION.gem \ | ||
"$RUNTIME_DIR/vendor/cache/" | ||
|
@@ -344,10 +350,8 @@ if [[ "$GEMFILE" != "" ]]; then | |
run cp "$GEMFILE.lock" ./ | ||
fi | ||
run bundle config --local force_ruby_platform true | ||
# We set -j to 1 because of this bug: | ||
# https://github.com/bundler/bundler/issues/3660 | ||
# When it is solved, we can set -j to $CONCURRENCY. | ||
run "$TMPBUILDROOT/bin/bundle" install --system --retry 3 --jobs 1 | ||
run "$TMPBUILDROOT/bin/bundle" config set --local system true | ||
run "$TMPBUILDROOT/bin/bundle" install --retry 3 --jobs $CONCURRENCY | ||
run "$TMPBUILDROOT/bin/bundle" package | ||
|
||
# Cache gems. | ||
|
@@ -372,7 +376,7 @@ run rm -f bin/testrb # Only Ruby 2.1 has it | |
run rm -rf include | ||
run rm -rf share | ||
run rm -rf lib/{libruby-static.a,pkgconfig} | ||
run rm -rf lib/ruby/$RUBY_COMPAT_VERSION/rdoc/generator/ | ||
#run rm -rf lib/ruby/$RUBY_COMPAT_VERSION/rdoc/generator/ # don't remove the documentation generators | ||
run rm -f lib/ruby/gems/$RUBY_COMPAT_VERSION/cache/* | ||
run rm -f lib/ruby/gems/$RUBY_COMPAT_VERSION/extensions/$GEM_PLATFORM/$GEM_EXTENSION_API_VERSION/*/{gem_make.out,mkmf.log} | ||
run rm -rf lib/ruby/gems/$RUBY_COMPAT_VERSION/gems/*/{test,spec,*.md,*.rdoc} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- CMakeLists.txt.orig 2022-07-05 17:51:38.000000000 +0200 | ||
+++ CMakeLists.txt 2022-07-05 17:51:57.000000000 +0200 | ||
@@ -101,17 +101,6 @@ | ||
endif() | ||
endif() | ||
endif() | ||
-if(NOT CMake_TEST_EXTERNAL_CMAKE) | ||
- # include special compile flags for some compilers | ||
- include(CompileFlags.cmake) | ||
- | ||
- # check for available C++ features | ||
- include(${CMake_SOURCE_DIR}/Source/Checks/cm_cxx_features.cmake) | ||
- | ||
- if(NOT CMake_HAVE_CXX_UNIQUE_PTR) | ||
- message(FATAL_ERROR "The C++ compiler does not support C++11 (e.g. std::unique_ptr).") | ||
- endif() | ||
-endif() | ||
|
||
# Inform STL library header wrappers whether to use system versions. | ||
configure_file(${CMake_SOURCE_DIR}/Utilities/std/cmSTL.hxx.in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line can be removed.