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

feat: support Ruby 3.4.1 #228

Merged
merged 4 commits into from
Jan 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/alpine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:
env:
- { CC: gcc, CXX: g++, ALPINE_VER: "3.17" }
- { CC: clang, CXX: clang++, ALPINE_VER: "3.17" }
package_ruby_ver: [ '3.1.6', '3.2.6', '3.3.6' ]
package_ruby_ver: [ '3.1.6', '3.2.6', '3.3.6', '3.4.1' ]
env: ${{ matrix.env }}
steps:
- name: Install packages
Expand Down Expand Up @@ -178,7 +178,7 @@ jobs:
env:
- { CC: gcc, CXX: g++, ALPINE_VER: "3.17" }
- { CC: clang, CXX: clang++, ALPINE_VER: "3.17" }
package_ruby_ver: [ '3.1.6', '3.2.6', '3.3.6' ]
package_ruby_ver: [ '3.1.6', '3.2.6', '3.3.6', '3.4.1' ]
env: ${{ matrix.env }}
steps:
- name: Install packages
Expand Down Expand Up @@ -234,7 +234,7 @@ jobs:
env:
- { CC: gcc, CXX: g++, ALPINE_VER: "3.17" }
- { CC: clang, CXX: clang++, ALPINE_VER: "3.17" }
package_ruby_ver: [ '3.1.6', '3.2.6', '3.3.6']
package_ruby_ver: [ '3.1.6', '3.2.6', '3.3.6', '3.4.1']
env: ${{ matrix.env }}
steps:
- name: Install packages
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:
- { os: macos-14, xcode: 15.4 }
- { os: macos-15, xcode: 16.1 }

package_ruby_ver: [ '3.1.6', '3.2.6', '3.3.6' ]
package_ruby_ver: [ '3.1.6', '3.2.6', '3.3.6', '3.4.1' ]
ruby_ver: ['3.2.6']
steps:
- name: Checkout tebako packaging environment
Expand Down Expand Up @@ -167,7 +167,7 @@ jobs:
- { os: macos-14, xcode: 15.4 }
- { os: macos-15, xcode: 16.1 }

package_ruby_ver: [ '3.3.6' ]
package_ruby_ver: [ '3.3.6', '3.4.1' ]
ruby_ver: ['3.2.6']
steps:
- name: Checkout tebako packaging environment
Expand Down Expand Up @@ -218,7 +218,7 @@ jobs:
- { os: macos-14, xcode: 15.0.1, LG_VADDR: 39}
- { os: macos-14, xcode: 15.4 }
- { os: macos-15, xcode: 16.1 }
package_ruby_ver: [ '3.1.6', '3.2.6', '3.3.6' ]
package_ruby_ver: [ '3.1.6', '3.2.6', '3.3.6', '3.4.1' ]
ruby_ver: ['3.2.6']
steps:
- name: Checkout tebako packaging environment
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:
strategy:
fail-fast: false
matrix:
package_ruby_ver: [ '2.7.8', '3.0.7', '3.1.6', '3.2.4', '3.2.5', '3.2.6', '3.3.3', '3.3.4', '3.3.5', '3.3.6' ]
package_ruby_ver: [ '2.7.8', '3.0.7', '3.1.6', '3.2.4', '3.2.5', '3.2.6', '3.3.3', '3.3.4', '3.3.5', '3.3.6', '3.4.1' ]
env:
- { os: ubuntu-20.04, CC: gcc-10, CXX: g++-10 }
- { os: ubuntu-20.04, CC: clang-12, CXX: clang++-12 }
Expand Down Expand Up @@ -162,7 +162,7 @@ jobs:
strategy:
fail-fast: false
matrix:
package_ruby_ver: [ '2.7.8', '3.0.7', '3.1.6', '3.2.4', '3.2.5', '3.2.6', '3.3.3', '3.3.4', '3.3.5', '3.3.6' ]
package_ruby_ver: [ '2.7.8', '3.0.7', '3.1.6', '3.2.4', '3.2.5', '3.2.6', '3.3.3', '3.3.4', '3.3.5', '3.3.6', '3.4.1' ]
env:
- { os: ubuntu-20.04, CC: gcc-10, CXX: g++-10 }
- { os: ubuntu-20.04, CC: clang-12, CXX: clang++-12 }
Expand Down Expand Up @@ -211,7 +211,7 @@ jobs:
strategy:
fail-fast: false
matrix:
package_ruby_ver: [ '2.7.8', '3.0.7', '3.1.6', '3.2.4', '3.2.5', '3.2.6', '3.3.3', '3.3.4', '3.3.5', '3.3.6' ]
package_ruby_ver: [ '2.7.8', '3.0.7', '3.1.6', '3.2.4', '3.2.5', '3.2.6', '3.3.3', '3.3.4', '3.3.5', '3.3.6', '3.4.1' ]
env:
- { os: ubuntu-20.04, CC: gcc-10, CXX: g++-10 }
- { os: ubuntu-20.04, CC: clang-12, CXX: clang++-12 }
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows-msys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ jobs:
- sys: ucrt64
CC: gcc
CXX: g++
package_ruby_ver: [ '3.1.6', '3.2.6', '3.3.6' ]
package_ruby_ver: [ '3.1.6', '3.2.6', '3.3.6', '3.4.1' ]
script: ['bundle', 'app']
env: ${{ matrix.env }}

