#138 f35: Fix FTBFS coming from Git and tzdata
Merged a year ago by jaruga. Opened a year ago by jaruga.
rpms/ jaruga/ruby wip/f35-ftbfs-on-git  into  f35

@@ -0,0 +1,27 @@ 

+ From dae843f6b7502f921a7e66f39e3714a39d860181 Mon Sep 17 00:00:00 2001

+ From: Hiroshi SHIBATA <hsbt@ruby-lang.org>

+ Date: Wed, 19 Oct 2022 19:40:00 +0900

+ Subject: [PATCH] Bypass git submodule add/update with git config

+  protocol.file.allow=always option.

+ 

+ Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>

+ ---

+  test/rubygems/test_gem_source_git.rb | 5 +++++

+  1 file changed, 5 insertions(+)

+ 

+ diff --git a/test/rubygems/test_gem_source_git.rb b/test/rubygems/test_gem_source_git.rb

+ index 5702da05974b6..c3b324771fa4d 100644

+ --- a/test/rubygems/test_gem_source_git.rb

+ +++ b/test/rubygems/test_gem_source_git.rb

+ @@ -63,6 +63,11 @@ def test_checkout_local_cached

+    end

+  

+    def test_checkout_submodules

+ +    # We need to allow to checkout submodules with file:// protocol

+ +    # CVE-2022-39253

+ +    # https://lore.kernel.org/lkml/xmqq4jw1uku5.fsf@gitster.g/

+ +    system(@git, *%W"config --global protocol.file.allow always")

+ +

+      source = Gem::Source::Git.new @name, @repository, 'master', true

+  

+      git_gem 'b'

@@ -0,0 +1,40 @@ 

+ From 7e9ec8a20b0f7469b415283d2ec0c22087f8eb2b Mon Sep 17 00:00:00 2001

+ From: Jun Aruga <jaruga@redhat.com>

+ Date: Wed, 24 Aug 2022 12:02:56 +0200

+ Subject: [PATCH] Fix tests with Europe/Amsterdam pre-1970 time on tzdata

+  version 2022b.

+ 

+ The Time Zone Database (tzdata) changed the pre-1970 timestamps in some zones

+ including Europe/Amsterdam on tzdata version 2022b or later.

+ See <https://github.com/eggert/tz/commit/35fa37fbbb152f5dbed4fd5edfdc968e3584fe12>.

+ 

+ The tzdata RPM package maintainer on Fedora project suggested changing the Ruby

+ test, because the change is intentional.

+ See <https://bugzilla.redhat.com/show_bug.cgi?id=2118259#c1>.

+ 

+ We use post-1970 time test data to simplify the test.

+ ---

+  core/time/shared/local.rb | 6 +++---

+  1 file changed, 3 insertions(+), 3 deletions(-)

+ 

+ diff --git a/spec/ruby/core/time/shared/local.rb b/spec/ruby/core/time/shared/local.rb

+ index 43f331c4c..c4aa7a7ea 100644

+ --- a/spec/ruby/core/time/shared/local.rb

+ +++ b/spec/ruby/core/time/shared/local.rb

+ @@ -8,10 +8,10 @@ describe :time_local, shared: true do

+  

+    platform_is_not :windows do

+      describe "timezone changes" do

+ -      it "correctly adjusts the timezone change to 'CEST' on 'Europe/Amsterdam'" do

+ +      it "correctly adjusts the timezone change to 'CET' on 'Europe/Amsterdam'" do

+          with_timezone("Europe/Amsterdam") do

+ -          Time.send(@method, 1940, 5, 16).to_a.should ==

+ -            [0, 40, 1, 16, 5, 1940, 4, 137, true, "CEST"]

+ +          Time.send(@method, 1970, 5, 16).to_a.should ==

+ +            [0, 0, 0, 16, 5, 1970, 6, 136, false, "CET"]

+          end

+        end

+      end

+ -- 

+ 2.36.1

+ 

file modified
+14 -1
@@ -22,7 +22,7 @@ 

  %endif

  

  

- %global release 153

+ %global release 154

  %{!?release_string:%define release_string %{?development_release:0.}%{release}%{?development_release:.%{development_release}}%{?dist}}

  

  # The RubyGems library has to stay out of Ruby directory tree, since the
