[pacman-dev] [PATCH 0/2] [WIP] Fix du filesize computation
This patchset is a WIP that tries to address FS#61717[1]. This is my first patch for pacman, so I may be missing a couple of the heuristics of proper pacman develoment. Namely, I'm worried about the use of xargs (I went down this road because I wanted to have the minimal set of changes). I'm not sure what're the heuristics for what I can assume (e.g., can findutils be assumed to exist?). As a followup of this, I removed the configure.ac stuff related to DUPATH and DUFLAGS. I'm not sure if we'd want to add XARGSPATH or so. I opted to not do that just yet. Thanks, -Santiago. [1] https://bugs.archlinux.org/task/61717 Santiago Torres (2): Make makepkg compute sizes properly configure.ac: drop DU* config configure.ac | 10 ---------- scripts/makepkg.sh.in | 3 +-- 2 files changed, 1 insertion(+), 12 deletions(-) -- 2.21.0
Makepkg used to use du --apparent-size to compute the size of the
package. Unfortunately, this would result in different sizes depending
on the filesystem used (e.g., btrfs vs ext4), which would affect
reproducible builds. Use a wc-based approach to compute sizes
Signed-off-by: Santiago Torres
Since DUFLAGS and DUPATH are not needed anymore remove them from the
configuration script
Signed-off-by: Santiago Torres
On 3/7/19 9:36 PM, Santiago Torres wrote:
This patchset is a WIP that tries to address FS#61717[1].
This is my first patch for pacman, so I may be missing a couple of the heuristics of proper pacman develoment. Namely, I'm worried about the use of xargs (I went down this road because I wanted to have the minimal set of changes). I'm not sure what're the heuristics for what I can assume (e.g., can findutils be assumed to exist?).
We explicitly use find -exec elsewhere, so that should be fine. xargs --null is a GNU-ism and does not work on supported targets: busybox xargs, and BSD xargs. Both support -0, but it is anyways a better idea to simply stick with POSIX-defined find -exec ... {} + (I think you can generally assume that long options will not work by default, actually. Neither busybox nor BSD utilities typically seem to implement them.)
As a followup of this, I removed the configure.ac stuff related to DUPATH and DUFLAGS. I'm not sure if we'd want to add XARGSPATH or so. I opted to not do that just yet.
We do not need this; the only reason du is configurable rather than relying on the PATH, is because people had wrapper programs that pretended to be du, but were broken: https://bugs.archlinux.org/task/19932 No one tries to colorize the output of find -exec or of xargs, I hope...
Thanks, -Santiago.
[1] https://bugs.archlinux.org/task/61717
Santiago Torres (2): Make makepkg compute sizes properly configure.ac: drop DU* config
configure.ac | 10 ---------- scripts/makepkg.sh.in | 3 +-- 2 files changed, 1 insertion(+), 12 deletions(-)
-- 2.21.0
-- Eli Schwartz Bug Wrangler and Trusted User
On Thu, Mar 07, 2019 at 10:07:12PM -0500, Eli Schwartz wrote:
On 3/7/19 9:36 PM, Santiago Torres wrote:
This patchset is a WIP that tries to address FS#61717[1].
This is my first patch for pacman, so I may be missing a couple of the heuristics of proper pacman develoment. Namely, I'm worried about the use of xargs (I went down this road because I wanted to have the minimal set of changes). I'm not sure what're the heuristics for what I can assume (e.g., can findutils be assumed to exist?).
We explicitly use find -exec elsewhere, so that should be fine.
xargs --null is a GNU-ism and does not work on supported targets: busybox xargs, and BSD xargs. Both support -0, but it is anyways a better idea to simply stick with POSIX-defined find -exec ... {} +
Oh ok, Ill move to a find-exec construct then.
(I think you can generally assume that long options will not work by default, actually. Neither busybox nor BSD utilities typically seem to implement them.)
TIL, thanks!
As a followup of this, I removed the configure.ac stuff related to DUPATH and DUFLAGS. I'm not sure if we'd want to add XARGSPATH or so. I opted to not do that just yet.
We do not need this; the only reason du is configurable rather than relying on the PATH, is because people had wrapper programs that pretended to be du, but were broken: https://bugs.archlinux.org/task/19932
Aha, noted!
No one tries to colorize the output of find -exec or of xargs, I hope...
Lol I hope so too. Let me follow up with a v2 using find -exec cat {} \;... Thanks! -Santiago.
On 3/7/19 10:18 PM, Santiago Torres-Arias wrote:
On Thu, Mar 07, 2019 at 10:07:12PM -0500, Eli Schwartz wrote:
On 3/7/19 9:36 PM, Santiago Torres wrote:
This patchset is a WIP that tries to address FS#61717[1].
This is my first patch for pacman, so I may be missing a couple of the heuristics of proper pacman develoment. Namely, I'm worried about the use of xargs (I went down this road because I wanted to have the minimal set of changes). I'm not sure what're the heuristics for what I can assume (e.g., can findutils be assumed to exist?).
We explicitly use find -exec elsewhere, so that should be fine.
xargs --null is a GNU-ism and does not work on supported targets: busybox xargs, and BSD xargs. Both support -0, but it is anyways a better idea to simply stick with POSIX-defined find -exec ... {} +
Oh ok, Ill move to a find-exec construct then.
(I think you can generally assume that long options will not work by default, actually. Neither busybox nor BSD utilities typically seem to implement them.)
TIL, thanks!
As a followup of this, I removed the configure.ac stuff related to DUPATH and DUFLAGS. I'm not sure if we'd want to add XARGSPATH or so. I opted to not do that just yet.
We do not need this; the only reason du is configurable rather than relying on the PATH, is because people had wrapper programs that pretended to be du, but were broken: https://bugs.archlinux.org/task/19932
Aha, noted!
No one tries to colorize the output of find -exec or of xargs, I hope...
Lol I hope so too. Let me follow up with a v2 using find -exec cat {} \;...
find . -type f -exec cat {} + Please use the + format, not \; as the former will be able to accept many filenames at once until it reaches the maximum length of a command line (and cat supports this mode), while \; will fork a new cat command for each file. This is functionally comparable to xargs, which defaults to being like find -exec {} +, but when using xargs -L 1, acts like find -exec {} \; -- Eli Schwartz Bug Wrangler and Trusted User
Makepkg used to use du --apparent-size to compute the size of the
package. Unfortunately, this would result in different sizes depending
on the filesystem used (e.g., btrfs vs ext4), which would affect
reproducible builds. Use a wc-based approach to compute sizes
Signed-off-by: Santiago Torres
Since DUFLAGS and DUPATH are not needed anymore remove them from the
configuration script
Signed-off-by: Santiago Torres
On 12/3/19 11:18 am, Santiago Torres wrote:
Since DUFLAGS and DUPATH are not needed anymore remove them from the configuration script
Signed-off-by: Santiago Torres
---
These variables had references throughout other build files. I have removed them and expanded your patch. Allan
Makepkg used to use du --apparent-size to compute the size of the
package. Unfortunately, this would result in different sizes depending
on the filesystem used (e.g., btrfs vs ext4), which would affect
reproducible builds. Use a wc-based approach to compute sizes
Signed-off-by: Santiago Torres
participants (4)
-
Allan McRae
-
Eli Schwartz
-
Santiago Torres
-
Santiago Torres-Arias