buildroot.busybox.net archive mirror
 help / color / mirror / Atom feed
From: James Hilliard <james.hilliard1@gmail.com>
To: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Matt Weber <Matthew.Weber@rockwellcollins.com>,
	Patrick Havelange <patrick.havelange@essensium.com>,
	"Yann E. MORIN" <yann.morin.1998@free.fr>,
	Buildroot List <buildroot@buildroot.org>
Subject: Re: [Buildroot] [PATCH v3 05/11] package/pkg-cargo.mk: introduce the cargo package infrastructure
Date: Fri, 7 Jan 2022 16:30:12 -0600	[thread overview]
Message-ID: <CADvTj4q+Ha1qvJ7t6YRRcmu9E8y-J_sU8=i0ZhdTzc1x_ZW+0A@mail.gmail.com> (raw)
In-Reply-To: <20220107105223.01912574@windsurf>

On Fri, Jan 7, 2022 at 3:52 AM Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
>
> Hello James,
>
> On Thu, 6 Jan 2022 19:12:51 -0600
> James Hilliard <james.hilliard1@gmail.com> wrote:
>
> > > +$(2)_CARGO_ENV += \
> > > +       CARGO_HOME=$$(HOST_DIR)/share/cargo \
> > > +       __CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS="nightly" \
> > > +       CARGO_TARGET_APPLIES_TO_HOST="false"
> >
> > Maybe want to set these additional options as well so that packages
> > using cargo can
> > build with only the env variables set(in some cases at least I think),
>
> Thanks for the suggestion. However, could you be more specific than
> "maybe" and "I think" ? The way you put it seems like we don't really
> know why those variables would be useful and what they do.
>
> > still probably
> > need to pass some command line args but this should reduce the amount at least:
> > RUSTC_TARGET_TRIPLE = $(subst -,_,$(call UPPERCASE,$(RUSTC_TARGET_NAME)))
>
> Which command line arguments would be replaced by those variables?
>
> > PKG_RUST_CARGO_ENV = \
> >     CARGO_HOME=$(HOST_DIR)/share/cargo \
>
> This one we already pass.
>
> >     CARGO_BUILD_TARGET=$(RUSTC_TARGET_NAME) \
>
> This one would replace the --target argument? Just to understand, what
> would be the advantage of the variable compared to the comand line
> argument?

Might be better for reusing this env for indirect cargo build
invocations like those
done by python-setuptools-rust.

>
> >     CARGO_INSTALL_ROOT=$(TARGET_DIR)/usr \
>
> This would replace --root $$(TARGET_DIR)/usr/ I suppose. Here as well,
> any benefit/drawback of arguments vs. variables?

Yeah, mostly for indict invocations as well.

>
> >     CARGO_TARGET_$(RUSTC_TARGET_TRIPLE)_LINKER=$(notdir $(TARGET_CROSS))gcc
>
> How come things are working today with this one?

I think this is currently set in the cargo config file.

>
> >
> > HOST_PKG_RUST_CARGO_ENV = \
> >     CARGO_HOME=$(HOST_DIR)/share/cargo \
>
> This one already passed.
>
> >     CARGO_INSTALL_ROOT=$(HOST_DIR) \
>
> This would replace --root $$(HOST_DIR) I suppose.

Yeah, sounds right.

>
> >     RUSTFLAGS="$(addprefix -C link-args=,$(HOST_LDFLAGS))"
>
> This is already passed, although replicated between the build and
> install steps of the host variant.
>
> So essentially the only questions is:
>
>  - Advantage of variables vs. command line options

Makes setting cargo variables when cargo is not directly invoked simpler.

>
>  - Relevance of CARGO_TARGET_$(RUSTC_TARGET_TRIPLE)_LINKER=$(notdir $(TARGET_CROSS))gcc

Set via CARGO_HOME currently, but I think may allow the cargo config to not
be required.

