Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 601060 - app-editors/nano: support /bin -> /usr/bin symlink with merged /usr
Summary: app-editors/nano: support /bin -> /usr/bin symlink with merged /usr
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Lars Wendler (Polynomial-C) (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: prefix-gx86
  Show dependency tree
 
Reported: 2016-11-28 10:03 UTC by Michael Haubenwallner (RETIRED)
Modified: 2021-01-06 10:05 UTC (History)
1 user (show)

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


Attachments
pkg_preinst: drop nano symlink for the /bin -> /usr/bin symlink (nano-bin-symlink.diff,1.07 KB, patch)
2016-11-28 10:03 UTC, Michael Haubenwallner (RETIRED)
Details | Diff
no symlink for prefix when PREFIX_DISABLE_USR_SPLIT=yes (nano-bin-symlink.diff,1.67 KB, patch)
2016-12-02 08:20 UTC, Michael Haubenwallner (RETIRED)
Details | Diff
no symlink for USE=prefix-guest, always has merged /usr (nano-bin-symlink.diff,403 bytes, patch)
2017-06-13 10:08 UTC, Michael Haubenwallner (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Haubenwallner (RETIRED) gentoo-dev 2016-11-28 10:03:58 UTC
Created attachment 454580 [details, diff]
pkg_preinst: drop nano symlink for the /bin -> /usr/bin symlink

In Prefix we have the /bin -> /usr/bin symlink, causing nano to install an invalid symlink (fails to merge in Cygwin).

What about this diff for 2.7.1 and 9999?

Thanks!
Comment 1 SpanKY gentoo-dev 2016-11-28 19:11:17 UTC
i don't think that'll work ... it's relying on non-deterministic behavior that the binary nano is merged after the symlink.

how critical is this ?  i'd like to land the USE=sep-usr support and nano could just leverage that.
Comment 2 SpanKY gentoo-dev 2016-11-28 19:58:50 UTC
nm, i misread your patch -- it would work as is

i also don't think USE=sep-usr would help -- while it's related, it's not exactly the same thing

i'm not keen on this sort of hackery in the pkg_* phases.  imo, the src_install should be set up the same way as it'll end up in $ROOT.

should we consider a USE=merged-usr flag ?
Comment 3 Michael Haubenwallner (RETIRED) gentoo-dev 2016-11-29 08:44:46 UTC
Ok, keeping in prefix overlay until we find some generic solution:
https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=40a0c3040793c2f7190bfa4ae9bfd28ab6063676
Comment 4 Michael Haubenwallner (RETIRED) gentoo-dev 2016-12-02 08:20:33 UTC
Created attachment 454890 [details, diff]
no symlink for prefix when PREFIX_DISABLE_USR_SPLIT=yes

My intent to not rely on PREFIX_DISABLE_USR_SPLIT in arbitrary ebuilds failed:
It turns out that pkg_preinst is too late for collision check these days(?),
and re-emerging has a collision with (unowned!) usr/bin/nano.
Comment 5 Fabian Groffen gentoo-dev 2017-01-29 21:35:10 UTC
Would it be possible to detect /usr and / map onto the same filesystem via df or something instead of relying on our secrit bootstrap-set env-var in make.conf?
Comment 6 Michael Haubenwallner (RETIRED) gentoo-dev 2017-01-30 09:37:22 UTC
Checking the filesystem would be necessary on the target machine. Unless I'm missing something, the first phase there is pkg_preinst(), which is run after content collection and collision protection nowadays, so I fail to see a chance to modify pkg content after src_install().
What do I miss here?
Comment 7 Fabian Groffen gentoo-dev 2017-01-30 10:04:46 UTC
I was wrong.  It indeed doesn't help anything.
Comment 8 Fabian Groffen gentoo-dev 2017-06-12 13:20:27 UTC
@haubi: should we reverse the expression?  PREFIX_DISABLE_USR_SPLIT is nowhere set in the profiles or via bootstrap, is it?  Currently, nano just ends up being installed as dead symlink.

Would it be possible to cp or hardlink the binary manually instead (and ignore messages like ln: failed to create hard link 'tmp/usr/x': File exists, cp: 'tmp/x' and 'tmp/usr/x' are the same file)?
Comment 9 Michael Haubenwallner (RETIRED) gentoo-dev 2017-06-12 14:39:59 UTC
Ah, PREFIX_DISABLE_USR_SPLIT is exported from within bootstrap-prefix.sh, but ends up as PREFIX_DISABLE_GEN_USR_LDSCRIPT=yes in make.conf.

What about 'use !prefix-guest' (true for main and rap) around the symlink creation?
Comment 10 Fabian Groffen gentoo-dev 2017-06-12 17:50:50 UTC
I can live with that, we can also use the LDSCRIPT one.  At this point it is broken for most (all?) Prefix installs (and it went without noticing for a long while), so whatever we do we better fix it soon.  Just assuming prefix == no-usr-split works for me.  Omitting the symlink in prefix works for me too, since we have /bin in PATH.
Comment 11 Michael Haubenwallner (RETIRED) gentoo-dev 2017-06-13 10:08:39 UTC
Created attachment 476240 [details, diff]
no symlink for USE=prefix-guest, always has merged /usr

https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=e64eba9aa5cef49debcaaa7e0704b6fdd0e2146f

Note: prefix-guest is in IUSE_IMPLICIT.
Comment 12 Fabian Groffen gentoo-dev 2021-01-06 10:05:06 UTC
this seems fixed with split-usr USE-flag these days