Commit Graph

1811 Commits

Author SHA1 Message Date
Natanael Copa 6ebe375a3e abuild: validate versioned dependencies 2024-10-10 13:41:18 +00:00
Natanael Copa ca9a11e492 tests: add test for validating depends 2024-10-10 13:41:18 +00:00
Sertonix d5591e6ccf samples: modernize and improve 2024-10-10 13:13:26 +00:00
fossdd a732ae00a1 abuild: run apk add/del with --no-interactive 2024-10-10 13:11:51 +00:00
Sertonix 1d9568b669 abuild: fix eval argument splitting and simplify
A newline starts a new command in shell scripts and eval uses the shell
grammar. Use a space instead to fix multiline repo templates.

Also avoid one subshell.
2024-10-10 14:48:33 +02:00
Pablo Correa Gómez 9c4abc561e
abuild: don't set the error on throwing a warning
Fixes da9269ba62
2024-10-10 14:20:47 +02:00
Natanael Copa fd7fa8a124 ==== release 3.14.0_rc1 ==== 2024-10-10 14:03:25 +02:00
Sertonix 186edf62a8 abuild: fix usrmerge warning with symlinks
Fixes <da9269ba62b> abuild: warn when files are installed to non-usr locations
2024-10-09 14:11:16 +00:00
Sertonix 35b6b30134 tests: remove 'test package' comment
These comments don't have any purpose. They just take up space.
2024-10-09 14:09:09 +00:00
Sertonix 34ef9de98f Prefer maintainer field instead of Maintainer comment
Fixes #10147
2024-10-09 14:09:09 +00:00
Sertonix cb4c8e40fb default.conf: move commented out options to abuild.conf 2024-10-09 14:09:09 +00:00
Sertonix 5a5df023cb abuild: remove .dummy file from empty packages 2024-10-09 12:42:10 +02:00
Sertonix 45a8c0dd79 abuild: deduplicate reproducible tarball creation 2024-10-09 12:42:10 +02:00
Sertonix 43ca11764a abuild: avoid shell splitting when packing metafiles 2024-10-09 12:39:52 +02:00
Sertonix 3fa9fda05b avoid masking exit code of shell commands
When a variables is declared (with 'local' or 'export') a failing
command is ignored[0]. Changing that so abuild should now error out
properly in more cases.

Also remove 1 pipe that could have prevented an issue recently[1] where
the 'du' command core dumped but abuild didn't error.

The other pipes were not changed for now since it may be better to use
'set -o pipefail' instead. That may require some changes with commands
like grep which use a non-zero exit code to indicate if a match was
found or similar[2].

[0]: https://www.shellcheck.net/wiki/SC2155
[1]: https://gitlab.alpinelinux.org/alpine/aports/-/issues/16005#note_395899
[2]: https://github.com/koalaman/shellcheck/issues/665
2024-10-09 10:00:07 +00:00
Sertonix b3b659a9f4 test: fix BSD-4-Clause license name 2024-10-09 09:58:53 +00:00
Sertonix d7208fa0c2 test: simplify usermerge test APKBUILD 2024-10-09 09:58:53 +00:00
Sertonix 78ae5e9386 abuild: remove origsubpackages
boost1.82 which used this variable has been removed
2024-10-08 11:30:19 +00:00
Natanael Copa cd78cd5da2 Rename sanitycheck -> validate
The term validate/validation is better than sanity/sane.
2024-10-08 11:56:47 +02:00
Bart Ribbers da9269ba62 abuild: warn when files are installed to non-usr locations
As agreed upon by the TSC:
https://gitlab.alpinelinux.org/alpine/tsc/-/blob/master/minutes/2024-08-15.md?ref_type=heads#implement-usr-merge-73
Should be changed to an error once some core packages are adjusted.
2024-10-07 20:58:53 +00:00
Sertonix 06695133c9 abuild: preserve attributes without setfattr/getfattr
The setfattr/getfattr commands were not guaranteed to be available and
abuild wouldn't properly error when they are not. That may cause some
hidden issues.

Changing the code to not need setfattr/getfattr like it is done in
default_dbg ([3ad93d9a83]) and pacman mkpkg ([pacman@88d054093c1]).

The code works by first writing the stripped output into a temporary file
and then replace the contents of the already existing file without changing
any file metadata.

[3ad93d9a83]: 3ad93d9a83
[pacman@88d054093c1]: 88d054093c
2024-10-07 20:56:49 +00:00
Hugo Osvaldo Barrera b3b42ae177 Link to buildrepo(1) in APKBUILD(5) and abuild(1)
Add a reference in the SEE ALSO section. Improves discoverability of
this tool for newcomers.

