Commit Graph

19 Commits

Author SHA1 Message Date
Peter Kjellerstedt 7ea76684cb package.bbclass: Restore functionality to detect RPM dependencies
During the transition to dnf and rpm4, the functionality to
automatically make RPM determine dependencies was lost.

Before the transition, an OE specific tool called rpmdeps-oecore had
been added to the rpm suit. It was based on the rpmdeps tool that is
part of rpm. For each file specified on its command line, it would
output the provides and requires that RPM could determine.

During the transition to rpm4, rpmdeps-oecore was replaced with the
standard rpmdeps. However, what no one noticed was that unless rpmdeps
is given options, e.g., -P or -R, to tell it what it should output, it
will not output anything. Thus, it would do all the work to determine
the requirements, but would keep silent about it. And since no output
from rpmdeps is expected unless there are requirements, there were no
warnings indicating that everything was not working as expected.

Porting the old rpmdeps-oecore to work with rpm4 is not really
possible since it relied on being able to access internals of RPM that
are no longer available. However, it turned out that rpmdeps had a
debug option, --rpmfcdebug, that would output exactly the information
that we need, albeit in a different format and to stderr. To make this
usable, rpmdeps has now received a new option, --alldeps, which sends
the information we need to stdout.

Since enabling this may cause packages to break, it is required that
ENABLE_RPM_FILEDEPS_FOR_PYRO is set to "1" to activate it for Pyro.
The name of this variable has been chosen as to indicate that it only
affects Pyro (since releases before and after Pyro has it enabled by
default).

(From OE-Core rev: 1009498f23ad319825c00ba60a4693d15aada553)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31 17:57:12 +01:00
Richard Purdie c90246caeb package: Fix various rpmdeps relocation issues
There are several issues with rpmdeps after the rpm v5 -> v4 transition:
 * _rpmfc_magic_path  is an invalid option for rpm4
 * --rpmpopt is an invalid option for rpm4
 * we need to use the path to rpmrc since otherwise it poitns at the
   original build path
 * we need to set MAGIC in the environment so libmagic can find its
   files.

This patch addresses those and ensures rpmdeps works in relocated builds
from sstate (or with rm_work).

(From OE-Core rev: 806e37264d7102ae982867350ad8363ed3e5f475)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-14 14:42:18 +00:00
Anders Darander 2db1227fa2 lib/oe/package.py: remove @ from package name
@ isn't allowed in package names. Angular2 packages often have
@ in their names.

(From OE-Core rev: 3c4291bc58bcc5c66ef539eed29b7c37ac968a06)

Signed-off-by: Anders Darander <anders@chargestorm.se>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04 23:18:18 +00:00
Joshua Lock c4e2c59088 meta: remove True option to getVar calls
getVar() now defaults to expanding by default, thus remove the True
option from getVar() calls with a regex search and replace.

Search made with the following regex: getVar ?\(( ?[^,()]*), True\)

