All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yoann Congal <yoann.congal@smile.fr>
To: zboszor@gmail.com, openembedded-core@lists.openembedded.org
Subject: Re: [OE-core][PATCH 1/3] cargo.bbclass: Allow using --offline instead of --frozen
Date: Wed, 29 Jan 2025 10:36:26 +0100	[thread overview]
Message-ID: <2932fc48-8cc5-41de-a155-e4d23272d802@smile.fr> (raw)
In-Reply-To: <20250129080902.1863054-1-zboszor@gmail.com>



Le 29/01/2025 à 09:09, Zoltan Boszormenyi via lists.openembedded.org a
écrit :
> Some rust packages complain about the --frozen flag:
> 
> | error: the lock file .../Cargo.lock needs to be updated but --frozen was passed to prevent this
> | If you want to try to generate the lock file without accessing the network, remove the --frozen flag and use --offline instead.
> 
> Add a CARGO_USE_OFFLINE_FLAG = 0/1 flag to allow using --offline
> instead of --frozen for such cases.
> 
> Use 0 by default to keep using --frozen as the default flag.
> 
> Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
> ---
>  meta/classes-recipe/cargo.bbclass | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/classes-recipe/cargo.bbclass b/meta/classes-recipe/cargo.bbclass
> index b583f84bdf..fe5ce9b023 100644
> --- a/meta/classes-recipe/cargo.bbclass
> +++ b/meta/classes-recipe/cargo.bbclass
> @@ -37,7 +37,10 @@ BUILD_MODE = "${@['--release', ''][d.getVar('DEBUG_BUILD') == '1']}"
>  # and will require an up to date Cargo.lock file.
>  # This force the package being built to already ship a Cargo.lock, in the end
>  # this is what we want, at least, for reproducibility of the build.
> -CARGO_BUILD_FLAGS = "-v --frozen --target ${RUST_HOST_SYS} ${BUILD_MODE} --manifest-path=${CARGO_MANIFEST_PATH}"
> +# Sometimes --freeze fails because Cargo.lock needs to be modified
> +# without version changes. --offline can be used instead.
> +CARGO_USE_OFFLINE_FLAG ??= "0"
> +CARGO_BUILD_FLAGS = "-v ${@ '--frozen' if d.getVar('CARGO_USE_OFFLINE_FLAG') == '0' else '--offline'} --target ${RUST_HOST_SYS} ${BUILD_MODE} --manifest-path=${CARGO_MANIFEST_PATH}"

Maybe use
bb.utils.to_boolean(d.getVar("CARGO_USE_OFFLINE_FLAG"))
instead of
d.getVar('CARGO_USE_OFFLINE_FLAG') == '0'
?

  >  # This is based on the content of CARGO_BUILD_FLAGS and generally
will need to
>  # change if CARGO_BUILD_FLAGS changes.
> 
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#210347): https://lists.openembedded.org/g/openembedded-core/message/210347
> Mute This Topic: https://lists.openembedded.org/mt/110874793/4316185
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [yoann.congal@smile.fr]
> -=-=-=-=-=-=-=-=-=-=-=-
> 

-- 
Yoann Congal
Smile ECS - Tech Expert



      parent reply	other threads:[~2025-01-29  9:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-29  8:09 [OE-core][PATCH 1/3] cargo.bbclass: Allow using --offline instead of --frozen Zoltán Böszörményi
2025-01-29  8:09 ` [OE-core][PATCH 2/3] rpm-sequoia: New recipe for version 1.6.0 Zoltán Böszörményi
2025-01-29  9:05   ` Alexander Kanavin
2025-01-29  9:14     ` Böszörményi Zoltán
2025-01-29  9:20     ` Böszörményi Zoltán
2025-01-29  9:29       ` Alexander Kanavin
2025-01-29 10:09         ` Böszörményi Zoltán
     [not found]       ` <181F1FDA3B65007A.31881@lists.openembedded.org>
2025-01-29  9:41         ` Alexander Kanavin
2025-01-29  8:09 ` [OE-core][PATCH 3/3] rpm: Automatically enable using rpm-sequoia for signed packages Zoltán Böszörményi
2025-01-29  8:56   ` Alexander Kanavin
2025-01-29 10:34     ` Böszörményi Zoltán
2025-01-29 10:54       ` Alexander Kanavin
2025-01-29  8:49 ` [OE-core][PATCH 1/3] cargo.bbclass: Allow using --offline instead of --frozen Alexander Kanavin
2025-01-29  9:00   ` Böszörményi Zoltán
2025-01-29  9:08     ` Alexander Kanavin
2025-01-29  9:36 ` Yoann Congal [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=2932fc48-8cc5-41de-a155-e4d23272d802@smile.fr \
    --to=yoann.congal@smile.fr \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=zboszor@gmail.com \
    /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 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.