@@ -162,6 +162,12 @@ 

  # https://bugzilla.redhat.com/show_bug.cgi?id=2027099

  # https://github.com/rubygems/rubygems/pull/5154

  Patch22: rubygems-3.2.33-Fix-loading-operating_system-rb-customizations-too-late.patch

+ # Fix tests with Europe/Amsterdam pre-1970 time on tzdata version 2022b.

+ # https://github.com/ruby/spec/pull/939

+ Patch26: ruby-spec-Fix-tests-on-tzdata-2022b.patch

+ # Bypass git submodule test failure on Git >= 2.38.1.

+ # https://github.com/ruby/ruby/pull/6587

+ Patch29: ruby-3.2.0-git-2.38.1-fix-rubygems-test.patch

  

  Requires: %{name}-libs%{?_isa} = %{version}-%{release}

  Suggests: rubypick
@@ -610,6 +616,8 @@ 

  %patch19 -p1

  %patch20 -p1

  %patch22 -p1

+ %patch26 -p1

+ %patch29 -p1

  

  # Provide an example of usage of the tapset:

  cp -a %{SOURCE3} .
@@ -1365,6 +1373,11 @@ 

  

  

  %changelog

+ * Fri Nov 04 2022 Jun Aruga <jaruga@redhat.com> - 3.0.4-154

+ - Fix tests with Europe/Amsterdam pre-1970 time on tzdata version 2022b.

+   Resolves: rhbz#2120354

+ - Bypass git submodule test failure on Git >= 2.38.1.

+ 

  * Wed Apr 27 2022 Vít Ondruch <vondruch@redhat.com> - 3.0.4-153

  - Fix loading of default gems.

    Resolves: rhbz#2027099

This PR is to fix FTBFS on f35.

https://koschei.fedoraproject.org/package/ruby?collection=f35
https://kojipkgs.fedoraproject.org/work/tasks/2726/93712726/build.log

  1) Failure:
TestGemSourceGit#test_checkout_submodules [/builddir/build/BUILD/ruby-3.0.4/test/rubygems/test_gem_source_git.rb:72]:
fatal: transport 'file' not allowed
fatal: clone of '/builddir/build/BUILD/ruby-3.0.4/tmp/test_rubygems_20221102-693297-lj37gh/git/b' into submodule path '/builddir/build/BUILD/ruby-3.0.4/tmp/test_rubygems_20221102-693297-lj37gh/git/a/b' failed
Finished tests in 887.680345s, 23.9963 tests/s, 3080.9649 assertions/s.
21301 tests, 2734912 assertions, 1 failures, 0 errors, 62 skips
ruby -v: ruby 3.0.4p208 (2022-04-12 revision 3fa771dded) [x86_64-linux]

One more test failure in the make test-spec comes from the tzdata RPM package version >= 2022b.
https://kojipkgs.fedoraproject.org//work/tasks/1952/93751952/build.log

1)
Time.local timezone changes correctly adjusts the timezone change to 'CEST' on 'Europe/Amsterdam' FAILED
Expected [0, 0, 0, 16, 5, 1940, 4, 137, true, "WEST"] == [0, 40, 1, 16, 5, 1940, 4, 137, true, "CEST"]
to be truthy but was false
/builddir/build/BUILD/ruby-3.0.4/spec/ruby/core/time/shared/local.rb:13:in `block (5 levels) in <top (required)>'
/builddir/build/BUILD/ruby-3.0.4/spec/ruby/core/time/shared/local.rb:12:in `block (4 levels) in <top (required)>'
/builddir/build/BUILD/ruby-3.0.4/spec/ruby/core/time/local_spec.rb:5:in `<top (required)>'

The scratch build is running here.
https://koji.fedoraproject.org/koji/taskinfo?taskID=93752954

Build succeeded.

The commits should have been probably applied in reverse order, i.e. first fix the tzdata followed by fix for git. LGTM other then that.

The commits should have been probably applied in reverse order, i.e. first fix the tzdata followed by fix for git. LGTM other then that.

OK. I will do in the reverse order, then merge.

rebased onto 2526f5f

a year ago

OK. I will do in the reverse order, then merge.

I reversed the order, and scratch build is ok. Zuul CI is ok. I am going to merge and build it.

Build succeeded.

Pull-Request has been merged by jaruga

a year ago