All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v3 01/10] package/pkg-cargo.mk: Introduce the cargo package infrastructure.
@ 2020-02-20 16:01 Patrick Havelange
  2020-02-20 16:01 ` [Buildroot] [PATCH v3 02/10] docs/manual/cargo: Update manual for cargo packages Patrick Havelange
                   ` (9 more replies)
  0 siblings, 10 replies; 13+ messages in thread
From: Patrick Havelange @ 2020-02-20 16:01 UTC (permalink / raw)
  To: buildroot

In order to be package agnostic, the install phase is now using
cargo instead of install.
TARGET_CONFIGURE_OPTS is now also set when running cargo in order
to support cross compiling C code within cargo.

Signed-off-by: Patrick Havelange <patrick.havelange@essensium.com>

---
changes:
v2 -> v3 (Sam Voss)
 - set TARGET_CONFIGURE_OPTS when running cargo

This is the V3 of the previously posted series :
http://patchwork.ozlabs.org/project/buildroot/list/?series=156166&state=%2A&archive=both

A lot of changes following the buildroot developer meeting's
decisions from February 2020.

Needs to be applied on top of the rust 1.40 bump
---
 package/Makefile.in  |  1 +
 package/pkg-cargo.mk | 92 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 93 insertions(+)
 create mode 100644 package/pkg-cargo.mk

diff --git a/package/Makefile.in b/package/Makefile.in
index 285e2837ef..650d7c166e 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -426,3 +426,4 @@ include package/pkg-kernel-module.mk
 include package/pkg-waf.mk
 include package/pkg-golang.mk
 include package/pkg-meson.mk
+include package/pkg-cargo.mk
diff --git a/package/pkg-cargo.mk b/package/pkg-cargo.mk
new file mode 100644
index 0000000000..35f7c15ad9
--- /dev/null
+++ b/package/pkg-cargo.mk
@@ -0,0 +1,92 @@
+################################################################################
+# Cargo package infrastructure
+#
+# This file implements an infrastructure that eases development of package
+# .mk files for Cargo packages. It should be used for all packages that use
+# Cargo as their build system.
+#
+# See the Buildroot documentation for details on the usage of this
+# infrastructure
+#
+# In terms of implementation, this Cargo infrastructure requires the .mk file
+# to only specify metadata information about the package: name, version,
+# download URL, etc.
+#
+# We still allow the package .mk file to override what the different steps
+# are doing, if needed. For example, if <PKG>_BUILD_CMDS is already defined,
+# it is used as the list of commands to perform to build the package,
+# instead of the default Cargo behaviour. The package can also define some
+# post operation hooks.
+#
+################################################################################
+
+################################################################################
+# inner-cargo-package -- defines how the configuration, compilation and
+# installation of a cargo package should be done, implements a few hooks
+# to tune the build process for cargo specifities and calls the generic
+# package infrastructure to generate the necessary make targets
+#
+#  argument 1 is the lowercase package name
+#  argument 2 is the uppercase package name, including a HOST_ prefix
+#             for host packages
+#  argument 3 is the uppercase package name, without the HOST_ prefix
+#             for host packages
+#  argument 4 is the type (target or host)
+################################################################################
+
+define inner-cargo-package
+
+# We need host-rustc to run cargo
+$(2)_DEPENDENCIES += host-rustc
+
+$(2)_CARGO_ENV = \
+	CARGO_HOME=$(HOST_DIR)/share/cargo \
+	$(TARGET_CONFIGURE_OPTS)
+
+$(2)_CARGO_MODE = $(if $(BR2_ENABLE_DEBUG),debug,release)
+
+ifeq ($(4),target)
+    $(2)_CARGO_TARGET_OPT = --target $$(RUSTC_TARGET_NAME)
+endif
+
+#
+# Build step. Only define it if not already defined by the package .mk
+# file.
+#
+ifndef $(2)_BUILD_CMDS
+define $(2)_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $$($(2)_CARGO_ENV) \
+		cargo build \
+			--$$($(2)_CARGO_MODE) \
+			$$($(2)_CARGO_TARGET_OPT) \
+			--manifest-path $$(@D)/Cargo.toml
+endef
+endif
+
+#
+# Target installation step. Only define it if not already defined by
+# the package .mk file.
+#
+ifndef $(2)_INSTALL_TARGET_CMDS
+define $(2)_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $$($(2)_CARGO_ENV) \
+		cargo install \
+			--root $(TARGET_DIR)/usr/ \
+			--bins \
+			--path $$(@D) \
+			$$($(2)_CARGO_TARGET_OPT) \
+			--force
+endef
+endif
+
+# Call the generic package infrastructure to generate the necessary
+# make targets
+$(call inner-generic-package,$(1),$(2),$(3),$(4))
+
+endef
+
+################################################################################
+# cargo-package -- the target generator macro for Cargo packages
+################################################################################
+
+cargo-package = $(call inner-cargo-package,$(pkgname),$(call UPPERCASE,$(pkgname)),$(call UPPERCASE,$(pkgname)),target)
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v3 02/10] docs/manual/cargo: Update manual for cargo packages.
  2020-02-20 16:01 [Buildroot] [PATCH v3 01/10] package/pkg-cargo.mk: Introduce the cargo package infrastructure Patrick Havelange
@ 2020-02-20 16:01 ` Patrick Havelange
  2020-02-20 16:01 ` [Buildroot] [PATCH v3 03/10] package/ripgrep: convert to cargo infrastructure Patrick Havelange
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Patrick Havelange @ 2020-02-20 16:01 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Patrick Havelange <patrick.havelange@essensium.com>
---
 docs/manual/adding-packages-cargo.txt | 54 +++++----------------------
 1 file changed, 10 insertions(+), 44 deletions(-)

diff --git a/docs/manual/adding-packages-cargo.txt b/docs/manual/adding-packages-cargo.txt
index bb078b6981..9a496224e3 100644
--- a/docs/manual/adding-packages-cargo.txt
+++ b/docs/manual/adding-packages-cargo.txt
@@ -27,9 +27,9 @@ The +Config.in+ file of Cargo-based package 'foo' should contain:
 
 ==== Cargo-based package's +.mk+ file
 
-Buildroot does not (yet) provide a dedicated package infrastructure for
-Cargo-based packages. So, we will explain how to write a +.mk+ file for such a
-package. Let's start with an example:
+Buildroot provides a dedicated package infrastructure for Cargo-based packages.
+So, we will explain how to write a +.mk+ file for such a package. Let's start
+with an example:
 
 ------------------------------
 01: ################################################################################
@@ -44,53 +44,19 @@ package. Let's start with an example:
 10: FOO_LICENSE = GPL-3.0+
 11: FOO_LICENSE_FILES = COPYING
 12:
-13: FOO_DEPENDENCIES = host-rustc
-14:
-15: FOO_CARGO_ENV = CARGO_HOME=$(HOST_DIR)/share/cargo
-16: FOO_CARGO_MODE = $(if $(BR2_ENABLE_DEBUG),debug,release)
-17:
-18: FOO_BIN_DIR = target/$(RUSTC_TARGET_NAME)/$(FOO_CARGO_MODE)
-19:
-20: FOO_CARGO_OPTS = \
-21:   --$(FOO_CARGO_MODE) \
-22: 	--target=$(RUSTC_TARGET_NAME) \
-23: 	--manifest-path=$(@D)/Cargo.toml
-24:
-25: define FOO_BUILD_CMDS
-26: 	$(TARGET_MAKE_ENV) $(FOO_CARGO_ENV) \
-27: 		cargo build $(FOO_CARGO_OPTS)
-28: endef
-29:
-30: define FOO_INSTALL_TARGET_CMDS
-31: 	$(INSTALL) -D -m 0755 $(@D)/$(FOO_BIN_DIR)/foo \
-32: 		$(TARGET_DIR)/usr/bin/foo
-33: endef
-34:
-35: $(eval $(generic-package))
+13: $(eval $(cargo-package))
 --------------------------------
 
 The Makefile starts with the definition of the standard variables for package
 declaration (lines 7 to 11).
 
-As seen in line 35, it is based on the
-xref:generic-package-tutorial[+generic-package+ infrastructure]. So, it defines
-the variables required by this particular infrastructure, where Cargo is
-invoked:
+As seen in line 13, it is based on the cargo-package infrastructure. Cargo will
+be invoked automatically by this infrastructure. The required dependencies of the
+crate will be downloaded and the buildroot dependencies will also be set.
 
