Re: [Buildroot] [PATCH v3 07/16] package/pkg-generic.mk: detect files overwritten in TARGET_DIR and HOST_DIR
From: Yann E. MORIN <hidden>
Date: 2021-08-29 16:41:03
Thomas, All, On 2021-08-29 14:51 +0200, Yann E. MORIN spake thusly: [--SNIP--]
Finally, as a side note: there is still a case of file overwrite that we do not detect, even with this series: if two packages that are not part of the same dependency chain (i.e. they do not depend one on the other), and they both install the same file, then the file-overwrite will only happen when we eventually assemble the global target/ and host/ from the individual PPD target/ and host/ and we still have to add a detection for that case (which is not a pre-requisite before we apply the current series, of course).
And of course, this will also cause an overwrite when two such packages
are also dependencies of a third patckage, and so when the PPD of that
third package is prepared, we would have to detect file overwrite.
Note: let's assume the following hypotetical dependency graph (where the
notation A --<-- B means that B depends on A):
.-<-- A --<-. S: skeleton
/ \ F: target-finalize
S --<-- B --<-- C
\ \
`-<-- D --<-----<-- F
If A and B both install the same file, then we do not have a sane PPD
to build C.
If D and any package in the dependency chain of C (i.e. S, A, B, or C
itself) install the same file, then we can only detect it in
target-finalize.
So, let's take a step back, and have a wider look. I wonder if the end
of a package installation step is the best location to detected file
overwrite...
Indeed, let's assume that we do file overwrite detection:
1. in PPD preparation (when we rsync the dependencies, in the macro
per-package-rsync): we can also detect that a package overwrites one
or more files of another package, report those files, *and* prevent
building a package with unsound dependencies;
2. in {target,host}-finalize: we can detect that a package overwrites
one or more files provided by another package, and report those
files.
So, the above (still theoretical implementation) is all we would need,
in the end, and we would not need to do the detection at the end of a
package installation step of each package, because it would not provide
any information that we couldn't have with the above.
However, a benefit of also doing it at the end of the installation step,
of a package, is that we can cut short on the build time. However, I am
not sure that benefit is that important or major...
So, I'd like we think a bit harder before we apply this patch...
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot