<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/poky.git/scripts/lib/recipetool, branch yocto-5.2.4</title>
<subtitle>Mirror of git.yoctoproject.org/poky</subtitle>
<id>https://git.enea.com/cgit/linux/poky.git/atom?h=yocto-5.2.4</id>
<link rel='self' href='https://git.enea.com/cgit/linux/poky.git/atom?h=yocto-5.2.4'/>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/'/>
<updated>2024-08-23T08:51:36+00:00</updated>
<entry>
<title>recipetool: create_npm: reuse license utils</title>
<updated>2024-08-23T08:51:36+00:00</updated>
<author>
<name>Enguerrand de Ribaucourt</name>
<email>enguerrand.de-ribaucourt@savoirfairelinux.com</email>
</author>
<published>2024-08-12T12:28:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=0a0caacfa54dd086b87e31f5e806e5f21d5ffc3f'/>
<id>urn:sha1:0a0caacfa54dd086b87e31f5e806e5f21d5ffc3f</id>
<content type='text'>
create_npm.py duplicated the logic for matching licenses from files and
also finding them. This patch refactors the code to reuse the license
utils. This will make the code more maintainable and also align both
behaviors. For instance, some licenses weren't matched properly because
the duplicate logic did not support the difference in format in the md5
tables for COMMON_LICENSE_DIR and licenses.csv.

This is also faster since the license files were being read twice.
The result is slightly more accurate since the utils have better
implementations, and I was able to reuse the logic for the root PN
package, as well as the base LICENSE variable.

I chose to extract generate_common_licenses_chksums into create.py
since it can be considered a general utility function to allow
other recipetool creators to refer to COMMON_LICENSE_DIR files.

I updated the wording in the code when appropriate.

v3:
 - added commit
 - this replaces the commit that added all the COMMON_LICENSE_DIR md5
   to licenses.csv

(From OE-Core rev: 7bc18bed63b94689890bcde63402d7cc1cedffa9)

Signed-off-by: Enguerrand de Ribaucourt &lt;enguerrand.de-ribaucourt@savoirfairelinux.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>recipetool: create: split guess_license function</title>
<updated>2024-08-23T08:51:36+00:00</updated>
<author>
<name>Enguerrand de Ribaucourt</name>
<email>enguerrand.de-ribaucourt@savoirfairelinux.com</email>
</author>
<published>2024-08-12T12:28:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=69bf37a3dd0470dc153bb7a21bd8f13a64bde2c3'/>
<id>urn:sha1:69bf37a3dd0470dc153bb7a21bd8f13a64bde2c3</id>
<content type='text'>
The npm recipetool handler redefines the license code the could be
unified. In order to do this refactoring, extract the bits we'll
need into separate functions.

guess_license() is renamed to find_licenses() and is split into
find_license_files() and match_licenses().

(From OE-Core rev: f1ec28feaea8ea6a2df894dd4ddba561c8a04ed2)

Signed-off-by: Enguerrand de Ribaucourt &lt;enguerrand.de-ribaucourt@savoirfairelinux.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>recipetool: create_npm: resolve licenses defined in package.json</title>
<updated>2024-08-23T08:51:36+00:00</updated>
<author>
<name>Enguerrand de Ribaucourt</name>
<email>enguerrand.de-ribaucourt@savoirfairelinux.com</email>
</author>
<published>2024-08-12T12:28:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=01d17cd5d42d1c9c349e1249bdacffb24d8446bb'/>
<id>urn:sha1:01d17cd5d42d1c9c349e1249bdacffb24d8446bb</id>
<content type='text'>
Some npm packages do not copy the LICENSE or COPY file into their
git repository. They'll instead simply use SPDX identifiers in their
package.json. A fallback for those repositories attempted to match
the README file to a license file instead, which had a very low
probability of success.

This commit replaces this fallback with parsing the package.json and
looking for the license in COMMON_LICENSE_DIR. If the license is not
found, "Unknown" will still be produced.

This also generates "Unknown" for packages which had no README file,
which could silently not appear in the generated recipe. The user was
more likely to miss them.

Co-authored-by: Tanguy Raufflet &lt;tanguy.raufflet@savoirfairelinux.com&gt;
(From OE-Core rev: 445604cfc4a5813ea635f18053cd1f673bf0b830)

Signed-off-by: Tanguy Raufflet &lt;tanguy.raufflet@savoirfairelinux.com&gt;
Signed-off-by: Enguerrand de Ribaucourt &lt;enguerrand.de-ribaucourt@savoirfairelinux.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>recipetool/devtool: Update to work correctly with UNPACKDIR</title>
<updated>2024-05-22T21:26:30+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2024-05-13T15:02:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=569f8e09f0b077045d112dd569cbc4d47fdae08e'/>
<id>urn:sha1:569f8e09f0b077045d112dd569cbc4d47fdae08e</id>
<content type='text'>
Tweak recipetool and devtool to correctly use UNPACKDIR. This allows some
simplification of the code. This patch makes things basically work but there
are likely deeper improvements that can be made now that WORKDIR != UNPACKDIR.

(From OE-Core rev: d2eeaa88b27a2875c419591d1d91bcc85d7b129c)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>classes/lib/scripts: Initial WORKDIR -&gt; UNPACKDIR updates</title>
<updated>2024-05-02T14:15:51+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2024-05-01T20:34:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=808f700efcb98f5344c18db6c91b83a9e4bd15e8'/>
<id>urn:sha1:808f700efcb98f5344c18db6c91b83a9e4bd15e8</id>
<content type='text'>
Work through the initial issues I found where we need to change WORKDIR
to UNPACKDIR.

