Skip to content

meson: fix symlink creation when sbin is symlink to bin - #8319

Merged
poettering merged 2 commits into
systemd:masterfrom
keszybz:yet-another-symlink-installation-tweak
Mar 1, 2018
Merged

poettering merged 2 commits into
systemd:masterfrom
keszybz:yet-another-symlink-installation-tweak

Conversation

@keszybz

@keszybz keszybz commented Mar 1, 2018

Copy link
Copy Markdown
Member

Follow-up for ba7f4ae.

This will copy the structure of the directories in the root file system to
$DESTDIR. If a directory is a directory in $DESTDIR but a symlink in the root
file system, this script will fail. This means that it's not possible to reuse
a $DESTDIR from between ba7f4ae and this patch.

@poettering

Copy link
Copy Markdown
Member

Uh, isn't this a bit too magic? Shouldn't this be something the package manager deals with?

Or alternatively, should this be handled like the split-usr stuff? i.e. we maintain a split-bin boolean, and only if true we distuingish between bin and sbin?

@keszybz

keszybz commented Mar 1, 2018

Copy link
Copy Markdown
Member Author

I like that this works "automagically", and users don't have to remember to set yet another setting. We could make this overrideable though. What about a new -Dsplit-bin=yes|no|auto setting?

@poettering

Copy link
Copy Markdown
Member

I like that this works "automagically", and users don't have to remember to set yet another setting. We could make this overrideable though. What about a new -Dsplit-bin=yes|no|auto setting?

Do we have "auto" for split-usr? I am pretty sure we should support automagic behaviour as much or as little as for split-usr...

@keszybz

keszybz commented Mar 1, 2018

Copy link
Copy Markdown
Member Author

I'd make -Dsplit-usr automatic too. There really isn't any reason not to autodetect this.

@michaelolbrich

Copy link
Copy Markdown
Contributor

I'm pretty sure this is broken for cross compiling. It checks if /sbin on the build machine is a symlink to /bin, right? This may be different from the target I'm building for.

keszybz added 2 commits March 1, 2018 12:23
Also move the status from "features" to the paths section. This is more of an
anti-feature.
Follow-up for ba7f4ae.

By default, we detect if the real root has a separate /usr/sbin directory, but
this can be overrides with -Dsplit-bin=true|false. The check assumes that
/usr/sbin is split if it is not a symlink, so it'll return a false negative
with some more complicated setups. But that's OK, in those cases this should be
configured explicitly.

This will copy the structure of the directories in the root file system to
$DESTDIR. If a directory is a directory in $DESTDIR but a symlink in the root
file system, this script will fail. This means that it's not possible to reuse
a $DESTDIR from between ba7f4ae and this patch.
@keszybz
keszybz force-pushed the yet-another-symlink-installation-tweak branch from 54fbbd2 to 157baa8 Compare March 1, 2018 11:31
@keszybz

keszybz commented Mar 1, 2018

Copy link
Copy Markdown
Member Author

Updated.

Comment thread meson.build
split_bin = run_command('test', '-L', '/usr/sbin').returncode() != 0
else
split_bin = get_option('split-bin') == 'true'
endif

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i figure sooner or later it would have sense to also define HAVE_SPLIT_BIN or so as c macro, so that we can adjust search paths depending on thus, and drop sbin where it is redundant.

@poettering
poettering merged commit 7df4b83 into systemd:master Mar 1, 2018
@keszybz
keszybz deleted the yet-another-symlink-installation-tweak branch March 1, 2018 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants