($INBOX_DIR/description missing)
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-architecture
	<openembedded-architecture@lists.openembedded.org>
Cc: docs <docs@lists.yoctoproject.org>
Subject: WOKRDIR change transition guide/notes
Date: Wed, 15 May 2024 14:12:30 +0100	[thread overview]
Message-ID: <4760bef7826c511c0a664e4e58ab5560cd340358.camel@linuxfoundation.org> (raw)

Now that there is a roughly ready patchset for this I wanted to write
down a quick guide to converting recipes.

S = ${WORKDIR}
==============

If a recipe has S set to be WORKDIR this is no longer supported.
Currently you'll see warnings, those will become errors very soon and
even now, the code probably isn't safe to work like that. The recipe
should be changed to:

S = "${WORKDIR}/sources"
UNPACKDIR = "${S}"

Any WORKDIR references where files from SRC_URI are referenced should
be changed to S. These are commonly in do_compile, do_install and
LIC_FILES_CHKSUM.


WORKDIR references in the recipe
================================

WORKDIR references in other recipes need auditing. If they reference
files from SRC_URI, they likely need changing to UNPACKDIR. These are
commonly in do_compile and do_install for things like service or
configuration files.

One unusual one is ${WORKDIR}/${BP} should probably be ${S}.

References to "../" in LIC_FILES_CHKSUM or elsewhere may need changing
to UNPACKDIR.

References to WORKDIR in sed commands are usually left as they are now.


General notes
=============

Files from do_unpack now unpack to WORKDIR/sources-unpack/ rather than
WORKDIR/. 

If S is set to a subdirectory under WORKDIR and that subdirectory
exists in sources-unpack after do_unpack runs, it is moved to WORKDIR.
This means S = "${WORKDIR}/${BP}", S = "${WORKDIR}/git" and also deeper
paths continue to work as expected without changes. We cannot use
symlinks to do this as it breaks autotools based recipes in weird and
interesting ways I didn't feel like exploring.

At this time, keeping all sources under sources-unpack isn't being
considered as it means more invasive recipes changes. The key issue is
separating the unpack task output from WORKDIR which this change
achieves.

Previously, S was always created but after the recent changes it is
not. This means the check in do_unpack_qa triggers where S is not
created by a recipe where as it did not before. This can mean adding a
S definition to a recipe that only uses file:// SRC_URI entries.

Building C files from UNPACKDIR without setting S to point at it does
not work as our debug prefix mapping doesn't handle that. 

devtool and recipetool have been updated to handle this and their
support for S = WORKDIR and oe-local-files has been removed.


Cheers,

Richard


             reply	other threads:[~2024-05-15 13:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-15 13:12 Richard Purdie [this message]
2024-05-23  9:05 ` [docs] WOKRDIR change transition guide/notes Michael Opdenacker

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=4760bef7826c511c0a664e4e58ab5560cd340358.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=docs@lists.yoctoproject.org \
    --cc=openembedded-architecture@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 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 read-only IMAP folder(s) and NNTP newsgroup(s).