-* +FOO_BUILD_CMDS+: Cargo is invoked to perform the build. The options required
-  to configure the cross-compilation of the package are passed via
-  +FOO_CONF_OPTS+.
-
-* +FOO_INSTALL_TARGET_CMDS+: The binary executable generated is installed on
-  the target.
-
-In order to have Cargo available for the build, +FOO_DEPENDENCIES+ needs to
-contain +host-cargo+.
-
-To sum it up, to add a new Cargo-based package, the Makefile example can be
-copied verbatim then edited to replace all occurences of +FOO+ with the
-uppercase name of the new package and update the values of the standard
-variables.
+It is still possible to define custom build commands or install commands (i.e.
+with FOO_BUILD_CMDS and FOO_INSTALL_TARGET_CMDS).
+Those will then replace the commands from the cargo infrastructure.
 
 ==== About Dependencies Management
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v3 03/10] package/ripgrep: convert to cargo infrastructure
  2020-02-20 16:01 [Buildroot] [PATCH v3 01/10] package/pkg-cargo.mk: Introduce the cargo package infrastructure Patrick Havelange
  2020-02-20 16:01 ` [Buildroot] [PATCH v3 02/10] docs/manual/cargo: Update manual for cargo packages Patrick Havelange
@ 2020-02-20 16:01 ` Patrick Havelange
  2020-02-20 16:01 ` [Buildroot] [PATCH v3 04/10] support/download/dl-wrapper: rework backend parsing Patrick Havelange
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Patrick Havelange @ 2020-02-20 16:01 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Patrick Havelange <patrick.havelange@essensium.com>
---
 package/ripgrep/ripgrep.mk | 23 +----------------------
 1 file changed, 1 insertion(+), 22 deletions(-)

diff --git a/package/ripgrep/ripgrep.mk b/package/ripgrep/ripgrep.mk
index 832c076f26..97e9e2ce5f 100644
--- a/package/ripgrep/ripgrep.mk
+++ b/package/ripgrep/ripgrep.mk
@@ -9,25 +9,4 @@ RIPGREP_SITE = $(call github,burntsushi,ripgrep,$(RIPGREP_VERSION))
 RIPGREP_LICENSE = MIT
 RIPGREP_LICENSE_FILES = LICENSE-MIT
 
-RIPGREP_DEPENDENCIES = host-rustc
-RIPGREP_CARGO_ENV = CARGO_HOME=$(HOST_DIR)/share/cargo
-RIPGREP_CARGO_MODE = $(if $(BR2_ENABLE_DEBUG),debug,release)
-
-RIPGREP_BIN_DIR = target/$(RUSTC_TARGET_NAME)/$(RIPGREP_CARGO_MODE)
-
-RIPGREP_CARGO_OPTS = \
-	--$(RIPGREP_CARGO_MODE) \
-	--target=$(RUSTC_TARGET_NAME) \
-	--manifest-path=$(@D)/Cargo.toml
-
-define RIPGREP_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(RIPGREP_CARGO_ENV) \
-		cargo build $(RIPGREP_CARGO_OPTS)
-endef
-
-define RIPGREP_INSTALL_TARGET_CMDS
-	$(INSTALL) -D -m 0755 $(@D)/$(RIPGREP_BIN_DIR)/rg \
-		$(TARGET_DIR)/usr/bin/rg
-endef
-
-$(eval $(generic-package))
+$(eval $(cargo-package))
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v3 04/10] support/download/dl-wrapper: rework backend parsing
  2020-02-20 16:01 [Buildroot] [PATCH v3 01/10] package/pkg-cargo.mk: Introduce the cargo package infrastructure Patrick Havelange
  2020-02-20 16:01 ` [Buildroot] [PATCH v3 02/10] docs/manual/cargo: Update manual for cargo packages Patrick Havelange
  2020-02-20 16:01 ` [Buildroot] [PATCH v3 03/10] package/ripgrep: convert to cargo infrastructure Patrick Havelange
@ 2020-02-20 16:01 ` Patrick Havelange
  2020-02-20 16:01 ` [Buildroot] [PATCH v3 05/10] docs/manual/adding-packages-generic: update for new FOO_PKGMGR value Patrick Havelange
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Patrick Havelange @ 2020-02-20 16:01 UTC (permalink / raw)
  To: buildroot

The point of this modification is to be more generic in the way
the backends/options are parsed from the urls.
The '+' char serves as delimiter between the backends and the
actual url.
The '|' char serves as separator between the different
options or backends.
This will be useful later when more options or backends would be
needed.

pkg-generic.mk now passes the optional FOO_PKGMGR value in case a
package needs to use a second backend.

Signed-off-by: Patrick Havelange <patrick.havelange@essensium.com>
---
 package/pkg-generic.mk      |  2 +-
 support/download/dl-wrapper | 34 ++++++++++++++++++++++------------
 2 files changed, 23 insertions(+), 13 deletions(-)

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 268d999efb..a5038ebff4 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -541,7 +541,7 @@ ifndef $(2)_PATCH
 endif
 
 $(2)_ALL_DOWNLOADS = \
-	$$(if $$($(2)_SOURCE),$$($(2)_SITE_METHOD)+$$($(2)_SITE)/$$($(2)_SOURCE)) \
+	$$(if $$($(2)_SOURCE),$$($(2)_PKGMGR)$$($(2)_SITE_METHOD)+$$($(2)_SITE)/$$($(2)_SOURCE)) \
 	$$(foreach p,$$($(2)_PATCH) $$($(2)_EXTRA_DOWNLOADS),\
 		$$(if $$(findstring ://,$$(p)),$$(p),\
 			$$($(2)_SITE_METHOD)+$$($(2)_SITE)/$$(p)))
diff --git a/support/download/dl-wrapper b/support/download/dl-wrapper
index 3315bd410e..3f613bb622 100755
--- a/support/download/dl-wrapper
+++ b/support/download/dl-wrapper
@@ -21,8 +21,8 @@ export BR_BACKEND_DL_GETOPTS=":hc:d:o:n:N:H:ru:qf:e"
 
 main() {
     local OPT OPTARG
-    local backend output hfile recurse quiet rc
-    local -a uris
+    local backend backends_str output hfile recurse quiet rc backend2
+    local -a uris backends
 
     # Parse our options; anything after '--' is for the backend
     while getopts ":c:d:D:o:n:N:H:rf:u:q" OPT; do
@@ -85,18 +85,24 @@ main() {
     download_and_check=0
     rc=1
     for uri in "${uris[@]}"; do
-        backend_urlencode="${uri%%+*}"
-        backend="${backend_urlencode%|*}"
-        case "${backend}" in
-            git|svn|cvs|bzr|file|scp|hg) ;;
-            *) backend="wget" ;;
-        esac
+        urlencode=""
+        backend="wget"
+        backend2=""
+
+        # Extract the backends list, separated by '+' from the actual url
+        backends_str="${uri%%+*}"
+        # make an array out of it, backends are '|' separated
+        IFS='|' read -r -a backends <<< "${backends_str}"
+        # parse each of them, set flags and set the real backend
+        for b in "${backends[@]}" ; do
+            case "${b}" in
+                urlencode) urlencode="${b}" ;;
+                git|svn|cvs|bzr|file|scp|hg) backend="${b}" ;;
+                # insert here supported second backends) backend2="${b}" ;;
+            esac
+        done
         uri=${uri#*+}
 
-        urlencode=${backend_urlencode#*|}
-        # urlencode must be "urlencode"
-        [ "${urlencode}" != "urlencode" ] && urlencode=""
-
         # tmpd is a temporary directory in which backends may store
         # intermediate by-products of the download.
         # tmpf is the file in which the backends should put the downloaded
@@ -138,6 +144,10 @@ main() {
         # cd back to free the temp-dir, so we can remove it later
         cd "${OLDPWD}"
 
+        if [ -n "${backend2}" ] ; then
+	    support/download/${backend2} "${tmpf}" "${tmpd}" "${old_dl_dir}"
+        fi
+
         # Check if the downloaded file is sane, and matches the stored hashes
         # for that file
         if support/download/check-hash ${quiet} "${hfile}" "${tmpf}" "${output##*/}"; then
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v3 05/10] docs/manual/adding-packages-generic: update for new FOO_PKGMGR value
  2020-02-20 16:01 [Buildroot] [PATCH v3 01/10] package/pkg-cargo.mk: Introduce the cargo package infrastructure Patrick Havelange
                   ` (2 preceding siblings ...)
  2020-02-20 16:01 ` [Buildroot] [PATCH v3 04/10] support/download/dl-wrapper: rework backend parsing Patrick Havelange
@ 2020-02-20 16:01 ` Patrick Havelange
  2020-02-20 16:01 ` [Buildroot] [PATCH v3 06/10] package/pkg-cargo.mk: Introduce the cargo dl backend Patrick Havelange
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Patrick Havelange @ 2020-02-20 16:01 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Patrick Havelange <patrick.havelange@essensium.com>
---
 docs/manual/adding-packages-generic.txt | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/docs/manual/adding-packages-generic.txt b/docs/manual/adding-packages-generic.txt
index baa052e31c..7fd58ed9a7 100644
--- a/docs/manual/adding-packages-generic.txt
+++ b/docs/manual/adding-packages-generic.txt
@@ -265,6 +265,13 @@ not and can not work as people would expect it should:
     +LIBFOO_SITE=/opt/software/libfoo.tar.gz+ +
     +LIBFOO_SITE=$(TOPDIR)/../src/libfoo+
 
+* +LIBFOO_PKGMGR+ may contain the name of the second backend used
+  to complete the sources tarball. This second backend is called after
+  the first archive has been generated (e.g. git) or simply downloaded
+  (wget). It can be useful in the case where some other files are
+  needed for the build and require to be downloaded by a specific tool.
+  The value of this variable must end with a '|' (serves as a separator).
+
 * +LIBFOO_DL_OPTS+ is a space-separated list of additional options to
   pass to the downloader. Useful for retrieving documents with
   server-side checking for user logins and passwords, or to use a proxy.
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v3 06/10] package/pkg-cargo.mk: Introduce the cargo dl backend
  2020-02-20 16:01 [Buildroot] [PATCH v3 01/10] package/pkg-cargo.mk: Introduce the cargo package infrastructure Patrick Havelange
                   ` (3 preceding siblings ...)
  2020-02-20 16:01 ` [Buildroot] [PATCH v3 05/10] docs/manual/adding-packages-generic: update for new FOO_PKGMGR value Patrick Havelange
@ 2020-02-20 16:01 ` Patrick Havelange
  2020-08-26 19:22   ` Thomas Petazzoni
  2020-02-20 16:01 ` [Buildroot] [PATCH v3 07/10] docs/manual/adding-packages-cargo: update doc for new infra Patrick Havelange
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 13+ messages in thread
From: Patrick Havelange @ 2020-02-20 16:01 UTC (permalink / raw)
  To: buildroot

Cargo is now a fully supported PKGMGR, automatically set for any
package using the cargo infrastructure.
This effectively splits the download phase and the build phase.

The cargo backend will set CARGO_HOME inside DL_DIR during download.
The cached files in CARGO_HOME permits to download only once the
crates index and each dependencies.
During download phase, it will call cargo vendor to copy the
dependencies inside the VENDOR directory inside the source archive.

A local cargo config is also inserted inside the archive in order
to use the VENDOR dir during the build phase.
The build phase is forced to not query the online repository anymore
and thus will be using the vendored dependencies from the tarball.
This also permits to have offline builds.

Signed-off-by: Patrick Havelange <patrick.havelange@essensium.com>
---
 package/pkg-cargo.mk         | 10 ++++--
 package/ripgrep/ripgrep.hash |  2 +-
 support/download/cargo       | 65 ++++++++++++++++++++++++++++++++++++
 support/download/dl-wrapper  |  2 +-
 4 files changed, 75 insertions(+), 4 deletions(-)
 create mode 100755 support/download/cargo

diff --git a/package/pkg-cargo.mk b/package/pkg-cargo.mk
index 35f7c15ad9..c084f7b35e 100644
--- a/package/pkg-cargo.mk
+++ b/package/pkg-cargo.mk
@@ -39,6 +39,8 @@ define inner-cargo-package
 # We need host-rustc to run cargo
 $(2)_DEPENDENCIES += host-rustc
 
+$(2)_PKGMGR = cargo\|
+
 $(2)_CARGO_ENV = \
 	CARGO_HOME=$(HOST_DIR)/share/cargo \
 	$(TARGET_CONFIGURE_OPTS)
@@ -55,11 +57,13 @@ endif
 #
 ifndef $(2)_BUILD_CMDS
 define $(2)_BUILD_CMDS
+	cd $$(@D) && \
 	$(TARGET_MAKE_ENV) $$($(2)_CARGO_ENV) \
 		cargo build \
 			--$$($(2)_CARGO_MODE) \
 			$$($(2)_CARGO_TARGET_OPT) \
-			--manifest-path $$(@D)/Cargo.toml
+			--manifest-path Cargo.toml \
+			--offline
 endef
 endif
 
@@ -69,12 +73,14 @@ endif
 #
 ifndef $(2)_INSTALL_TARGET_CMDS
 define $(2)_INSTALL_TARGET_CMDS
+	cd $$(@D) && \
 	$(TARGET_MAKE_ENV) $$($(2)_CARGO_ENV) \
 		cargo install \
 			--root $(TARGET_DIR)/usr/ \
 			--bins \
-			--path $$(@D) \
+			--path ./ \
 			$$($(2)_CARGO_TARGET_OPT) \
+			--offline \
 			--force
 endef
 endif
diff --git a/package/ripgrep/ripgrep.hash b/package/ripgrep/ripgrep.hash
index 0841c0185c..8c48458cd8 100644
--- a/package/ripgrep/ripgrep.hash
+++ b/package/ripgrep/ripgrep.hash
@@ -1,3 +1,3 @@
 # Locally calculated
-sha256 7035379fce0c1e32552e8ee528b92c3d01b8d3935ea31d26c51a73287be74bb3 ripgrep-0.8.1.tar.gz
+sha256 cb895cff182740c219fefbbaaf903e60f005a4ac4688cac1e43e5fbbbccc5a94 ripgrep-0.8.1.tar.gz
 sha256 0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f LICENSE-MIT
