From: William Sherrer <william.sherrer1@gmail.com>
To: buildroot@buildroot.org
Subject: [Buildroot] [PATCH 2/2] docs/manual/adding-packages-cargo.adoc: add instructions for offline vendoring
Date: Thu, 12 Mar 2026 13:37:13 -0400 [thread overview]
Message-ID: <20260312173714.1428063-2-william.sherrer1@gmail.com> (raw)
In-Reply-To: <20260312173714.1428063-1-william.sherrer1@gmail.com>
This commit adds documentation to the cargo package infrastructure for offline vendoring.
It provides an example config for a user for what config file they'll need and where to
install it if working in an offline airgapped environment.
Signed-off-by: William Sherrer <william.sherrer1@gmail.com>
---
docs/manual/adding-packages-cargo.adoc | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/docs/manual/adding-packages-cargo.adoc b/docs/manual/adding-packages-cargo.adoc
index 4df758537b..f966a1497f 100644
--- a/docs/manual/adding-packages-cargo.adoc
+++ b/docs/manual/adding-packages-cargo.adoc
@@ -54,6 +54,25 @@ 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.
+When building custom cargo packages in an offline environment, Buildroot will
+attempt to download your dependencies from crates.io by default. Buildroot builds
+the package tarball with everything needed to compile the package offline.
+However, to use an offline crates mirror or registry to download dependencies,
+add a +config.toml+ pointing cargo to the offline registry.
+This file should exist in the +output/build/.cargo/+ directory.
+
+Below is an example config using panamax as a mirror.
+
+----
+01: [source.my-mirror]
+02: registry = "http://panamax.internal/crates.io-index"
+03:
+04: [source.crates-io]
+05: replace-with = "my-mirror"
+----
+
+This config will need to be installed as part of the build process.
+
==== +cargo-package+ reference
The main macros for the Cargo package infrastructure are
@@ -96,6 +115,4 @@ the tarball cached in Buildroot's +DL_DIR+, and therefore the hash of
the package's tarball doesn't only cover the source of the package
itself, but also covers the sources of the dependencies. Thus, a change
injected into one of the dependencies will also be discovered by the
-hash check. In addition, this mechanism allows the build to be
-performed completely offline since cargo will not do any downloads
-during the build. This mechanism is called vendoring the dependencies.
+hash check. This mechanism is called vendoring the dependencies.
--
2.43.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
prev parent reply other threads:[~2026-03-12 17:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-12 17:37 [Buildroot] [PATCH 1/2] package/pkg-cargo.mk: add option to vendor crates offline William Sherrer
2026-03-12 17:37 ` William Sherrer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260312173714.1428063-2-william.sherrer1@gmail.com \
--to=william.sherrer1@gmail.com \
--cc=buildroot@buildroot.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox