Commit Graph

1437 Commits

Author SHA1 Message Date
Nathan Rennie-Waldock
83f19b7fd8 abuild: Fix always reporting ccache as missing when USE_CCACHE=1 2022-06-14 12:40:59 +00:00
Jakub Jirutka
140d8ab82c newapkbuild: do not run cargo test with --release
It takes a longer time to compile and, most importantly, it may cause
unnecessary rebuild of everything in the package phase (installation).
2022-06-14 12:25:28 +00:00
Jakub Jirutka
bf1dae494b newapkbuild: fetch rust dependencies in prepare phase
Fetch all dependencies in the prepare phase and do not access network
in the following phases.
2022-06-14 12:25:28 +00:00
Clayton Craft
f7f53bac28 abuild.conf: disable Go's buildvcs
This was added in Go 1.18 and enabled by default, and causes builds to
fail if $builddir is not a repo.
2022-06-14 14:17:25 +02:00
Jakub Panek
79624340a1 abuild.conf: add -trimpath flag
remove all file system paths from the resulting executable.
Instead of absolute file system paths, the recorded file names
will begin either a module path@version (when using modules),
or a plain import path (when using the standard library, or GOPATH).
2022-06-14 12:12:39 +00:00
Olliver Schinagl
f5d6e5e34b abuild: Do not store whitespaces in license field
Currently, abuild stores the license variable ad-verbatim in the PKGINFO
file. This causes many downstream systems to fail. For example, `apk
info` won't show anything after the newline, our webview that lists
licenses do not show these either.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2022-06-14 12:08:01 +00:00
Sören Tempel
0ab9d5b621 abuild.conf: add -modcacherw to default Go build flags
By default, the Go module cache is read-only. This become a problem
when cleaning up the build directory from within abuild. For this
reason, many existing aports for Go software employ one of the following
solutions: (1) passing -modcacherw manually (2) setting the chmod-clean
option or (3) overwriting default_cleanup_srcdir. By solving this
problem globally we make it easier to create packages for Go software
and ensure consistency in regards to cleaning the module cache.
2022-06-07 15:51:57 +00:00
Alex Xu (Hello71)
b69e0230d0 tests: use BATS_TEST_TMPDIR, don't dump temp files in repo 2022-05-21 14:23:58 +00:00
Kevin Daudt
074a335464 gitlab: highlight abuild.in as shell
The syntax highlighting on gitlab for abuild.in is off, probably because
it detected a different language.

Lets help by explicitly specifying `gitlab-language` in gitattributes.
2022-05-03 12:42:36 +02:00
donoban
d9f03b387a rootbld: add '--cache-dir' when preparing the $BUILD_ROOT
Otherwise apk will rely on defaults 'etc/apk/cache' and 'var/apk/cache'
based on new chroot directory and will delete everything when rootbld finishes.
2022-04-05 08:02:48 +00:00
donoban
84d7b7693d rootbld: run mkusers inside the chroot and don't affect host users 2022-04-05 08:02:48 +00:00
Natanael Copa
681ef9dfcf tests: add test with invalid version of subpkgs' dependency
Ref: https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10058
2022-01-17 16:17:25 +01:00
Natanael Copa
9a96275d87 abuild: test that subpkg's dependencies versions are valid
Also verify the version of provides

Fixes: https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10058
2022-01-17 16:14:58 +01:00
Natanael Copa
8824e43ad9 abuild: verify subpkgnames
Refactor pkgname check and also check subpkgnames

Add tests for invalid subpkgnames
2022-01-17 15:44:10 +01:00
Natanael Copa
070341e21d tests: add tests for invalid pkgname
Add s test for valid pkgnames to verify the testsuite APKBUILD actually
works as intended, and a few tests for invalid pkgnames
2022-01-17 15:36:49 +01:00
Natanael Copa
bc71314cc3 ==== release 3.9.0 ==== 2021-11-22 15:03:42 +01:00
Kevin Daudt
6cd337fa9c ==== release 3.9.0_rc2 ==== 2021-10-11 23:32:14 +02:00
Kevin Daudt
a1975471ab tests/abuild: skip remote initd tests
This test is flaky and relies on a file hosted remotely, which can be
unreachable. Ideally there should a way to have this file served from
the test suite itself, but this might be challenging to do without
adding dependencies.
2021-10-11 23:13:57 +02:00
Kevin Daudt
2a95c3d50c tests: only generate key when not available yet
Installing a build key requires root permissions, something that is not
possible in all cases, most notably on the builders.

Instead of generating a key each time, which results in many keys being
generated each test suite run, check whether a key is already present by
using `abuild-sign --installed`, and only generate a key when that
returns false.
2021-10-11 23:12:59 +02:00
Kevin Daudt
a0d6085e9b tests: don't hardcode sudo implementation
Remove the SUDO environment variable, as it depends on what's installed
and configured on the host what implementation should be used.

It would not suffice to add sudo or doas as a makedepend, as it would
also need to be configured to allow abuild-keygen -ain to be executed
without password.
2021-10-11 22:44:43 +02:00
Kevin Daudt
4f723af7e5 ==== release 3.9.0_rc1 ==== 2021-10-11 20:53:50 +02:00
Ariadne Conill
78e36813d1 functions: add hostspecs for loongarch
Alpine itself will most likely use only the loongarch64 target, but it
makes sense to reserve the others as well.
2021-10-11 18:45:50 +00:00
Ross Younger
d0ccbb7c09 abuild: filter out security.selinux xattrs
This patch modifies abuild's behaviour to be independent of
whether SELinux labels are present in the build environment.

This is a workaround for containerised build environments where the
hosting environment has SELinux enabled. Security labels leak into the
container, manifesting as xattrs.