(From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16 10:23:23 +00:00
Stephano Cetola d8fbaebc48 package_manager: remove strings and migrate to direct arrays
When using subprocess call and check_output, it is better to use arrays
rather than strings when possible to avoid whitespace and quoting
problems.

[ YOCTO #9342 ]

(From OE-Core rev: b12cec9a5ef14ecb02be7feec65508cf5d65c795)

Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-08 10:31:30 +00:00
Ross Burton b384b724ec oe/lib/package: handle shlibs files disappearing
During a parallel build it's possible for unrelated shlib files to be removed if
the recipe they came from is about to be rebuilt.  They can't be involved in the
dependency chains as otherwise they wouldn't be removed, so just silently handle
files disappearing.

[ YOCTO #8555 ]

(From OE-Core rev: 1e355da3fda742c78d99ddd2ee5caa9df52f92e1)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:28:47 +01:00
Richard Purdie 3b39971748 classes/lib: Complete transition to python3
This patch contains all the other misc pieces of the transition to
python3 which didn't make sense to be broken into individual patches.

(From OE-Core rev: fcd6b38bab8517d83e1ed48eef1bca9a9a190f57)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:01 +01:00
Richard Purdie a7309d5790 classes/lib: Update to use python3 command pipeline decoding
In python3, strings are unicode by default. We need to encode/decode
from command pipelines and other places where we interface with the
real world using the correct locales. This patch updates various
call sites to use the correct encoding/decodings.

(From OE-Core rev: bb4685af1bffe17b3aa92a6d21398f38a44ea874)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:00 +01:00
Paul Eggleton 6ddd408f6d recipetool: create: fix picking up false npm package directories
It is possible for a Node.js module to have node_modules subdirectories
that contain no package.json file (e.g. iotivity-node has such a
directory). It appears these should simply be ignored, or else with the
way the current code works we will get errors later.

(From OE-Core rev: 8c522f1f536270e195c8c73f5c72801495e7b33b)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06 10:31:14 +01:00
Brendan Le Foll 69e20cade6 npm.bbclass: Stop packagenames containing underscores from being generated
Package names cannot contain underscores yet some npm modules use them as part
of the name, replace them with hyphens in the package name.

(From OE-Core rev: fea932c79c8201e3e7649f4443874ea540e33461)

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-14 10:58:33 +01:00
Paul Eggleton 91455005b6 recipetool: create: split npm module dependencies into packages
Rather than rolling all of an npm module's dependencies into the same
package, split them into one module per package, setting the SUMMARY and
PKGV values from the package.json file for each package. Additionally,
mark each package with the appropriate license using the license
scanning we already do, falling back to the license stated in the
package.json file for the module if unknown. All of this is mostly in
aid of ensuring all modules and their licenses now show up in the
manifests for the image.

Additionally we set the main LICENSE value more concretely once we've
calculated the per-package licenses, since we have more information at
that point.

(From OE-Core rev: 8226805f83d21e7c1d2ba21969f3e8ee4b137496)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-09 17:00:29 +00:00
Ed Bartosh 74dc93651f split_and_strip_files: regroup hardlinks to make build deterministic
Reverted 7c0fd561bad0250a00cef63e3d787573112a59cf

Created separate group of hardlinks for the files inside
the same package. This should prevent stripped files to be
populated outside of package directories.

This turns out not to be straightforward and has overlap with the
other hardlink handling code in this area. The code is condensed
into a more concise and documented form.

[Original patch from Ed with tweaks from RP]

[YOCTO #7586]

(From OE-Core rev: 82d00f7254b7d3bb6a167d675d798134884d1b19)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-29 10:58:55 +01:00
Richard Purdie 9eb4222e36 lib/oe/package: Improve strip subprocess handling
Currently if the strip process fails, we get a message but don't know why. This adds
code to show the return value and any error output.

(From OE-Core rev: 85e8fb1c7a3baac5633ecdfb36113aec7f4235cb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-29 10:58:55 +01:00
Fabrice Coulon 1e34e71e0f meta/lib/oe/package.py: fix files ownership in packages
This fix solves the problem with the ownership of files in packages.
The do_install task was producing correct and expected output but when
the files were being put in, e.g. a rpm package, the ownership could
be different than that in the do_install task.

[YOCTO #7428]

(From OE-Core rev: 1a50cc5aeafff0d8ee6c4a41dd2770ecd31455f0)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Fabrice Coulon <fabrice.coulon@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-20 11:03:46 +00:00
Richard Purdie 8bab098c36 lib/oe/package: Ensure strip breaks hardlinks
Normally, strip preserves hardlinks which in the case of the way our hardlink
rather than copy functionality works, is a disadvantage and leads to non-deterministic
builds. This adds a move into place after the strip operation to ensure hardlinks
are broken and we bring back build determinism.

(From OE-Core rev: 7c0fd561bad0250a00cef63e3d787573112a59cf)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-23 11:36:31 +00:00
Paul Eggleton de8730ce2d classes/package: move read_shlib_providers() to a common unit
This allows us to use this function elsewhere in the code.

(From OE-Core rev: 657cff8a0f0e5db171b2ed9388a790ee0b135842)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-21 12:37:56 +00:00
Martin Jansa ff8d8fbc9e package.py: use subprocess.Popen for rpmdeps call
* I've noticed errors like this in log.do_package:

  DEBUG: Executing python function package_do_filedeps
  sh: 1: Syntax error: "(" unexpected
  sh: 1: Syntax error: "(" unexpected
  DEBUG: Python function package_do_filedeps finished

  which are actually caused by some filenames included in package
  containing '()' characters

  Maybe we should change meta/classes/package.bbclass to
  fail when some filedeprunner call fails like this and fix
  filedeprunner to escape '()' and other possibly dangerous chars
  it's called like this:
  processed = list(pool.imap(oe.package.filedeprunner, pkglist))

* don't use shell=True
* show the command when it fails and let do_package task to fail

(From OE-Core rev: 148c04c1bf39ca0d21288fdce61c51dc8e1c3226)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-07 14:58:46 +00:00
Richard Purdie b34fd60d8f package: Process package stripping in parallel
(From OE-Core rev: 981fed49ee80560fb067b3f47aeada1fdee792ca)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06 13:12:59 +00:00
Richard Purdie d81aa06ece package.bbclass: Multithread per file dependency generation code
(From OE-Core rev: b659eb0f2070149d9516c129b3853b41fbbd1033)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06 13:12:59 +00:00