Skip to content
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
2 changes: 1 addition & 1 deletion .github/actions/easy_compile/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28274,7 +28274,7 @@ function rubyBuilderURL(rubyVersion) {
let platform = os.platform();

if (platform == "linux") {
platform = "ubuntu-24.04"; // Not great but this is a quick workaround
platform = "ubuntu-22.04"; // Not great but this is a quick workaround
}

return `${rubyReleasesUrl}/ruby-${rubyVersion}/ruby-${rubyVersion}-${platform}-${os.arch()}.tar.gz`;
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/easy_compile/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function rubyBuilderURL(rubyVersion) {
let platform = os.platform();

if (platform == "linux") {
platform = "ubuntu-24.04"; // Not great but this is a quick workaround
platform = "ubuntu-22.04"; // Not great but this is a quick workaround
}

return `${rubyReleasesUrl}/ruby-${rubyVersion}/ruby-${rubyVersion}-${platform}-${os.arch()}.tar.gz`;
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/e2e-dummy-gem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
name: "Cross compile the gem on different ruby versions"
strategy:
matrix:
os: ["macos-latest", "ubuntu-latest", "windows-latest"]
os: ["macos-latest", "ubuntu-22.04", "windows-latest"]
runs-on: "${{ matrix.os }}"
steps:
- name: "Checkout code"
Expand All @@ -29,7 +29,7 @@ jobs:
needs: compile
strategy:
matrix:
os: ["macos-latest", "ubuntu-latest", "windows-latest"]
os: ["macos-latest", "ubuntu-22.04", "windows-latest"]
rubies: ["3.4.7", "3.1.7"]
type: ["cross", "native"]
runs-on: "${{ matrix.os }}"
Expand All @@ -54,7 +54,7 @@ jobs:
needs: test
strategy:
matrix:
os: ["macos-latest", "ubuntu-latest", "windows-latest"]
os: ["macos-latest", "ubuntu-22.04", "windows-latest"]
runs-on: "${{ matrix.os }}"
steps:
- name: "Checkout code"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/gem-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ jobs:
name: "Cross compile the gem on different ruby versions"
strategy:
matrix:
os: ["macos-latest", "ubuntu-latest", "windows-latest"]
os: ["macos-latest", "ubuntu-22.04", "windows-latest"]
runs-on: "${{ matrix.os }}"
steps:
- name: "Install gperf"
if: ${{ matrix.os == 'windows-latest' }}
run: choco install gperf
- name: "Install gperf"
if: ${{ matrix.os == 'ubuntu-latest' }}
if: ${{ matrix.os == 'ubuntu-22.04' }}
run: sudo apt-get -qy install gperf
- name: "Checkout code"
uses: "actions/checkout@v5"
Expand All @@ -43,7 +43,7 @@ jobs:
needs: compile
strategy:
matrix:
os: ["macos-latest", "ubuntu-latest", "windows-latest"]
os: ["macos-latest", "ubuntu-22.04", "windows-latest"]
rubies: ["3.4.7", "3.1.7"]
type: ["cross", "native"]
runs-on: "${{ matrix.os }}"
Expand All @@ -68,7 +68,7 @@ jobs:
needs: test
strategy:
matrix:
os: ["macos-latest", "ubuntu-latest", "windows-latest"]
os: ["macos-latest", "ubuntu-22.04", "windows-latest"]
runs-on: "${{ matrix.os }}"
steps:
- name: "Setup Ruby"
Expand Down
2 changes: 1 addition & 1 deletion lib/easy_compile/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def clobber
method_option "test-command", type: "string", required: false, desc: "The test command to run. Defaults to running `bundle exec rake test` and `bundle exec rake spec`."
def ci_template
# os = ["macos-latest", "macos-15-intel", "ubuntu-latest", "windows-latest"]
os = ["macos-latest", "ubuntu-latest"] # Just this for now because the CI takes too long otherwise.
os = ["macos-latest", "ubuntu-22.04"] # Just this for now because the CI takes too long otherwise.

ruby_requirements = compilation_task.gemspec.required_ruby_version
latest_supported_ruby_version = RubySeries.latest_version_for_requirements(ruby_requirements)
Expand Down
10 changes: 7 additions & 3 deletions lib/easy_compile/compilation_tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def define_task(path)
ext.cross_compile = true
end

disable_shared if darwin?
disable_shared unless Gem.win_platform?
ensure
self.binary_name = nil
end
Expand All @@ -106,9 +106,13 @@ def disable_shared
makefile_tasks.each do |task|
task.enhance do
makefile_content = File.read(task.name)
makefile_content.sub!(/(LIBRUBYARG_SHARED = )(?:-l\$\(RUBY_SO_NAME\))(.*)/, '\1\2')
makefile_content.match(/LIBRUBYARG_SHARED = (.*)/) do |match|
shared_flags = match[1].split(" ")
shared_flags.reject! { |flag| flag == "-l$(RUBY_SO_NAME)" }
makefile_content.gsub!(/(LIBRUBYARG_SHARED = ).*/, "\\1#{shared_flags.join(' ')}")

File.write(task.name, makefile_content)
File.write(task.name, makefile_content)
end
end
end
end
Expand Down
6 changes: 3 additions & 3 deletions test/fixtures/expected_github_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
name: "Cross compile the gem on different ruby versions"
strategy:
matrix:
os: ["macos-latest", "ubuntu-latest"]
os: ["macos-latest", "ubuntu-22.04"]
runs-on: "${{ matrix.os }}"
steps:
- name: "Checkout code"
Expand All @@ -34,7 +34,7 @@ jobs:
needs: compile
strategy:
matrix:
os: ["macos-latest", "ubuntu-latest"]
os: ["macos-latest", "ubuntu-22.04"]
rubies: ["3.4.7", "3.3.9", "3.2.9", "3.1.7"]
type: ["cross", "native"]
runs-on: "${{ matrix.os }}"
Expand All @@ -57,7 +57,7 @@ jobs:
needs: test
strategy:
matrix:
os: ["macos-latest", "ubuntu-latest"]
os: ["macos-latest", "ubuntu-22.04"]
runs-on: "${{ matrix.os }}"
steps:
- name: "Setup Ruby"
Expand Down
6 changes: 3 additions & 3 deletions test/fixtures/expected_github_workflow_test_and_workdir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
name: "Cross compile the gem on different ruby versions"
strategy:
matrix:
os: ["macos-latest", "ubuntu-latest"]
os: ["macos-latest", "ubuntu-22.04"]
runs-on: "${{ matrix.os }}"
steps:
- name: "Checkout code"
Expand All @@ -36,7 +36,7 @@ jobs:
needs: compile
strategy:
matrix:
os: ["macos-latest", "ubuntu-latest"]
os: ["macos-latest", "ubuntu-22.04"]
rubies: ["3.4.7", "3.3.9", "3.2.9", "3.1.7"]
type: ["cross", "native"]
runs-on: "${{ matrix.os }}"
Expand All @@ -62,7 +62,7 @@ jobs:
needs: test
strategy:
matrix:
os: ["macos-latest", "ubuntu-latest"]
os: ["macos-latest", "ubuntu-22.04"]
runs-on: "${{ matrix.os }}"
steps:
- name: "Setup Ruby"
Expand Down
6 changes: 3 additions & 3 deletions test/fixtures/expected_github_workflow_test_command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
name: "Cross compile the gem on different ruby versions"
strategy:
matrix:
os: ["macos-latest", "ubuntu-latest"]
os: ["macos-latest", "ubuntu-22.04"]
runs-on: "${{ matrix.os }}"
steps:
- name: "Checkout code"
Expand All @@ -34,7 +34,7 @@ jobs:
needs: compile
strategy:
matrix:
os: ["macos-latest", "ubuntu-latest"]
os: ["macos-latest", "ubuntu-22.04"]
rubies: ["3.4.7", "3.3.9", "3.2.9", "3.1.7"]
type: ["cross", "native"]
runs-on: "${{ matrix.os }}"
Expand All @@ -58,7 +58,7 @@ jobs:
needs: test
strategy:
matrix:
os: ["macos-latest", "ubuntu-latest"]
os: ["macos-latest", "ubuntu-22.04"]
runs-on: "${{ matrix.os }}"
steps:
- name: "Setup Ruby"
Expand Down
6 changes: 3 additions & 3 deletions test/fixtures/expected_github_workflow_working_dir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
name: "Cross compile the gem on different ruby versions"
strategy:
matrix:
os: ["macos-latest", "ubuntu-latest"]
os: ["macos-latest", "ubuntu-22.04"]
runs-on: "${{ matrix.os }}"
steps:
- name: "Checkout code"
Expand All @@ -36,7 +36,7 @@ jobs:
needs: compile
strategy:
matrix:
os: ["macos-latest", "ubuntu-latest"]
os: ["macos-latest", "ubuntu-22.04"]
rubies: ["3.4.7", "3.3.9", "3.2.9", "3.1.7"]
type: ["cross", "native"]
runs-on: "${{ matrix.os }}"
Expand All @@ -61,7 +61,7 @@ jobs:
needs: test
strategy:
matrix:
os: ["macos-latest", "ubuntu-latest"]
os: ["macos-latest", "ubuntu-22.04"]
runs-on: "${{ matrix.os }}"
steps:
- name: "Setup Ruby"
Expand Down