Expand Down Expand Up @@ -232,7 +232,7 @@ jobs:
- sys: ucrt64
CC: gcc
CXX: g++
package_ruby_ver: [ '3.1.6', '3.2.6', '3.3.6' ]
package_ruby_ver: [ '3.1.6', '3.2.6', '3.3.6', '3.4.1' ]
env: ${{ matrix.env }}

defaults:
Expand Down
1 change: 1 addition & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ higher.
| 3.1.6 | Linux, macOS, Windows
| 3.2.{4,5,6} | Linux, macOS, Windows
| 3.3.{3,4,5,6} | Linux, macOS, Windows
| 3.4.1 | Linux, macOS, Windows

|===

Expand Down
51 changes: 51 additions & 0 deletions include/tebako/tebako-prism.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#include <fcntl.h>

static pm_string_init_result_t
tebako_string_file_init(pm_string_t *string, const char *filepath) {

// Open the file for reading
int fd = open(filepath, O_RDONLY);
if (fd == -1) {
return PM_STRING_INIT_ERROR_GENERIC;
}

// Stat the file to get the file size
struct stat sb;
if (fstat(fd, &sb) == -1) {
close(fd);
return PM_STRING_INIT_ERROR_GENERIC;
}

// Ensure it is a file and not a directory
if (S_ISDIR(sb.st_mode)) {
close(fd);
return PM_STRING_INIT_ERROR_DIRECTORY;
}

// Check the size to see if it's empty
size_t size = (size_t) sb.st_size;
if (size == 0) {
close(fd);
const uint8_t source[] = "";
*string = (pm_string_t) { .type = PM_STRING_CONSTANT, .source = source, .length = 0 };
return PM_STRING_INIT_SUCCESS;
}

size_t length = (size_t) size;
uint8_t *source = xmalloc(length);
if (source == NULL) {
close(fd);
return PM_STRING_INIT_ERROR_GENERIC;
}

long bytes_read = (long) read(fd, source, length);
close(fd);

if (bytes_read == -1) {
xfree(source);
return PM_STRING_INIT_ERROR_GENERIC;
}

*string = (pm_string_t) { .type = PM_STRING_OWNED, .source = source, .length = length };
return PM_STRING_INIT_SUCCESS;
}
11 changes: 6 additions & 5 deletions lib/tebako/packager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
require_relative "deploy_helper"
require_relative "ruby_builder"
require_relative "stripper"
require_relative "packager/pass1"
require_relative "packager/pass1a"
require_relative "packager/pass1_patch"
require_relative "packager/pass1a_patch"
require_relative "packager/pass2"
require_relative "packager/patch_helpers"

Expand Down Expand Up @@ -119,7 +119,8 @@ def pass1(ostype, ruby_source_dir, mount_point, src_dir, ruby_ver)
puts "-- Running pass1 script"

PatchHelpers.recreate(src_dir)
do_patch(Pass1.get_patch_map(ostype, mount_point, ruby_ver), ruby_source_dir)
patch = crt_pass1_patch(ostype, mount_point, ruby_ver)
do_patch(patch.patch_map, ruby_source_dir)

# Roll back pass1a, pass2 patches
# Just in case we are recovering after some error
Expand All @@ -132,8 +133,8 @@ def pass1(ostype, ruby_source_dir, mount_point, src_dir, ruby_ver)
# Patch gem_prelude.rb
def pass1a(ruby_source_dir)
puts "-- Running pass1a script"

do_patch(Pass1A.get_patch_map, ruby_source_dir)
patch = Pass1APatch.new.patch_map
do_patch(patch, ruby_source_dir)
end

# Pass2
Expand Down
Loading
Loading