diff --git a/.github/actions/easy_compile/dist/index.js b/.github/actions/easy_compile/dist/index.js index 0e41c36..35142d6 100644 --- a/.github/actions/easy_compile/dist/index.js +++ b/.github/actions/easy_compile/dist/index.js @@ -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`; diff --git a/.github/actions/easy_compile/src/index.js b/.github/actions/easy_compile/src/index.js index 7c9b265..9cc645e 100644 --- a/.github/actions/easy_compile/src/index.js +++ b/.github/actions/easy_compile/src/index.js @@ -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`; diff --git a/.github/workflows/e2e-dummy-gem.yml b/.github/workflows/e2e-dummy-gem.yml index f5c961e..869dcf2 100644 --- a/.github/workflows/e2e-dummy-gem.yml +++ b/.github/workflows/e2e-dummy-gem.yml @@ -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" @@ -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 }}" @@ -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" diff --git a/.github/workflows/gem-compile.yml b/.github/workflows/gem-compile.yml index 3da21bf..25880f3 100644 --- a/.github/workflows/gem-compile.yml +++ b/.github/workflows/gem-compile.yml @@ -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" @@ -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 }}" @@ -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" diff --git a/lib/easy_compile/cli.rb b/lib/easy_compile/cli.rb index 1301cf9..eeb7af4 100644 --- a/lib/easy_compile/cli.rb +++ b/lib/easy_compile/cli.rb @@ -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) diff --git a/lib/easy_compile/compilation_tasks.rb b/lib/easy_compile/compilation_tasks.rb index 38f916a..8091a82 100644 --- a/lib/easy_compile/compilation_tasks.rb +++ b/lib/easy_compile/compilation_tasks.rb @@ -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 @@ -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 diff --git a/test/fixtures/expected_github_workflow.yml b/test/fixtures/expected_github_workflow.yml index 3202106..ea89f85 100644 --- a/test/fixtures/expected_github_workflow.yml +++ b/test/fixtures/expected_github_workflow.yml @@ -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" @@ -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 }}" @@ -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" diff --git a/test/fixtures/expected_github_workflow_test_and_workdir.yml b/test/fixtures/expected_github_workflow_test_and_workdir.yml index 6cbf398..d0456e5 100644 --- a/test/fixtures/expected_github_workflow_test_and_workdir.yml +++ b/test/fixtures/expected_github_workflow_test_and_workdir.yml @@ -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" @@ -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 }}" @@ -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" diff --git a/test/fixtures/expected_github_workflow_test_command.yml b/test/fixtures/expected_github_workflow_test_command.yml index 6d9346c..ecf5e40 100644 --- a/test/fixtures/expected_github_workflow_test_command.yml +++ b/test/fixtures/expected_github_workflow_test_command.yml @@ -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" @@ -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 }}" @@ -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" diff --git a/test/fixtures/expected_github_workflow_working_dir.yml b/test/fixtures/expected_github_workflow_working_dir.yml index 10d438a..b21dfb1 100644 --- a/test/fixtures/expected_github_workflow_working_dir.yml +++ b/test/fixtures/expected_github_workflow_working_dir.yml @@ -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" @@ -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 }}" @@ -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"