diff --git a/support/download/cargo b/support/download/cargo
new file mode 100755
index 0000000000..0ce94cf16b
--- /dev/null
+++ b/support/download/cargo
@@ -0,0 +1,65 @@
+#!/usr/bin/env bash
+
+# We want to catch any unexpected failure, and exit immediately
+set -e
+
+# Download helper for cargo package. It will populate the VENDOR directory
+# inside the archive with the dependencies of the package
+#
+# Arguments are in this order:
+# $1 mandatory fullpath to an already downloaded source file of a cargo package
+# $2 mandatory fullpath to a temp dir
+# $3 mandatory fullpath to the DL_DIR
+#
+# Environment:
+# cargo in PATH
+
+tmpd=""
+
+do_clean() {
+    if [ -n "${tmpd}" ]; then
+        rm -rf "${tmpd}"
+    fi
+}
+
+trap do_clean EXIT
+
+if [ $# -le 2 ] ; then
+    echo 'Need at least 3 arguments' >&2
+    exit 1
+fi;
+
+tmpd="$(mktemp -d -p "$2")"
+cd "${tmpd}"
+
+tar xf "${1}"
+cd ./*/
+echo "Running cargo vendor."
+CARGO_HOME="${3}"/cargo_home cargo vendor -q --locked VENDOR
+# Create the local .cargo/config with vendor info
+mkdir -p .cargo/
+cat <<EOF >.cargo/config
+[source.crates-io]
+replace-with = "vendored-sources"
+
+[source.vendored-sources]
+directory = "VENDOR"
+EOF
+
+cd ..
+
+# Generate the archive, sort with the C locale so that it is reproducible.
+find "$(basename "$OLDPWD")" -not -type d -print0 >files.list
+LC_ALL=C sort -z <files.list >files.list.sorted
+# let's use a fixed hardcoded date to be reproducible
+date="2020-02-06 01:02:03"
+
+# Create GNU-format tarballs, since that's the format of the tarballs on
+# sources.buildroot.org and used in the *.hash files
+echo "Creating final archive."
+tar cf new.tar --null --verbatim-files-from --numeric-owner --format=gnu \
+    --owner=0 --group=0 --mtime="${date}" -T files.list.sorted
+gzip -6 -n <new.tar >new.tar.gz
+mv "${1}" "${1}".old
+mv new.tar.gz "${1}"
+rm "${1}".old
diff --git a/support/download/dl-wrapper b/support/download/dl-wrapper
index 3f613bb622..5e52b3e60f 100755
--- a/support/download/dl-wrapper
+++ b/support/download/dl-wrapper
@@ -98,7 +98,7 @@ main() {
             case "${b}" in
                 urlencode) urlencode="${b}" ;;
                 git|svn|cvs|bzr|file|scp|hg) backend="${b}" ;;
-                # insert here supported second backends) backend2="${b}" ;;
+                cargo) backend2="${b}" ;;
             esac
         done
         uri=${uri#*+}
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v3 07/10] docs/manual/adding-packages-cargo: update doc for new infra
  2020-02-20 16:01 [Buildroot] [PATCH v3 01/10] package/pkg-cargo.mk: Introduce the cargo package infrastructure Patrick Havelange
                   ` (4 preceding siblings ...)
  2020-02-20 16:01 ` [Buildroot] [PATCH v3 06/10] package/pkg-cargo.mk: Introduce the cargo dl backend Patrick Havelange
@ 2020-02-20 16:01 ` Patrick Havelange
  2020-02-20 16:01 ` [Buildroot] [PATCH v3 08/10] package/ripgrep: bump to version 11.0.1 Patrick Havelange
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Patrick Havelange @ 2020-02-20 16:01 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Patrick Havelange <patrick.havelange@essensium.com>
---
 docs/manual/adding-packages-cargo.txt | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/docs/manual/adding-packages-cargo.txt b/docs/manual/adding-packages-cargo.txt
index 9a496224e3..e7d03eb7b5 100644
--- a/docs/manual/adding-packages-cargo.txt
+++ b/docs/manual/adding-packages-cargo.txt
@@ -61,16 +61,8 @@ Those will then replace the commands from the cargo infrastructure.
 ==== About Dependencies Management
 
 A crate can depend on other libraries from crates.io or git repositories, listed
-in its Cargo.toml file. Before starting a build, Cargo usually downloads
-automatically them. This step can also be performed independently, via the
-+cargo fetch+ command.
+in its Cargo.toml file. Before starting a build, the +cargo vendor+ command
+will be run and will take care of downloading those dependencies.
 
-Cargo maintains a local cache of the registry index and of git checkouts of the
-crates, whose location is given by +$CARGO_HOME+. As seen in the package
-Makefile example at line 15, this environment variable is set to
-+$(HOST_DIR)/share/cargo+.
-
-This dependency download mechanism is not convenient when performing an offline
-build, as Cargo will fail to fetch the dependencies. In that case, it is advised
-to generate a tarball of the dependencies using the +cargo vendor+ and add it to
-+FOO_EXTRA_DOWNLOADS+.
+The final source tarball will contain all the required dependencies, effectively
+permitting us to do an offline build.
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v3 08/10] package/ripgrep: bump to version 11.0.1
  2020-02-20 16:01 [Buildroot] [PATCH v3 01/10] package/pkg-cargo.mk: Introduce the cargo package infrastructure Patrick Havelange
                   ` (5 preceding siblings ...)
  2020-02-20 16:01 ` [Buildroot] [PATCH v3 07/10] docs/manual/adding-packages-cargo: update doc for new infra Patrick Havelange
@ 2020-02-20 16:01 ` Patrick Havelange
  2020-02-20 16:01 ` [Buildroot] [PATCH v3 09/10] package/ripgrep: add legal-info for dependencies Patrick Havelange
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Patrick Havelange @ 2020-02-20 16:01 UTC (permalink / raw)
  To: buildroot

This bump is needed because the old cached archive of the
tarball of ripgrep is still using the old format and can't
be used anymore (as the expected content of the final archive has
changed with the recent infrastructure changes for cargo packages).

Signed-off-by: Patrick Havelange <patrick.havelange@essensium.com>
---
 package/ripgrep/ripgrep.hash | 2 +-
 package/ripgrep/ripgrep.mk   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/ripgrep/ripgrep.hash b/package/ripgrep/ripgrep.hash
index 8c48458cd8..1e70cbae5a 100644
--- a/package/ripgrep/ripgrep.hash
+++ b/package/ripgrep/ripgrep.hash
@@ -1,3 +1,3 @@
 # Locally calculated
-sha256 cb895cff182740c219fefbbaaf903e60f005a4ac4688cac1e43e5fbbbccc5a94 ripgrep-0.8.1.tar.gz
+sha256 c02fe3077c95872175b098d002f872a619195436569a7dff443bbb605bc27474 ripgrep-11.0.1.tar.gz
 sha256 0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f LICENSE-MIT
diff --git a/package/ripgrep/ripgrep.mk b/package/ripgrep/ripgrep.mk
index 97e9e2ce5f..1023b4bad8 100644
--- a/package/ripgrep/ripgrep.mk
+++ b/package/ripgrep/ripgrep.mk
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-RIPGREP_VERSION = 0.8.1
+RIPGREP_VERSION = 11.0.1
 RIPGREP_SITE = $(call github,burntsushi,ripgrep,$(RIPGREP_VERSION))
 RIPGREP_LICENSE = MIT
 RIPGREP_LICENSE_FILES = LICENSE-MIT
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v3 09/10] package/ripgrep: add legal-info for dependencies
  2020-02-20 16:01 [Buildroot] [PATCH v3 01/10] package/pkg-cargo.mk: Introduce the cargo package infrastructure Patrick Havelange
                   ` (6 preceding siblings ...)
  2020-02-20 16:01 ` [Buildroot] [PATCH v3 08/10] package/ripgrep: bump to version 11.0.1 Patrick Havelange
@ 2020-02-20 16:01 ` Patrick Havelange
  2020-08-26 19:26   ` Thomas Petazzoni
  2020-02-20 16:01 ` [Buildroot] [PATCH v3 10/10] docs/manual/adding-packages-cargo: Update for legal-info Patrick Havelange
  2020-04-29 13:53 ` [Buildroot] [PATCH v3 01/10] package/pkg-cargo.mk: Introduce the cargo package infrastructure Romain Naour
  9 siblings, 1 reply; 13+ messages in thread
From: Patrick Havelange @ 2020-02-20 16:01 UTC (permalink / raw)
  To: buildroot

As the dependencies are now vendored in the tarball, we can
extract them easily. Added a helper script to list them.
Updated the .hash & .mk files with those new licenses.

Signed-off-by: Patrick Havelange <patrick.havelange@essensium.com>
---
 package/ripgrep/find_vendor_licenses.sh |   6 +
 package/ripgrep/ripgrep.hash            | 167 +++++++++++++++++++++++
 package/ripgrep/ripgrep.mk              |   4 +-
 package/ripgrep/vendor.inc              | 169 ++++++++++++++++++++++++
 4 files changed, 345 insertions(+), 1 deletion(-)
 create mode 100755 package/ripgrep/find_vendor_licenses.sh
 create mode 100644 package/ripgrep/vendor.inc

diff --git a/package/ripgrep/find_vendor_licenses.sh b/package/ripgrep/find_vendor_licenses.sh
new file mode 100755
index 0000000000..fd8638e399
--- /dev/null
+++ b/package/ripgrep/find_vendor_licenses.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+# to run from the extracted final sources
+find VENDOR/ -type f \
+    \( -iname '*license*' -o -iname 'licence*' -o -iname 'copying*' -o -iname 'copyright*' \) \
+    -a -not -name '*.a' | \
+    sort
diff --git a/package/ripgrep/ripgrep.hash b/package/ripgrep/ripgrep.hash
index 1e70cbae5a..cad9fdc865 100644
--- a/package/ripgrep/ripgrep.hash
+++ b/package/ripgrep/ripgrep.hash
@@ -1,3 +1,170 @@
 # Locally calculated
 sha256 c02fe3077c95872175b098d002f872a619195436569a7dff443bbb605bc27474 ripgrep-11.0.1.tar.gz
 sha256 0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f LICENSE-MIT
+# Locally calculated with:
+# for i in $(find_vendor_licenses.sh) ; do echo -n "sha256 " ; sha256sum $i ; done | sort --key=3
+sha256 01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f  VENDOR/aho-corasick/COPYING
+sha256 0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f  VENDOR/aho-corasick/LICENSE-MIT
+sha256 7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c  VENDOR/aho-corasick/UNLICENSE
+sha256 f3f8d32084848316048c5a1e125a3c5003eb32145a5f5f2a0d5586377324f9ba  VENDOR/atty/LICENSE
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/autocfg/LICENSE-APACHE
+sha256 27995d58ad5c1145c1a8cd86244ce844886958a35eb2b78c6b772748669999ac  VENDOR/autocfg/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/base64/LICENSE-APACHE
+sha256 0dd882e53de11566d50f8e8e2d5a651bcf3fabee4987d70f306233cf39094ba7  VENDOR/base64/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/bitflags/LICENSE-APACHE
+sha256 6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb  VENDOR/bitflags/LICENSE-MIT
+sha256 13361f93b3db60ddb43f8fdc97ba469461019bbf7589f6bde833eb3d995d2497  VENDOR/bstr/COPYING
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/bstr/LICENSE-APACHE
+sha256 0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f  VENDOR/bstr/LICENSE-MIT
+sha256 b40930bbcf80744c86c46a12bc9da056641d722716c378f5659b9e555ef833e1  VENDOR/bytecount/LICENSE.Apache2
+sha256 a5dea80c1f383cb5f80a6bb0da5e55a2beb9f24adb123ce6300af2cbaaa3bf65  VENDOR/bytecount/LICENSE.MIT
+sha256 01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f  VENDOR/byteorder/COPYING
+sha256 0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f  VENDOR/byteorder/LICENSE-MIT
+sha256 7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c  VENDOR/byteorder/UNLICENSE
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/cc/LICENSE-APACHE
+sha256 378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397  VENDOR/cc/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/cfg-if/LICENSE-APACHE
+sha256 378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397  VENDOR/cfg-if/LICENSE-MIT
+sha256 6725d1437fc6c77301f2ff0e7d52914cf4f9509213e1078dc77d9356dbe6eac5  VENDOR/clap/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/crossbeam-channel/LICENSE-APACHE
+sha256 23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3  VENDOR/crossbeam-channel/LICENSE-MIT
+sha256 924a49392dc8304def57586be4ebd69aaf51e16fd245b55b4b69ad2cce6b715a  VENDOR/crossbeam-channel/LICENSE-THIRD-PARTY
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/crossbeam-utils/LICENSE-APACHE
+sha256 23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3  VENDOR/crossbeam-utils/LICENSE-MIT
+sha256 8b98376eb373dcf81950474efe34b5576a8171460dff500cc58a1ed8d160cd57  VENDOR/encoding_rs/COPYRIGHT
+sha256 13361f93b3db60ddb43f8fdc97ba469461019bbf7589f6bde833eb3d995d2497  VENDOR/encoding_rs_io/COPYING
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/encoding_rs_io/LICENSE-APACHE
+sha256 0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f  VENDOR/encoding_rs_io/LICENSE-MIT
+sha256 cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30  VENDOR/encoding_rs/LICENSE-APACHE
+sha256 f2ad48641d9c997d9ae3b95d93d1cd6e1ab12ab4c44de89937c7bfabbd076a4a  VENDOR/encoding_rs/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/fnv/LICENSE-APACHE
+sha256 65fdb6c76cd61612070c066eec9ecdb30ee74fb27859d0d9af58b9f499fd0c3e  VENDOR/fnv/LICENSE-MIT
+sha256 03b114f53e6587a398931762ee11e2395bfdba252a329940e2c8c9e81813845b  VENDOR/fuchsia-cprng/LICENSE
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/glob/LICENSE-APACHE
+sha256 6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb  VENDOR/glob/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/itoa/LICENSE-APACHE
+sha256 23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3  VENDOR/itoa/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/lazy_static/LICENSE-APACHE
+sha256 0621878e61f0d0fda054bcbe02df75192c28bde1ecc8289cbd86aeba2dd72720  VENDOR/lazy_static/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/libc/LICENSE-APACHE
+sha256 6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb  VENDOR/libc/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/log/LICENSE-APACHE
+sha256 6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb  VENDOR/log/LICENSE-MIT
+sha256 01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f  VENDOR/memchr/COPYING
+sha256 0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f  VENDOR/memchr/LICENSE-MIT
+sha256 7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c  VENDOR/memchr/UNLICENSE
+sha256 04ea4849dba9dcae07113850c6f1b1a69052c625210639914eee352023f750ad  VENDOR/memmap/LICENSE-APACHE
+sha256 bd1d8f06a6ce1f7645991e347b95864b970eed43624305eb4bb78c09aef8692d  VENDOR/memmap/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/num_cpus/LICENSE-APACHE
+sha256 0593d22d122d4bfec6407115e3907546312976f75473417aaa4c57ecd2095ae6  VENDOR/num_cpus/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/packed_simd/LICENSE-APACHE
+sha256 6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb  VENDOR/packed_simd/LICENSE-MIT
+sha256 01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f  VENDOR/pcre2/COPYING
+sha256 cb3c929a05e6cbc9de9ab06a4c57eeb60ca8c724bef6c138c87d3a577e27aa14  VENDOR/pcre2/LICENSE-MIT
+sha256 01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f  VENDOR/pcre2-sys/COPYING
+sha256 cb3c929a05e6cbc9de9ab06a4c57eeb60ca8c724bef6c138c87d3a577e27aa14  VENDOR/pcre2-sys/LICENSE-MIT
+sha256 46cde7dc11e64c78d650b4851b88f6704b4665ff60f22a1caf68ceb15e217e5b  VENDOR/pcre2-sys/pcre2/cmake/COPYING-CMAKE-SCRIPTS
+sha256 99272c55f3dcfa07a8a7e15a5c1a33096e4727de74241d65fa049fccfdd59507  VENDOR/pcre2-sys/pcre2/COPYING
+sha256 c4a8b89cd38d6a7501d5b11a472fa15e71a051b66d6331c6cda364101389d6ee  VENDOR/pcre2-sys/pcre2/LICENCE
+sha256 7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c  VENDOR/pcre2-sys/UNLICENSE
+sha256 7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c  VENDOR/pcre2/UNLICENSE
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/pkg-config/LICENSE-APACHE
+sha256 378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397  VENDOR/pkg-config/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/proc-macro2/LICENSE-APACHE
+sha256 378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397  VENDOR/proc-macro2/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/quote/LICENSE-APACHE
+sha256 c9a75f18b9ab2927829a208fc6aa2cf4e63b8420887ba29cdb265d6619ae82d5  VENDOR/quote/LICENSE-MIT
+sha256 90eb64f0279b0d9432accfa6023ff803bc4965212383697eee27a0f426d5f8d5  VENDOR/rand_chacha/COPYRIGHT
+sha256 aaff376532ea30a0cd5330b9502ad4a4c8bf769c539c87ffe78819d188a18ebf  VENDOR/rand_chacha/LICENSE-APACHE
+sha256 209fbbe0ad52d9235e37badf9cadfe4dbdc87203179c0899e738b39ade42177b  VENDOR/rand_chacha/LICENSE-MIT
+sha256 90eb64f0279b0d9432accfa6023ff803bc4965212383697eee27a0f426d5f8d5  VENDOR/rand/COPYRIGHT
+sha256 90eb64f0279b0d9432accfa6023ff803bc4965212383697eee27a0f426d5f8d5  VENDOR/rand_core-0.3.1/COPYRIGHT
+sha256 aaff376532ea30a0cd5330b9502ad4a4c8bf769c539c87ffe78819d188a18ebf  VENDOR/rand_core-0.3.1/LICENSE-APACHE
+sha256 209fbbe0ad52d9235e37badf9cadfe4dbdc87203179c0899e738b39ade42177b  VENDOR/rand_core-0.3.1/LICENSE-MIT
+sha256 90eb64f0279b0d9432accfa6023ff803bc4965212383697eee27a0f426d5f8d5  VENDOR/rand_core/COPYRIGHT
+sha256 aaff376532ea30a0cd5330b9502ad4a4c8bf769c539c87ffe78819d188a18ebf  VENDOR/rand_core/LICENSE-APACHE
+sha256 209fbbe0ad52d9235e37badf9cadfe4dbdc87203179c0899e738b39ade42177b  VENDOR/rand_core/LICENSE-MIT
+sha256 90eb64f0279b0d9432accfa6023ff803bc4965212383697eee27a0f426d5f8d5  VENDOR/rand_hc/COPYRIGHT
+sha256 aaff376532ea30a0cd5330b9502ad4a4c8bf769c539c87ffe78819d188a18ebf  VENDOR/rand_hc/LICENSE-APACHE
+sha256 a771e4354f6b3ad4c92da1a5c9a239b6c291527db869632ecea4f20e24ca1135  VENDOR/rand_hc/LICENSE-MIT
+sha256 90eb64f0279b0d9432accfa6023ff803bc4965212383697eee27a0f426d5f8d5  VENDOR/rand_isaac/COPYRIGHT
+sha256 aaff376532ea30a0cd5330b9502ad4a4c8bf769c539c87ffe78819d188a18ebf  VENDOR/rand_isaac/LICENSE-APACHE
+sha256 209fbbe0ad52d9235e37badf9cadfe4dbdc87203179c0899e738b39ade42177b  VENDOR/rand_isaac/LICENSE-MIT
+sha256 90eb64f0279b0d9432accfa6023ff803bc4965212383697eee27a0f426d5f8d5  VENDOR/rand_jitter/COPYRIGHT
+sha256 aaff376532ea30a0cd5330b9502ad4a4c8bf769c539c87ffe78819d188a18ebf  VENDOR/rand_jitter/LICENSE-APACHE
+sha256 209fbbe0ad52d9235e37badf9cadfe4dbdc87203179c0899e738b39ade42177b  VENDOR/rand_jitter/LICENSE-MIT
+sha256 aaff376532ea30a0cd5330b9502ad4a4c8bf769c539c87ffe78819d188a18ebf  VENDOR/rand/LICENSE-APACHE
+sha256 209fbbe0ad52d9235e37badf9cadfe4dbdc87203179c0899e738b39ade42177b  VENDOR/rand/LICENSE-MIT
+sha256 90eb64f0279b0d9432accfa6023ff803bc4965212383697eee27a0f426d5f8d5  VENDOR/rand_os/COPYRIGHT
+sha256 aaff376532ea30a0cd5330b9502ad4a4c8bf769c539c87ffe78819d188a18ebf  VENDOR/rand_os/LICENSE-APACHE
+sha256 209fbbe0ad52d9235e37badf9cadfe4dbdc87203179c0899e738b39ade42177b  VENDOR/rand_os/LICENSE-MIT
+sha256 90eb64f0279b0d9432accfa6023ff803bc4965212383697eee27a0f426d5f8d5  VENDOR/rand_pcg/COPYRIGHT
+sha256 aaff376532ea30a0cd5330b9502ad4a4c8bf769c539c87ffe78819d188a18ebf  VENDOR/rand_pcg/LICENSE-APACHE
+sha256 2234e3cefee876aeb686ad89e978bdb07bf118a1186ab1cf161bcdf69d4b4f57  VENDOR/rand_pcg/LICENSE-MIT
+sha256 90eb64f0279b0d9432accfa6023ff803bc4965212383697eee27a0f426d5f8d5  VENDOR/rand_xorshift/COPYRIGHT
+sha256 aaff376532ea30a0cd5330b9502ad4a4c8bf769c539c87ffe78819d188a18ebf  VENDOR/rand_xorshift/LICENSE-APACHE
+sha256 209fbbe0ad52d9235e37badf9cadfe4dbdc87203179c0899e738b39ade42177b  VENDOR/rand_xorshift/LICENSE-MIT
+sha256 00d7b0c8bf95ea93162fccc84da96b906b15add708eade04f7ee6141f7b53141  VENDOR/rdrand/LICENSE
+sha256 efcfee7981ff72431fffb06925cad00a23dce079ed4354f61030ad5abdb78829  VENDOR/redox_syscall/LICENSE
+sha256 cb46b697c3fd9d27d7bfe1b1ad48f8a58a284984504c6eb215ae2164538df7cb  VENDOR/redox_termios/LICENSE
+sha256 01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f  VENDOR/regex-automata/COPYING
+sha256 58cf078acc03da3e280a938c2bd9943f554fc9b6ced89ad93ba35ca436872899  VENDOR/regex-automata/data/fowler-tests/LICENSE
+sha256 58cf078acc03da3e280a938c2bd9943f554fc9b6ced89ad93ba35ca436872899  VENDOR/regex-automata/data/tests/fowler/LICENSE
+sha256 0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f  VENDOR/regex-automata/LICENSE-MIT
+sha256 7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c  VENDOR/regex-automata/UNLICENSE
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/regex/LICENSE-APACHE
+sha256 6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb  VENDOR/regex/LICENSE-MIT
+sha256 58cf078acc03da3e280a938c2bd9943f554fc9b6ced89ad93ba35ca436872899  VENDOR/regex/src/testdata/LICENSE
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/regex-syntax/LICENSE-APACHE
+sha256 6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb  VENDOR/regex-syntax/LICENSE-MIT
+sha256 74db5baf44a41b1000312c673544b3374e4198af5605c7f9080a402cec42cfa3  VENDOR/regex-syntax/src/unicode_tables/LICENSE-UNICODE
+sha256 c6c8c9dbe29fb4d68d829c7a402f9f6baae3472ecf107cc2a57c75a9a8d1b85c  VENDOR/remove_dir_all/LICENCE-APACHE
+sha256 db264505cb1856383e255c8373da9e5aeadc1cd92b570fcc94fd1fb7d892db78  VENDOR/remove_dir_all/LICENCE-MIT
+sha256 c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4  VENDOR/ryu/LICENSE-APACHE
+sha256 c9bff75738922193e67fa726fa225535870d2aa1059f91452c411736284ad566  VENDOR/ryu/LICENSE-BOOST
+sha256 01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f  VENDOR/same-file/COPYING
+sha256 cb3c929a05e6cbc9de9ab06a4c57eeb60ca8c724bef6c138c87d3a577e27aa14  VENDOR/same-file/LICENSE-MIT
+sha256 7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c  VENDOR/same-file/UNLICENSE
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/serde_derive/LICENSE-APACHE
+sha256 23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3  VENDOR/serde_derive/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/serde_json/LICENSE-APACHE
+sha256 23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3  VENDOR/serde_json/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/serde/LICENSE-APACHE
+sha256 23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3  VENDOR/serde/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/smallvec/LICENSE-APACHE
+sha256 0b28172679e0009b655da42797c03fd163a3379d5cfa67ba1f1655e974a2a1a9  VENDOR/smallvec/LICENSE-MIT
+sha256 1738b51502ae831fb59ffbeb22ebdd90bf17e5c72fe57c00b47552415f133fd8  VENDOR/strsim/LICENSE
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/syn/LICENSE-APACHE
+sha256 23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3  VENDOR/syn/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/tempfile/LICENSE-APACHE
+sha256 8b427f5bc501764575e52ba4f9d95673cf8f6d80a86d0d06599852e1a9a20a36  VENDOR/tempfile/LICENSE-MIT
+sha256 01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f  VENDOR/termcolor/COPYING
+sha256 0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f  VENDOR/termcolor/LICENSE-MIT
+sha256 7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c  VENDOR/termcolor/UNLICENSE
+sha256 6252f0c8d4a0df9b2dc0c6464cb2489dbe8859b0eb727e19c14e6af1ee432394  VENDOR/termion/LICENSE
+sha256 ce93600c49fbb3e14df32efe752264644f6a2f8e08a735ba981725799e5309ef  VENDOR/textwrap/LICENSE
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/thread_local/LICENSE-APACHE
+sha256 c9a75f18b9ab2927829a208fc6aa2cf4e63b8420887ba29cdb265d6619ae82d5  VENDOR/thread_local/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/ucd-util/LICENSE-APACHE
+sha256 0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f  VENDOR/ucd-util/LICENSE-MIT
+sha256 ea8df489e83b7674d5c9d50c320bec3b15d2e2eeb7a3a8879a666d91e5640c16  VENDOR/ucd-util/LICENSE-UNICODE
+sha256 23860c2a7b5d96b21569afedf033469bab9fe14a1b24a35068b8641c578ce24d  VENDOR/unicode-width/COPYRIGHT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/unicode-width/LICENSE-APACHE
+sha256 7b63ecd5f1902af1b63729947373683c32745c16a10e8e6292e2e2dcd7e90ae0  VENDOR/unicode-width/LICENSE-MIT
+sha256 23860c2a7b5d96b21569afedf033469bab9fe14a1b24a35068b8641c578ce24d  VENDOR/unicode-xid/COPYRIGHT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/unicode-xid/LICENSE-APACHE
+sha256 7b63ecd5f1902af1b63729947373683c32745c16a10e8e6292e2e2dcd7e90ae0  VENDOR/unicode-xid/LICENSE-MIT
+sha256 01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f  VENDOR/utf8-ranges/COPYING
+sha256 0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f  VENDOR/utf8-ranges/LICENSE-MIT
+sha256 7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c  VENDOR/utf8-ranges/UNLICENSE
+sha256 01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f  VENDOR/walkdir/COPYING
+sha256 0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f  VENDOR/walkdir/LICENSE-MIT
+sha256 7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c  VENDOR/walkdir/UNLICENSE
+sha256 b40930bbcf80744c86c46a12bc9da056641d722716c378f5659b9e555ef833e1  VENDOR/winapi/LICENSE-APACHE
+sha256 ce7bc3499fee93d5022ef430d5e4201e79a6d9154f3974e42f41349f0569e09b  VENDOR/winapi/LICENSE-MIT
+sha256 01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f  VENDOR/winapi-util/COPYING
+sha256 cb3c929a05e6cbc9de9ab06a4c57eeb60ca8c724bef6c138c87d3a577e27aa14  VENDOR/winapi-util/LICENSE-MIT
+sha256 7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c  VENDOR/winapi-util/UNLICENSE
+sha256 01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f  VENDOR/wincolor/COPYING
+sha256 0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f  VENDOR/wincolor/LICENSE-MIT
+sha256 7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c  VENDOR/wincolor/UNLICENSE
diff --git a/package/ripgrep/ripgrep.mk b/package/ripgrep/ripgrep.mk
index 1023b4bad8..3be143e15c 100644
--- a/package/ripgrep/ripgrep.mk
+++ b/package/ripgrep/ripgrep.mk
@@ -4,9 +4,11 @@
 #
 ################################################################################
 
+include package/ripgrep/vendor.inc
+
 RIPGREP_VERSION = 11.0.1
 RIPGREP_SITE = $(call github,burntsushi,ripgrep,$(RIPGREP_VERSION))
 RIPGREP_LICENSE = MIT
-RIPGREP_LICENSE_FILES = LICENSE-MIT
+RIPGREP_LICENSE_FILES = LICENSE-MIT $(RIPGREP_VENDOR_LICENSE_FILES)
 
 $(eval $(cargo-package))
diff --git a/package/ripgrep/vendor.inc b/package/ripgrep/vendor.inc
new file mode 100644
index 0000000000..df131ac533
--- /dev/null
+++ b/package/ripgrep/vendor.inc
@@ -0,0 +1,169 @@
+# Generated with:
+# (echo "RIPGREP_VENDOR_LICENSE_FILES = \\" ; \
+# 	find_vendor_licenses.sh | sed 's%^\(.*\)$%\t\1 \\%') 
+RIPGREP_VENDOR_LICENSE_FILES = \
+	VENDOR/aho-corasick/COPYING \
+	VENDOR/aho-corasick/LICENSE-MIT \
+	VENDOR/aho-corasick/UNLICENSE \
+	VENDOR/atty/LICENSE \
+	VENDOR/autocfg/LICENSE-APACHE \
+	VENDOR/autocfg/LICENSE-MIT \
+	VENDOR/base64/LICENSE-APACHE \
+	VENDOR/base64/LICENSE-MIT \
+	VENDOR/bitflags/LICENSE-APACHE \
+	VENDOR/bitflags/LICENSE-MIT \
+	VENDOR/bstr/COPYING \
+	VENDOR/bstr/LICENSE-APACHE \
+	VENDOR/bstr/LICENSE-MIT \
+	VENDOR/bytecount/LICENSE.Apache2 \
+	VENDOR/bytecount/LICENSE.MIT \
+	VENDOR/byteorder/COPYING \
+	VENDOR/byteorder/LICENSE-MIT \
+	VENDOR/byteorder/UNLICENSE \
+	VENDOR/cc/LICENSE-APACHE \
+	VENDOR/cc/LICENSE-MIT \
+	VENDOR/cfg-if/LICENSE-APACHE \
+	VENDOR/cfg-if/LICENSE-MIT \
+	VENDOR/clap/LICENSE-MIT \
+	VENDOR/crossbeam-channel/LICENSE-APACHE \
+	VENDOR/crossbeam-channel/LICENSE-MIT \
+	VENDOR/crossbeam-channel/LICENSE-THIRD-PARTY \
+	VENDOR/crossbeam-utils/LICENSE-APACHE \
+	VENDOR/crossbeam-utils/LICENSE-MIT \
+	VENDOR/encoding_rs/COPYRIGHT \
+	VENDOR/encoding_rs_io/COPYING \
+	VENDOR/encoding_rs_io/LICENSE-APACHE \
+	VENDOR/encoding_rs_io/LICENSE-MIT \
+	VENDOR/encoding_rs/LICENSE-APACHE \
+	VENDOR/encoding_rs/LICENSE-MIT \
+	VENDOR/fnv/LICENSE-APACHE \
+	VENDOR/fnv/LICENSE-MIT \
+	VENDOR/fuchsia-cprng/LICENSE \
+	VENDOR/glob/LICENSE-APACHE \
+	VENDOR/glob/LICENSE-MIT \
+	VENDOR/itoa/LICENSE-APACHE \
+	VENDOR/itoa/LICENSE-MIT \
+	VENDOR/lazy_static/LICENSE-APACHE \
+	VENDOR/lazy_static/LICENSE-MIT \
+	VENDOR/libc/LICENSE-APACHE \
+	VENDOR/libc/LICENSE-MIT \
+	VENDOR/log/LICENSE-APACHE \
+	VENDOR/log/LICENSE-MIT \
+	VENDOR/memchr/COPYING \
+	VENDOR/memchr/LICENSE-MIT \
+	VENDOR/memchr/UNLICENSE \
+	VENDOR/memmap/LICENSE-APACHE \
+	VENDOR/memmap/LICENSE-MIT \
+	VENDOR/num_cpus/LICENSE-APACHE \
+	VENDOR/num_cpus/LICENSE-MIT \
+	VENDOR/packed_simd/LICENSE-APACHE \
+	VENDOR/packed_simd/LICENSE-MIT \
+	VENDOR/pcre2/COPYING \
+	VENDOR/pcre2/LICENSE-MIT \
+	VENDOR/pcre2-sys/COPYING \
+	VENDOR/pcre2-sys/LICENSE-MIT \
+	VENDOR/pcre2-sys/pcre2/cmake/COPYING-CMAKE-SCRIPTS \
+	VENDOR/pcre2-sys/pcre2/COPYING \
+	VENDOR/pcre2-sys/pcre2/LICENCE \
+	VENDOR/pcre2-sys/UNLICENSE \
+	VENDOR/pcre2/UNLICENSE \
+	VENDOR/pkg-config/LICENSE-APACHE \
+	VENDOR/pkg-config/LICENSE-MIT \
+	VENDOR/proc-macro2/LICENSE-APACHE \
+	VENDOR/proc-macro2/LICENSE-MIT \
+	VENDOR/quote/LICENSE-APACHE \
+	VENDOR/quote/LICENSE-MIT \
+	VENDOR/rand_chacha/COPYRIGHT \
+	VENDOR/rand_chacha/LICENSE-APACHE \
+	VENDOR/rand_chacha/LICENSE-MIT \
+	VENDOR/rand/COPYRIGHT \
+	VENDOR/rand_core-0.3.1/COPYRIGHT \
+	VENDOR/rand_core-0.3.1/LICENSE-APACHE \
+	VENDOR/rand_core-0.3.1/LICENSE-MIT \
+	VENDOR/rand_core/COPYRIGHT \
+	VENDOR/rand_core/LICENSE-APACHE \
+	VENDOR/rand_core/LICENSE-MIT \
+	VENDOR/rand_hc/COPYRIGHT \
+	VENDOR/rand_hc/LICENSE-APACHE \
+	VENDOR/rand_hc/LICENSE-MIT \
+	VENDOR/rand_isaac/COPYRIGHT \
+	VENDOR/rand_isaac/LICENSE-APACHE \
+	VENDOR/rand_isaac/LICENSE-MIT \
+	VENDOR/rand_jitter/COPYRIGHT \
+	VENDOR/rand_jitter/LICENSE-APACHE \
+	VENDOR/rand_jitter/LICENSE-MIT \
+	VENDOR/rand/LICENSE-APACHE \
+	VENDOR/rand/LICENSE-MIT \
+	VENDOR/rand_os/COPYRIGHT \
+	VENDOR/rand_os/LICENSE-APACHE \
+	VENDOR/rand_os/LICENSE-MIT \
+	VENDOR/rand_pcg/COPYRIGHT \
+	VENDOR/rand_pcg/LICENSE-APACHE \
+	VENDOR/rand_pcg/LICENSE-MIT \
+	VENDOR/rand_xorshift/COPYRIGHT \
+	VENDOR/rand_xorshift/LICENSE-APACHE \
+	VENDOR/rand_xorshift/LICENSE-MIT \
+	VENDOR/rdrand/LICENSE \
+	VENDOR/redox_syscall/LICENSE \
+	VENDOR/redox_termios/LICENSE \
+	VENDOR/regex-automata/COPYING \
+	VENDOR/regex-automata/data/fowler-tests/LICENSE \
+	VENDOR/regex-automata/data/tests/fowler/LICENSE \
+	VENDOR/regex-automata/LICENSE-MIT \
+	VENDOR/regex-automata/UNLICENSE \
+	VENDOR/regex/LICENSE-APACHE \
+	VENDOR/regex/LICENSE-MIT \
+	VENDOR/regex/src/testdata/LICENSE \
+	VENDOR/regex-syntax/LICENSE-APACHE \
+	VENDOR/regex-syntax/LICENSE-MIT \
+	VENDOR/regex-syntax/src/unicode_tables/LICENSE-UNICODE \
+	VENDOR/remove_dir_all/LICENCE-APACHE \
+	VENDOR/remove_dir_all/LICENCE-MIT \
+	VENDOR/ryu/LICENSE-APACHE \
+	VENDOR/ryu/LICENSE-BOOST \
+	VENDOR/same-file/COPYING \
+	VENDOR/same-file/LICENSE-MIT \
+	VENDOR/same-file/UNLICENSE \
+	VENDOR/serde_derive/LICENSE-APACHE \
+	VENDOR/serde_derive/LICENSE-MIT \
+	VENDOR/serde_json/LICENSE-APACHE \
+	VENDOR/serde_json/LICENSE-MIT \
+	VENDOR/serde/LICENSE-APACHE \
+	VENDOR/serde/LICENSE-MIT \
+	VENDOR/smallvec/LICENSE-APACHE \
+	VENDOR/smallvec/LICENSE-MIT \
+	VENDOR/strsim/LICENSE \
+	VENDOR/syn/LICENSE-APACHE \
+	VENDOR/syn/LICENSE-MIT \
+	VENDOR/tempfile/LICENSE-APACHE \
+	VENDOR/tempfile/LICENSE-MIT \
+	VENDOR/termcolor/COPYING \
+	VENDOR/termcolor/LICENSE-MIT \
+	VENDOR/termcolor/UNLICENSE \
+	VENDOR/termion/LICENSE \
+	VENDOR/textwrap/LICENSE \
+	VENDOR/thread_local/LICENSE-APACHE \
+	VENDOR/thread_local/LICENSE-MIT \
+	VENDOR/ucd-util/LICENSE-APACHE \
+	VENDOR/ucd-util/LICENSE-MIT \
+	VENDOR/ucd-util/LICENSE-UNICODE \
+	VENDOR/unicode-width/COPYRIGHT \
+	VENDOR/unicode-width/LICENSE-APACHE \
+	VENDOR/unicode-width/LICENSE-MIT \
+	VENDOR/unicode-xid/COPYRIGHT \
+	VENDOR/unicode-xid/LICENSE-APACHE \
+	VENDOR/unicode-xid/LICENSE-MIT \
+	VENDOR/utf8-ranges/COPYING \
+	VENDOR/utf8-ranges/LICENSE-MIT \
+	VENDOR/utf8-ranges/UNLICENSE \
+	VENDOR/walkdir/COPYING \
+	VENDOR/walkdir/LICENSE-MIT \
+	VENDOR/walkdir/UNLICENSE \
+	VENDOR/winapi/LICENSE-APACHE \
+	VENDOR/winapi/LICENSE-MIT \
+	VENDOR/winapi-util/COPYING \
+	VENDOR/winapi-util/LICENSE-MIT \
+	VENDOR/winapi-util/UNLICENSE \
+	VENDOR/wincolor/COPYING \
+	VENDOR/wincolor/LICENSE-MIT \
+	VENDOR/wincolor/UNLICENSE \
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v3 10/10] docs/manual/adding-packages-cargo: Update for legal-info
  2020-02-20 16:01 [Buildroot] [PATCH v3 01/10] package/pkg-cargo.mk: Introduce the cargo package infrastructure Patrick Havelange
                   ` (7 preceding siblings ...)
  2020-02-20 16:01 ` [Buildroot] [PATCH v3 09/10] package/ripgrep: add legal-info for dependencies Patrick Havelange
@ 2020-02-20 16:01 ` Patrick Havelange
  2020-04-29 13:53 ` [Buildroot] [PATCH v3 01/10] package/pkg-cargo.mk: Introduce the cargo package infrastructure Romain Naour
  9 siblings, 0 replies; 13+ messages in thread
From: Patrick Havelange @ 2020-02-20 16:01 UTC (permalink / raw)
  To: buildroot

Added a bit of explanations regarding the vendored licenses.

Signed-off-by: Patrick Havelange <patrick.havelange@essensium.com>
---
 docs/manual/adding-packages-cargo.txt | 45 ++++++++++++++++++++-------
 1 file changed, 34 insertions(+), 11 deletions(-)

diff --git a/docs/manual/adding-packages-cargo.txt b/docs/manual/adding-packages-cargo.txt
index e7d03eb7b5..e92b8bc353 100644
--- a/docs/manual/adding-packages-cargo.txt
+++ b/docs/manual/adding-packages-cargo.txt
@@ -38,19 +38,25 @@ with an example:
 04: #
 05: ################################################################################
 06:
-07: FOO_VERSION = 1.0
-08: FOO_SOURCE = foo-$(FOO_VERSION).tar.gz
-09: FOO_SITE = http://www.foosoftware.org/download
-10: FOO_LICENSE = GPL-3.0+
-11: FOO_LICENSE_FILES = COPYING
-12:
-13: $(eval $(cargo-package))
+07: include package/foo/vendor.inc
+08:
+09: FOO_VERSION = 1.0
+10: FOO_SOURCE = foo-$(FOO_VERSION).tar.gz
+11: FOO_SITE = http://www.foosoftware.org/download
+12: FOO_LICENSE = GPL-3.0+
+13: FOO_LICENSE_FILES = COPYING $(FOO_VENDOR_LICENSE_FILES)
+14:
+15: $(eval $(cargo-package))
 --------------------------------
 
-The Makefile starts with the definition of the standard variables for package
-declaration (lines 7 to 11).
+The Makefile starts with the inclusion of a second file that
+contains the vendored licenses, more info on that topic later.
+Then it continues with the definition of the standard variables
+for package declaration (lines 9 to 13).
 
-As seen in line 13, it is based on the cargo-package infrastructure. Cargo will
+FOO_VENDOR_LICENSE_FILES is defined in the previously included file vendor.inc
+
+As seen in line 15, it is based on the cargo-package infrastructure. Cargo will
 be invoked automatically by this infrastructure. The required dependencies of the
 crate will be downloaded and the buildroot dependencies will also be set.
 
@@ -58,7 +64,20 @@ It is still possible to define custom build commands or install commands (i.e.
 with FOO_BUILD_CMDS and FOO_INSTALL_TARGET_CMDS).
 Those will then replace the commands from the cargo infrastructure.
 
-==== About Dependencies Management
+The file vendor.inc contains only one variable :
+
+------------------------------
+01: FOO_VENDOR_LICENSES_FILES = \
+02: 	VENDOR/bar/COPYING \
+03: 	VENDOR/blah/LICENSE-MIT \
+04:	VENDOR/bleh/COPYING \
+05: 
+--------------------------------
+
+It is recommended to generate the list via scripting.
+A script example can be found in the ripgrep directory.
+
+==== About Dependencies Management and Licenses
 
 A crate can depend on other libraries from crates.io or git repositories, listed
 in its Cargo.toml file. Before starting a build, the +cargo vendor+ command
@@ -66,3 +85,7 @@ will be run and will take care of downloading those dependencies.
 
 The final source tarball will contain all the required dependencies, effectively
 permitting us to do an offline build.
+
+In order for the +legal-info+ target to work as expected, it is necessary to list
+the licenses of the vendored dependencies. Each of those entries should be added
+to the +.mk+ and +.hash+ files.
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v3 01/10] package/pkg-cargo.mk: Introduce the cargo package infrastructure.
  2020-02-20 16:01 [Buildroot] [PATCH v3 01/10] package/pkg-cargo.mk: Introduce the cargo package infrastructure Patrick Havelange
                   ` (8 preceding siblings ...)
  2020-02-20 16:01 ` [Buildroot] [PATCH v3 10/10] docs/manual/adding-packages-cargo: Update for legal-info Patrick Havelange
@ 2020-04-29 13:53 ` Romain Naour
  9 siblings, 0 replies; 13+ messages in thread
From: Romain Naour @ 2020-04-29 13:53 UTC (permalink / raw)
  To: buildroot

Hi Patrick, Arnout, All,

Le 20/02/2020 ? 17:01, Patrick Havelange a ?crit?:
> In order to be package agnostic, the install phase is now using
> cargo instead of install.
> TARGET_CONFIGURE_OPTS is now also set when running cargo in order
> to support cross compiling C code within cargo.
> 
> Signed-off-by: Patrick Havelange <patrick.havelange@essensium.com>
> 
> ---
> changes:
> v2 -> v3 (Sam Voss)
>  - set TARGET_CONFIGURE_OPTS when running cargo
> 
> This is the V3 of the previously posted series :
> http://patchwork.ozlabs.org/project/buildroot/list/?series=156166&state=%2A&archive=both
> 
> A lot of changes following the buildroot developer meeting's
> decisions from February 2020.
> 
> Needs to be applied on top of the rust 1.40 bump
> ---
>  package/Makefile.in  |  1 +
>  package/pkg-cargo.mk | 92 ++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 93 insertions(+)
>  create mode 100644 package/pkg-cargo.mk
> 
> diff --git a/package/Makefile.in b/package/Makefile.in
> index 285e2837ef..650d7c166e 100644
> --- a/package/Makefile.in
> +++ b/package/Makefile.in
> @@ -426,3 +426,4 @@ include package/pkg-kernel-module.mk
>  include package/pkg-waf.mk
>  include package/pkg-golang.mk
>  include package/pkg-meson.mk
> +include package/pkg-cargo.mk
> diff --git a/package/pkg-cargo.mk b/package/pkg-cargo.mk
> new file mode 100644
> index 0000000000..35f7c15ad9
> --- /dev/null
> +++ b/package/pkg-cargo.mk
> @@ -0,0 +1,92 @@
> +################################################################################
> +# Cargo package infrastructure
> +#
> +# This file implements an infrastructure that eases development of package
> +# .mk files for Cargo packages. It should be used for all packages that use
> +# Cargo as their build system.
> +#
> +# See the Buildroot documentation for details on the usage of this
> +# infrastructure
> +#
> +# In terms of implementation, this Cargo infrastructure requires the .mk file
> +# to only specify metadata information about the package: name, version,
> +# download URL, etc.
> +#
> +# We still allow the package .mk file to override what the different steps
> +# are doing, if needed. For example, if <PKG>_BUILD_CMDS is already defined,
> +# it is used as the list of commands to perform to build the package,
> +# instead of the default Cargo behaviour. The package can also define some
> +# post operation hooks.
> +#
> +################################################################################
> +
> +################################################################################
> +# inner-cargo-package -- defines how the configuration, compilation and
> +# installation of a cargo package should be done, implements a few hooks
> +# to tune the build process for cargo specifities and calls the generic
> +# package infrastructure to generate the necessary make targets
> +#
> +#  argument 1 is the lowercase package name
> +#  argument 2 is the uppercase package name, including a HOST_ prefix
> +#             for host packages
> +#  argument 3 is the uppercase package name, without the HOST_ prefix
> +#             for host packages
> +#  argument 4 is the type (target or host)
> +################################################################################
> +
> +define inner-cargo-package
> +
> +# We need host-rustc to run cargo
> +$(2)_DEPENDENCIES += host-rustc
> +
> +$(2)_CARGO_ENV = \
> +	CARGO_HOME=$(HOST_DIR)/share/cargo \
> +	$(TARGET_CONFIGURE_OPTS)

Like other package infrastructure, it would be useful to define $(2)_CONF_ENV to
allow cargo based packages to modify cargo environment.

For example, we need to add PKG_CONFIG_ALLOW_CROSS=1 to use pkg-config while
cross-compiling.

https://github.com/rust-embedded/cross/issues/250

> +
> +$(2)_CARGO_MODE = $(if $(BR2_ENABLE_DEBUG),debug,release)
> +
> +ifeq ($(4),target)
> +    $(2)_CARGO_TARGET_OPT = --target $$(RUSTC_TARGET_NAME)
> +endif
> +
> +#
> +# Build step. Only define it if not already defined by the package .mk
> +# file.
> +#
> +ifndef $(2)_BUILD_CMDS
> +define $(2)_BUILD_CMDS
> +	$(TARGET_MAKE_ENV) $$($(2)_CARGO_ENV) \
> +		cargo build \
> +			--$$($(2)_CARGO_MODE) \
> +			$$($(2)_CARGO_TARGET_OPT) \
> +			--manifest-path $$(@D)/Cargo.toml

cargo support -q (quiet) option that can be added to BUILD_CMDS and
INSTALL_TARGET_CMDS.

> +endef
> +endif
> +
> +#
> +# Target installation step. Only define it if not already defined by
> +# the package .mk file.
> +#
> +ifndef $(2)_INSTALL_TARGET_CMDS
> +define $(2)_INSTALL_TARGET_CMDS
> +	$(TARGET_MAKE_ENV) $$($(2)_CARGO_ENV) \
> +		cargo install \
> +			--root $(TARGET_DIR)/usr/ \
> +			--bins \
> +			--path $$(@D) \
> +			$$($(2)_CARGO_TARGET_OPT) \
> +			--force

While testing this infra with opcua [1], I get this error :
"found a virtual manifest at `path/Cargo.toml` instead of a package manifest"

We need to customize "cargo --path ./" to a package subdirectory containing
another Cargo.toml with a package manifest.

But it seems we can provide only one path to cargo command line, but I need to
install binaries from several subdirectories. We may need a loop here otherwise
cargo packages should redefine _INSTALL_TARGET_CMDS.

[1] https://github.com/locka99/opcua

Best regards,
Romain


> +endef
> +endif
> +
> +# Call the generic package infrastructure to generate the necessary
> +# make targets
> +$(call inner-generic-package,$(1),$(2),$(3),$(4))
> +
> +endef
> +
> +################################################################################
> +# cargo-package -- the target generator macro for Cargo packages
> +################################################################################
> +
> +cargo-package = $(call inner-cargo-package,$(pkgname),$(call UPPERCASE,$(pkgname)),$(call UPPERCASE,$(pkgname)),target)
> 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v3 06/10] package/pkg-cargo.mk: Introduce the cargo dl backend
  2020-02-20 16:01 ` [Buildroot] [PATCH v3 06/10] package/pkg-cargo.mk: Introduce the cargo dl backend Patrick Havelange
@ 2020-08-26 19:22   ` Thomas Petazzoni
  0 siblings, 0 replies; 13+ messages in thread
From: Thomas Petazzoni @ 2020-08-26 19:22 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu, 20 Feb 2020 17:01:15 +0100
Patrick Havelange <patrick.havelange@essensium.com> wrote:

> Cargo is now a fully supported PKGMGR, automatically set for any
> package using the cargo infrastructure.
> This effectively splits the download phase and the build phase.
> 
> The cargo backend will set CARGO_HOME inside DL_DIR during download.
> The cached files in CARGO_HOME permits to download only once the
> crates index and each dependencies.
> During download phase, it will call cargo vendor to copy the
> dependencies inside the VENDOR directory inside the source archive.
> 
> A local cargo config is also inserted inside the archive in order
> to use the VENDOR dir during the build phase.
> The build phase is forced to not query the online repository anymore
> and thus will be using the vendored dependencies from the tarball.
> This also permits to have offline builds.
> 
> Signed-off-by: Patrick Havelange <patrick.havelange@essensium.com>

We looked at this patch series during the previous (virtual) Buildroot
Developers Meeting in late July, and we forgot to give some feedback.
I'll provide the raw IRC logs of the discussion we had, however, I see
there's been more discussion tonight on the IRC channel on this topic.

[13:54:34] <kos_tom> wow, wow this series https://patchwork.ozlabs.org/project/buildroot/list/?series=159771 has some pretty weird download infrastructure changes
[13:55:17] <y_morin> Yes, it scares me quite a bit...
[13:55:33] <y_morin> However, I think we already discussed that here some time ago.
[13:55:52] <y_morin> The proposal I did was:
[13:56:19] <y_morin> 1) introduce a cargo download backend
[13:56:47] <y_morin> 2) have the cargo backend call the real backend (git, wget, etc...) for the cargo package,
[13:57:21] <y_morin> 3) have the cargo backend call "cargo bundle" to complete the package archive.
[13:57:26] <y_morin> kos_tom: ^^^
[13:59:50] <kos_tom> y_morin: I'm not sure how the "cargo backend can call the real backend
[14:00:10] <kos_tom> y_morin: what the patch series does is call "cargo vendor" to download all the dependencies
[14:00:34] <kos_tom> and then it makes a tarball of the whole thing, i.e the actual package source code + all its cargo dependencies
[14:00:48] <kos_tom> and that's what you get as a tarball for this package in DL_DIR
[14:01:09] <y_morin> kos_tom: It is easy for the cargo backend to call the adequate "real" backend:  "${0%/*}/wget"
[14:01:30] <y_morin> We "just" need to be able to pass that info yto he cargo backend
[14:01:32] <kos_tom> y_morin: the cargo backend does not do the download of dependecnies by itself
[14:01:37] <kos_tom> it calls the "cargo vendor" command
[14:01:55] <y_morin> kos_tom: I don;t yet care about the depdnencies. I care about the main download for now.
[14:02:15] <y_morin> kos_tom: Hold on a sec, I'll post a simple script that shows that...
[14:02:46] <kos_tom> y_morin: look at the patch series
[14:02:52] <kos_tom> y_morin: it does use *two* backends
[14:02:56] <kos_tom> it uses the normal backend for the main download
[14:03:04] <y_morin> kos_tom: I know.
[14:03:08] <kos_tom> + an extra secondary backend, called "cargo" to download the dependencis
[14:03:11] <y_morin> And I am not OK with that.
[14:03:23] <y_morin> I am propiosing something else.
[14:03:40] <y_morin> I.e. to invert the logic
[14:03:48] <kos_tom> yeah, you are proposing that the "cargo" backend takes care of both the main download and the dependencies download
[14:03:57] <kos_tom> and not have this concept of "secondary backend"
[14:04:02] <y_morin> Exactly.
[14:04:05] <kos_tom> Ok.
[14:04:15] <kos_tom> the question is: do we want this kind of download integration at all?
[14:04:22] <kos_tom> if we do, does it work for NodeJS ? PHP ?
[14:05:40] <y_morin> kos_tom: https://pastebin.com/c3K42Lb7
[14:06:03] <y_morin> kos_tom: That is also the idea. For go, it would be very similar too.
[14:06:19] <kos_tom> y_morin: but how do you pass the "real backend" if the backend is "cargo" ?
[14:06:22] <y_morin> And for npm and php, afaiu (which is not much), as well
[14:06:28] <kos_tom> i.e if you have a cargo package to fetch from Git, and another from https
[14:07:06] <y_morin> kos_tom: Pretty east. In the cargo infra:    FOO_SITE_METHOD = cargo  FOO_EXTRA_DLOPTS += --backend=$(whatever)
[14:07:22] <y_morin> kos_tom: Hmm...
[14:07:39] <y_morin> you mean "cargo vendor" can fetch from various locations?
[14:08:07] <y_morin> I meant: from various location usign various methods?
[14:08:21] <y_morin> It that is so, then my proposal is not good, indeed.
[14:08:55] <kos_tom> y_morin: no I meant the primary download
[14:09:11] <kos_tom> y_morin: ie. for the ripgrep package, the actual download of the ripgrep code
[14:09:44] <kos_tom> of the cargo series, I'm wondering if I should apply patches 1/2/3, which create the package infra, but not the download stuff
[14:09:53] <y_morin> kos_tom: Ah, but the primary download is exactly that: FOO_EXTRA_DLOPTS += --backend=$(geturischeme $(FOO_SITE))
[14:10:08] <kos_tom> my main concern is that we have a single package that would use this infra right now, which doesn't make merging such a simple infra very convincing.
[14:10:30] <kos_tom> y_morin: instead of an extra backend, can we do with a post-download hook ?
[14:10:54] <y_morin> kos_tom: I had a good reason not to use such a hook.
[14:11:06] <y_morin> kos_tom: I would have to dig my irc logs...
[14:11:54] <y_morin> kos_tom: Ah yes, I know...
[14:12:19] <y_morin> kos_tom: If you use a post-dl hook, it means the archive with just the main package is already in $(FOO_DL_DIR)
[15:12:14] <kos_tom> y_morin: so can we try to conclude on the cargo download thing?
[15:13:08] <y_morin> kos_tom: I provided some info above, not sure you saw it...
[15:13:29] <y_morin> kos_tom: If you use a post-dl hook, it means the archive with just the main package is already in $(FOO_DL_DIR)
[15:13:47] <kos_tom> y_morin: but is that a problem ?
[15:14:00] <kos_tom> I guess it is indeed simpler to have a single tarball that has the source code for everything, including dependencies
[15:14:05] <y_morin> kos_tom: Yes it is, for a subsequent build: it would not match the hashes.
[15:14:35] <kos_tom> are the hashes anyway going to match when you see (from the "bat" example being discussed with Romain) that dependency versions anyway can change
[15:14:40] <y_morin> kos_tom: That is the idea that the archive contains the main package *and* all its depednencies.
[15:14:56] <y_morin> For those package managers that allow pinning the version, we can get hashes of the archive, then

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v3 09/10] package/ripgrep: add legal-info for dependencies
  2020-02-20 16:01 ` [Buildroot] [PATCH v3 09/10] package/ripgrep: add legal-info for dependencies Patrick Havelange
@ 2020-08-26 19:26   ` Thomas Petazzoni
  0 siblings, 0 replies; 13+ messages in thread
From: Thomas Petazzoni @ 2020-08-26 19:26 UTC (permalink / raw)
  To: buildroot

Hello all,

On Thu, 20 Feb 2020 17:01:18 +0100
Patrick Havelange <patrick.havelange@essensium.com> wrote:

> As the dependencies are now vendored in the tarball, we can
> extract them easily. Added a helper script to list them.
> Updated the .hash & .mk files with those new licenses.
> 
> Signed-off-by: Patrick Havelange <patrick.havelange@essensium.com>
> ---
>  package/ripgrep/find_vendor_licenses.sh |   6 +
>  package/ripgrep/ripgrep.hash            | 167 +++++++++++++++++++++++
>  package/ripgrep/ripgrep.mk              |   4 +-
>  package/ripgrep/vendor.inc              | 169 ++++++++++++++++++++++++
>  4 files changed, 345 insertions(+), 1 deletion(-)

At the latest virtual Buildroot Developers Meeting, Yann and I talked
about this. I'll paste the complete IRC conversation below. In short,
Yann wanted some way of dynamically grabbing the legal information at
runtime, but our discussion made it clear (I believe) that this was not
possible. Yann agreed that a static description of the licenses and
licenses files (like you did) was the only option. However, Yann didn't
like that the vendor licenses are described in a separate vendor.inc
file. I personally don't mind too much, as we already do that for the
qt5webengine package. Overall, I believe this aspect is fairly minor
compared to the concerns about the download backend.

Here is the unedited IRC conversation:

[15:32:56] <y_morin> kos_tom: For cargo: I do not like the vendor.inc stuff at all...
[15:33:05] <kos_tom> y_morin: do we have a better proposal ?
[15:33:33] <y_morin> kos_tom: Yes: handle it in the cargo infra
[15:33:46] <y_morin> I.e.: do not let the packages do the inclusion by themselves.
[15:33:53] <kos_tom> how would you do that? we don't support "dynamic legal-info" currently
[15:35:29] <y_morin> And in the infra:  include $(pkgdir)/vendor.inc     $(1)_LICENSE += , $($(1)_VENDOR_LICENSE)   $(1)_LICENSE_FILES += $($(1)_VENDOR_LICENSE_FILES)
[15:36:05] <y_morin> kos_tom: The trick with the license list, is that the 'space-comma' is properly replaced by a comma in the legal-infra already
[15:36:25] <kos_tom> mooh, https://github.com/facebook/rocksdb/commit/085e4dcf8173e91311fbf9037d8bc9393f254c6f exists, but "git show 085e4dcf8173e91311fbf9037d8bc9393f254c6f" in this repo says "no such commit"
[15:36:54] <kos_tom> y_morin: but the value of this VENDOR_LICENSE variable would only be known after the package has been downloaded
[15:36:56] <y_morin> (*if* we can get the license list of the vensored stuff; having the license fiels would already be nice enough)
[15:37:04] <kos_tom> y_morin: how does the infra fills it in ?
[15:37:07] <y_morin> Ah, right/
[15:37:24] <kos_tom> that's what I called "support for dynamic legal-info"
[15:37:39] <y_morin> No, no, the infra does not fill in the variables, they are prepared as is.
[15:37:45] <y_morin> ... as is in the series.
[15:37:52] <kos_tom> aah, github says "This commit does not belong to any branch on this repository."
[15:38:04] <y_morin> Except it is not the package ./mk that does the include and aggregartion, but the cvargo infra
[15:38:09] <kos_tom> y_morin: ah, so it doesn't change much compared to the series
[15:38:20] <y_morin> No, not much.
[15:38:37] <y_morin> kos_tom: Except the series as is does not even catter for the list of licenses either.
[15:39:21] <y_morin> kos_tom: But:
[15:39:42] <y_morin> 1) I am not too fond of the vendor.inc to begin with; the info should be in the .mk
[15:40:00] <y_morin> 2) *if* we want to go with the vendor.inc, then let's handle it in the cargo-infra
[15:40:17] <y_morin> But TBH, I would really prefer option 1.
[15:40:40] <y_morin> There is no reason to single out cargo from other infras.
[15:41:36] <kos_tom> y_morin: we do have something similar as the vendor.inc already today
[15:41:56] <y_morin> Where?
[15:42:02] <kos_tom> enjoy package/qt5/qt5webengine/chromium-latest.inc
[15:42:23] <y_morin> Oh noes... :-(
[15:43:18] <y_morin> kos_tom: OK, so *if* we want to go that route, let's not let packages handle it, but let's handle it in the infra, and in pkg-generic at that.
[15:44:05] <kos_tom> hm, maybe this is something we should do long-term, but I'm not sure it's really something we should promote at the pkg-generic level today
[15:44:18] <kos_tom> we're only talking about a few cargo-related packages for now
[15:46:05] <y_morin> kos_tom: https://pastebin.com/AQfyKaSL
[15:46:18] <y_morin> I think it would not be much more complex that that.
[15:46:46] <kos_tom> doesn't account for per-version subdirectories
[15:47:04] <kos_tom> for qt5webengine, we use two have .inc files :-)
[15:47:09] <y_morin> Yes, yes... You are nit-picking. ;-)
[15:47:26] <kos_tom> to me, that is a minor detail in the whole story
[15:47:37] <kos_tom> the question is: do we accept to handle legal-info for cargo packages this way ?
[15:48:05] <y_morin> To me: no.
[15:48:21] <y_morin> I'd like chromuium stays the esception.
[15:49:19] <y_morin> I don;t think this is a problem that the .mk of cargo packages is just 99% legal-stuff. That's just the sad story there is to it.
[15:49:42] <y_morin> Also, I don't like that parts of the legal-info is in the .mk, and part in the vendor.inc.
[15:50:25] <y_morin> Unless we decide that we want to move the legal-info to is own file, like foo.mk foo.hash and now foo.legal
[15:50:45] <y_morin> But meh, I would keep everything in a single file, please.
[15:50:47] <kos_tom> the idea for qt5webengine is also that the .inc file is kind of auto-generated
[15:51:07] <y_morin> Havinf the legal-info in a side file means it fille bit-rot there ebecause no one will look/update it.
[15:51:37] <y_morin> kos_tom: So what? The legalinfo in scan-pypi or scan-cpan is also autogenerated the first time. Tyhen it is manually updated..
[15:51:58] <kos_tom> y_morin: no, it is again updated with scanpypi or scancpan
[15:52:05] <kos_tom> scanpypi and scancpan are not one-time scripts
[15:52:18] <Jacmet> kos_tom: yeah, I couldn't backport the gnutls security bump before we had a fix for uclibc
[15:53:34] <Kubu> kos_tom: ok, I'm able to build bat
[15:53:40] <kos_tom> Kubu: ah :)
[15:53:43] <Kubu> even with ARM toolchain
[15:58:44] <y_morin> kos_tom: So, even the generated packages are properly updated, so even that is not an excuse ti have the licensing info outside the .mk
[15:58:58] <y_morin> (sorry, I had a sigfood from the nano-tigers...)
[16:00:33] <y_morin> Kubu: When you're done with cargo/rust, mind diving back into elf2flt:  https://patchwork.ozlabs.org/project/buildroot/patch/20200726094338.1276868-1-fontaine.fabrice at gmail.com/  ? ;-)
[16:01:27] <Kubu> y_morin: well, there is no much change in this version compared to what we have currently
[16:02:00] <kos_tom> y_morin: again, to me inside/outside the .mk is a small detail
[16:02:21] <kos_tom> Lightsword: have you looked at the Lua 5.4 series from Fran?ois Perrad ?
[16:02:22] <y_morin> kos_tom: So I am not sure I understood your question...
[16:02:23] <Kubu> it's just about sync with with the tag added recently
[16:02:52] <kos_tom> y_morin: are we OK with handling legal-info like this, i.e it's quite manual. I anyway don't really see any other option.
[16:03:36] <y_morin> kos_tom: Still, not sure to understand... :-/
[16:04:30] <y_morin> kos_tom: In fact, we *could* very well have the list established at runtime.
[16:04:31] <kos_tom> y_morin: well, aside the location of the legal details, are we OK with the way it's done ?
[16:04:59] <y_morin> Since the lists are not used to generate Makefile code, they are only evaluated in shell context
[16:05:20] <kos_tom> ooh, but
[16:05:22] <y_morin> so we could do:  FOO_LICENSE = `some script to extract the list`
[16:05:23] <kos_tom> we already have BR2_PACKAGE_LUAINTERPRETER_ABI_VERSION
[16:05:33] <kos_tom> which contains 5.1 for LuaJIT/Lua5.1 and 5.3 for Lua 5.3
[16:06:03] <y_morin> and FOO_LICENSE_FILES = `some script to extract the list of files`
[16:06:04] <kos_tom> y_morin: but then we could only evaluate the FOO_LICENSE variable after the download has taken place
[16:06:32] <y_morin> kos_tom: No, because the variable are evaluated when the corresponding make rule is generated.
[16:07:02] <y_morin> which is another rule than foo-legal-info
[16:07:32] <y_morin> So, at the time foo-lkegal-info is "started/run", the foo-extract and foo-patch are finished
[16:08:07] <y_morin> .. it should work (famous last words)
[16:08:23] <kos_tom> y_morin: well, if I do "make FOO_LICENSE printvars"
[16:08:47] <y_morin> That won;t work if the patckage is not extractd/patched, no. indeed.
[16:09:09] <y_morin> So that wouild bust show-info too
[16:09:12] <y_morin> So not good.
[16:10:01] <y_morin> We indeed do need a static list of licenses and files

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2020-08-26 19:26 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-20 16:01 [Buildroot] [PATCH v3 01/10] package/pkg-cargo.mk: Introduce the cargo package infrastructure Patrick Havelange
2020-02-20 16:01 ` [Buildroot] [PATCH v3 02/10] docs/manual/cargo: Update manual for cargo packages Patrick Havelange
2020-02-20 16:01 ` [Buildroot] [PATCH v3 03/10] package/ripgrep: convert to cargo infrastructure Patrick Havelange
2020-02-20 16:01 ` [Buildroot] [PATCH v3 04/10] support/download/dl-wrapper: rework backend parsing Patrick Havelange
2020-02-20 16:01 ` [Buildroot] [PATCH v3 05/10] docs/manual/adding-packages-generic: update for new FOO_PKGMGR value Patrick Havelange
2020-02-20 16:01 ` [Buildroot] [PATCH v3 06/10] package/pkg-cargo.mk: Introduce the cargo dl backend Patrick Havelange
2020-08-26 19:22   ` Thomas Petazzoni
2020-02-20 16:01 ` [Buildroot] [PATCH v3 07/10] docs/manual/adding-packages-cargo: update doc for new infra Patrick Havelange
2020-02-20 16:01 ` [Buildroot] [PATCH v3 08/10] package/ripgrep: bump to version 11.0.1 Patrick Havelange
2020-02-20 16:01 ` [Buildroot] [PATCH v3 09/10] package/ripgrep: add legal-info for dependencies Patrick Havelange
2020-08-26 19:26   ` Thomas Petazzoni
2020-02-20 16:01 ` [Buildroot] [PATCH v3 10/10] docs/manual/adding-packages-cargo: Update for legal-info Patrick Havelange
2020-04-29 13:53 ` [Buildroot] [PATCH v3 01/10] package/pkg-cargo.mk: Introduce the cargo package infrastructure Romain Naour

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.