Yocto Project Discussions
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Nicolas Jeker <n.jeker@delisys.ch>,
	Khoi Dinh Trinh <khoidinhtrinh@gmail.com>,
	Mike Looijmans <mike.looijmans@topic.nl>,
	Martin Weber <martin.weber@br-automation.com>
Cc: yocto@lists.yoctoproject.org
Subject: Re: [yocto] Switching between multiple DISTROs without "contamination"
Date: Wed, 20 Jul 2022 17:22:26 +0100	[thread overview]
Message-ID: <6e47ae24c2e5548db4c48875a91e4c52a8a9f2ee.camel@linuxfoundation.org> (raw)
In-Reply-To: <18cb0052f9c42bba13cbe2738b74058a4d691a00.camel@delisys.ch>

On Wed, 2022-07-13 at 15:32 +0200, Nicolas Jeker wrote:
> Thanks Martin and Mike for your explanations and tips.
> 
> So, I've done a lot of testing today and it seems I simplified the
> example in my first email a bit too much. The example as-is works fine
> when switching DISTROs as far as I can tell. The problem only arises
> when wildcards are used.
> 
> Changing my initial example like this should trigger the behaviour I've
> initially described:
> 
> SRC_URI:append:mydistro-dev = " file://application-dbg.service"
> 
> do_install {
>     # ...snip...
>     # systemd service
>     install -d ${D}${systemd_system_unitdir}
>     install -m 0644 ${WORKDIR}/*.service ${D}${systemd_system_unitdir}
> }
> 
> do_install:append:mydistro-dev() {
>     # debug systemd services
>     install -d ${D}${systemd_system_unitdir}
>     install -m 0644 ${WORKDIR}/application-dbg.service
> ${D}${systemd_system_unitdir}
> }
> 
> Notice the *.service in do_install.
> 
> From my testing, this is how contamination happens:
> 
> 1) Build with 'DISTRO=mydistro bitbake application'. All tasks for the
> recipe are run and the directories in WORKDIR are populated, including
> the "application.service" file.
> 2) Build with 'DISTRO=mydistro-dev bitbake application'. do_unpack is
> rerun and places the additional "application-dbg.service" file in
> WORKDIR.
> 3) Switching back to 'mydistro' will get the recipe from sstate cache,
> which works fine.
> 4) Changing application.bb and rebuilding with 'DISTRO=mydistro bitbake
> application' reruns do_install (as expected). This leads to the
> packages do_install picking up the additional "application-dbg.service"
> file left behind by the invocation in step 2).
> 
> Mike, Martin: Do you remember in which cases you encountered problems
> when sharing the build directory?

This is unfortunately a known issue and is one reason I'd like to stop
recipes downloading files to WORKDIR. Sadly changing that to fix this
bug is very invasive and painful but I think we do need to do so
somehow.

Cheers,

Richard



      parent reply	other threads:[~2022-07-20 16:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1b153bce-a66a-45ee-a5c6-963ea6fb1c82.949ef384-8293-46b8-903f-40a477c056ae.0579b8aa-d2a5-42d7-9e61-2548c06e61ef@emailsignatures365.codetwo.com>
     [not found] ` <1b153bce-a66a-45ee-a5c6-963ea6fb1c82.0d2bd5fa-15cc-4b27-b94e-83614f9e5b38.2d9bc8b4-92c7-47b2-b9e8-ac8d32e87ee0@emailsignatures365.codetwo.com>
2022-07-12 13:37   ` Switching between multiple DISTROs without "contamination" Nicolas Jeker
2022-07-12 14:49     ` AW: [yocto] " Martin Weber
2022-07-12 15:05     ` Mike Looijmans
2022-07-12 16:15       ` Khoi Dinh Trinh
2022-07-13 13:32         ` Nicolas Jeker
2022-07-20 14:42           ` Mike Looijmans
2022-07-20 16:22           ` Richard Purdie [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=6e47ae24c2e5548db4c48875a91e4c52a8a9f2ee.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=khoidinhtrinh@gmail.com \
    --cc=martin.weber@br-automation.com \
    --cc=mike.looijmans@topic.nl \
    --cc=n.jeker@delisys.ch \
    --cc=yocto@lists.yoctoproject.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