1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-09-20 17:26:15 +02:00
Commit Graph

368 Commits

Author SHA1 Message Date
Marcus Huewe
d549f27ec5 Escape % character in binary download URLs
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")
2021-12-07 20:44:48 +01:00
f3a9ef6446 build: Fix printing paths to built debian packages 2021-12-07 09:17:55 +01:00
4d7dd3d46c
fix hdmrd5 check of local cached files
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
2021-10-19 16:01:24 +02:00
3b90480dfc
fix downloading from mirrors
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>
2021-10-06 13:16:40 +02:00
b61b79cf85 Don't run source services when building outside of an OSC package working copy
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>
2021-08-08 18:20:30 +02:00
90d9402a05 fix local product builds using obsrepositories:/ directives
We need an absolute path since osc calls build in user home directory.

Also extend the file name to hint to osc (and not any service
configuration)
2021-06-28 09:26:27 +02:00
209686a16f support cross compile using a sysroot
We need to hand over the sysroot rpms in rpmlist with a prefix. And we
need to take care of the "crossarch" definition in buildinfo
2021-05-18 07:57:02 +02:00
William Brown
c12e0b5cda Add support for sccache.
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
2021-05-14 12:57:40 +10:00
Marcus Huewe
1e94757498 Merge branch 'build_as_user' of https://github.com/adrianschroeter/osc
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
2021-04-28 16:55:34 +02:00
08979fb0eb do not use preinstallimages when building as non-root
it can not work and build script will direct complain in future
2021-04-28 16:53:17 +02:00
320adda399 simpleimage uses OTHER directory to deliver files 2021-04-26 08:02:38 +02:00
6ac7855f4d remove "need root" autodetection
This kind of guessing can not really work here and leads to failing
builds when using KVM. (eg. when using a preinstallimage)

Removing the code, since we have a now a way to allow the user to
specify building as user via su-wrapper config
2021-03-25 09:06:48 +01:00
4907982d42 allow to run build script as user
works only with kvm atm, we should maybe point the user to it in that
case?

Requires: https://github.com/openSUSE/obs-build/pull/678/files
2021-03-22 15:16:35 +01:00
2bc186d0ea add new stage option for the build script
(minor code improvement for handing over release number)
2021-02-18 09:01:18 +01:00
c06b794ddf support osc build --shell-after-fail from build script 2021-02-12 08:20:51 +01:00
9ad555ee24 mention flatpack as well 2021-01-18 10:21:50 +01:00
Oleg Girko
74846ea83b Add support for nspawn VM type.
This allows to utilise support for systemd-nspawn backend in build engine.
Like LXC, systemd-nspawn creates isolated lightweight container.

Signed-off-by: Oleg Girko <ol@infoserver.lv>
2020-11-22 14:34:37 +00:00
Michael Schroeder
5d2542522d Support flatpak building 2020-11-12 14:08:10 +01:00
Marcus Huewe
e58abf1527 Support a preinstallimage in combination with the --offline option
Currently, if the --offline option is passed to "osc build ...", a
preinstallimage is not used (even if it exists). Instead, a
preinstallimage should be used (if it exists) even if the --offline
option is specified.
2020-09-07 18:54:59 +02:00
Kevin Tee
783544d2da
Update build.py
Fix repeated word.
2020-07-26 11:57:18 +00:00
Adam Williamson
13a13a87c4 Fix ElementTree imports for Python 3.9
Importing `cElementTree` has been deprecated since Python 3.3 -
importing `ElementTree` automatically uses the fastest
implementation available - and is finally removed in Python 3.9.
Importing cElementTree directly (not as part of xml) is an even
older relic, it's for Ye Time Before ElementTree Was Added To
Python and it was instead an external module...which was before
Python 2.5.

We still need to work with Python 2.7 for now, so we use a try/
except to handle both 2.7 and 3.9 cases. Also, let's not repeat
this import 12 times in one file for some reason.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2020-06-02 15:13:10 -07:00
Marco Strigl
3967133022
Merge pull request #793 from sjamgade/ccache_path
add option pkg-ccache to be passed to build-cmd
2020-05-22 15:55:48 +02:00
Fabian Vogt
f3d07eab3f Fix kiwi build with --prefer-pkgs
The buildinfo contains packages from the local dir, so it needs the list of
local packages to work correctly.
2020-05-20 11:34:27 +02:00
Sumit Jamgade
5dd853e302 add option pkg-ccache to be passed to build-cmd
this option is a /path/to/_ccache.tar. The patch just forwards that
option to the build script.
2020-05-19 16:15:49 +02:00
12e0b67117 complete --shell-cmd support parts to get it working 2020-05-12 13:16:29 +02:00
William Brown
bdb0c8033c Add ccache argument for oscrc 2020-04-14 14:50:24 +10:00
lethliel
81acc39c9f e.reason is a string not a integer decimal 2020-04-01 12:48:12 +02:00
Marcus Huewe
cd51f47a77 Return bytes in packagequery.PackageQueryResult.evr() instead of a str
The packagequery.PackageQueryResult class is supposed to provide a
bytes API. Hence, packagequery.PackageQueryResult.evr() should return
bytes instead of a str. Also, adjust the single caller in the build
module.
2020-03-15 18:30:00 +01:00
Marcus Huewe
fb9e64c2f1 Merge branch 'handle_empty_releas_in_rpmquery' of https://github.com/lethliel/osc
Do not pass None as a release to RpmQuery.filename. The release might
be None in case of a kiwi build (the returned canonname is not used in
case of kiwi build).
2020-02-07 10:23:35 +01:00
lethliel
f5aa389e38 handle empty release in build.py
This is very unlikely but in very rare cases this
can happen.