See: https://gitlab.alpinelinux.org/alpine/lua-aports/-/merge_requests/16
2024-10-07 20:53:44 +00:00
Sertonix e36e92c6f2 abuild: calculate size only based on st_size of normal files
Fixes [#10134]

[#10134]: https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10134
2024-10-07 20:53:10 +00:00
Sertonix ae059fd558 abuild: drop support for md5 and sha1 checksums 2024-10-07 20:52:19 +00:00
Sertonix bf66ab6312 abuild: drop special linguas variable 2024-10-07 20:51:19 +00:00
Sertonix 18340ddd42 default.conf: reduce duplication through default.conf
By setting some environmental variables in default.conf we can reduce the
amount of duplicated code needed in APKBUILDs.
2024-10-07 20:31:45 +00:00
Tyler Amick 75a6e8e14c make: add depends for abuild-tar.static 2024-10-07 20:27:42 +00:00
Sertonix c1c233a45a abuild-tar: drop legacy checksum mechanism
This mechanism was an optional speed optimization for apk-tools which has
been replaced with a better one **before the 2.0 full release** of apk-tools.

This in combination with the fact that the code is endian dependant and
therefor is incompatible with reproducible builds seems enough reason to
remove the code.
2024-10-07 20:27:00 +00:00
Sertonix a7e7587758 abuild: use static srcdir/pkgbasedir/tmpdir in rootbld
This fixes 'abuild rootbld' failing to mount when srcdir is moved
outside of $HOME (eg. in /run). This also has the advantage of building
more reproducible even when the build path leaks into the packges (which
happens in most -dbg packages).
2024-10-07 20:10:16 +00:00
Sertonix 1131a46699 abuild: remove default CC and CXX
These variables are already set by functions.sh.
2024-10-07 20:09:13 +00:00
Dominique Martinet d9f3f05b50 checkapk: fix size difference output when multiple info matches
I rebuilt networkmanager locally and was greeted with this:
>>> Size difference for networkmanager: 16 MiB -> 2772 KiB

It turns out networkmanager-elogind provides networkmanager so apk info
will list both, and the former is much bigger so it looked like the
rebuilt package was much smaller when there was almost no difference (as
expected)

Fix by matching on exact package name for both lines; this is already
what we were doing with the local package anyway and the apk fetch
correctly picks the correct package in this case
2024-10-07 20:07:31 +00:00
Sertonix d235d5c5a4 newapkbuild: fix meson setup argument order
according to the meson documentation the arguments are
'meson setup <builddir> <srcdir>'. meson is very relaxed and allows the
wrong order but this behavior should not be endorsed by a template.
2024-10-07 20:04:40 +00:00
Sertonix dd66d17b49 abuild: fix object files detected as shared libs
dmd installs an object file that matches *.so.* so we need to check for
*.o explicitly.
2024-10-07 20:03:13 +00:00
Sertonix ac45be0c71 abuild: strip leading v from pkgconfig versions 2024-10-07 20:03:13 +00:00
Sertonix d85ea24eca abuild: remove host uid/gid from pkg
Closes https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10127
2024-10-07 20:02:01 +00:00
Sertonix 0a91a31e47 abuild: kill all childs when bwrap exits
--unshare-pid is needed for --die-with-parent to work correctly.

Ref https://github.com/containers/bubblewrap/issues/529
2024-10-07 20:00:04 +00:00
Hugo Osvaldo Barrera 8eaa065f3a Add a man page for abuild.conf
For those familiar with abuild all this content is obvious. For
newcomers, the only way to figure this out is by reading abuild's
source code.
2024-10-07 19:58:50 +00:00
Hugo Osvaldo Barrera 5cae4119f9 Document some environment variables for abuild 2024-10-07 19:58:50 +00:00
Sertonix c8fb8965fc newapkbuild: add instructions when there is no check/build command 2024-10-07 19:55:23 +00:00
Willow Barraco ca9bc0a9e9 abuild: add default_nftrules helper
As proposed here:

https://gitlab.alpinelinux.org/alpine/aports/-/issues/16177
2024-10-07 19:52:15 +00:00
Dmitry Klochkov 15b9496135 abuild-fetch: try to work around an ESTALE error which occurs on NFS
This is because of the following race condition case:

  A                               B
                                |
  lockfd = open(lockfile, ...)  |
                                | unlink(lockfile)
  lockf(lockfd, F_LOCK, 0)      |

According to [1], to recover from an ESTALE error, an application must
close the file or directory where the error occurred, and reopen it so
the NFS client can resolve the pathname again and retrieve the new file
handle.

[1] https://nfs.sourceforge.net/#faq_a10
2024-10-07 19:50:19 +00:00
Sertonix 2fbfb5e700 tests: fix with changed ABUILD_USERDIR
The test suite expects ABUILD_USERDIR to be "$HOME"/.abuild but that
could be overwritten in ABUILD_CONF. So use the fixed value instead of
relying on the default.
2024-10-07 19:43:12 +00:00
Sertonix 59be83ca19 functions.sh: overwrite ABUILD_USERDIR from env
To be consistent with other variables ABUILD_USERDIR set from the
environment should be prefered over ABUILD_USERDIR set by the
ABUILD_CONF file.
2024-10-07 19:43:12 +00:00
Sertonix f8d9a6f1b5 abuild: simplify 'Entering fakeroot' message 2024-10-07 19:41:56 +00:00
Sertonix 18eeb336a2 abuild: remove CBUILDROOT check for cross_*
CBUILDROOT is guaranteed to be set by functions.sh when
CHOST != CTARGET or CBUILD != CHOST.
2024-10-07 19:41:00 +00:00
Sertonix 88fab9f624 abuild: detect precompiled lua files
Precompiled lua files aren't portable between word sizes and byte order.
2024-10-07 19:37:16 +00:00
Sertonix 2ea6d3c734 abuild: remove empty check before for loop
When the variable is empty the body of the for loop will never be run.
So the behaviour is the same without the extra check if the variable is
empty.
2024-10-07 19:35:31 +00:00
Hugo Osvaldo Barrera c3f021f2b4 abuild: add missing params flags in docs 2024-10-07 19:32:31 +00:00
Sertonix a417fd27fc abuild: update -r doc 2024-10-07 19:25:19 +00:00
Sertonix 87e8792b8c abuild: clean unused and global variables 2024-10-07 19:24:49 +00:00