* [Buildroot] [PATCH 1/4] package/uutils-coreutils: new package
@ 2023-03-14 12:15 Sebastian Weyer
2023-03-14 12:15 ` [Buildroot] [PATCH 2/4] package/busybox: add uutils-coreutils as optional dependency Sebastian Weyer
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Sebastian Weyer @ 2023-03-14 12:15 UTC (permalink / raw)
To: buildroot; +Cc: Sebastian Weyer, Thomas Petazzoni, Sebastian Weyer
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 5331 bytes --]
This package is an implementation of coreutils written completely in rust.
Signed-off-by: Sebastian Weyer <sebastian.weyer@smile.fr>
---
The installation (creating the symlinks pointing to the main binary) is done
using the project's Makefile. A patch was added to remove the build dependency
of the install step in said Makefile. Since install is always called after
build, this avoids the install step rebuilding the application.
Signed-off-by: Sebastian Weyer <sebastian.weyer@smile.fr>
---
DEVELOPERS | 3 ++
package/Config.in | 1 +
...ve-dependency-on-build-during-instal.patch | 29 +++++++++++++++++++
package/uutils-coreutils/Config.in | 9 ++++++
.../uutils-coreutils/uutils-coreutils.hash | 2 ++
package/uutils-coreutils/uutils-coreutils.mk | 23 +++++++++++++++
6 files changed, 67 insertions(+)
create mode 100644 package/uutils-coreutils/0001-GNUMakefile-remove-dependency-on-build-during-instal.patch
create mode 100644 package/uutils-coreutils/Config.in
create mode 100644 package/uutils-coreutils/uutils-coreutils.hash
create mode 100644 package/uutils-coreutils/uutils-coreutils.mk
diff --git a/DEVELOPERS b/DEVELOPERS
index b49491da7a..14661f7944 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2580,6 +2580,9 @@ F: support/misc/toolchainfile.cmake.in
N: Sam Voss <sam.voss@gmail.com>
F: package/ripgrep/
+N: Sebastian Weyer <sebatian.weyer@smile.fr>
+F: package/uutils-coreutils
+
N: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
F: package/mmc-utils/
F: package/python-flask-jsonrpc/
diff --git a/package/Config.in b/package/Config.in
index 0f8dab3e71..79bbe0b44d 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2725,6 +2725,7 @@ menu "System tools"
source "package/tpm2-totp/Config.in"
source "package/unscd/Config.in"
source "package/util-linux/Config.in"
+ source "package/uutils-coreutils/Config.in"
source "package/watchdog/Config.in"
source "package/watchdogd/Config.in"
source "package/xdg-dbus-proxy/Config.in"
diff --git a/package/uutils-coreutils/0001-GNUMakefile-remove-dependency-on-build-during-instal.patch b/package/uutils-coreutils/0001-GNUMakefile-remove-dependency-on-build-during-instal.patch
new file mode 100644
index 0000000000..0540d9becb
--- /dev/null
+++ b/package/uutils-coreutils/0001-GNUMakefile-remove-dependency-on-build-during-instal.patch
@@ -0,0 +1,29 @@
+From cbec6b8ee3c4418f8f04760678ec655f05e79220 Mon Sep 17 00:00:00 2001
+From: Sebastian Weyer <sebastian.weyer@smile.fr>
+Date: Fri, 10 Mar 2023 10:52:00 +0100
+Subject: [PATCH] GNUMakefile: remove dependency on build during install
+
+When we call install we already built the application so we don't want
+to have to rebuild
+
+Signed-off-by: Sebastian Weyer <sebastian.weyer@smile.fr>
+---
+ GNUmakefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/GNUmakefile b/GNUmakefile
+index 81b90d32f..6b97a4879 100644
+--- a/GNUmakefile
++++ b/GNUmakefile
+@@ -334,7 +334,7 @@ clean:
+ distclean: clean
+ $(CARGO) clean $(CARGOFLAGS) && $(CARGO) update $(CARGOFLAGS)
+
+-install: build
++install:
+ mkdir -p $(INSTALLDIR_BIN)
+ ifeq (${MULTICALL}, y)
+ $(INSTALL) $(BUILDDIR)/coreutils $(INSTALLDIR_BIN)/$(PROG_PREFIX)coreutils
+--
+2.25.1
+
diff --git a/package/uutils-coreutils/Config.in b/package/uutils-coreutils/Config.in
new file mode 100644
index 0000000000..76ce5b174d
--- /dev/null
+++ b/package/uutils-coreutils/Config.in
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_UUTILS_COREUTILS
+ bool "uutils-coreutils"
+ depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
+ depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
+ help
+ uutils is an attempt at writing universal (as in
+ cross-platform) CLI utilities in Rust. While all programs have
+ been implemented, some options might be missing or different
+ behavior might be experienced.
diff --git a/package/uutils-coreutils/uutils-coreutils.hash b/package/uutils-coreutils/uutils-coreutils.hash
new file mode 100644
index 0000000000..b4855222fd
--- /dev/null
+++ b/package/uutils-coreutils/uutils-coreutils.hash
@@ -0,0 +1,2 @@
+#Locally generated
+sha256 5bc773bcbc66851aa17979df44224c66c0b5323044c3c9cefb925b44ee9cd81b uutils-coreutils-0.0.17.tar.gz
diff --git a/package/uutils-coreutils/uutils-coreutils.mk b/package/uutils-coreutils/uutils-coreutils.mk
new file mode 100644
index 0000000000..37a647a1f0
--- /dev/null
+++ b/package/uutils-coreutils/uutils-coreutils.mk
@@ -0,0 +1,23 @@
+################################################################################
+#
+# uutils-coreutils
+#
+################################################################################
+
+UUTILS_COREUTILS_VERSION = 0.0.17
+UUTILS_COREUTILS_SITE = $(call github,uutils,coreutils,$(UUTILS_COREUTILS_VERSION))
+UUTILS_COREUTILS_LICENSE = MIT
+UUTILS_COREUTILS_LICENSE_FILES = LICENSE
+
+UUTILS_COREUTILS_BUILD_OPTS = PROFILE=release MULTICALL=y PREFIX=$(TARGET_DIR)
+UUTILS_COREUTILS_INSTALL_OPTS = $(UUTILS_COREUTILS_BUILD_OPTS) install
+
+define UUTILS_COREUTILS_BUILD_CMDS
+ $(TARGET_CONFIGURE_OPTS) $(MAKE) $(UUTILS_COREUTILS_BUILD_OPTS) -C $(@D)
+endef
+
+define UUTILS_COREUTILS_INSTALL_TARGET_CMDS
+ $(TARGET_ENV) $(MAKE) $(UUTILS_COREUTILS_INSTALL_OPTS) -C $(@D)
+endef
+
+$(eval $(generic-package))
--
2.25.1
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH 2/4] package/busybox: add uutils-coreutils as optional dependency
2023-03-14 12:15 [Buildroot] [PATCH 1/4] package/uutils-coreutils: new package Sebastian Weyer
@ 2023-03-14 12:15 ` Sebastian Weyer
2023-03-14 12:15 ` [Buildroot] [PATCH 3/4] package/coreutils: rename package Sebastian Weyer
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: Sebastian Weyer @ 2023-03-14 12:15 UTC (permalink / raw)
To: buildroot; +Cc: Sebastian Weyer
This optional dependency is necessary so that when uutils-coreutils is
selected, it will be built before busybox. Then busybox will see the
symlinks that are already placed in target/bin and will not recreate
them (noclobber).
Signed-off-by: Sebastian Weyer <sebastian.weyer@smile.fr>
---
package/busybox/busybox.mk | 1 +
1 file changed, 1 insertion(+)
diff --git a/package/busybox/busybox.mk b/package/busybox/busybox.mk
index 1633ca525d..d8000ddbb4 100644
--- a/package/busybox/busybox.mk
+++ b/package/busybox/busybox.mk
@@ -68,6 +68,7 @@ BUSYBOX_DEPENDENCIES = \
$(if $(BR2_PACKAGE_UNZIP),unzip) \
$(if $(BR2_PACKAGE_USBUTILS),usbutils) \
$(if $(BR2_PACKAGE_UTIL_LINUX),util-linux) \
+ $(if $(BR2_PACKAGE_UUTILS_COREUTILS),uutils-coreutils) \
$(if $(BR2_PACKAGE_VIM),vim) \
$(if $(BR2_PACKAGE_WATCHDOG),watchdog) \
$(if $(BR2_PACKAGE_WGET),wget) \
--
2.25.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH 3/4] package/coreutils: rename package
2023-03-14 12:15 [Buildroot] [PATCH 1/4] package/uutils-coreutils: new package Sebastian Weyer
2023-03-14 12:15 ` [Buildroot] [PATCH 2/4] package/busybox: add uutils-coreutils as optional dependency Sebastian Weyer
@ 2023-03-14 12:15 ` Sebastian Weyer
2023-03-14 12:47 ` Thomas Petazzoni via buildroot
2023-03-14 12:15 ` [Buildroot] [PATCH 4/4] package/coreutils: new virtual package Sebastian Weyer
2023-03-14 12:40 ` [Buildroot] [PATCH 1/4] package/uutils-coreutils: new package Thomas Petazzoni via buildroot
3 siblings, 1 reply; 8+ messages in thread
From: Sebastian Weyer @ 2023-03-14 12:15 UTC (permalink / raw)
To: buildroot; +Cc: Sebastian Weyer, Julien Olivain, Thomas De Schampheleire
In preparation for the addition of a virtual package providing the
coreutils functionality, the package package/coreutils has been renamed
to package/coreutils.
Signed-off-by: Sebastian Weyer <sebastian.weyer@smile.fr>
---
package/Config.in | 2 +-
package/busybox/busybox.mk | 2 +-
package/e2fsprogs/Config.in | 4 +-
package/glslsandbox-player/Config.in | 2 +-
.../{coreutils => gnu-coreutils}/Config.in | 8 +-
.../gnu-coreutils.hash} | 0
.../gnu-coreutils.mk} | 84 +++++++++----------
package/opkg-utils/Config.in | 2 +-
8 files changed, 52 insertions(+), 52 deletions(-)
rename package/{coreutils => gnu-coreutils}/Config.in (88%)
rename package/{coreutils/coreutils.hash => gnu-coreutils/gnu-coreutils.hash} (100%)
rename package/{coreutils/coreutils.mk => gnu-coreutils/gnu-coreutils.mk} (62%)
diff --git a/package/Config.in b/package/Config.in
index 79bbe0b44d..6a0c3fd049 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2634,7 +2634,6 @@ menu "System tools"
source "package/cgroupfs-mount/Config.in"
source "package/circus/Config.in"
source "package/containerd/Config.in"
- source "package/coreutils/Config.in"
source "package/cpulimit/Config.in"
source "package/cpuload/Config.in"
source "package/crun/Config.in"
@@ -2655,6 +2654,7 @@ menu "System tools"
source "package/ftop/Config.in"
source "package/getent/Config.in"
source "package/gkrellm/Config.in"
+ source "package/gnu-coreutils/Config.in"
source "package/htop/Config.in"
source "package/ibm-sw-tpm2/Config.in"
source "package/initscripts/Config.in"
diff --git a/package/busybox/busybox.mk b/package/busybox/busybox.mk
index d8000ddbb4..00c1e9695f 100644
--- a/package/busybox/busybox.mk
+++ b/package/busybox/busybox.mk
@@ -27,7 +27,7 @@ BUSYBOX_DEPENDENCIES = \
$(if $(BR2_PACKAGE_BASH),bash) \
$(if $(BR2_PACKAGE_BC),bc) \
$(if $(BR2_PACKAGE_BINUTILS),binutils) \
- $(if $(BR2_PACKAGE_COREUTILS),coreutils) \
+ $(if $(BR2_PACKAGE_GNU_COREUTILS),gnu-coreutils) \
$(if $(BR2_PACKAGE_CPIO),cpio) \
$(if $(BR2_PACKAGE_DCRON),dcron) \
$(if $(BR2_PACKAGE_DEBIANUTILS),debianutils) \
diff --git a/package/e2fsprogs/Config.in b/package/e2fsprogs/Config.in
index 23c4ef30b3..945e147769 100644
--- a/package/e2fsprogs/Config.in
+++ b/package/e2fsprogs/Config.in
@@ -34,14 +34,14 @@ config BR2_PACKAGE_E2FSPROGS_E2IMAGE
config BR2_PACKAGE_E2FSPROGS_E2SCRUB
bool "e2scrub"
depends on BR2_PACKAGE_BASH # runtime
- depends on BR2_PACKAGE_COREUTILS # runtime
+ depends on BR2_PACKAGE_GNU_COREUTILS # runtime
depends on BR2_PACKAGE_LVM2 # runtime
depends on BR2_PACKAGE_UTIL_LINUX # runtime
help
Check the contents of a mounted ext[234] filesystem
comment "e2scrub needs bash, coreutils, lvm2, and util-linux"
- depends on !BR2_PACKAGE_BASH || !BR2_PACKAGE_COREUTILS \
+ depends on !BR2_PACKAGE_BASH || !BR2_PACKAGE_GNU_COREUTILS \
|| !BR2_PACKAGE_LVM2 || !BR2_PACKAGE_UTIL_LINUX
config BR2_PACKAGE_E2FSPROGS_E4DEFRAG
diff --git a/package/glslsandbox-player/Config.in b/package/glslsandbox-player/Config.in
index 530c158fc3..4bbec9b53a 100644
--- a/package/glslsandbox-player/Config.in
+++ b/package/glslsandbox-player/Config.in
@@ -36,7 +36,7 @@ config BR2_PACKAGE_GLSLSANDBOX_PLAYER_SCRIPTS
depends on BR2_USE_WCHAR # python3
select BR2_PACKAGE_BASH # runtime
select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS if BR2_PACKAGE_BUSYBOX # bash
- select BR2_PACKAGE_COREUTILS # runtime (timeout)
+ select BR2_PACKAGE_GNU_COREUTILS # runtime (timeout)
select BR2_PACKAGE_LIBCURL_CURL # runtime
select BR2_PACKAGE_IMAGEMAGICK # runtime
select BR2_PACKAGE_JPEG # runtime
diff --git a/package/coreutils/Config.in b/package/gnu-coreutils/Config.in
similarity index 88%
rename from package/coreutils/Config.in
rename to package/gnu-coreutils/Config.in
index 705013bae0..9a15c0ee8b 100644
--- a/package/coreutils/Config.in
+++ b/package/gnu-coreutils/Config.in
@@ -1,5 +1,5 @@
-config BR2_PACKAGE_COREUTILS
- bool "coreutils"
+config BR2_PACKAGE_GNU_COREUTILS
+ bool "gnu-coreutils"
depends on BR2_USE_WCHAR
depends on BR2_USE_MMU # fork()
depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
@@ -15,9 +15,9 @@ config BR2_PACKAGE_COREUTILS
http://www.gnu.org/software/coreutils/
-if BR2_PACKAGE_COREUTILS
+if BR2_PACKAGE_GNU_COREUTILS
-config BR2_PACKAGE_COREUTILS_INDIVIDUAL_BINARIES
+config BR2_PACKAGE_GNU_COREUTILS_INDIVIDUAL_BINARIES
bool "Individual binaries"
depends on !BR2_STATIC_LIBS
help
diff --git a/package/coreutils/coreutils.hash b/package/gnu-coreutils/gnu-coreutils.hash
similarity index 100%
rename from package/coreutils/coreutils.hash
rename to package/gnu-coreutils/gnu-coreutils.hash
diff --git a/package/coreutils/coreutils.mk b/package/gnu-coreutils/gnu-coreutils.mk
similarity index 62%
rename from package/coreutils/coreutils.mk
rename to package/gnu-coreutils/gnu-coreutils.mk
index 931859b0ac..3373021cf5 100644
--- a/package/coreutils/coreutils.mk
+++ b/package/gnu-coreutils/gnu-coreutils.mk
@@ -1,26 +1,26 @@
################################################################################
#
-# coreutils
+# gnu-coreutils
#
################################################################################
-COREUTILS_VERSION = 9.1
-COREUTILS_SITE = $(BR2_GNU_MIRROR)/coreutils
-COREUTILS_SOURCE = coreutils-$(COREUTILS_VERSION).tar.xz
-COREUTILS_LICENSE = GPL-3.0+
-COREUTILS_LICENSE_FILES = COPYING
-COREUTILS_CPE_ID_VENDOR = gnu
+GNU_COREUTILS_VERSION = 9.1
+GNU_COREUTILS_SITE = $(BR2_GNU_MIRROR)/coreutils
+GNU_COREUTILS_SOURCE = coreutils-$(GNU_COREUTILS_VERSION).tar.xz
+GNU_COREUTILS_LICENSE = GPL-3.0+
+GNU_COREUTILS_LICENSE_FILES = COPYING
+GNU_COREUTILS_CPE_ID_VENDOR = gnu
-COREUTILS_CONF_OPTS = --disable-rpath \
+GNU_COREUTILS_CONF_OPTS = --disable-rpath \
$(if $(BR2_TOOLCHAIN_USES_MUSL),--with-included-regex)
-ifeq ($(BR2_PACKAGE_COREUTILS_INDIVIDUAL_BINARIES),y)
-COREUTILS_CONF_OPTS += --disable-single-binary
+ifeq ($(BR2_PACKAGE_GNU_COREUTILS_INDIVIDUAL_BINARIES),y)
+GNU_COREUTILS_CONF_OPTS += --disable-single-binary
else
-COREUTILS_CONF_OPTS += --enable-single-binary=symlinks
+GNU_COREUTILS_CONF_OPTS += --enable-single-binary=symlinks
endif
-COREUTILS_CONF_ENV = ac_cv_c_restrict=no \
+GNU_COREUTILS_CONF_ENV = ac_cv_c_restrict=no \
ac_cv_func_chown_works=yes \
ac_cv_func_euidaccess=no \
ac_cv_func_fstatat=yes \
@@ -58,51 +58,51 @@ COREUTILS_CONF_ENV = ac_cv_c_restrict=no \
MAKEINFO=true \
INSTALL_PROGRAM=$(INSTALL)
-COREUTILS_BIN_PROGS = base64 cat chgrp chmod chown cp date dd df dir echo false \
+GNU_COREUTILS_BIN_PROGS = base64 cat chgrp chmod chown cp date dd df dir echo false \
kill link ln ls mkdir mknod mktemp mv nice printenv pwd rm rmdir \
vdir sleep stty sync touch true uname join
ifeq ($(BR2_PACKAGE_ACL),y)
-COREUTILS_DEPENDENCIES += acl
+GNU_COREUTILS_DEPENDENCIES += acl
else
-COREUTILS_CONF_OPTS += --disable-acl
+GNU_COREUTILS_CONF_OPTS += --disable-acl
endif
ifeq ($(BR2_PACKAGE_ATTR),y)
-COREUTILS_DEPENDENCIES += attr
+GNU_COREUTILS_DEPENDENCIES += attr
else
-COREUTILS_CONF_OPTS += --disable-xattr
+GNU_COREUTILS_CONF_OPTS += --disable-xattr
endif
-COREUTILS_DEPENDENCIES += $(TARGET_NLS_DEPENDENCIES)
+GNU_COREUTILS_DEPENDENCIES += $(TARGET_NLS_DEPENDENCIES)
# It otherwise fails to link properly, not mandatory though
ifeq ($(BR2_PACKAGE_GETTEXT_PROVIDES_LIBINTL),y)
-COREUTILS_CONF_OPTS += --with-libintl-prefix=$(STAGING_DIR)/usr
+GNU_COREUTILS_CONF_OPTS += --with-libintl-prefix=$(STAGING_DIR)/usr
endif
ifeq ($(BR2_PACKAGE_GMP),y)
-COREUTILS_DEPENDENCIES += gmp
+GNU_COREUTILS_DEPENDENCIES += gmp
else
-COREUTILS_CONF_OPTS += --without-gmp
+GNU_COREUTILS_CONF_OPTS += --without-gmp
endif
ifeq ($(BR2_PACKAGE_LIBCAP),y)
-COREUTILS_DEPENDENCIES += libcap
+GNU_COREUTILS_DEPENDENCIES += libcap
else
-COREUTILS_CONF_OPTS += --disable-libcap
+GNU_COREUTILS_CONF_OPTS += --disable-libcap
endif
ifeq ($(BR2_PACKAGE_LIBSELINUX),y)
-COREUTILS_DEPENDENCIES += libselinux
-COREUTILS_CONF_OPTS += --with-selinux
+GNU_COREUTILS_DEPENDENCIES += libselinux
+GNU_COREUTILS_CONF_OPTS += --with-selinux
else
-COREUTILS_CONF_OPTS += --without-selinux
+GNU_COREUTILS_CONF_OPTS += --without-selinux
endif
ifeq ($(BR2_PACKAGE_OPENSSL),y)
-COREUTILS_CONF_OPTS += --with-openssl=yes
-COREUTILS_DEPENDENCIES += openssl
+GNU_COREUTILS_CONF_OPTS += --with-openssl=yes
+GNU_COREUTILS_DEPENDENCIES += openssl
endif
ifeq ($(BR2_ROOTFS_MERGED_USR),)
@@ -110,53 +110,53 @@ ifeq ($(BR2_ROOTFS_MERGED_USR),)
# coreutils being built as multi-call binary, we do so by re-creating
# the corresponding symlinks. If coreutils is built with individual
# binaries, we actually move the binaries.
-ifeq ($(BR2_PACKAGE_COREUTILS_INDIVIDUAL_BINARIES),y)
-define COREUTILS_FIX_BIN_LOCATION
- $(foreach f,$(COREUTILS_BIN_PROGS), \
+ifeq ($(BR2_PACKAGE_GNU_COREUTILS_INDIVIDUAL_BINARIES),y)
+define GNU_COREUTILS_FIX_BIN_LOCATION
+ $(foreach f,$(GNU_COREUTILS_BIN_PROGS), \
mv $(TARGET_DIR)/usr/bin/$(f) $(TARGET_DIR)/bin
)
endef
else
-define COREUTILS_FIX_BIN_LOCATION
+define GNU_COREUTILS_FIX_BIN_LOCATION
# some things go in /bin rather than /usr/bin
- $(foreach f,$(COREUTILS_BIN_PROGS), \
+ $(foreach f,$(GNU_COREUTILS_BIN_PROGS), \
rm -f $(TARGET_DIR)/usr/bin/$(f) && \
ln -sf ../usr/bin/coreutils $(TARGET_DIR)/bin/$(f)
)
endef
endif
-COREUTILS_POST_INSTALL_TARGET_HOOKS += COREUTILS_FIX_BIN_LOCATION
+GNU_COREUTILS_POST_INSTALL_TARGET_HOOKS += GNU_COREUTILS_FIX_BIN_LOCATION
endif
ifeq ($(BR2_STATIC_LIBS),y)
-COREUTILS_CONF_OPTS += --enable-no-install-program=stdbuf
+GNU_COREUTILS_CONF_OPTS += --enable-no-install-program=stdbuf
endif
# link for archaic shells
-define COREUTILS_CREATE_TEST_SYMLINK
+define GNU_COREUTILS_CREATE_TEST_SYMLINK
ln -fs test $(TARGET_DIR)/usr/bin/[
endef
-COREUTILS_POST_INSTALL_TARGET_HOOKS += COREUTILS_CREATE_TEST_SYMLINK
+GNU_COREUTILS_POST_INSTALL_TARGET_HOOKS += GNU_COREUTILS_CREATE_TEST_SYMLINK
# gnu thinks chroot is in bin, debian thinks it's in sbin
-ifeq ($(BR2_PACKAGE_COREUTILS_INDIVIDUAL_BINARIES),y)
-define COREUTILS_FIX_CHROOT_LOCATION
+ifeq ($(BR2_PACKAGE_GNU_COREUTILS_INDIVIDUAL_BINARIES),y)
+define GNU_COREUTILS_FIX_CHROOT_LOCATION
mv $(TARGET_DIR)/usr/bin/chroot $(TARGET_DIR)/usr/sbin
endef
else
-define COREUTILS_FIX_CHROOT_LOCATION
+define GNU_COREUTILS_FIX_CHROOT_LOCATION
rm -f $(TARGET_DIR)/usr/bin/chroot
ln -sf ../bin/coreutils $(TARGET_DIR)/usr/sbin/chroot
endef
endif
-COREUTILS_POST_INSTALL_TARGET_HOOKS += COREUTILS_FIX_CHROOT_LOCATION
+GNU_COREUTILS_POST_INSTALL_TARGET_HOOKS += GNU_COREUTILS_FIX_CHROOT_LOCATION
# Explicitly install ln and realpath, which we *are* insterested in.
# A lot of other programs still get installed, however, but disabling
# them does not gain much at build time, and is a loooong list that is
# difficult to maintain... Just avoid overwriting fakedate when creating
# a reproducible build
-HOST_COREUTILS_CONF_OPTS = \
+HOST_GNU_COREUTILS_CONF_OPTS = \
--disable-acl \
--disable-libcap \
--disable-rpath \
diff --git a/package/opkg-utils/Config.in b/package/opkg-utils/Config.in
index 2973055baf..c93afb32ed 100644
--- a/package/opkg-utils/Config.in
+++ b/package/opkg-utils/Config.in
@@ -7,7 +7,7 @@ config BR2_PACKAGE_OPKG_UTILS
depends on !BR2_STATIC_LIBS # python3
select BR2_PACKAGE_BINUTILS if !BR2_PACKAGE_BUSYBOX # runtime
select BR2_PACKAGE_BINUTILS_TARGET if !BR2_PACKAGE_BUSYBOX # runtime
- select BR2_PACKAGE_COREUTILS if !BR2_PACKAGE_BUSYBOX # runtime
+ select BR2_PACKAGE_GNU_COREUTILS if !BR2_PACKAGE_BUSYBOX # runtime
select BR2_PACKAGE_DIFFUTILS if !BR2_PACKAGE_BUSYBOX # runtime
select BR2_PACKAGE_FINDUTILS if !BR2_PACKAGE_BUSYBOX # runtime
select BR2_PACKAGE_GREP if !BR2_PACKAGE_BUSYBOX # runtime
--
2.25.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH 4/4] package/coreutils: new virtual package
2023-03-14 12:15 [Buildroot] [PATCH 1/4] package/uutils-coreutils: new package Sebastian Weyer
2023-03-14 12:15 ` [Buildroot] [PATCH 2/4] package/busybox: add uutils-coreutils as optional dependency Sebastian Weyer
2023-03-14 12:15 ` [Buildroot] [PATCH 3/4] package/coreutils: rename package Sebastian Weyer
@ 2023-03-14 12:15 ` Sebastian Weyer
2023-03-14 12:40 ` [Buildroot] [PATCH 1/4] package/uutils-coreutils: new package Thomas Petazzoni via buildroot
3 siblings, 0 replies; 8+ messages in thread
From: Sebastian Weyer @ 2023-03-14 12:15 UTC (permalink / raw)
To: buildroot; +Cc: Sebastian Weyer, Sebastian Weyer
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 6561 bytes --]
This virtual package provides the coreutils functionality which is
provided by the classical gnu implementation of the coreutils
package/gnu-coreutils as well as the more recent rust implementation
package/uutils-coreutils. When the user selects coreutils they will be
presented with a choice between the gnu and the rust implementation. The
gnu implementation will be selected by default.
Signed-off-by: Sebastian Weyer <sebastian.weyer@smile.fr>
---
DEVELOPERS | 1 +
package/Config.in | 3 +--
package/coreutils/Config.in | 24 ++++++++++++++++++++
package/coreutils/coreutils.mk | 7 ++++++
package/gnu-coreutils/Config.in | 8 +++++--
package/gnu-coreutils/gnu-coreutils.mk | 2 ++
package/uutils-coreutils/Config.in | 10 +++++++-
package/uutils-coreutils/uutils-coreutils.mk | 2 ++
8 files changed, 52 insertions(+), 5 deletions(-)
create mode 100644 package/coreutils/Config.in
create mode 100644 package/coreutils/coreutils.mk
diff --git a/DEVELOPERS b/DEVELOPERS
index 14661f7944..f86dcaa420 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2581,6 +2581,7 @@ N: Sam Voss <sam.voss@gmail.com>
F: package/ripgrep/
N: Sebastian Weyer <sebatian.weyer@smile.fr>
+F: package/coreutils
F: package/uutils-coreutils
N: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
diff --git a/package/Config.in b/package/Config.in
index 6a0c3fd049..0f8dab3e71 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2634,6 +2634,7 @@ menu "System tools"
source "package/cgroupfs-mount/Config.in"
source "package/circus/Config.in"
source "package/containerd/Config.in"
+ source "package/coreutils/Config.in"
source "package/cpulimit/Config.in"
source "package/cpuload/Config.in"
source "package/crun/Config.in"
@@ -2654,7 +2655,6 @@ menu "System tools"
source "package/ftop/Config.in"
source "package/getent/Config.in"
source "package/gkrellm/Config.in"
- source "package/gnu-coreutils/Config.in"
source "package/htop/Config.in"
source "package/ibm-sw-tpm2/Config.in"
source "package/initscripts/Config.in"
@@ -2725,7 +2725,6 @@ menu "System tools"
source "package/tpm2-totp/Config.in"
source "package/unscd/Config.in"
source "package/util-linux/Config.in"
- source "package/uutils-coreutils/Config.in"
source "package/watchdog/Config.in"
source "package/watchdogd/Config.in"
source "package/xdg-dbus-proxy/Config.in"
diff --git a/package/coreutils/Config.in b/package/coreutils/Config.in
new file mode 100644
index 0000000000..a5bfc016ac
--- /dev/null
+++ b/package/coreutils/Config.in
@@ -0,0 +1,24 @@
+config BR2_PACKAGE_HAS_COREUTILS
+ bool
+
+config BR2_PACKAGE_PROVIDES_COREUTILS
+ string
+ depends on BR2_PACKAGE_HAS_COREUTILS
+
+menuconfig BR2_PACKAGE_COREUTILS
+ bool "coreutils"
+ depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
+ help
+ Enable coreutils on the target. Either standard GNU-coreutils
+ or its rust implementation: uutils-coreutils.
+
+if BR2_PACKAGE_COREUTILS
+
+choice
+ prompt "Coreutils Type"
+
+source "package/gnu-coreutils/Config.in"
+source "package/uutils-coreutils/Config.in"
+endchoice
+
+endif
diff --git a/package/coreutils/coreutils.mk b/package/coreutils/coreutils.mk
new file mode 100644
index 0000000000..e5585afb61
--- /dev/null
+++ b/package/coreutils/coreutils.mk
@@ -0,0 +1,7 @@
+################################################################################
+#
+# coreutils
+#
+################################################################################
+
+$(eval $(virtual-package))
diff --git a/package/gnu-coreutils/Config.in b/package/gnu-coreutils/Config.in
index 9a15c0ee8b..60731b8266 100644
--- a/package/gnu-coreutils/Config.in
+++ b/package/gnu-coreutils/Config.in
@@ -2,7 +2,8 @@ config BR2_PACKAGE_GNU_COREUTILS
bool "gnu-coreutils"
depends on BR2_USE_WCHAR
depends on BR2_USE_MMU # fork()
- depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
+ depends on BR2_PACKAGE_COREUTILS
+ select BR2_PACKAGE_HAS_COREUTILS
help
All of the basic file/text/shell utilities. These are the
core utilities which are expected to exist on every system.
@@ -17,6 +18,9 @@ config BR2_PACKAGE_GNU_COREUTILS
if BR2_PACKAGE_GNU_COREUTILS
+config BR2_PACKAGE_PROVIDES_COREUTILS
+ default "gnu-coreutils"
+
config BR2_PACKAGE_GNU_COREUTILS_INDIVIDUAL_BINARIES
bool "Individual binaries"
depends on !BR2_STATIC_LIBS
@@ -36,4 +40,4 @@ endif
comment "coreutils needs a toolchain w/ wchar"
depends on BR2_USE_MMU
depends on !BR2_USE_WCHAR
- depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
+ depends on BR2_PACKAGE_COREUTILS
diff --git a/package/gnu-coreutils/gnu-coreutils.mk b/package/gnu-coreutils/gnu-coreutils.mk
index 3373021cf5..402cd3f023 100644
--- a/package/gnu-coreutils/gnu-coreutils.mk
+++ b/package/gnu-coreutils/gnu-coreutils.mk
@@ -11,6 +11,8 @@ GNU_COREUTILS_LICENSE = GPL-3.0+
GNU_COREUTILS_LICENSE_FILES = COPYING
GNU_COREUTILS_CPE_ID_VENDOR = gnu
+GNU_COREUTILS_PROVIDES = coreutils
+
GNU_COREUTILS_CONF_OPTS = --disable-rpath \
$(if $(BR2_TOOLCHAIN_USES_MUSL),--with-included-regex)
diff --git a/package/uutils-coreutils/Config.in b/package/uutils-coreutils/Config.in
index 76ce5b174d..5a75c36e61 100644
--- a/package/uutils-coreutils/Config.in
+++ b/package/uutils-coreutils/Config.in
@@ -1,9 +1,17 @@
config BR2_PACKAGE_UUTILS_COREUTILS
bool "uutils-coreutils"
depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
- depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
+ depends on BR2_PACKAGE_COREUTILS
+ select BR2_PACKAGE_HAS_COREUTILS
help
uutils is an attempt at writing universal (as in
cross-platform) CLI utilities in Rust. While all programs have
been implemented, some options might be missing or different
behavior might be experienced.
+
+if BR2_PACKAGE_UUTILS_COREUTILS
+
+config BR2_PACKAGE_PROVIDES_COREUTILS
+ default "uutils-coreutils"
+
+endif
diff --git a/package/uutils-coreutils/uutils-coreutils.mk b/package/uutils-coreutils/uutils-coreutils.mk
index 37a647a1f0..f7b688e42b 100644
--- a/package/uutils-coreutils/uutils-coreutils.mk
+++ b/package/uutils-coreutils/uutils-coreutils.mk
@@ -12,6 +12,8 @@ UUTILS_COREUTILS_LICENSE_FILES = LICENSE
UUTILS_COREUTILS_BUILD_OPTS = PROFILE=release MULTICALL=y PREFIX=$(TARGET_DIR)
UUTILS_COREUTILS_INSTALL_OPTS = $(UUTILS_COREUTILS_BUILD_OPTS) install
+UUTILS_COREUTILS_PROVIDES = coreutils
+
define UUTILS_COREUTILS_BUILD_CMDS
$(TARGET_CONFIGURE_OPTS) $(MAKE) $(UUTILS_COREUTILS_BUILD_OPTS) -C $(@D)
endef
--
2.25.1
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Buildroot] [PATCH 1/4] package/uutils-coreutils: new package
2023-03-14 12:15 [Buildroot] [PATCH 1/4] package/uutils-coreutils: new package Sebastian Weyer
` (2 preceding siblings ...)
2023-03-14 12:15 ` [Buildroot] [PATCH 4/4] package/coreutils: new virtual package Sebastian Weyer
@ 2023-03-14 12:40 ` Thomas Petazzoni via buildroot
2023-03-15 9:15 ` Sebastian WEYER
3 siblings, 1 reply; 8+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-03-14 12:40 UTC (permalink / raw)
To: Sebastian Weyer; +Cc: Sebastian Weyer, buildroot
Hello,
On Tue, 14 Mar 2023 13:15:03 +0100
Sebastian Weyer <sebastian.weyer@smile.fr> wrote:
> This package is an implementation of coreutils written completely in rust.
>
> Signed-off-by: Sebastian Weyer <sebastian.weyer@smile.fr>
Thanks for working on this!
> diff --git a/package/uutils-coreutils/0001-GNUMakefile-remove-dependency-on-build-during-instal.patch b/package/uutils-coreutils/0001-GNUMakefile-remove-dependency-on-build-during-instal.patch
> new file mode 100644
> index 0000000000..0540d9becb
> --- /dev/null
> +++ b/package/uutils-coreutils/0001-GNUMakefile-remove-dependency-on-build-during-instal.patch
> @@ -0,0 +1,29 @@
> +From cbec6b8ee3c4418f8f04760678ec655f05e79220 Mon Sep 17 00:00:00 2001
> +From: Sebastian Weyer <sebastian.weyer@smile.fr>
> +Date: Fri, 10 Mar 2023 10:52:00 +0100
> +Subject: [PATCH] GNUMakefile: remove dependency on build during install
> +
> +When we call install we already built the application so we don't want
> +to have to rebuild
> +
> +Signed-off-by: Sebastian Weyer <sebastian.weyer@smile.fr>
It would be good to add the upstream status of this patch here. Was it
sent upstream? If so, a link?
> diff --git a/package/uutils-coreutils/Config.in b/package/uutils-coreutils/Config.in
> new file mode 100644
> index 0000000000..76ce5b174d
> --- /dev/null
> +++ b/package/uutils-coreutils/Config.in
> @@ -0,0 +1,9 @@
> +config BR2_PACKAGE_UUTILS_COREUTILS
> + bool "uutils-coreutils"
> + depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
> + depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
> + help
> + uutils is an attempt at writing universal (as in
> + cross-platform) CLI utilities in Rust. While all programs have
> + been implemented, some options might be missing or different
> + behavior might be experienced.
We like to have a blank line followed by the URL of the project
homepage, at the end of the Config.in help text.
> diff --git a/package/uutils-coreutils/uutils-coreutils.hash b/package/uutils-coreutils/uutils-coreutils.hash
> new file mode 100644
> index 0000000000..b4855222fd
> --- /dev/null
> +++ b/package/uutils-coreutils/uutils-coreutils.hash
> @@ -0,0 +1,2 @@
> +#Locally generated
Nit: space after #
> +sha256 5bc773bcbc66851aa17979df44224c66c0b5323044c3c9cefb925b44ee9cd81b uutils-coreutils-0.0.17.tar.gz
We also need a hash for the license file.
> diff --git a/package/uutils-coreutils/uutils-coreutils.mk b/package/uutils-coreutils/uutils-coreutils.mk
> new file mode 100644
> index 0000000000..37a647a1f0
> --- /dev/null
> +++ b/package/uutils-coreutils/uutils-coreutils.mk
> @@ -0,0 +1,23 @@
> +################################################################################
> +#
> +# uutils-coreutils
> +#
> +################################################################################
> +
> +UUTILS_COREUTILS_VERSION = 0.0.17
> +UUTILS_COREUTILS_SITE = $(call github,uutils,coreutils,$(UUTILS_COREUTILS_VERSION))
> +UUTILS_COREUTILS_LICENSE = MIT
> +UUTILS_COREUTILS_LICENSE_FILES = LICENSE
There is no dependency on host-rustc ? How can the rust compiler be
available prior to building this package then ?
> +UUTILS_COREUTILS_BUILD_OPTS = PROFILE=release MULTICALL=y PREFIX=$(TARGET_DIR)
> +UUTILS_COREUTILS_INSTALL_OPTS = $(UUTILS_COREUTILS_BUILD_OPTS) install
Is PREFIX= needed at build time ?
> +
> +define UUTILS_COREUTILS_BUILD_CMDS
> + $(TARGET_CONFIGURE_OPTS) $(MAKE) $(UUTILS_COREUTILS_BUILD_OPTS) -C $(@D)
> +endef
> +
> +define UUTILS_COREUTILS_INSTALL_TARGET_CMDS
> + $(TARGET_ENV) $(MAKE) $(UUTILS_COREUTILS_INSTALL_OPTS) -C $(@D)
I think we will prefer to not have BUILD_OPTS/INSTALL_OPTS but instead:
UUTILS_COREUTILS_MAKE_OPTS = \
PROFILE=release \
MULTICALL=y
define UUTILS_COREUTILS_BUILD_CMDS
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) \
$(UUTILS_COREUTILS_MAKE_OPTS) -C $(@D)
endef
define UUTILS_COREUTILS_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE) \
$(UUTILS_COREUTILS_MAKE_OPTS) -C $(@D) \
PREFIX=$(TARGET_DIR) install
endef
(assuming PREFIX= is only needed at install time)
It does the same, but the above suggestion is a bit more idiomatic in
Buildroot.
Best regards,
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Buildroot] [PATCH 3/4] package/coreutils: rename package
2023-03-14 12:15 ` [Buildroot] [PATCH 3/4] package/coreutils: rename package Sebastian Weyer
@ 2023-03-14 12:47 ` Thomas Petazzoni via buildroot
2023-03-15 10:48 ` Sebastian WEYER
0 siblings, 1 reply; 8+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-03-14 12:47 UTC (permalink / raw)
To: Sebastian Weyer
Cc: Julien Olivain, buildroot, Yann E. MORIN, Thomas De Schampheleire
Hello Sebastian,
On Tue, 14 Mar 2023 13:15:05 +0100
Sebastian Weyer <sebastian.weyer@smile.fr> wrote:
> In preparation for the addition of a virtual package providing the
> coreutils functionality, the package package/coreutils has been renamed
> to package/coreutils.
>
> Signed-off-by: Sebastian Weyer <sebastian.weyer@smile.fr>
As it is proposed, this patch will break existing configurations that
have BR2_PACKAGE_COREUTILS=y enabled, as the option is being renamed.
A solution to that would be to substitute package/coreutils by a
virtual package *and* rename package/coreutils into
package/gnu-coreutils in the same patch.
However, I'd like to challenge the need of turning package/coreutils
into a virtual package in the first place. Virtual packages are very
useful for libraries that have multiple implementations, but also a
large number of users: OpenGL libraries, zlib, openssl, jpeg, etc.
Coreutils has almost no reverse dependencies in Buildroot:
package/e2fsprogs/Config.in: depends on BR2_PACKAGE_COREUTILS # runtime
package/e2fsprogs/Config.in: depends on !BR2_PACKAGE_BASH || !BR2_PACKAGE_COREUTILS \
package/glslsandbox-player/Config.in: select BR2_PACKAGE_COREUTILS # runtime (timeout)
package/opkg-utils/Config.in: select BR2_PACKAGE_COREUTILS if !BR2_PACKAGE_BUSYBOX # runt
So I really don't think a virtual package is needed. We can handle the
two coreutils implementation manually in the very few places where it
is needed, and perhaps where it does matter for people.
Virtual packages are not "free" in terms of complexity and code churn.
In addition, I am almost sure that uutils-coreutils is not a 100%
drop-in replacement for coreutils. Most likely there are a few tools
that are missing, or a few options that are not supported, or differ in
behavior. And virtual packages for which the different implementations
are not strictly compatible generally cause quite a lot of pain (see
the mess around libopenssl vs. libressl for example).
What do you think?
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Buildroot] [PATCH 1/4] package/uutils-coreutils: new package
2023-03-14 12:40 ` [Buildroot] [PATCH 1/4] package/uutils-coreutils: new package Thomas Petazzoni via buildroot
@ 2023-03-15 9:15 ` Sebastian WEYER
0 siblings, 0 replies; 8+ messages in thread
From: Sebastian WEYER @ 2023-03-15 9:15 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: Sebastian Weyer, buildroot
Hello Thomas,
> It would be good to add the upstream status of this patch here. Was it
> sent upstream? If so, a link?
I created the patch myself. Since I removed a dependency in the project's
Makefile, I assume it would be hard to upstream and rejected by the maintainers.
> We like to have a blank line followed by the URL of the project
> homepage, at the end of the Config.in help text.
Alright
> Nit: space after #
Done. Wouldn't it be good to have check-package pick that up in that case?
> We also need a hash for the license file.
I forgot about that
> There is no dependency on host-rustc ? How can the rust compiler be
> available prior to building this package then ?
You're correct. Initially I created it as a cargo-package and therefore the
host-rustc dependency was implicit. When changing it to a generic-package I
forgot to add it again.
> Is PREFIX= needed at build time ?
It isn't, I should've put more thought into that. I changed it to how you
suggested it now.
Best regards,
Sebastian
On 14/03/2023 13:40, Thomas Petazzoni wrote:
> Hello,
>
> On Tue, 14 Mar 2023 13:15:03 +0100
> Sebastian Weyer <sebastian.weyer@smile.fr> wrote:
>
>> This package is an implementation of coreutils written completely in rust.
>>
>> Signed-off-by: Sebastian Weyer <sebastian.weyer@smile.fr>
>
> Thanks for working on this!
>
>
>> diff --git a/package/uutils-coreutils/0001-GNUMakefile-remove-dependency-on-build-during-instal.patch b/package/uutils-coreutils/0001-GNUMakefile-remove-dependency-on-build-during-instal.patch
>> new file mode 100644
>> index 0000000000..0540d9becb
>> --- /dev/null
>> +++ b/package/uutils-coreutils/0001-GNUMakefile-remove-dependency-on-build-during-instal.patch
>> @@ -0,0 +1,29 @@
>> +From cbec6b8ee3c4418f8f04760678ec655f05e79220 Mon Sep 17 00:00:00 2001
>> +From: Sebastian Weyer <sebastian.weyer@smile.fr>
>> +Date: Fri, 10 Mar 2023 10:52:00 +0100
>> +Subject: [PATCH] GNUMakefile: remove dependency on build during install
>> +
>> +When we call install we already built the application so we don't want
>> +to have to rebuild
>> +
>> +Signed-off-by: Sebastian Weyer <sebastian.weyer@smile.fr>
>
> It would be good to add the upstream status of this patch here. Was it
> sent upstream? If so, a link?
>
>
>> diff --git a/package/uutils-coreutils/Config.in b/package/uutils-coreutils/Config.in
>> new file mode 100644
>> index 0000000000..76ce5b174d
>> --- /dev/null
>> +++ b/package/uutils-coreutils/Config.in
>> @@ -0,0 +1,9 @@
>> +config BR2_PACKAGE_UUTILS_COREUTILS
>> + bool "uutils-coreutils"
>> + depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
>> + depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
>> + help
>> + uutils is an attempt at writing universal (as in
>> + cross-platform) CLI utilities in Rust. While all programs have
>> + been implemented, some options might be missing or different
>> + behavior might be experienced.
>
> We like to have a blank line followed by the URL of the project
> homepage, at the end of the Config.in help text.
>
>> diff --git a/package/uutils-coreutils/uutils-coreutils.hash b/package/uutils-coreutils/uutils-coreutils.hash
>> new file mode 100644
>> index 0000000000..b4855222fd
>> --- /dev/null
>> +++ b/package/uutils-coreutils/uutils-coreutils.hash
>> @@ -0,0 +1,2 @@
>> +#Locally generated
>
> Nit: space after #
>
>> +sha256 5bc773bcbc66851aa17979df44224c66c0b5323044c3c9cefb925b44ee9cd81b uutils-coreutils-0.0.17.tar.gz
>
> We also need a hash for the license file.
>
>> diff --git a/package/uutils-coreutils/uutils-coreutils.mk b/package/uutils-coreutils/uutils-coreutils.mk
>> new file mode 100644
>> index 0000000000..37a647a1f0
>> --- /dev/null
>> +++ b/package/uutils-coreutils/uutils-coreutils.mk
>> @@ -0,0 +1,23 @@
>> +################################################################################
>> +#
>> +# uutils-coreutils
>> +#
>> +################################################################################
>> +
>> +UUTILS_COREUTILS_VERSION = 0.0.17
>> +UUTILS_COREUTILS_SITE = $(call github,uutils,coreutils,$(UUTILS_COREUTILS_VERSION))
>> +UUTILS_COREUTILS_LICENSE = MIT
>> +UUTILS_COREUTILS_LICENSE_FILES = LICENSE
>
> There is no dependency on host-rustc ? How can the rust compiler be
> available prior to building this package then ?
>
>> +UUTILS_COREUTILS_BUILD_OPTS = PROFILE=release MULTICALL=y PREFIX=$(TARGET_DIR)
>> +UUTILS_COREUTILS_INSTALL_OPTS = $(UUTILS_COREUTILS_BUILD_OPTS) install
>
> Is PREFIX= needed at build time ?
>
>> +
>> +define UUTILS_COREUTILS_BUILD_CMDS
>> + $(TARGET_CONFIGURE_OPTS) $(MAKE) $(UUTILS_COREUTILS_BUILD_OPTS) -C $(@D)
>> +endef
>> +
>> +define UUTILS_COREUTILS_INSTALL_TARGET_CMDS
>> + $(TARGET_ENV) $(MAKE) $(UUTILS_COREUTILS_INSTALL_OPTS) -C $(@D)
>
> I think we will prefer to not have BUILD_OPTS/INSTALL_OPTS but instead:
>
> UUTILS_COREUTILS_MAKE_OPTS = \
> PROFILE=release \
> MULTICALL=y
>
> define UUTILS_COREUTILS_BUILD_CMDS
> $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) \
> $(UUTILS_COREUTILS_MAKE_OPTS) -C $(@D)
> endef
>
> define UUTILS_COREUTILS_INSTALL_TARGET_CMDS
> $(TARGET_MAKE_ENV) $(MAKE) \
> $(UUTILS_COREUTILS_MAKE_OPTS) -C $(@D) \
> PREFIX=$(TARGET_DIR) install
> endef
>
> (assuming PREFIX= is only needed at install time)
>
> It does the same, but the above suggestion is a bit more idiomatic in
> Buildroot.
>
> Best regards,
>
> Thomas
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Buildroot] [PATCH 3/4] package/coreutils: rename package
2023-03-14 12:47 ` Thomas Petazzoni via buildroot
@ 2023-03-15 10:48 ` Sebastian WEYER
0 siblings, 0 replies; 8+ messages in thread
From: Sebastian WEYER @ 2023-03-15 10:48 UTC (permalink / raw)
To: Thomas Petazzoni
Cc: Julien Olivain, buildroot, Yann E. MORIN, Thomas De Schampheleire
Hello Thomas,
> As it is proposed, this patch will break existing configurations that
> have BR2_PACKAGE_COREUTILS=y enabled, as the option is being renamed.
>
> A solution to that would be to substitute package/coreutils by a
> virtual package *and* rename package/coreutils into
> package/gnu-coreutils in the same patch.
It's actually what I did initially and then I pulled the two apart because the
commit was very cluttered. I then didn't think about the possible breaking of
existing configurations.
> So I really don't think a virtual package is needed. We can handle the
> two coreutils implementation manually in the very few places where it
> is needed, and perhaps where it does matter for people.
I agree that it is not necessarily needed and considering the few places where
it appears it is manageable manualy. I just thought it could be a nice way to
implement it. If it's not wanted for whatever reason I'll change it, no problem :).
> Virtual packages are not "free" in terms of complexity and code churn.
> In addition, I am almost sure that uutils-coreutils is not a 100%
> drop-in replacement for coreutils. Most likely there are a few tools
> that are missing, or a few options that are not supported, or differ in
> behavior. And virtual packages for which the different implementations
> are not strictly compatible generally cause quite a lot of pain (see
> the mess around libopenssl vs. libressl for example).
I did think about the problem of it not being a drop-in replacement that's why
for now I changed the dependencies of the concerned packages to the new name for
coreutils instead of depending on the virtual package.
Considering what you mentioned earlier, I guess the renaming of
BR2_PACKAGE_COREUTILS_INDIVIDUAL_BINARIES to
BR2_PACKAGE_GNU_COREUTILS_INDIVIDUAL_BINARIES would bring the same kind of
potential breaking of existing configurations so this will need to be handled too.
Best regards,
Sebastian
On 14/03/2023 13:47, Thomas Petazzoni wrote:
> Hello Sebastian,
>
> On Tue, 14 Mar 2023 13:15:05 +0100
> Sebastian Weyer <sebastian.weyer@smile.fr> wrote:
>
>> In preparation for the addition of a virtual package providing the
>> coreutils functionality, the package package/coreutils has been renamed
>> to package/coreutils.
>>
>> Signed-off-by: Sebastian Weyer <sebastian.weyer@smile.fr>
>
> As it is proposed, this patch will break existing configurations that
> have BR2_PACKAGE_COREUTILS=y enabled, as the option is being renamed.
>
> A solution to that would be to substitute package/coreutils by a
> virtual package *and* rename package/coreutils into
> package/gnu-coreutils in the same patch.
>
> However, I'd like to challenge the need of turning package/coreutils
> into a virtual package in the first place. Virtual packages are very
> useful for libraries that have multiple implementations, but also a
> large number of users: OpenGL libraries, zlib, openssl, jpeg, etc.
>
> Coreutils has almost no reverse dependencies in Buildroot:
>
> package/e2fsprogs/Config.in: depends on BR2_PACKAGE_COREUTILS # runtime
> package/e2fsprogs/Config.in: depends on !BR2_PACKAGE_BASH || !BR2_PACKAGE_COREUTILS \
> package/glslsandbox-player/Config.in: select BR2_PACKAGE_COREUTILS # runtime (timeout)
> package/opkg-utils/Config.in: select BR2_PACKAGE_COREUTILS if !BR2_PACKAGE_BUSYBOX # runt
>
> So I really don't think a virtual package is needed. We can handle the
> two coreutils implementation manually in the very few places where it
> is needed, and perhaps where it does matter for people.
>
> Virtual packages are not "free" in terms of complexity and code churn.
> In addition, I am almost sure that uutils-coreutils is not a 100%
> drop-in replacement for coreutils. Most likely there are a few tools
> that are missing, or a few options that are not supported, or differ in
> behavior. And virtual packages for which the different implementations
> are not strictly compatible generally cause quite a lot of pain (see
> the mess around libopenssl vs. libressl for example).
>
> What do you think?
>
> Thomas
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2023-03-15 10:48 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-14 12:15 [Buildroot] [PATCH 1/4] package/uutils-coreutils: new package Sebastian Weyer
2023-03-14 12:15 ` [Buildroot] [PATCH 2/4] package/busybox: add uutils-coreutils as optional dependency Sebastian Weyer
2023-03-14 12:15 ` [Buildroot] [PATCH 3/4] package/coreutils: rename package Sebastian Weyer
2023-03-14 12:47 ` Thomas Petazzoni via buildroot
2023-03-15 10:48 ` Sebastian WEYER
2023-03-14 12:15 ` [Buildroot] [PATCH 4/4] package/coreutils: new virtual package Sebastian Weyer
2023-03-14 12:40 ` [Buildroot] [PATCH 1/4] package/uutils-coreutils: new package Thomas Petazzoni via buildroot
2023-03-15 9:15 ` Sebastian WEYER
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).