>
> Thanks!
>
> 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

  reply	other threads:[~2022-01-07 22:30 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-06 20:59 [Buildroot] [PATCH v3 00/11] Support for Cargo and Go vendoring Thomas Petazzoni
2022-01-06 20:59 ` [Buildroot] [PATCH v3 01/11] support/download/dl-wrapper: add concept of download post-processing Thomas Petazzoni
2022-01-07 10:28   ` Yann E. MORIN
2022-01-06 20:59 ` [Buildroot] [PATCH v3 02/11] package/pkg-download.mk: add <pkg>_DOWNLOAD_POST_PROCESS variable Thomas Petazzoni
2022-01-07 10:35   ` Yann E. MORIN
2022-01-06 20:59 ` [Buildroot] [PATCH v3 03/11] support/download/post-process-helpers: add helper function for post process scripts Thomas Petazzoni
2022-01-07 10:36   ` Yann E. MORIN
2022-01-06 20:59 ` [Buildroot] [PATCH v3 04/11] package/pkg-golang.mk: implement Go vendoring support Thomas Petazzoni
2022-01-09 11:49   ` Romain Naour
2022-01-06 20:59 ` [Buildroot] [PATCH v3 05/11] package/pkg-cargo.mk: introduce the cargo package infrastructure Thomas Petazzoni
2022-01-07  1:12   ` James Hilliard
2022-01-07  9:52     ` Thomas Petazzoni
2022-01-07 22:30       ` James Hilliard [this message]
2022-01-07 22:59         ` Thomas Petazzoni
2022-01-08  3:21           ` James Hilliard
2022-01-08 13:52           ` Juergen Stuber
2022-01-07 10:05   ` Romain Naour
2022-01-07 10:26   ` Romain Naour
2022-01-07 10:44     ` Yann E. MORIN
2022-01-07 11:03       ` Romain Naour
2022-01-07 21:07   ` Romain Naour
2022-01-07 21:53     ` Thomas Petazzoni
2022-01-09 10:04     ` Thomas Petazzoni
2022-01-06 20:59 ` [Buildroot] [PATCH v3 06/11] docs/manual/cargo: document the cargo-package infrastructure Thomas Petazzoni
2022-01-06 20:59 ` [Buildroot] [PATCH v3 07/11] package/ripgrep: convert to cargo infrastructure Thomas Petazzoni
2022-01-06 20:59 ` [Buildroot] [PATCH v3 08/11] package/sentry-cli: re-add package Thomas Petazzoni
2022-01-06 22:04   ` Christian Stewart via buildroot
2022-01-06 22:29     ` Thomas Petazzoni
2022-01-06 22:38       ` Christian Stewart via buildroot
2022-01-06 22:59         ` Thomas Petazzoni
2022-01-06 20:59 ` [Buildroot] [PATCH v3 09/11] package/tinifier: new package Thomas Petazzoni
2022-01-06 22:30   ` Christian Stewart via buildroot
2022-01-06 20:59 ` [Buildroot] [PATCH v3 10/11] package/embiggen-disk: " Thomas Petazzoni
2022-01-06 22:11   ` Christian Stewart via buildroot
2022-01-06 20:59 ` [Buildroot] [PATCH v3 11/11] package/gocryptfs: " Thomas Petazzoni
2022-01-06 22:26 ` [Buildroot] [PATCH v3 00/11] Support for Cargo and Go vendoring Christian Stewart via buildroot
2022-01-06 22:29   ` Thomas Petazzoni
2022-01-08 22:39 ` Thomas Petazzoni

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='CADvTj4q+Ha1qvJ7t6YRRcmu9E8y-J_sU8=i0ZhdTzc1x_ZW+0A@mail.gmail.com' \
    --to=james.hilliard1@gmail.com \
    --cc=Matthew.Weber@rockwellcollins.com \
    --cc=buildroot@buildroot.org \
    --cc=patrick.havelange@essensium.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=yann.morin.1998@free.fr \
    /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;
as well as URLs for NNTP newsgroup(s).