#72 Add bootstrap with miniruby build from the source tarball.
Opened 10 months ago by vondruch. Modified 10 months ago
rpms/ vondruch/ruby bootstrap  into  private-ruby-3.0

file modified
+87 -1
@@ -65,6 +65,12 @@ 

  

  %global tapset_libdir %(echo %{_libdir} | sed 's/64//')*

  

+ %bcond_without miniruby

+ %if %{with miniruby}

+ %global miniruby_dir %{_builddir}/miniruby

+ %global miniruby %{miniruby_dir}/miniruby

+ %endif

+ 

  %if 0%{?fedora} >= 19

  %bcond_without rubypick

  %endif
@@ -155,6 +161,7 @@ 

  # Avoid possible timeout errors in TestBugReporter#test_bug_reporter_add.

  # https://bugs.ruby-lang.org/issues/16492

  Patch19: ruby-2.7.1-Timeout-the-test_bug_reporter_add-witout-raising-err.patch

+ Patch20: 0001-Revert-Add-GC.auto_compact-true-false-and-GC.auto_co.patch

  

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

  Suggests: rubypick
@@ -181,6 +188,10 @@ 

  BuildRequires: multilib-rpm-config

  BuildRequires: gcc

  BuildRequires: zlib-devel

+ %if %{with miniruby}

+ BuildRequires: automake

+ BuildRequires: bison

+ %endif

  

  # This package provides %%{_bindir}/ruby-mri therefore it is marked by this

  # virtual provide. It can be installed as dependency of rubypick.
@@ -592,6 +603,13 @@ 

  %prep

  %setup -q -n %{ruby_archive}

  

+ %if %{with miniruby}

+ mkdir %{_builddir}/miniruby

+ cp -a . %{_builddir}/miniruby

+ 

+ # TODO: Remove unnecessary stuf?

+ %endif

+ 

  # Remove bundled libraries to be sure they are not used.

  rm -rf ext/psych/yaml

  rm -rf ext/fiddle/libffi*
@@ -607,14 +625,82 @@ 

  %patch11 -p1

  %patch12 -p1

  %patch19 -p1

+ %patch20 -p1

  

  # Provide an example of usage of the tapset:

  cp -a %{SOURCE3} .

  

  %build

- autoconf

+ %if %{with miniruby}

+ pushd %{miniruby_dir}

+ %configure \

+   --disable-gem \

+   --disable-jit \

+   --disable-did_you_mean

+ 

+ # Compile miniruby + rbconfig.rb.

+ %make_build COPY="cp -p" Q= rbconfig.rb

+ 

+ # Prepare extensions.

+ %make_build COPY="cp -p" Q= ext/configure-ext.mk

+ 

+ # io subdirectories needs special treatment.

+ %make_build -f ext/configure-ext.mk srcdir="." ext/io/exts.mk

+ 

+ for e in \

+   io/wait \

+   pathname \

+   ripper \

+   stringio \

+   `# RubyGems depednencies` \

+   digest \

+   digest/sha2 \

+   monitor \

+   psych \

+   strscan \

+   zlib

+ do

+   %make_build -f ext/configure-ext.mk srcdir="." ext/${e}/exts.mk || :

+   %make_build -C ext/${e}

+ done

+ 

+ # Re-link miniruby with dynamic loading of extensions enabled.

+ %make_build ARCHMINIOBJS="dln.o" COPY="cp -p" Q= miniruby

+ popd

+ 

+ # Provide Ruby shim with the right load paths.

+ cat << EOL > miniruby.sh

+ #!/usr/bin/sh

+ exec %{miniruby} -I%{miniruby_dir}:%{miniruby_dir}/.ext/common:%{miniruby_dir}/.ext/x86_64-linux:lib "\$@"

+ EOL

+ 

+ chmod a+x miniruby.sh

+ 

+ # Clean everything pregenerated. `configure` must be executed to have Makefile

+ # available.

+ %configure

+ 

+ %make_build Q= realclean

+ 

+ # Restore several pieces.

+ for p in \

+   ChangeLog \

+   revision.h \

+   gems/\*.gem

+ do

+   cp %{miniruby_dir}/${p} `dirname ${p}`

+ done

+ 

+ # Restore config.guess.

+ cp /usr/lib/rpm/redhat/config.{guess,sub} tool/

+ 

+ %endif

+ 

+ # Final build.

+ %{?with_miniruby:autoreconf}%{!?without_miniruby:autoconf}

  

  %configure \

+         %{?with_miniruby:--with-baseruby=./miniruby.sh} \

          --with-rubylibprefix='%{ruby_libdir}' \

          --with-archlibdir='%{_libdir}' \

          --with-rubyarchprefix='%{ruby_libarchdir}' \

Is this PR working in progress, right?

Seeing the patch name 0001-Revert-Add-GC.auto_compact-true-false-and-GC.auto_co.patch that can be used as temporary use. And the hardcorded architecture name x86_64-linux.

Is this PR working in progress, right?

Seeing the patch name 0001-Revert-Add-GC.auto_compact-true-false-and-GC.auto_co.patch that can be used as temporary use. And the hardcorded architecture name x86_64-linux.

See related email with details - this question is addressed there.

Yeah, it is. It is even against my private-ruby-3.0 branch, not master. And the patch is just to demonstrate the situation.

1 new commit added

  • Cleanup the sources from all pregenerated code.
10 months ago

Unable to freeze job graph: Job rpm-linter depends on rpm-scratch-build which was not run.

2 new commits added

  • Cleanup the sources from all pregenerated code.
  • Add bootstrap with miniruby build from the source tarball.
10 months ago

Unable to freeze job graph: Job rpm-linter depends on rpm-scratch-build which was not run.

Would you mind to add in the initial comment message the following ?:

Depends-on: https://pagure.io/fedora-zuul-jobs/pull-request/75

2 new commits added

  • Cleanup the sources from all pregenerated code.
  • Add bootstrap with miniruby build from the source tarball.
10 months ago

Unable to freeze job graph: Job rpm-linter depends on rpm-scratch-build which was not run.

Unable to freeze job graph: Job check-for-tests depends on rpm-scratch-build which was not run.

Would you mind to add in the initial comment message the following ?:

I can but should it change anything? If yes, I'd appreciate if you can provide me with a link to a ticket requesting to remove the need for the initial comment.

Ok it seems we are back to the right behavior where Zuul should not try to run any jobs on extra branches. (This https://pagure.io/fedora-zuul-jobs-config/pull-request/70 was also needed).

I can but should it change anything?

Yes Zuul is able to understand dependencies between un-merged PRs. By adding a Depends-on: <unmerged-PR-url> thenthe dependency is handled by Zuul in the context of this PR.

So in our case we would have been able to validate the change on the CI config (https://pagure.io/fedora-zuul-jobs/pull-request/75) w/o modifying the current CI config so w/o impact on the production CI.

If yes, I'd appreciate if you can provide me with a link to a ticket requesting to remove the need for the initial comment

Sorry I don't get it :(

If yes, I'd appreciate if you can provide me with a link to a ticket requesting to remove the need for the initial comment

Sorry I don't get it :(

Ah, sorry, I completely missed the "depends-on" part of your comment :see_no_evil: please ignore the comment :innocent: