All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: enrico.scholz@sigma-chemnitz.de,
	openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] rust: why is it built in do_install()
Date: Fri, 01 Sep 2023 22:22:04 +0100	[thread overview]
Message-ID: <5c1df1490ce569e7644d33b33b2a44cd42dfc270.camel@linuxfoundation.org> (raw)
In-Reply-To: <lyjzt9g8e8.fsf@ensc-pc.intern.sigma-chemnitz.de>

On Fri, 2023-09-01 at 18:34 +0200, Enrico Scholz via
lists.openembedded.org wrote:
> Hello,
> 
> rust recipe does
> 
> > do_compile () {
> > }
> >  
> > rust_do_install() {
> >     rust_runx install
> > }
> > 
> > rust_do_install:class-nativesdk() {
> >     export PSEUDO_UNLOAD=1
> >     rust_runx install
> >     rust_runx install clippy
> >     rust_runx install rustfmt
> 
> 
> What is the reason to run the expensive "rust_runx" in do_install() and
> not in do_compile().

The reason was probably that was what was found to work in the original
recipe and nobody has had the time/need to improve it.

> This:
> 
> - is unexpected... do_install is usually expected to run fast
> 
> - might interfere with different ${PARALLEL_MAKE} and ${PARALLEL_MAKEINST}
>   setup
> 
> - might slow down the build process because the 'class-native' variant
>   seems to run with active 'pseudo'
> 
> 
> I guess it is done in this way because of
> 
> >    config.set("install", "prefix",  e(d.getVar("D") + d.getVar("prefix")))
> 
> where '${D}' is cleared by do_install.

That would seem likely to be at least one reason.

> Wouldn't it be better to replace this by
> 
> >    config.set("install", "prefix",  e(d.getVar("B") + '/_install' + d.getVar("prefix")))
> 
> 
> > do_compile () {
> >     rust_runx install
> >     rust_runx install clippy
> >     rust_runx install rustfmt
> > }
> > 
> > rust_do_install() {
> >     cp -a ${B}/_install ${D}
> 
> ?
> 
> 
> [adding 'rustfmt' to 'class-native' would be nice because e.g. 'bindgen'
>  users might expect it]

One potential downside is that "install" would then run outside pseudo
context which may cause problems with permissions. I don't really know
whether that would be an issue or not though in reality.

I'd be happy to see more people working on the rust recipes. The
challenge is the long testing cycles needed. Fancy working on some
patches?

Cheers,

Richard







  parent reply	other threads:[~2023-09-01 21:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-01 16:34 rust: why is it built in do_install() Enrico Scholz
2023-09-01 17:37 ` [OE-core] " Frédéric Martinsons
2023-09-01 21:22 ` Richard Purdie [this message]
2023-09-02  5:09   ` Alexander Kanavin
2023-09-02  9:22     ` Enrico Scholz
2023-09-02  9:49       ` Richard Purdie

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=5c1df1490ce569e7644d33b33b2a44cd42dfc270.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=enrico.scholz@sigma-chemnitz.de \
    --cc=openembedded-core@lists.openembedded.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 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.