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





-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#187016): 
https://lists.openembedded.org/g/openembedded-core/message/187016
Mute This Topic: https://lists.openembedded.org/mt/101098826/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to