Source: ruby-dbf
Version: 4.3.2-1
Severity: serious
Justification: FTBFS
Tags: ftbfs patch
User: debian-r...@lists.debian.org
Usertags: ruby3.3

I've been testing a patch to fix this bug so that CI tests can run
successfully again and make it reproducible again. The patch is quite
simple and just adds "Encoding.default_external = "UTF-8"" to set a
unicode that was set in "failure/Error:
expect(record.name.encode('UTF-8').unpack1('H4')).to eq 'd0b0'".

RUBYLIB=. 
GEM_PATH=/build/reproducible-path/ruby-dbf-4.3.2/debian/ruby-dbf/usr/share/rubygems-integration/all:/build/reproducible-path/ruby-dbf-4.3.2/debian/.debhelper/generated/_source/home/.local/share/gem/ruby/3.3.0:/var/lib/gems/3.3.0:/usr/local/lib/ruby/gems/3.3.0:/usr/lib/ruby/gems/3.3.0:/usr/lib/x86_64-linux-gnu/ruby/gems/3.3.0:/usr/share/rubygems-integration/3.3.0:/usr/share/rubygems-integration/all:/usr/lib/x86_64-linux-gnu/rubygems-integration/3.3.0
ruby3.3 -S rake --rakelibdir /gem2deb-nonexistent -f
debian/ruby-tests.rake
/usr/bin/ruby3.3
-I/usr/share/rubygems-integration/all/gems/rspec-support-3.13.1/lib:/usr/share/rubygems-integration/all/gems/rspec-core-3.13.0/lib
/usr/share/rubygems-integration/all/gems/rspec-core-3.13.0/exe/rspec
--pattern ./spec/\*\*/\*_spec.rb

Randomized with seed 24365
...........................................................................................................................................................................................FF..............................

Failures:

  1) DBF::Record column data for table overriding specified in dbf
encoding transcodes from manually specified encoding to default system
encoding
     Failure/Error:
expect(record.name.encode('UTF-8').unpack1('H4')).to eq 'd180'

       expected: #<Encoding:UTF-8> "d180"
            got: #<Encoding:US-ASCII> "3f3f"

       (compared using ==)
     # ./spec/dbf/record_spec.rb:99:in `block (4 levels) in <top (required)>'

  2) DBF::Record column data for table using specified in dbf encoding
encodes to default system encoding
     Failure/Error:
expect(record.name.encode('UTF-8').unpack1('H4')).to eq 'd0b0'

       expected: #<Encoding:UTF-8> "d0b0"
            got: #<Encoding:US-ASCII> "3f3f"

       (compared using ==)
     # ./spec/dbf/record_spec.rb:87:in `block (4 levels) in <top (required)>'

Finished in 0.51922 seconds (files took 0.23877 seconds to load)
219 examples, 2 failures

Failed examples:

rspec ./spec/dbf/record_spec.rb:95 # DBF::Record column data for table
overriding specified in dbf encoding transcodes from manually
specified encoding to default system encoding
rspec ./spec/dbf/record_spec.rb:83 # DBF::Record column data for table
using specified in dbf encoding encodes to default system encoding

Randomized with seed 24365

View full logs:

https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/ruby-dbf.html
https://salsa.debian.org/leandrocunha/ruby-dbf/-/pipelines/861054
Description: Set default external encoding as UTF-8
 This makes the package reproducible in reproducible
 builds and even fixes failures in CI tests.
Forwarded: https://github.com/infused/dbf/pull/77
Author: Cédric Boutillier <boutil@debian.org>
Last-Update: 2025-05-04

---
 spec/spec_helper.rb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 9cabf2d..8897f89 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -5,6 +5,8 @@ rescue LoadError
   # ignore
 end
 
+Encoding.default_external = "UTF-8"
+
 require 'dbf'
 require 'yaml'
 require 'rspec'

Reply via email to