Discussion thread:
https://lists.alpinelinux.org/~alpine/devel/%3CCA%2Bgy4ieuXLuQddxmPuiucyZbut%3D14cR8tgmGrh0qE9qLDBivmg%40mail.gmail.com%3E
2021-10-11 20:43:40 +02:00
Samanta Navarro
f2ab775123 abuild: avoid calculations with void pointers
Arithmetic operations with void pointers are an extension by some
compilers and not part of the C standard, which does not specify the
size of void.

CFLAGS with -pedantic reveals this during compile time. I have adjusted
the usage of ?: so CFLAGS can contain -pedantic now.
2021-10-11 18:34:27 +00:00
Rodrigo Lourenço
0db2d3397a Convert man pages to scdoc
Closes #9986.
2021-10-11 18:31:29 +00:00
kpcyrd
f550705177 abuild-sign: Do not record uid and user name in index 2021-10-11 20:08:51 +02:00
Alex Xu (Hello71)
3ad93d9a83 abuild: default_dbg: various fixes
- fix symlinks
- fix hard links
- fix dbg not first
- fix scan race condition
- fix (non-extended) attrs
- general refactoring
2021-10-11 15:33:01 +00:00
Ariadne Conill
02652f5dd6 abuild: version cmd: providers
The default provider priority is 0, which disables the normal way apk
selects an unversioned virtual dependency.  Instead, version the
provider so that cmd: dependencies can be robustly used like normal
dependencies.
2021-10-11 15:27:28 +00:00
ba127ff45c abuild: use sourced filename instead of whole line for initd checks 2021-10-11 14:46:43 +00:00
Kevin Daudt
ff913b4907 tests: generate and install keys
abuild requires that a build key is present, so make sure a key is
generated.
2021-10-07 17:25:03 +02:00
Kevin Daudt
789fca23db tests: add project dir to PATH
abuild and abump call a few helpers that are expected to be available in
PATH. As abuild is not installed yet, they are not in the default PATH
locations.

Add the project root dir to $PATH to make sure these helpers can be found.
2021-10-07 17:25:03 +02:00
Kevin Daudt
12ba0a14a2 tests: set APORTSDIR for abuild tests
If `APORTSDIR` is not set, abuild tries to find it. One way it does this
is by trying to look at the url for the git remote 'origin'. This fails
either if there is no git repository, or the git repository has no
remote called 'origin'.

Instead of having abuild guess the location, provide it by exporting
APORTSDIR.
2021-10-07 17:25:01 +02:00
Kevin Daudt
d4af7cd4e2 ci: add job to run tests
This uses the alpinelinux/abuild-ci image to run the test suite, which
has all the required dependencies already installed.
2021-10-07 17:24:10 +02:00
Natanael Copa
1c00caaddb abuild: make sure to not get colors in git_last_commit
git log may return color codes if users colored output forcibly enabled
with:

[color]
	ui = always

Use `git rev-list` instead of `git log` to make sure that we don't get
any color codes.

fixes https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10042
2021-10-07 13:06:06 +02:00
Natanael Copa
3d9918f14d tests: enable colors in git config
Force colors in git config so we can test that we don't get color codes
in our last commit.

ref https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10042
2021-10-07 13:02:25 +02:00
Natanael Copa
e510181626 abuild-keygen: make cp non-interactive with -n
only use interactive copy when -n is omitted, so abuild-keygen --install
becomes non-interactive.

Add tests for both ineractive and non-interactive --install.

Fixes https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10049
2021-09-27 20:08:30 +02:00
Natanael Copa
62066fa2b9 abuild-keygen: allow run without any sudo
make it possible to skip the sudo invocation for testing
2021-09-27 20:01:32 +02:00
Natanael Copa
f35682d086 ==== release 3.8.0 ==== 2021-09-21 11:29:47 +02:00
Natanael Copa
272c1e4780 abuild-tar: load engines on openssl < 3 2021-09-21 11:29:13 +02:00
Samanta Navarro
dc99ce423a abuild: fix typos
Typos found with codespell
2021-09-21 09:15:34 +00:00
Ariadne Conill
a590096e30 abuild-tar: remove openssl engine registration, deprecated in OpenSSL 3 2021-09-20 10:02:26 -06:00
Natanael Copa
10ad48d1fe ==== release 3.8.0_rc4 ==== 2021-06-10 16:44:46 +02:00
Kaarle Ritvanen
91c4bc018d rootbld: foreign arch build with QEMU user mode 2021-06-10 14:40:55 +00:00
Natanael Copa
22ff0df215 abump: fix check for clean git of APKBUILD 2021-06-10 16:37:26 +02:00
Sören Tempel
33957133ec newapkbuild: automatically add perl to $depends
The same thing is already done for other scripting languages (e.g.
python).
2021-06-10 14:32:52 +00:00
Timothy Legge
e0e6ee0d14 apkbuild-cpan.in: prevent inserting extra new line before checksum on upgrade 2021-06-10 14:31:02 +00:00
Timothy Legge
fbd28a76f0 apkbuild-cpan.in: don't change arch on an upgrade of package 2021-06-10 14:31:02 +00:00
Timothy Legge
474edd8fd9 Fix issue with incorrectly inserted newline 2021-06-10 14:31:02 +00:00
Leo
74b32d03db fix(abuild): use -print0 **after** the print commands 2021-06-10 14:28:44 +00:00
Natanael Copa
dee82f764c tests: skip lock test on s390x
the sleep(0) trick does not appear to work on s390x. which is okish as
worst case we end up with lock file leftovers. skip the test
2021-05-14 12:53:11 +02:00