lorenz / torcx-zfs

A torcx module for ZFS on CoreOS
MIT License
16 stars 5 forks source link

Fails to build on CoreOS < 1745 #2

Closed mvk15 closed 6 years ago

mvk15 commented 6 years ago

I use CoreOS version 1632.3.0 and met 2 issues related to dev-lang/perl

  1. In newly installed CoreOS 1632.3.0 the command equery -l dev-lang/perl doesn't return anything useful:
    # equery l dev-lang/perl -F '$fullversion'
    * Searching for perl in dev-lang ...
    !!! No installed packages matching 'dev-lang/perl'

    however the command equery -w dev-lang/perl returns the path to ebuild file:

    # equery w dev-lang/perl
    /var/lib/portage/portage-stable/dev-lang/perl/perl-5.24.1-r2.ebuild
  2. The patch file perl-fwrapv-fix.patch is hardcoded to use ebuild file /var/lib/portage/portage-stable/dev-lang/perl/perl-5.24.1.ebuild but it seems my system will be using /var/lib/portage/portage-stable/dev-lang/perl/perl-5.24.1-r2.ebuild and patch file can't be correctly apply to this file.

I don't know how to an elegantly resolve the 2nd issue but temporary added this construction:

# Define ebuild file
EBUILD_FILE="$(equery w dev-lang/perl)"

if ! fgrep 'append-cflags "-fwrapv"' $EBUILD_FILE; then
  line=$(fgrep -n 'use ithreads && myconf -Dusethreads' $EBUILD_FILE | cut -d':' -f1)
  if [ $? -eq 0 ]; then
    : $((line++))
    sed -i "${line}i\\\tappend-cflags \"-fwrapv\"" $EBUILD_FILE
  fi
fi
lorenz commented 6 years ago

The new Perl fixes probably broke CoreOS < 1745, I was aware of that. Since that version is quite old now (and CoreOS doesn't support anything that isn't the current release), I just ignored that (see #1).

If you're really interested in these older CoreOS versions, could you test if the older version before the 1745+ fixes (5c06a40603d3c342248367808465d78f1eedc92e) works with your CoreOS? Because then we could just make the new fixes conditional on CoreOS 1745+.

mvk15 commented 6 years ago

Haven't tested on the version before 5c06a40 but tested on CoreOS 1745.7.0 and the same issue

# cat /etc/os-release | grep VERSION=
VERSION=1745.7.0
# equery w dev-lang/perl
/var/lib/portage/portage-stable/dev-lang/perl/perl-5.24.1-r2.ebuild

it seems that maybe will be enough to prepare patch for perl-5.24.1-r2.ebuild file.

lorenz commented 6 years ago

Sorry, 1745 still needs the old version. 1800 and later need the new version.

mvk15 commented 6 years ago

Checked on CoreOS version 1800.4.0 and 1800.7.0. The command equery l dev-lang/perl -F '$fullversion' works as the command equery w dev-lang/perl:

# cat /etc/os-release | grep VERSION=
VERSION=1800.4.0
# equery l dev-lang/perl -F '$fullversion'
 * Searching for perl in dev-lang ...
5.24.1-r2
# equery w dev-lang/perl
/var/lib/portage/portage-stable/dev-lang/perl/perl-5.24.1-r2.ebuild

# cat /etc/os-release | grep VERSION=
VERSION=1800.7.0
# equery l dev-lang/perl
 * Searching for perl in dev-lang ...
[IP-] [  ] dev-lang/perl-5.24.1-r2:0/5.24
# equery w dev-lang/perl
/var/lib/portage/portage-stable/dev-lang/perl/perl-5.24.1-r2.ebuild

In these results, I see that systems use perl-5.24.1-r2.ebuild file. Older version 1632.3.0 uses this file too. So patch file should be created and applied to the file perl-5.24.1-r2.ebuild.

Also, as a universal solution may be possible to change the command: patch /var/lib/portage/portage-stable/dev-lang/perl/perl-$(equery l dev-lang/perl -F '$fullversion' 2>/dev/null).ebuild perl-fwrapv-fix.patch to patch $(equery w dev-lang/perl) perl-fwrapv-fix.patch ?

lorenz commented 6 years ago

I ran CI on that change and it didn't regress 1800+. I did a compile-only run for 1745.5.0, which did work, so I pushed the change since it seems to have strictly better compatibility than the old one. Thanks for your suggestion!

lorenz commented 6 years ago

Everything works now down to 1745. I'm not going to support more than the latest 3 stable CoreOS versions here since it goes against the idea of CoreOS and I'm not going to validate 10 versions. Therefore I'm closing this. If anyone really needs earlier versions you can either use an older version or PR your changes.