Lastly I think https://lists.debian.org/debian-devel/2022/02/msg00216.html
to which Simon had a quite nice answer.
* decide on a directory name (`./debian/export_artifacts/`?)
* the build process will dump any files that could be interesting to
export in there (no decision if/how to define the structure within
this directory)
* potentially, all `dh_*` could copy there whatever is relevant to
them (i.e., `dh_auto_configure` could export configure logs,
`dh_auto_test` the various test logs, ..)
* place the tar'ed-up artifacts in the usual results directory, with
a predictive name (`$srcpkg_$ver_$arch.artifacts.tar.xz`?)
Matthias Klose would like to find a way to do something that at the end
of a build will look for and collect all the relevant files that are
produced during an ICE (for example all the pre-processor inputs, etc).
I'm not sure how to best solve it, but he was imagining a hook somewhere
(in dpkg?) that would look for them and copy them into the directory.
Simon McVittie:
In the design that I prototyped, it's declarative, loosely inspired by
the equivalent Gitlab-CI feature:
- the maintainer can write patterns into debian/build-artifacts for
package-specific quirks like GTK's reftests
(#-prefixed comments are allowed)
I am a bit tempted to keep this one out of the spec and leave it to the build-helper to define it. I find that files in `debian/` are not very discoverable and they are harder to support properly in tooling like
`debputy lsp server`. Each file format requires extra setup and there is not a good way to announce they exist unlike fields in `debian/control`. For `debputy` based packages, I would prefer to have this in the `debian/debputy.manifest`, since that will enable me to guide the packager
to its existence and provide on-line documentation for it.
Mattia's wiki page does list "A reproducible
compiler error (ICE) produces a /tmp/cc*.out containing the preprocessed source.", which might need some tweaking compared to the "the -artifacts.tar.gz is always a subset of the build tree".
On Fri, 02 Aug 2024 at 16:40:15 +0900, Mattia Rizzolo wrote:
[...]
* decide on a directory name (`./debian/export_artifacts/`?)
* the build process will dump any files that could be interesting to
export in there (no decision if/how to define the structure within
this directory)
* potentially, all `dh_*` could copy there whatever is relevant to
them (i.e., `dh_auto_configure` could export configure logs,
`dh_auto_test` the various test logs, ..)
My concern about this, and the reason my prototype doesn't work this way,
is what I said in <https://lists.debian.org/debian-devel/2022/02/msg00242.html>.
The artifacts that I'm primarily interested in are the results of failed testing, because at the moment librsvg and gtk4 have to exfiltrate
their failed test results (some of which are in the form of images,
because these are GUI libraries) by uuencoding PNG files and writing
the result to the log, and that's both inconvenient and inefficient.
But, when a test has failed, writing arbitrary imperative code to gather
up the package-specific results (for example the images that were generated by the gtk4 test suite) is extra complexity for the package maintainer,
which can have bugs, and is rarely tested because hopefully the tests
usually pass. I dislike that as a pattern, and I'd strongly prefer a declarative syntax of some sort.
(Take a look at all the ad-hoc scripting that src:gtk4 has around what
to do after test failures and I think you'll see what I mean!)
In the design that I prototyped, it's declarative, loosely inspired by
the equivalent Gitlab-CI feature:
- the maintainer can write patterns into debian/build-artifacts for
package-specific quirks like GTK's reftests
(#-prefixed comments are allowed)
- tools like debhelper can append patterns to debian/extra-build-artifacts,
for example dh_auto_* in Meson mode should append "obj-*/meson-logs/*"
- the buildd operator can configure $artifact_patterns in .sbuildrc if
they want to (I'm unsure how useful this genuinely is, but maintainers
running sbuild locally might find it more convenient than editing the
source package during ad-hoc debugging)
- the patterns reuse machine-readable debian/copyright syntax
- as a result the -artifacts.tar.gz is always a subset of the build tree,
and inherits its layout, same as Gitlab's artifacts.zip
- if a sufficiently desperate maintainer really wants to, they can tar up
the entire build tree by specifying a broad enough pattern like '*',
although this should be discouraged when building larger packages :-)
and sbuild (or pbuilder if you prefer) is responsible for enumerating files matching the given patterns and packing them into a tarball.
[...]
Matthias Klose would like to find a way to do something that at the end
of a build will look for and collect all the relevant files that are
produced during an ICE (for example all the pre-processor inputs, etc).
I'm not sure how to best solve it, but he was imagining a hook somewhere
(in dpkg?) that would look for them and copy them into the directory.
If we need an imperative hooks mechanism for something like this, then so
be it, but I'd really prefer executing arbitrary code to be the uncommon
case rather than something we always have to do.
Perhaps dpkg or dh_auto_build could append appropriate patterns to my debian/extra-build-artifacts on build failure, so that this hook would
just be acting as an extension to the declarative mechanism?
smcv
(not at Debconf)
On Fri, 02 Aug 2024 at 18:17:52 +0200, Niels Thykier wrote:
Simon McVittie:
In the design that I prototyped, it's declarative, loosely inspired by
the equivalent Gitlab-CI feature:
- the maintainer can write patterns into debian/build-artifacts for
package-specific quirks like GTK's reftests
(#-prefixed comments are allowed)
I am a bit tempted to keep this one out of the spec and leave it to the
build-helper to define it. I find that files in `debian/` are not very
discoverable and they are harder to support properly in tooling like
`debputy lsp server`. Each file format requires extra setup and there is not >> a good way to announce they exist unlike fields in `debian/control`. For
`debputy` based packages, I would prefer to have this in the
`debian/debputy.manifest`, since that will enable me to guide the packager >> to its existence and provide on-line documentation for it.
That's fine, debputy could read a list of patterns out of its own input
file and "register" them via whatever mechanism exists (debian/extra-build-artifacts in my prototype, or writing them into an "artifacts patterns" directory in your suggestion).
I wanted there to be a straightforward way for a maintainer to opt-in
to this, even if they are not yet living in the debputy future, because
I'd prefer to be able to adopt useful features one at a time, rather
than having to rewrite key packages' build systems in debputy syntax
as a blocker for finding out why their tests fail. [...]
Or, is it possible to have a debputy manifest exist, and get the
information in it about artifacts copied out appropriately, without
needing to make debputy drive the entire build?
Mattia's wiki page does list "A reproducible
compiler error (ICE) produces a /tmp/cc*.out containing the preprocessed
source.", which might need some tweaking compared to the "the
-artifacts.tar.gz is always a subset of the build tree".
Hmm, yes, that's unfortunate. This wouldn't be compatible with the
Gitlab-CI feature that I was inspired by, either.
smcv
I also did some more concrete design and wrote a prototype - <https://lists.debian.org/debian-devel/2022/02/msg00238.html> as revised
in <https://lists.debian.org/debian-devel/2022/02/msg00242.html>, and <https://salsa.debian.org/debian/sbuild/-/merge_requests/14> -
although I never got as far as doing enough testing and polishing to get
it to a production-ready status. I'm sorry that this did not stay as my
top priority, but I can only have one top priority at a time.
The artifacts that I'm primarily interested in are the results of failed testing
But, when a test has failed, writing arbitrary imperative code to gather
up the package-specific results (for example the images that were generated by the gtk4 test suite) is extra complexity for the package maintainer,
which can have bugs, and is rarely tested because hopefully the tests
usually pass. I dislike that as a pattern, and I'd strongly prefer a declarative syntax of some sort.
In the design that I prototyped, it's declarative, loosely inspired by
the equivalent Gitlab-CI feature:
- the maintainer can write patterns into debian/build-artifacts for
package-specific quirks like GTK's reftests
(#-prefixed comments are allowed)
- tools like debhelper can append patterns to debian/extra-build-artifacts,
for example dh_auto_* in Meson mode should append "obj-*/meson-logs/*"
- the patterns reuse machine-readable debian/copyright syntax
- as a result the -artifacts.tar.gz is always a subset of the build tree,
and inherits its layout, same as Gitlab's artifacts.zip
and sbuild (or pbuilder if you prefer) is responsible for enumerating files matching the given patterns and packing them into a tarball.
* place the tar'ed-up artifacts in the usual results directory, with
a predictive name (`$srcpkg_$ver_$arch.artifacts.tar.xz`?)
I prototyped this as the same name as the log file, except replacing the .build extension with -artifacts.tar.gz (so the filename has a timestamp
in it). My rationale for this choice is that when tests fail, it's common
to retry the build to see whether the tests are reproducibly failing or
just flaky, so we want to collect one blob of artifacts per attempt, the
same way we collect one log per attempt.
I don't know how the layers "above" sbuild such as buildd and wanna-build operate, and I don't have a way to test them, so my prototype stops at sbuild.
Matthias Klose would like to find a way to do something that at the end
of a build will look for and collect all the relevant files that are produced during an ICE (for example all the pre-processor inputs, etc).
I'm not sure how to best solve it, but he was imagining a hook somewhere (in dpkg?) that would look for them and copy them into the directory.
Perhaps dpkg or dh_auto_build could append appropriate patterns to my debian/extra-build-artifacts on build failure, so that this hook would
just be acting as an extension to the declarative mechanism?
I think it is more of a question whether [artifacts in /tmp] will be supported
initially (might require a per-source TMPDIR too for buildd support, so artifacts does not get tainted because the buildd was running two builds at the same time, where once had ICE errors and the other had not).
Consider that in my mind, most packages wouldn't have needed to write
any imperative code.
I was considering it for example within dh_auto_configure and
dh_auto_test, etc, those tools would be responsible for copying the
relevant test files into my proposed directory.
Just, if we do we need to keep this as simple as possible as multiple
tools will try to parse it. I'd be ok with a plan list, at most accept
# at the start of a line for comments and empty lines.
and sbuild (or pbuilder if you prefer) is responsible for enumerating files matching the given patterns and packing them into a tarball.
I was trying to have something else do the enumeration and have sbuild/pbuilder only do the packing, but I can be convinced in doing the enumeration sure.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (0 / 16) |
Uptime: | 170:35:09 |
Calls: | 10,385 |
Calls today: | 2 |
Files: | 14,057 |
Messages: | 6,416,559 |