From 121b3b2a35ca9dc506d220595b60df65395751aa Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Tue, 23 May 2023 17:38:25 +0200 Subject: [PATCH 1/2] Revert "CI: Enable the verbose mode in the mkmf.rb." This reverts commit a832f5cb98ee952a3e7ceeddf59065b9c1f430b4. Because there is a simpler way to enable the verbose mode by setting the environment variable `MAKEFLAGS`. --- .github/workflows/test.yml | 9 --------- tool/enable-mkmf-verbose | 24 ------------------------ 2 files changed, 33 deletions(-) delete mode 100755 tool/enable-mkmf-verbose diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cb33a8d24..374447f87 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,11 +42,6 @@ jobs: - name: depends run: bundle install - # Enable the verbose option in mkmf.rb to print the compiling commands. - - name: enable mkmf verbose - run: tool/enable-mkmf-verbose - if: runner.os == 'Linux' || runner.os == 'macOS' - - name: compile run: rake compile -- --enable-debug @@ -134,10 +129,6 @@ jobs: - name: depends run: bundle install - - name: enable mkmf verbose - run: tool/enable-mkmf-verbose - if: runner.os == 'Linux' || runner.os == 'macOS' - - name: compile run: rake compile -- --enable-debug --with-openssl-dir=$HOME/.openssl/${{ matrix.openssl }} diff --git a/tool/enable-mkmf-verbose b/tool/enable-mkmf-verbose deleted file mode 100755 index be039077c..000000000 --- a/tool/enable-mkmf-verbose +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -set -eux - -gem_home="$(gem environment home)" -mkmf_rb_path="$(find "${gem_home}"/../.. -name mkmf.rb)" - -# Backup the original file. -cp -p "${mkmf_rb_path}" "${mkmf_rb_path}.orig" - -# Replace the target line to set the verbose option. -sed -i -e 's/^V = .*/V = 1/' "${mkmf_rb_path}" - -# Print the difference between the original and modified file. This is useful -# to debug when the `mkmf.rb` may change in the future. And check if the -#`mkmf.rb` was modified. Because the `sed` command returns the exit status 0 no -# matter it replaces successfully or not. -if diff "${mkmf_rb_path}.orig" "${mkmf_rb_path}"; then - echo "error: ${mkmf_rb_path} was not modified." 1>&2 - exit 1 -elif [ "${?}" != 1 ]; then - echo "error: diff was failed." 1>&2 - exit 1 -fi From 08e19817b5d0e10511fc0018a12e82b7d65d3c93 Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Tue, 23 May 2023 17:49:30 +0200 Subject: [PATCH 2/2] CI: Enable the verbose mode in the mkmf.rb by env MAKEFLAGS. Enable the verbose option (variable `V`) in the `Makefile` generated by `mkmf.rb` to print the compiling commands in the process of the `rake compile` by setting the environment variable `MAKEFLAGS`[1] reserved by `make`. Because it's helpful to see what compiler warnings are checked. It seems that this implementation to enable the verbose mode only works in Linux and macOS. Not Windows. [1] https://www.gnu.org/software/make/manual/html_node/Variables_002fRecursion.html --- .github/workflows/test.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 374447f87..becf99029 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,6 +42,11 @@ jobs: - name: depends run: bundle install + # Enable the verbose option in mkmf.rb to print the compiling commands. + - name: enable mkmf verbose + run: echo "MAKEFLAGS=V=1" >> $GITHUB_ENV + if: runner.os == 'Linux' || runner.os == 'macOS' + - name: compile run: rake compile -- --enable-debug @@ -129,6 +134,10 @@ jobs: - name: depends run: bundle install + - name: enable mkmf verbose + run: echo "MAKEFLAGS=V=1" >> $GITHUB_ENV + if: runner.os == 'Linux' || runner.os == 'macOS' + - name: compile run: rake compile -- --enable-debug --with-openssl-dir=$HOME/.openssl/${{ matrix.openssl }}