-
Notifications
You must be signed in to change notification settings - Fork 40
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
test_dlopen_linker_script_input_linux is failed with ArchLinux #166
Comments
I manually update But
Should I update that test case for inconsistency case like ArchLinux? |
Oh, does this work? diff --git a/lib/fiddle.rb b/lib/fiddle.rb
index 6718b01..4723d70 100644
--- a/lib/fiddle.rb
+++ b/lib/fiddle.rb
@@ -111,7 +111,11 @@ module Fiddle
case line
when /\A\s*(?:INPUT|GROUP)\s*\(\s*([^\s,\)]+)/
# TODO: Should we support multiple files?
- return dlopen($1)
+ first_input = $1
+ if first_input.start_with?("-l")
+ first_input = "lib#{first_input[2..-1]}.so"
+ end
+ return dlopen(first_input)
end
end
end
diff --git a/test/fiddle/test_fiddle.rb b/test/fiddle/test_fiddle.rb
index d16c2a0..ee6c546 100644
--- a/test/fiddle/test_fiddle.rb
+++ b/test/fiddle/test_fiddle.rb
@@ -34,13 +34,22 @@ class TestFiddle < Fiddle::TestCase
omit("Fiddle::Handle#file_name doesn't exist in FFI backend")
end
- # libncurses.so uses INPUT() on Debian GNU/Linux
+ # libncurses.so uses INPUT() on Debian GNU/Linux and Arch Linux:
+ #
+ # Debian GNU/Linux:
+ #
# $ cat /usr/lib/x86_64-linux-gnu/libncurses.so
# INPUT(libncurses.so.6 -ltinfo)
+ #
+ # Arch Linux:
+ # $ cat /usr/lib/libncurses.so
+ # INPUT(-lncursesw)
handle = Fiddle.dlopen("libncurses.so")
begin
- assert_equal("libncurses.so",
- File.basename(handle.file_name, ".*"))
+ normalized_file_name = File.basename(handle.file_name, ".*")
+ # Arch Linux uses -lncursesw for libncurses.so
+ normalized_file_name = normalized_file_name.sub(/ncursesw/, "ncurses")
+ assert_equal("libncurses.so", normalized_file_name)
ensure
handle.close
end |
Thanks. I understood But test is still failing.
|
Ah, diff --git a/lib/fiddle.rb b/lib/fiddle.rb
index 6718b01..4723d70 100644
--- a/lib/fiddle.rb
+++ b/lib/fiddle.rb
@@ -111,7 +111,11 @@ module Fiddle
case line
when /\A\s*(?:INPUT|GROUP)\s*\(\s*([^\s,\)]+)/
# TODO: Should we support multiple files?
- return dlopen($1)
+ first_input = $1
+ if first_input.start_with?("-l")
+ first_input = "lib#{first_input[2..-1]}.so"
+ end
+ return dlopen(first_input)
end
end
end
diff --git a/test/fiddle/test_fiddle.rb b/test/fiddle/test_fiddle.rb
index d16c2a0..69d0c3d 100644
--- a/test/fiddle/test_fiddle.rb
+++ b/test/fiddle/test_fiddle.rb
@@ -34,13 +34,34 @@ class TestFiddle < Fiddle::TestCase
omit("Fiddle::Handle#file_name doesn't exist in FFI backend")
end
- # libncurses.so uses INPUT() on Debian GNU/Linux
+ # libncurses.so uses INPUT() on Debian GNU/Linux and Arch Linux:
+ #
+ # Debian GNU/Linux:
+ #
# $ cat /usr/lib/x86_64-linux-gnu/libncurses.so
# INPUT(libncurses.so.6 -ltinfo)
+ #
+ # Arch Linux:
+ # $ cat /usr/lib/libncurses.so
+ # INPUT(-lncursesw)
handle = Fiddle.dlopen("libncurses.so")
begin
- assert_equal("libncurses.so",
- File.basename(handle.file_name, ".*"))
+ # /usr/lib/x86_64-linux-gnu/libncurses.so.6 ->
+ # libncurses.so.6
+ normalized_file_name = File.basename(handle.file_name)
+ # libncurses.so.6 ->
+ # libncurses.so
+ #
+ # libncursesw.so ->
+ # libncursesw.so
+ normalized_file_name = normalized_file_name.sub(/\.so(\.\d+)+\z/, ".so")
+ # libncurses.so ->
+ # libncurses.so
+ #
+ # libncursesw.so ->
+ # libncurses.so
+ normalized_file_name = normalized_file_name.sub(/ncursesw/, "ncurses")
+ assert_equal("libncurses.so", normalized_file_name)
ensure
handle.close
end |
👍 The latest patch passed on ArchLinux of Ruby CI. Thanks. |
Thanks for confirming it. I'll push this. |
GitHub: fix ruby/fiddle#166 Arch Linux's libncurses.so uses this style. ruby/fiddle@77d3dc934f
The latest result fixed this. http://rubyci.s3.amazonaws.com/arch/ruby-master/log/20241211T060002Z.fail.html.gz Thank you. |
After merging ruby/ruby@b5ed7aa, Ruby CI is failed at ArchLinux.
http://rubyci.s3.amazonaws.com/arch/ruby-master/log/20241211T030006Z.fail.html.gz
I'm not sure why Arch Linux couldn't open
libncursesw.so
in that case.The text was updated successfully, but these errors were encountered: