Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 550516 - few dev-ruby/* does not respect slotted packages, installed the latest which breaks an application
Summary: few dev-ruby/* does not respect slotted packages, installed the latest which ...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Ruby Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-27 07:11 UTC by Anton Bolshakov
Modified: 2018-01-30 10:02 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Bolshakov 2015-05-27 07:11:45 UTC
[nomerge       ] www-apps/rda-2.0_beta1::local-overlay  USE="mysql" 
[nomerge       ]  dev-ruby/rails-3.2.21:3.2::gentoo  USE="asset-pipeline {-test}" RUBY_TARGETS="ruby19 ruby20" 
[nomerge       ]   dev-ruby/jquery-rails-3.1.2:3::gentoo  USE="{-test}" RUBY_TARGETS="ruby19 ruby20 -ruby21" 
[nomerge       ]    dev-ruby/railties-4.0.13:4.0::gentoo  USE="{-test}" RUBY_TARGETS="ruby19 ruby20 -ruby21" 
[nomerge       ]     dev-ruby/actionpack-4.0.13:4.0::gentoo  USE="-doc {-test}" RUBY_TARGETS="ruby19 ruby20 -ruby21" 
[ebuild  NS   ~]      dev-ruby/rack-1.5.2-r4:1.5::gentoo [1.4.5-r3:1.4::gentoo] USE="-doc {-test}" RUBY_TARGETS="ruby19 ruby20 -ruby21 -ruby22" 0 KiB

the current rdep is as below:
ruby_add_rdepend ">=dev-ruby/railties-3.0 >=dev-ruby/thor-0.14"

This condition became invalid since dev-ruby/railties:4 has been stabilized
Comment 1 Hans de Graaff gentoo-dev Security 2015-05-28 04:33:18 UTC
The dependency is mostly correct. It is lacking a guard for <dev-ruby/railties-5 (now added in-place) but that won't make a difference here. jquery-rails 3.1.2 is the default version for Rails 3.2, but it can also be used without problems with Rails 4.x versions.

It seems that portage does not manage to see that the railties dependency is already satisfied by the rails:3.2 dependency tree and then pulls in the highest keyworded railties version. From a dependency perspective this can't be helped.

As a workaround you could emerge rails 3.2 without the asset-pipeline USE flag first.
Comment 2 Anton Bolshakov 2015-05-28 04:51:22 UTC
Can I suggest to compromise and make it dev-ruby/railties:3 dependant?
There are 3 jquery-rails slots available so might be confusing why its slot 3 is compatible with railties:3 and :4 but not 5

You might also want to file a portage bug report.

My application fails to start if both dev-ruby/railties:3 and dev-ruby/railties:4 are install. Somehow, it is unable to find slot 3 ..
Comment 3 Anton Bolshakov 2015-05-28 23:14:55 UTC
actually, this is not a portage issue. You asked >3.0 and it pulled the highest available version and slot.

How about || ( dev-ruby/railties:3 dev-ruby/railties:4 ) if you really want it to depend on both slots?
Comment 4 Anton Bolshakov 2016-06-29 06:07:56 UTC
(In reply to Anton Bolshakov from comment #3)
> actually, this is not a portage issue. You asked >3.0 and it pulled the
> highest available version and slot.
> 
> How about || ( dev-ruby/railties:3 dev-ruby/railties:4 ) if you really want
> it to depend on both slots?

Here is a nice blog post which confirms my suggestion above:
https://blogs.gentoo.org/mgorny/2016/06/21/dependency-pitfalls-regarding-slots-slot-ops-and-any-of-deps/

Can you fix the email?
Comment 5 Hans de Graaff gentoo-dev Security 2016-07-10 06:00:10 UTC
(In reply to Anton Bolshakov from comment #4)

> > How about || ( dev-ruby/railties:3 dev-ruby/railties:4 ) if you really want
> > it to depend on both slots?
> 
> Here is a nice blog post which confirms my suggestion above:
> https://blogs.gentoo.org/mgorny/2016/06/21/dependency-pitfalls-regarding-
> slots-slot-ops-and-any-of-deps/

In this case it would not make a difference, given the set of rails versions available, so it would not solve your problem. We should probably be more careful with these dependencies in the future to avoid potential problems when more versions become available.

Different slots of jquery-rails contain different major versions of jquery, which is why the slots also work for newer rails versions. In this case jquery and rails code can be upgraded independently. Consequently a rails application should be explicit about the jquery-rails version to use.
Comment 6 Anton Bolshakov 2016-07-10 06:52:43 UTC
> In this case it would not make a difference, given the set of rails versions
> available,

it does solve the problem. With the current condition ">=dev-ruby/railties-3.0:* <dev-ruby/railties-5.0:*" it pulls slot 4 even when I dont have rails 4 installed.

> Different slots of jquery-rails contain different major versions of jquery, 
> which is why the slots also work for newer rails versions.

that is not the case now because it forces user to install the latest stable railties.

Correction to the above, the condition should be:
|| ( dev-ruby/railties-4.0 dev-ruby/railties-4.1 dev-ruby/railties-4.2 )

That would allow a user to install a desired version jquery with current version of rails.
Comment 7 Hans de Graaff gentoo-dev Security 2016-07-10 18:06:16 UTC
(In reply to Anton Bolshakov from comment #6)
> > In this case it would not make a difference, given the set of rails versions
> > available,
> 
> it does solve the problem. With the current condition
> ">=dev-ruby/railties-3.0:* <dev-ruby/railties-5.0:*" it pulls slot 4 even
> when I dont have rails 4 installed.

I'm sorry, but I don't see how this would happen when rails 4.0 or 4.1 is already installed? Or how specifying it like "|| ( dev-ruby/railties:4.2 dev-ruby/railties:4.1 dev-ruby/railties:4.0" would make a difference in this case?

In both cases the dependency should already be satisfied by the installed version.

What package manager are you using? Could you also provide a more up-to-date example given that rails 3.2 is now masked, and point me to the specific ebuild that triggers this if possible?
Comment 8 Anton Bolshakov 2016-07-11 00:22:37 UTC
(In reply to Hans de Graaff from comment #7)
> I'm sorry, but I don't see how this would happen when rails 4.0 or 4.1 is
> already installed? Or how specifying it like "|| ( dev-ruby/railties:4.2
> dev-ruby/railties:4.1 dev-ruby/railties:4.0" would make a difference in this
> case?

sorry for not explaining it very clearly, but I dont have two rails installed.

If you look at my very first post, my application requires rails 3 (or let's 4.0 today).
Due to jquery-rails deps, it would pool rails 4.1 or even 4.2 if that higher slot is stable.
Comment 9 Hans de Graaff gentoo-dev Security 2016-07-18 19:37:39 UTC
(In reply to Hans de Graaff from comment #7)

> What package manager are you using? Could you also provide a more up-to-date
> example given that rails 3.2 is now masked, and point me to the specific
> ebuild that triggers this if possible?

I can't really do much more here without this information.
Comment 10 Anton Bolshakov 2016-07-19 01:01:02 UTC
emerge --info
Portage 2.2.28 (python 2.7.10-final-0, hardened/linux/amd64, gcc-4.9.3, glibc-2.22-r4, 4.4.8-pentoo-r1 x86_64)
=================================================================
System uname: Linux-4.4.8-pentoo-r1-x86_64-Intel-R-_Core-TM-_i5-3320M_CPU_@_2.60GHz-with-gentoo-2.2
KiB Mem:     7981336 total,   1522204 free
KiB Swap:    4194300 total,   4167344 free
Timestamp of repository gentoo: Sun, 17 Jul 2016 01:00:01 +0000
sh bash 4.3_p42-r1
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p42-r1::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.20.2::gentoo
dev-lang/python:          2.7.10-r1::gentoo, 3.4.3-r1::gentoo
dev-util/cmake:           3.3.1-r1::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.19.1::gentoo
sys-apps/sandbox:         2.10-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69::gentoo
sys-devel/automake:       1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            4.9.3::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.3::gentoo (virtual/os-headers)
sys-libs/glibc:           2.22-r4::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

steam-overlay
    location: /var/lib/layman/steam-overlay
    masters: gentoo
    priority: 0

pentoo
    location: /var/lib/layman/pentoo
    masters: gentoo
    priority: 1

local-overlay
    location: /usr/local/portage
    masters: gentoo
    priority: 2

ABI="amd64"
ABI_X86="64"
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA NVIDIA-CUDA PUEL AdobeFlash-11.x Google-TOS dlj-1.1 google-chrome Oracle-BCLA-JavaSE Intel-SDP skype-4.0.0.7-copyright baudline"
ACCEPT_PROPERTIES="*"
ACCEPT_RESTRICT="*"
ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci"
ANDROID_HOME="/opt/android-sdk-update-manager"
ANDROID_SWT="/usr/share/swt-3.7/lib"
ANT_HOME="/usr/share/ant"
APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias"
ARCH="amd64"
AUTOCLEAN="yes"
BOOTSTRAP_USE="cxx unicode internal-glib python_targets_python3_4 python_targets_python2_7 multilib hardened pax_kernel pic xtpax -jit -orc"
CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author"
CAMERAS="ptp2"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CFLAGS_amd64="-m64"
CFLAGS_x32="-mx32"
CFLAGS_x86="-m32"
CHOST="x86_64-pc-linux-gnu"
CHOST_amd64="x86_64-pc-linux-gnu"
CHOST_x32="x86_64-pc-linux-gnux32"
CHOST_x86="i686-pc-linux-gnu"
CLEAN_DELAY="5"
COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog"
COLLISION_IGNORE="/lib/modules/* *.py[co] *$py.class */dropin.cache"
CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /opt/sonar/conf /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3"
CXXFLAGS="-march=native -O2 -pipe"
DEFAULT_ABI="amd64"
DISPLAY=":0"
DISTDIR="/usr/portage/distfiles"
EDITOR="/usr/bin/mcedit"
ELIBC="glibc"
EMERGE_DEFAULT_OPTS=" --ask-enter-invalid --keep-going=y --binpkg-respect-use=y --tree --verbose --with-bdeps=y --autounmask=n --buildpkg-exclude "sys-kernel/compat-drivers sys-kernel/ax88179_178a x11-drivers/ati-drivers x11-drivers/nvidia-drivers sys-fs/zfs-kmod sys-kernel/spl                        sys-power/bbswitch pentoo/pentoo-installer x11-drivers/xf86-video-virtualbox app-emulation/virtualbox-guest-additions                  app-emulation/virtualbox-modules app-emulation/vmware-modules app-emulation/open-vm-tools-kmod sys-kernel/genkernel                    sys-kernel/pentoo-sources dev-python/twisted-web net-analyzer/metasploit sci-libs/lapack-reference x11-base/xorg-drivers app-admin/genmenu" --usepkg-exclude "sys-kernel/compat-drivers sys-kernel/ax88179_178a x11-drivers/ati-drivers x11-drivers/nvidia-drivers sys-fs/zfs-kmod sys-kernel/spl                     sys-power/bbswitch pentoo/pentoo-installer x11-drivers/xf86-video-virtualbox app-emulation/virtualbox-guest-additions                  app-emulation/virtualbox-modules app-emulation/vmware-modules app-emulation/open-vm-tools-kmod sys-kernel/genkernel                    sys-kernel/pentoo-sources dev-python/twisted-web net-analyzer/metasploit sci-libs/lapack-reference x11-base/xorg-drivers app-admin/genmenu""
EMERGE_WARNING_DELAY="10"
EPREFIX=""
EROOT="/"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FETCHCOMMAND="wget -t 3 -T 60 --passive-ftp -O "${DISTDIR}/${FILE}" "${URI}""
FETCHCOMMAND_RSYNC="rsync -avP "${URI}" "${DISTDIR}/${FILE}""
FETCHCOMMAND_SFTP="bash -c "x=\${2#sftp://} ; host=\${x%%/*} ; port=\${host##*:} ; host=\${host%:*} ; [[ \${host} = \${port} ]] && port=22 ; eval \"declare -a ssh_opts=(\${3})\" ; exec sftp -P \${port} \"\${ssh_opts[@]}\" \"\${host}:/\${x#*/}\" \"\$1\"" sftp "${DISTDIR}/${FILE}" "${URI}" "${PORTAGE_SSH_OPTS}""
FETCHCOMMAND_SSH="bash -c "x=\${2#ssh://} ; host=\${x%%/*} ; port=\${host##*:} ; host=\${host%:*} ; [[ \${host} = \${port} ]] && port=22 ; exec rsync --rsh=\"ssh -p\${port} \${3}\" -avP \"\${host}:/\${x#*/}\" \"\$1\"" rsync "${DISTDIR}/${FILE}" "${URI}" "${PORTAGE_SSH_OPTS}""
FFLAGS="-O2 -pipe"
Comment 11 Anton Bolshakov 2016-07-19 01:07:02 UTC
You refuse to understand the a basic syntax difference between deps ">3 <5" and "|| (4.1 4.2 4.3)"

How can I make it more clearly?
Comment 12 dwfreed 2016-07-19 02:27:35 UTC
I spoke with blshkv on IRC, and figured out what he's aiming for here.  He has an app, rda, which depends on rails:4.0.  The way the dependency in jquery-rails is written right now, though, portage will also pull in railties:4.2, because it's the best slot, but it is completely unneeded.  The dependency could be improved so that this doesn't happen.  I'm not a ruby guy, so I don't know how to make this work with the USE_RUBY stuff, but the basic idea is this:

|| (
    dev-ruby/railties:4.2
    dev-ruby/railties:4.1
    dev-ruby/railties:4.0
)

For people that just want jquery-rails, this'll pull in the best slot of railties; for people getting jquery-rails because it's a dep of another package, portage will be satisfied with whatever railties gets pulled in by the rest of the depgraph.
Comment 13 Hans de Graaff gentoo-dev Security 2016-07-25 17:04:38 UTC
After discussing this some more with dwfreed on IRC I now understand that this issue is caused by using 'emerge -uD', where the -D flag causes the "best" slot to be pulled in regardless of what is already installed. I'm not sure if this is a bug in portage or not (I think it is).

In any case changing all relevant dependencies to use the ||() style will bring a lot of additional maintenance work with it, and I'm not sure we can sustain that given the current manpower in the ruby project.
Comment 14 Anton Bolshakov 2016-07-25 23:02:04 UTC
You are correct about flags, I'm using "emerge -DNua world", the last bit which I didnt not provide initially.

I'm not sure what kind of maintenance you are worry around. It won't be rails 4.3 slot since 5.0 has been released. In fact, the current reference "<dev-ruby/railties-5" may not be clear simply because it is not in the tree yet and it will be 5.0 slot most probably. So you are creating an additional work by not fixing it as suggested.

You should probably go with dwfreed suggestions if you really want to invest your time and fix property to reduce maintenance. Introduce RUBY_DEPS/RUBY_USEDEP, similarly to python variables so that the fix would be dev-ruby/railties[${RUBY_USEDEPS}]
Comment 15 Anton Bolshakov 2016-07-25 23:15:07 UTC
sorry I confused ruby with rails in my last comment (7am here). But you've got an idea.
Comment 16 Anton Bolshakov 2016-09-22 06:31:52 UTC
ping?
Comment 17 Anton Bolshakov 2018-01-10 00:48:20 UTC
and ping again. It's been almost 3 years since my initial filling.

Does it really need to be that slow?
Comment 18 Anton Bolshakov 2018-01-19 08:25:27 UTC
I faced this problem again with the sprockets/sprockets package.

It has the following condition:
 >=dev-ruby/rack-1:* <dev-ruby/rack-3:*

My application is using dev-ruby/rack:1.6 , however dev-ruby/rack:2.0 is stable too. So both packages was installed and my application has failed to start with the following message:

/usr/lib64/ruby/gems/2.3.0/gems/bundler-1.15.4/lib/bundler/runtime.rb:317:in `check_for_activated_spec!': You have already activated rack 2.0.3, but your Gemfile requires rack 1.6.7. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)
        from /usr/lib64/ruby/gems/2.3.0/gems/bundler-1.15.4/lib/bundler/runtime.rb:32:in `block in setup'
        from /usr/lib64/ruby/2.3.0/forwardable.rb:204:in `each'
        from /usr/lib64/ruby/2.3.0/forwardable.rb:204:in `each'
        from /usr/lib64/ruby/gems/2.3.0/gems/bundler-1.15.4/lib/bundler/runtime.rb:27:in `map'
        from /usr/lib64/ruby/gems/2.3.0/gems/bundler-1.15.4/lib/bundler/runtime.rb:27:in `setup'
        from /usr/lib64/ruby/gems/2.3.0/gems/bundler-1.15.4/lib/bundler.rb:101:in `setup'
        from /usr/lib64/ruby/gems/2.3.0/gems/bundler-1.15.4/lib/bundler/setup.rb:19:in `<top (required)>'
        from /usr/lib64/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:133:in `require'
        from /usr/lib64/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:133:in `rescue in require'
        from /usr/lib64/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:39:in `require'
        from /data/www/rda/RDA-2.2/config/boot.rb:3:in `<top (required)>'
        from /usr/lib64/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /usr/lib64/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /data/www/rda/RDA-2.2/config/application.rb:1:in `<top (required)>'
        from /usr/lib64/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /usr/lib64/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /data/www/rda/RDA-2.2/config/environment.rb:2:in `<top (required)>'
        from /usr/lib64/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /usr/lib64/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from config.ru:3:in `block in <main>'
        from /usr/lib64/ruby/gems/2.3.0/gems/rack-2.0.3/lib/rack/builder.rb:55:in `instance_eval'
        from /usr/lib64/ruby/gems/2.3.0/gems/rack-2.0.3/lib/rack/builder.rb:55:in `initialize'
        from config.ru:in `new'
        from config.ru:in `<main>'
        from /usr/lib64/ruby/gems/2.3.0/gems/rack-2.0.3/lib/rack/builder.rb:49:in `eval'
        from /usr/lib64/ruby/gems/2.3.0/gems/rack-2.0.3/lib/rack/builder.rb:49:in `new_from_string'
        from /usr/lib64/ruby/gems/2.3.0/gems/rack-2.0.3/lib/rack/builder.rb:40:in `parse_file'
/usr/lib64/ruby/gems/2.3.0/gems/bundler-1.15.4/lib/bundler/runtime.rb:317:in `check_for_activated_spec!': You have already activated rack 2.0.3, but your Gemfile requires rack 1.6.7. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)
Comment 19 Anton Bolshakov 2018-01-30 10:02:43 UTC
dev-ruby/rails-deprecated_sanitizer has:
 ">=dev-ruby/activesupport-4.2"

which means all 3 slots: 4.2 5.0 and 5.1.

Since 5.1 is stable, it pulls it even if 4.2 is already installed