• Produce extra build artifacts during package builds

    From Mattia Rizzolo@21:1/5 to All on Fri Aug 2 09:50:01 2024
    Hello people,

    just now at DebConf we had a small BOF to discuss this problem, that has several times come up.

    Lastly I think https://lists.debian.org/debian-devel/2022/02/msg00216.html
    to which Simon had a quite nice answer.


    This is what we came up with: https://wiki.debian.org/BuildArtifacts#Design_proposal

    I'm copying it here for reference:

    * 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, ..)
    * the containering tool (sbuild, pbuilder, ...) at the end of the
    build, regardless of the result of the build:
    * check if the directory exists, and it's non-empty
    * if true, tar it up
    * place the tar'ed-up artifacts in the usual results directory, with
    a predictive name (`$srcpkg_$ver_$arch.artifacts.tar.xz`?)
    * tbd if this should happen always or opt-in by the build caller
    * `buildd`/`pybuildd` will check if such file has been exported, if it
    is, then it will be uploaded to some service
    * something as simple as an authenticate HTTP POST somewhere will
    do - no strong auth needed (right?)
    * this new service will simply just accept whatever upload and store it
    * possibly define an expiry rule for these artifacts to not hog all
    space needlessly


    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.




    Looking for inputs!


    --
    regards,
    Mattia Rizzolo

    GPG Key: 66AE 2B4A FCCF 3F52 DA18 4D18 4B04 3FCD B944 4540 .''`.
    More about me: https://mapreri.org : :' : Launchpad user: https://launchpad.net/~mapreri `. `'`
    Debian QA page: https://qa.debian.org/developer.php?login=mattia `-

    -----BEGIN PGP SIGNATURE-----

    iQIzBAEBCgAdFiEEi3hoeGwz5cZMTQpICBa54Yx2K60FAmasjVwACgkQCBa54Yx2 K60aEg//Z9cdLS4AZaWIZAcsXH78iiHcPTpQbq/35yihAgRkcvd5IyGXdviQLS0r uPSLy+l1217T8nY5M2M8Xt4nSs05wSOq4KA2mmCD/gmhP4tKcstmLUTT/8Hmmcgs CMiRUKfD5Cx5a/OGX/AX3BMDdQHmoTpxZBAl1vsFjUv2zY5Z/gTu+lbltkGOAVaZ dS976i34yeRhZ4lEW8mAOEh/dsTN4VOnymEBL1n4Y+oWfnkp1CzZswWUMe13OvYS 9SaJBV0xADhIITwPxx+hPMFEvo9+Kh7WPTCDdLabig4h7xWbrr0Nf+d0zPspfm0N LFiCivbvvmO7t+TcD3E03xGPHhnf8ejVbm/aFCQFPX52iBWEVT8Qeflk/OC/JeHA Gbwd+ZqEJJnAhG1hzxFBwgfF/SjApn8CSZ2TcnqUx2Kox5Tm9KhD+j51Y0wGCeRs ULfZQBKJ6QkITu0smLNgvKkCvzpRKGKzk2lm8+s2JrHCgrg3J9VXxXLwhR8MjIBu 6TZkqnUEtkwYkoTI/DZ1O6/uX2m5v205IK5P7vIM8uJ6wOBgJcN
  • From Simon McVittie@21:1/5 to Mattia Rizzolo on Fri Aug 2 12:10:01 2024
    On Fri, 02 Aug 2024 at 16:40:15 +0900, Mattia Rizzolo wrote:
    Lastly I think https://lists.debian.org/debian-devel/2022/02/msg00216.html
    to which Simon had a quite nice answer.

    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.

    (There is also some good input from Paul Wise in the 2022 thread)

    * 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.

    * 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.

    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)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon McVittie@21:1/5 to Niels Thykier on Fri Aug 2 19:00:01 2024
    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. But in an imperative (dh-style) build system, that could be something more like:

    ifneq ($(PUT_ARTIFACT_PATTERNS_HERE),)
    execute_before_dh_auto_configure:
    cp debian/build-artifacts $(PUT_ARTIFACT_PATTERNS_HERE)/
    endif

    and that's not so bad.

    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Niels Thykier@21:1/5 to All on Fri Aug 2 18:20:01 2024
    Simon McVittie:
    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!)


    I agree with Simon on this part. This logic will rarely be tested by the maintainer, so we should minimize the amount of code a maintainer should
    do for this.

    Thanks to previous design work, I think this problem is now largely down
    to various tool writers (pbuilder/sbuilder + the build helper tooling)
    doing a prototype of it and letting it loose.

    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.

    - tools like debhelper can append patterns to debian/extra-build-artifacts,
    for example dh_auto_* in Meson mode should append "obj-*/meson-logs/*"

    As a minor detail, I would make this a .d directory where tools can
    write files in. This avoids issues with concurrency control. It is
    possible to run `dh_auto_configure` in parallel. That is not the only
    way concurrency issues could happen and I am already not excited about
    solving concurrency issues even assuming debhelper is the only source of
    this problem (hint: it won't be). Therefore, a directory and tools using
    random generated filenames. Be that standard `mktemp -p $DIR` or even
    just uuidv4'ing the filename. Either way the concurrency issue would be
    reduced to "an already solved problem".

    Secondly, I would want clarity on how this directory is created and
    cleaned up. Personally, I do non-chroot host builds all the time for
    rapid development and I would mind the clutter if every build leaves
    this directory behind - which realistically will end up in the
    `.debian.tar.gz` at some point if not cleaned by the build process
    itself. At the same time, I quite understand always wanting the
    directory for CI/buildd builds.
    An alternative here is that the build tool exports an ENV variable
    for the directory to put these "extra-build-artifacts" into and is then responsible for cleaning it up. Since the ENV var would only be exported
    when you wrap your build in sbuild/pbuilder, the clutter would not occur.

    However, I think further detailing on this part is between me and
    whoever is going to do it on the pbuilder/sbuild side.

    - 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 :-)


    This all sounds good to me. 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". But again, I
    sure we can figure out a solution to this problem in the practical
    coding - such as requiring the tool to copy it into the build tree first
    (which in turn requires the tool to ensure it is cleaned by `d/rules
    clean`, but presumably a trivially solvable problem).

    and sbuild (or pbuilder if you prefer) is responsible for enumerating files matching the given patterns and packing them into a tarball.


    I very much like this part of the design. They can delegate to a common
    tool to share the implementation without us worrying about build-depends contamination (which would be a issue for build-helpers). Since the
    logic would be able to run on the host system rather than in the chroot,
    we also do not have to worry about the installability being trashed in
    sid and temporarily neuter the log fetching ability.

    [...]
    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)


    I am sure we can figure out a solution to this on top of the protocol. I
    see arguments for putting it in pbuilder/sbuild and for putting it into
    the build helper. I think this boils down to the use-case would be
    invoked in practice where exactly the logic goes. But I feel it is again
    a problem that is very solvable once we have the infrastructure in-place
    and a proper idea of how to play out the use-case.

    Dear, sbuild/pbuilder maintainers, feel free to give me a holler on this
    and lets fix this with a prototype somewhere.

    Best regards,
    Niels

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Niels Thykier@21:1/5 to All on Fri Aug 2 21:10:01 2024
    Simon McVittie:
    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. [...]


    My argument was that `debhelper` and `debputy` would each define how
    they provide this functionality to their consumers in a way that fits
    how their style. Not that `debputy` was going to be mandatory for this
    feature.


    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?


    The `debputy` framework already has two "integration modes" where `dh`
    drives the build. As an example, the `dh-sequence-zz-debputy-rrr` build-dependency is useful for getting rid of implicit `fakeroot` / `Rules-Requires-Root: binary-targets` for static ownership while keeping
    *most* things as you know them.

    While adding a third mode would be possible at this junction, I would
    not go down this route for the `debhelper` support as it would imply an
    extra dependency for `debhelper` (a circular one at that) plus it would
    not fit the usual `debhelper` pattern.

    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


    Indeed. But as said, I am pretty sure we can figure out a solution to
    this problem. I think it is more of a question whether it 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). It will be fun to solve, I am sure. :D

    Best regards,
    Niels

    PS: If anyone is maintaining a `Rules-Requires-Root: binary-targets`
    package and want to migrate away from the implicit `fakeroot`
    build-dependency, please let me know. I am happy to look at providing
    patches (`debputy` is only required for static ownership though. Often
    it is just a matter of masking `chown/chgrp` or `-o` + `-g` for `install`).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mattia Rizzolo@21:1/5 to Simon McVittie on Sat Aug 3 08:20:01 2024
    On Fri, Aug 02, 2024 at 11:01:24AM +0100, Simon McVittie wrote:
    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.

    Right, I read most of the emails in that thread and I did look at the
    MR.
    Unfortunately, I did so _after_ the BOF :\

    The artifacts that I'm primarily interested in are the results of failed testing

    Right, that's also what we thought.

    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.

    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.

    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/*"

    Well, I don't use debputy nor really understand it, so I don't
    understand Niels' concerns.
    But I could accept a file debian/extra-artifacts (for
    maintainer-specified globs) and directory debian/extra-artifacts.d/
    (for tools-provided globs). dh_auto_clean should (eventually) learn to
    clean this directory.

    And I suspect that packages that want to be dynamic in the content of
    this archive can simply `echo path/to/stuff >> debian/extra-artifacts.d/package` during the build instead of my
    proposed `cp`.


    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.

    - 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

    This might not work as we want to be able to collect, for example, stuff
    from /tmp/.
    OTOH, this can be handled by doing proper subfolders in the tarball.

    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.

    * 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.

    This can be left as an implementation detail of the build runner
    (most likely, both sbuild and pbuilder will obtain a configuration knob
    for this filename).

    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?

    Possibly. I suppose there could be a tool developed later that can be
    used to search for any relevant file.

    --
    regards,
    Mattia Rizzolo

    GPG Key: 66AE 2B4A FCCF 3F52 DA18 4D18 4B04 3FCD B944 4540 .''`.
    More about me: https://mapreri.org : :' : Launchpad user: https://launchpad.net/~mapreri `. `'`
    Debian QA page: https://qa.debian.org/developer.php?login=mattia `-

    -----BEGIN PGP SIGNATURE-----

    iQIzBAEBCgAdFiEEi3hoeGwz5cZMTQpICBa54Yx2K60FAmatyusACgkQCBa54Yx2 K62zfA/+NoqLkdEqapEw1EiobFJzSDzqMQ57lPZyNapTCQImSw7Zls6d3AWpsoCD KTeKuzBXFbVn28t7HemExhidTtLFIE4eyeLXpk5oBZJdiLttLHkVgfyYxNN9UoXl 5Zh2m76fm05XorTQzJPOoHEhNIiunLHYC14sIzMZR3fnzAxd9BOEN/T+46a7VWOJ syRWdT61tVYqBa96Y+TXq9Jud7IgkCzsL7J9vC+gO5GzdxbA3BU6XrhBTXW1lXNH 53lVOdLw7l1kt/EowP18BcKRUkVz/fdws7EnJvwIlugq/W+SXi1lLepCYxq71iGP HaYp///H2Fc+ooyAV5Hz1gwApC0cFc/rgtJF2qjEMi8JfQY1rK+hfFqa7+MsThpE YneWcFGVrdAZaekAzjCsnYn3sSFayUFhCM2UzC4j0QC9jat1+nBZU1EVkxbKWYm/ HDDdpKob8RSzJsjnxGVWdvklxpC1Zm9F+svh16445+/EhbkgQWmCite88yKi74Lv KVxmZ1TWx7MwJwojcioYSEOZE+xd/+MCuzKYBez59MOvTA82DNe
  • From Simon McVittie@21:1/5 to Niels Thykier on Sat Aug 3 12:00:01 2024
    On Fri, 02 Aug 2024 at 21:03:05 +0200, Niels Thykier wrote:
    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).

    If it's really $TMPDIR, then that's easy to implement. The $TMPDIR
    could even be inside the build directory, like you would often want to
    do in Gitlab-CI to avoid any weird effects of /tmp being on an overlayfs
    (the build directory is typically mounted as a volume rather than being
    part of the container image, so commands like rm -r --one-file-system
    in the build directory work as you'd expect, which as I've found out
    from experience is not necessarily true for /tmp). It's a pity the name debian/tmp is already in use for something different!

    If /tmp is hard-coded, then I think there's going to be no substitute
    for the sbuild-equivalent mounting a unique /tmp for each build, which shouldn't be difficult to achieve either.

    smcv

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon McVittie@21:1/5 to Mattia Rizzolo on Sat Aug 3 11:30:01 2024
    On Sat, 03 Aug 2024 at 15:15:10 +0900, Mattia Rizzolo wrote:
    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.

    Sure, but is this assuming that the only relevant build artifacts for
    most packages are the logs that are integrated with the build system
    (Autotools config.log and test-suite.log, Meson meson-logs/, etc.)
    and having the tests output ad-hoc, package-specific results files is
    very rare?

    I would expect every package that does something visual (render an image, assert that it looks right), or something audio-related, to want to do
    what GTK does in its test suite - output some images or audio files for
    later inspection - and unlike text output, this is not something that
    is standardized in any build system that I'm familiar with. (Autotools,
    CMake, Meson)

    (I also think you might be underestimating the number of packages that
    have reinvented logging to a file, because their authors are unaware that spamming to stderr and letting the build system collect it is easier :-)

    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.

    Right. I think any format that is intended to be human-writeable does need
    nice things like comments and empty lines, and that's why I included
    them in my prototype (and it wasn't hard to implement), but if the
    format is intended to be machine-writeable-only (more like substvars)
    then they become unnecessary.

    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.

    If I remember correctly, the way I prototyped the enumeration was to
    convert the list of patterns into a find | tar --files-from=- command,
    and it did't actually end up as very much code.

    It would be entirely feasible to do that translation outside the chroot (possibly in a helper tool that sbuild and pbuilder both add a Depends on),
    and then inject the command (which I think uses only Essential packages)
    into the chroot/container and collect its output. I assume any reasonable sbuild/pbuilder equivalent is going to have a function for "execute this arbitrary code in the build container".

    smcv

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)