[ruby-core:117680] [Ruby master Bug#20451] Bad Ruby 3.1.5 backport causes fiddle to fail to build

Issue #20451 has been reported by Bo98 (Bo Anderson). ---------------------------------------- Bug #20451: Bad Ruby 3.1.5 backport causes fiddle to fail to build https://bugs.ruby-lang.org/issues/20451 * Author: Bo98 (Bo Anderson) * Status: Open * ruby -v: 3.1.5p252 * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- Ruby 3.1.5 shipped with the following backport: https://github.com/ruby/ruby/commit/84f2aabd272a54e79979795d2d405090704a1d07 However this backport directly breaks the build: ``` closure.c:279:60: error: use of undeclared identifier 'data' result = ffi_prep_closure(pcl, cif, callback, (void *)(data->self)); ^ ``` The original commit (https://github.com/ruby/fiddle/commit/2530496602) was updating the second branch to match the change in the first branch a couple lines up. However that change in the other branch does not exist in Ruby 3.1. The commit in question requires a previous commit of https://github.com/ruby/fiddle/commit/81a8a56239973ab7559229830a449d201955b4.... The backport should either be reverted or an other commit should also be backported. Note that these commits were in a series of many commits made to fix an upstream issue https://github.com/ruby/fiddle/issues/102 so I cannot vouch whether or not the two commits are sufficient to fix the originally reported issue. -- https://bugs.ruby-lang.org/

Issue #20451 has been updated by ylecuyer (Yoann Lecuyer). Additional information: From fiddle extconf: ``` ruby case when $mswin, $mingw, (libffi_version && (libffi_version <=> [3, 2]) >= 0) $defs << "-DUSE_FFI_CLOSURE_ALLOC=1" when (libffi_version && (libffi_version <=> [3, 2]) < 0) else have_func('ffi_closure_alloc', ffi_header) end ``` and closure.c ```c #if USE_FFI_CLOSURE_ALLOC result = ffi_prep_closure_loc(pcl, cif, callback, (void *)self, cl->code); #else result = ffi_prep_closure(pcl, cif, callback, (void *)(data->self)); cl->code = (void *)pcl; i = mprotect(pcl, sizeof(*pcl), PROT_READ | PROT_EXEC); if (i) { rb_sys_fail("mprotect"); } #endif ``` With libffi > 3.2 it compiles without any issue (I tried with 3.4.4) and with older version there is the error described (test with 3.1.0) ---------------------------------------- Bug #20451: Bad Ruby 3.1.5 backport causes fiddle to fail to build https://bugs.ruby-lang.org/issues/20451#change-108144 * Author: Bo98 (Bo Anderson) * Status: Open * ruby -v: 3.1.5p252 * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- Ruby 3.1.5 shipped with the following backport: https://github.com/ruby/ruby/commit/84f2aabd272a54e79979795d2d405090704a1d07 However this backport directly breaks the build: ``` closure.c:279:60: error: use of undeclared identifier 'data' result = ffi_prep_closure(pcl, cif, callback, (void *)(data->self)); ^ ``` The original commit (https://github.com/ruby/fiddle/commit/2530496602) was updating the second branch to match the change in the first branch a couple lines up. However that change in the other branch does not exist in Ruby 3.1. The commit in question requires a previous commit of https://github.com/ruby/fiddle/commit/81a8a56239973ab7559229830a449d201955b4.... The backport should either be reverted or an other commit should also be backported. Note that these commits were in a series of many commits made to fix an upstream issue https://github.com/ruby/fiddle/issues/102 so I cannot vouch whether or not the two commits are sufficient to fix the originally reported issue. -- https://bugs.ruby-lang.org/

Issue #20451 has been updated by ylecuyer (Yoann Lecuyer). I went ahead and created https://github.com/ruby/ruby/pull/10695 to revert the faulty backport @unak who you mind review it and release the patch version if accepted? I checked the repro https://github.com/ruby/fiddle/issues/102#issuecomment-1241763091 within fedora 36 and everything is ok. If people are still having an issue as described in https://github.com/ruby/fiddle/issues/102 they can bump to ruby 3.2 or 3.3 where it should be fixed ---------------------------------------- Bug #20451: Bad Ruby 3.1.5 backport causes fiddle to fail to build https://bugs.ruby-lang.org/issues/20451#change-108154 * Author: Bo98 (Bo Anderson) * Status: Open * ruby -v: 3.1.5p252 * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- Ruby 3.1.5 shipped with the following backport: https://github.com/ruby/ruby/commit/84f2aabd272a54e79979795d2d405090704a1d07 However this backport directly breaks the build: ``` closure.c:279:60: error: use of undeclared identifier 'data' result = ffi_prep_closure(pcl, cif, callback, (void *)(data->self)); ^ ``` The original commit (https://github.com/ruby/fiddle/commit/2530496602) was updating the second branch to match the change in the first branch a couple lines up. However that change in the other branch does not exist in Ruby 3.1. The commit in question requires a previous commit of https://github.com/ruby/fiddle/commit/81a8a56239973ab7559229830a449d201955b4.... The backport should either be reverted or an other commit should also be backported. Note that these commits were in a series of many commits made to fix an upstream issue https://github.com/ruby/fiddle/issues/102 so I cannot vouch whether or not the two commits are sufficient to fix the originally reported issue. -- https://bugs.ruby-lang.org/

Issue #20451 has been updated by nobu (Nobuyoshi Nakada). Backport changed from 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN to 3.0: UNKNOWN, 3.1: REQUIRED, 3.2: DONTNEED, 3.3: DONTNEED It seems a4ad6bd9aac564e93219284c912b26a72f9e82fc is missing. ---------------------------------------- Bug #20451: Bad Ruby 3.1.5 backport causes fiddle to fail to build https://bugs.ruby-lang.org/issues/20451#change-108155 * Author: Bo98 (Bo Anderson) * Status: Open * ruby -v: 3.1.5p252 * Backport: 3.0: UNKNOWN, 3.1: REQUIRED, 3.2: DONTNEED, 3.3: DONTNEED ---------------------------------------- Ruby 3.1.5 shipped with the following backport: https://github.com/ruby/ruby/commit/84f2aabd272a54e79979795d2d405090704a1d07 However this backport directly breaks the build: ``` closure.c:279:60: error: use of undeclared identifier 'data' result = ffi_prep_closure(pcl, cif, callback, (void *)(data->self)); ^ ``` The original commit (https://github.com/ruby/fiddle/commit/2530496602) was updating the second branch to match the change in the first branch a couple lines up. However that change in the other branch does not exist in Ruby 3.1. The commit in question requires a previous commit of https://github.com/ruby/fiddle/commit/81a8a56239973ab7559229830a449d201955b4.... The backport should either be reverted or an other commit should also be backported. Note that these commits were in a series of many commits made to fix an upstream issue https://github.com/ruby/fiddle/issues/102 so I cannot vouch whether or not the two commits are sufficient to fix the originally reported issue. -- https://bugs.ruby-lang.org/

Issue #20451 has been updated by ylecuyer (Yoann Lecuyer). File Dockerfile.ol8 added I tested both PR with ol8/ol9 using the attached dockerfile and they both work OK I'll close my PR in favor of yours as it is more complete regarding the backport. ---------------------------------------- Bug #20451: Bad Ruby 3.1.5 backport causes fiddle to fail to build https://bugs.ruby-lang.org/issues/20451#change-108156 * Author: Bo98 (Bo Anderson) * Status: Open * ruby -v: 3.1.5p252 * Backport: 3.0: UNKNOWN, 3.1: REQUIRED, 3.2: DONTNEED, 3.3: DONTNEED ---------------------------------------- Ruby 3.1.5 shipped with the following backport: https://github.com/ruby/ruby/commit/84f2aabd272a54e79979795d2d405090704a1d07 However this backport directly breaks the build: ``` closure.c:279:60: error: use of undeclared identifier 'data' result = ffi_prep_closure(pcl, cif, callback, (void *)(data->self)); ^ ``` The original commit (https://github.com/ruby/fiddle/commit/2530496602) was updating the second branch to match the change in the first branch a couple lines up. However that change in the other branch does not exist in Ruby 3.1. The commit in question requires a previous commit of https://github.com/ruby/fiddle/commit/81a8a56239973ab7559229830a449d201955b4.... The backport should either be reverted or an other commit should also be backported. Note that these commits were in a series of many commits made to fix an upstream issue https://github.com/ruby/fiddle/issues/102 so I cannot vouch whether or not the two commits are sufficient to fix the originally reported issue. ---Files-------------------------------- Dockerfile.ol8 (747 Bytes) -- https://bugs.ruby-lang.org/
participants (3)
-
Bo98 (Bo Anderson)
-
nobu (Nobuyoshi Nakada)
-
ylecuyer (Yoann Lecuyer)