New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: check for ln --relative #5682
Conversation
ln --relative is recent enough that not all distributions support it. This is especially the case for enterprise-grade distributions than can have a life-span of more than a decade. Detect if ln supports --relative and use it if so. If not supported, use a bit of sed magic to construct the ../ sequence, that leads back to / when appended to the destination directory. We introduce this as a macro that expands to a single command. To avoid complexity in the macro, we expect paths to be passed whitout the leading DESTDIR.
What distributions don't support it?
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be patched somewhere downstream.
Thanks for the review and comments! :-) [0] we in Buildroot try to support building on enterprise-grade distributions, like the RHEL series, [1] for example, I have a build that takes a bit les than 20 min; adding 1 min is a 5% overhead which is quite a bit noticeable, especially as it may be built a great many times a day... :-( Regards, |
Sorry, I should have chosen "comment". I'll fix that.
I mean that I'm not sure that |
@evverx Thanks for the feedback. So, yes, coreutils could be built. However, it takes a lot of time to build (see my previous reply) which can add quite a fair amount to the build time, when what we "just" need of it is As for the "old" distros: please consider that they are present in a lot of companies (for various reasons, one being long-term support, the other being reproducibility in the long term, like 10+ years). And no, I do not expect systemd to work on those distro, but they can be used to cross-compile systemd for, say, an embedded target with all latest and greatest components (kernel, gcc, systemd...). This is a typical setup. Thanks. ;-) Regards, |
We really don't care too much building systemd on really old distros, the same way we don't support building it against really old kernels. In fact, we are much more agressive with build deps than with runtime deps, and ln --relative is only a build dep. We try to focus on building things with kernels that are 2y old or newer, though currently we do support 3y old kernels, too. ln --relative is 5y old now, and that's an eternity in IT. Hence I fully agree with @evverx: this is beyond what we intend to support upstream. Please update your local system, I am pretty sure focussing on 5y old infrastructure is not even a safe thing to do these days. Alternatively, maintain this patch downstream. Sorry if this is disappointing, but I do hope this makes sense. |
This is needed as systemd has gained a dependency on realpath(1) which was introduced in coreutils too recently for our supported distro to have it (Ubuntu 14.04 does not have it from coreutils, although there is a dedicated package for it). This also means that we now have a ln that understands --relative, so we can drop our workaround, that upstream said they would never accept anyway [0]. [0] systemd/systemd#5682 Fixes: http://autobuild.buildroot.org/results/a9a/a9a285e482285d062892bab0d1a2e2f89928c92d/ http://autobuild.buildroot.org/results/6f5/6f5b1065859d866af6fa719f611c3ea7f4b88760/ ... Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Cc: Adam Duskett <aduskett@gmail.com> Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This is needed as systemd has gained a dependency on realpath(1) which was introduced in coreutils too recently for our supported distro to have it (Ubuntu 14.04 does not have it from coreutils, although there is a dedicated package for it). This also means that we now have a ln that understands --relative, so we can drop our workaround, that upstream said they would never accept anyway [0]. [0] systemd/systemd#5682 Fixes: http://autobuild.buildroot.org/results/a9a/a9a285e482285d062892bab0d1a2e2f89928c92d/ http://autobuild.buildroot.org/results/6f5/6f5b1065859d866af6fa719f611c3ea7f4b88760/ ... Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Cc: Adam Duskett <aduskett@gmail.com> Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This is needed as systemd has gained a dependency on realpath(1) which was introduced in coreutils too recently for our supported distro to have it (Ubuntu 14.04 does not have it from coreutils, although there is a dedicated package for it). This also means that we now have a ln that understands --relative, so we can drop our workaround, that upstream said they would never accept anyway [0]. [0] systemd/systemd#5682 Fixes: http://autobuild.buildroot.org/results/a9a/a9a285e482285d062892bab0d1a2e2f89928c92d/ http://autobuild.buildroot.org/results/6f5/6f5b1065859d866af6fa719f611c3ea7f4b88760/ ... Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Cc: Adam Duskett <aduskett@gmail.com> Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
ln --relative is recent enough that not all distributions support it.
This is especially the case for enterprise-grade distributions than can
have a life-span of more than a decade.
Detect if ln supports --relative and use it if so.
If not supported, use a bit of sed magic to construct the ../ sequence,
that leads back to / when appended to the destination directory.
We introduce this as a macro that expands to a single command. To avoid
complexity in the macro, we expect paths to be passed whitout the
leading DESTDIR.