Builing kiwi images containing debian is one case.
In this case we do not know what is inside the kiwi
file and osc build assumes buildtype 'rpm' to generate
a package list which get's thrown away anyway.

Now we just check for release
2020-02-07 09:41:23 +01:00
Marcus Huewe
d94e457632 Merge branch 'fix_build_user_determination' of https://github.com/lethliel/osc
By default, pass --norootforbuild to the build script when running osc
shell/chroot (unless --userootforbuild is passed to osc).
2020-02-04 19:43:24 +01:00
8716dcc24a use signdummy for product builds
avoids build failure, but leads to unsigned media
2020-02-04 17:26:24 +01:00
37f19f7de9 fix counter handling for obsrepositories:/ in products
all entries had the same name, so repos got ignored.
2020-02-04 17:25:14 +01:00
lethliel
9849112278 append --norootforbuild as default
pass opts to run_build and check if norootforbuild
needs to be appended to cmd. (if opts.userootforbuild is not set)
2020-01-22 14:24:58 +01:00
Marco Strigl
3d2f1a4ffb
Merge pull request #718 from adrianschroeter/arch_zst
- support zstd arch linux files in local build
2020-01-10 14:06:56 +01:00
5f2721d8f6 - support zstd arch linux files in local build
Note: This requires a tar executable supporting zstd
2020-01-09 15:49:54 +01:00
lethliel
76793cc0ac fix regression in osc chroot
This fixes some regressions with osc chroot:

- osc chroot --wipe --root=/dir/ can now be called outside
  a working copy
- osc chroot --noinit --root=/dir/ can now be called outside
  a working copy and behaves like the old code (Just entering
  the chroot without any modifications)
- The confirmation of the deletion is implemented again and thus
  the --force option was implemented too.
2019-12-20 20:43:01 +01:00
lethliel
ade9baba52 fix lastbuildroot on builds not in WC
fix the lastbuildroot handling if the package is being build oustide of
a package directory and thus no .osc/ dir can be found.

We then just skip the store_write_last_buildroot and store_read_last_buildroot
calls.
2019-12-09 14:07:48 +01:00
db795c8121 support local building using RedHat rpm-md modules 2019-12-05 13:06:30 +01:00
b08bd8a437 support building for kiwi products using obsrepositories:/ 2019-12-04 15:16:58 +01:00
b329b74816 build environement parameter caching
repository, architecture and vm_type from last build is automatically
reused if not specified otherwise.
2019-12-04 15:16:54 +01:00
47e346dde8 avoid source service run for "osc shell"
this also drops the warning line if service disabled. It seems not
to be important enough to me.
2019-12-04 14:50:15 +01:00
f4bdd3c876 avoid implicit --noinit if extra packages are specified 2019-12-04 14:50:15 +01:00
eb7aab1cf7 osc build --vm-disk-size= switch support 2019-12-04 14:50:15 +01:00
a628ea8cca read debug packages from server side project configuration
=> avoids unresolvable errors when distro is not providing the
    extra/debug package
2019-12-04 08:41:46 +01:00
f480799522 Use --noinit and --offline on "osc shell" when environment exists 2019-12-02 14:23:41 +01:00
d46e93fb03 disable hostarch check for emulator builds entirely 2019-12-02 08:35:50 +01:00
4bcb78e322 osc build --vm-type=qemu support for cross architecture builds 2019-11-28 10:07:36 +01:00
b78a0b3896 osc shell/chroot/wipe is now handled via build script (working for chroot and KVM only atm) 2019-11-28 10:07:11 +01:00
lethliel
d59141e3fe fix build with alternative prj and multibuild
building with alternative project (pac='_repository')
and multibuild did not work correctly, because the buildflavor
was not submitted to the src server.

With commit 2390823d649a3b0b6bf3b7bd07713c4426932bed in open-build-service
it is now possible to submit the build flavor like this: _repository:<flavor>

The obs commit also enables osc buildinfo --alternative-prject -M <flavor>
to show the correct buildinfo for the flavor.
2019-10-23 11:46:38 +02:00