in build we imported "conf" and "from .conf import config" which let to
two different instances of config: "global config" at import was the
DEFAULTS array, and conf.config the updated config after reading the
user configuration.
Convert everything to use conf.config as everywhere else, which makes
setting of build defaults in the oscrc work again (like build-jobs).
This option adds extra packages listed in the specified file to build.
For now, osc does not support automatic buildrequires.
When a package has automatic buildrequires, osc just
returns error code 9 that is returned by build,
but build leaves a list of missing dependencies in
".build.packages/OTHER/_generated_buildreqs" file inside build root.
These extra packages can be added using "--extra-pkgs" ("-x") option,
but this is very inconvenient if there are many of them.
Allowing to add extra dependencies listed in a file makes building
packages with automatic buildrequires much more convenient:
just do a first stage build, resulting in a file with list of
extra dependencies, and then add extra packages from this file
using "--extra-pkgs-from" ("-X") option that is added by this change.
Signed-off-by: Oleg Girko <ol@infoserver.lv>
This causes downloads to come from the api, generally on noarch packages.
However, in countries like australia, due to OBS' high latency, and poor
bandwidth, these faults can cause downloads to take more than an hour, compared
to using a local mirror which can take minutes. There is actually nothing
wrong with the packages it all, OBS just sends the wrong md5.
As a result, ignore the problem and complain about it, because OBS is broken
here, not osc, and this wastes a lot of time.
The original findpacs() was returning either [Package]
or ([Package], [str]) depending on the `fatal` option.
This confused pylint and it was returning false-positives:
E1101: Instance of 'list' has no '...' member (no-member)
A list of strings is expected, but a string was passed.
It was working only by coincidence, because iterating
through ["."] and "." gives the same result.
* src/noarch rpm packaages needs to be stored in scheduler architecture to avoid
conflicts of the multiple versions
* avoid removal of every downloaded file
This allows a format to be specified in the sccache uri, specifically
the file uri so that a per-package cache can be created. This way
an osc build locally doesn't ruin your cache moving between different
packages.
Without escaping the % character, the download URL could be subject
to string formatting (depending on the subsequent characters). For
instance, if the url attribute's value of a buildinfo's path element
contains the substring "c_c%2B%2B", the "%2B" is interpreted as a
format string (see issue #965), which is wrong ("B" is not a valid
format character at all). In order to avoid this, escape all
% characters in the download urls.
Note: escaping the % characters in the download url itself is OK
because we only intend to "format" the path.
Note: we do not escape the % characters for urls from the config
file (implicit assumption: the user already correctly escaped the
urls (whether this assumption is sensible or not is debatable, of
course)).
Fixes: #965 ("unsupported format character 'B' (0x42) at index 66")
Current OBS is delivering hdrmd5 in buildinfo. It turns out
that osc has already code for validating cached files, but it
invalidates all local files atm with python 3.x
Some of our repositories have specific download urls. osc is ignoring
this so far and just tries to use the generic downloadurl
This code prefers definitions for individual path elements if they exist.
We could IMHO remove the old code, since old OBS instances would still
work via the api download fallback.
Real life examples for repo specific configs are on openSUSE all
repositories outside of the /repositories/ directory. eg.
<path project="openSUSE:Tumbleweed" repository="dod" url="http://download.opensuse.org/tumbleweed/repo/oss/"/>
Co-Author: Marcus Hüwe <suse-tux@gmx.de>
When building a package from a directory that is not a checked-out
OBS working, the error message:
"Error: "<directory>" is not an osc package working copy."
is generated.
This occurs when build.main() attempts to run source services which
is probably not a good idea as these are part of the core.Package
infrastructure which cannot be initialized for such packages.
It is probably best to disable the source services in this case.
See Issue#936.
Suggested-by: Marcus Huewe <suse-tux@gmx.de>
Signed-off-by: Egbert Eich <eich@suse.com>
Sccache is an alternate build caching system to ccache/icecream. It
supports C, C++ and Rust. It can optionally have distributed or remote
caches via redis, s3 object stores, memcached, azure storage or
google cloud storage.
This can help to significantly improve the performance of Rust rebuilds.
For example, Kanidm changes from 400s to 122s on a rebuild, and rust-lang
rebuilds improve from 7200s to 4770s. With some changes to the rust
packages especially this will be possible to speed up over version
changes as well.
See also: obs-build PR https://github.com/openSUSE/obs-build/pull/680
Do not use a preinstallimage if the local build is executed as a non-root
(the preinstallimage contains device nodes which usually cannot be created
by a non-root user - this is not a problem in the non-preinstallimage
codepath (see [1])).
[1] https://github.com/openSUSE/osc/pull/908#issuecomment-806903856