(From OE-Core rev: 86fec41b1e809d1a2fa2feadc26d29020df53d39)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>recipetool: Handle several go-import tags in go resolver</title>
<updated>2024-04-23T12:40:24+00:00</updated>
<author>
<name>Sven Schwermer</name>
<email>sven.schwermer@disruptive-technologies.com</email>
</author>
<published>2024-04-11T10:10:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=8219eefdd808bc1abed165cec3764cc5583c2149'/>
<id>urn:sha1:8219eefdd808bc1abed165cec3764cc5583c2149</id>
<content type='text'>
When dynamically resolving go modules, the HTML page may contain several
go-import meta tags. We must handle all and pick the correct one based
on the module name. An example for such a behaviour is
gonum.org/v1/gonum:

&lt;meta name="go-import" content="gonum.org/v1/exp git https://github.com/gonum/exp"&gt;
&lt;meta name="go-import" content="gonum.org/v1/gonum git https://github.com/gonum/gonum"&gt;
&lt;meta name="go-import" content="gonum.org/v1/hdf5 git https://github.com/gonum/hdf5"&gt;
&lt;meta name="go-import" content="gonum.org/v1/netlib git https://github.com/gonum/netlib"&gt;
&lt;meta name="go-import" content="gonum.org/v1/plot git https://github.com/gonum/plot"&gt;
&lt;meta name="go-import" content="gonum.org/v1/tools git https://github.com/gonum/tools"&gt;

(From OE-Core rev: 9c36a61e29359067165bddc7f2accdf2c4c8a761)

Signed-off-by: Sven Schwermer &lt;sven.schwermer@disruptive-technologies.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>recipetool: Handle unclean response in go resolver</title>
<updated>2024-04-23T12:40:24+00:00</updated>
<author>
<name>Sven Schwermer</name>
<email>sven.schwermer@disruptive-technologies.com</email>
</author>
<published>2024-04-11T10:10:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=e4c3483ecf496b7637d1e9fd3b0eb9ace94a09d2'/>
<id>urn:sha1:e4c3483ecf496b7637d1e9fd3b0eb9ace94a09d2</id>
<content type='text'>
It appears that some go modules repond with a 404 error when trying to
resolve them dynamically. The response body may still contain the
go-import meta tag. An example for such behaviour is gonum.org/v1/gonum.

(From OE-Core rev: 8f2e14ab6562a9a68819a960c66a258ea9dbe246)

Signed-off-by: Sven Schwermer &lt;sven.schwermer@disruptive-technologies.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>recipetool; add support for python_mesonpy class</title>
<updated>2024-02-20T11:39:45+00:00</updated>
<author>
<name>Tim Orling</name>
<email>ticotimo@gmail.com</email>
</author>
<published>2024-02-19T17:30:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=9f7475b4e5219da89f04c21a96d54e76fc6a6960'/>
<id>urn:sha1:9f7475b4e5219da89f04c21a96d54e76fc6a6960</id>
<content type='text'>
* Add support to detect the "mesonpy" build-backend for recipetool create.
* Add oe-selftest case for creating a recipe for "siphash24" from pypi.
  https://pypi.org/project/siphash24/

This is by far the simplest recipe using the mesonpy build backend.

Upstream does not provide LICENSE file(s) and we do not detect the
LICENSE so don't check for that result in the test. Likewise, upstream
does not define HOMEPAGE, so skip that result.

(From OE-Core rev: 256749322671d2f4ea994db671d73c4de10e1723)

Signed-off-by: Tim Orling &lt;tim.orling@konsulko.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>scripts: python 3.12 regex</title>
<updated>2024-02-13T13:51:41+00:00</updated>
<author>
<name>Adrian Freihofer</name>
<email>adrian.freihofer@gmail.com</email>
</author>
<published>2024-02-10T13:15:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=605ef6f5a292fe169b1469b0a8996f3d5ae53daf'/>
<id>urn:sha1:605ef6f5a292fe169b1469b0a8996f3d5ae53daf</id>
<content type='text'>
All the regexes throw a warning like this:

WARNING: scripts/lib/recipetool/create_buildsys.py:140:
      SyntaxWarning: invalid escape sequence '\s'
      proj_re = re.compile('project\s*\(([^)]*)\)', re.IGNORECASE)

Python 3 interprets string literals as Unicode strings, and therefore
\s is treated as an escaped Unicode character which is not correct.
Declaring the RegEx pattern as a raw string instead of unicode is
required for Python 3.

(From OE-Core rev: 24b0ba00d4f0b4d9834f7693ecb6032dfc534a80)

Signed-off-by: Adrian Freihofer &lt;adrian.freihofer@siemens.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>recipetool: don't dump stack traces if a toml parser can't be found</title>
<updated>2024-02-10T14:13:24+00:00</updated>
<author>
<name>Ross Burton</name>
<email>ross.burton@arm.com</email>
</author>
<published>2024-02-09T15:39:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=c472b4ce5990080e258a409cec0cab4cdb1a37f8'/>
<id>urn:sha1:c472b4ce5990080e258a409cec0cab4cdb1a37f8</id>
<content type='text'>
If we can't find tomllib or tomli then we can just tell the user politely
that we can't parse the pyproject.toml file, there's no need to dump
exception stack traces.

Move the parser exception handler to catch the actual parse, as otherwise
it will never be used.

Whilst here, also add some debug statements to make it clear what of the
handlers is being called.

(From OE-Core rev: 1a3ba4c312844d80ae382912b319e60ad8b30737)

Signed-off-by: Ross Burton &lt;ross.burton@arm.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
</feed>
