You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Stefan Bodewig <bo...@apache.org> on 2026/04/11 14:44:59 UTC
Do we want to make Ant's build reproducible?
Hi all
https://bz.apache.org/bugzilla/show_bug.cgi?id=61269 is not exactly a
new issue but I completely forgot about it until Elliotte Rusty Harold
asked about its state yesterday.
The issue is "Ant should support reproducible builds" where the request
is more general than "Ant's own build should be reproducible". For a
definition of reproducible builds and the things that need to be done,
see https://reproducible-builds.org/docs/
For example this defines a SOURCE_DATE_EPOCH environment variable for a
deterministic timestamp of the build output. <tstamp> already support
this.
Given the nature of Ant builds I don't beliieve we can magically make
arbitrary build processes reproducible but IMHO it would be a good idea
to enable people to do so and not make it more difficult. Some things
are already possible today like <zip>'s modificationtime attribute that
ensures there the resulting archive does not depend on file times (I
believe it still depends on filesystem traversal order right now).
Ant could even go further and - in the example above - could implicitly
set <zip>'s modificationtime to the value of SOURCE_DATE_EPOCH if the
attribute was not set and the environment variable present. In a similar
way we could use default values for other things (locale in javadoc is
something the Debian folks set, for example) if the variable is present
- using it as a signal for "this build should be reproducible".
If we agree making reproducible builds via Ant easier, then I thought if
we tried to make our own build reproducible we might stumble over places
where we make things more difficult than they should be.
Also I know the Tomcat community is creating reproducible builds of
Tomcat so we could (a) learn from them and (b) ask them which things
could be easier.
If this is something we consider a goal, then I'd focus my
(unfortunately little) spare time on this. I still have "creating SBOMs"
on my TODO list but believe these would benefit from reproducible
artifacts so would prefer to start there.
If you want to stop me from going ahead, please yell.
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: Do we want to make Ant's build reproducible?
Posted by Stefan Bodewig <bo...@apache.org>.
On 2026-04-13, Dominique Devienne wrote:
> On Sat, Apr 11, 2026 at 4:45 PM Stefan Bodewig <bo...@apache.org> wrote:
>> The issue is "Ant should support reproducible builds" [...]
>> I still have "creating SBOMs" on my TODO list [...]
> Hi Stefan. First, thanks for the release.
> Second, with the EU's emphasis on the [CRA][1],
> I'd think SBOMs would take priority, although reproducible
> build by themselves are a good thing, and a wirthy goal.
OK, SBOMs first, it is. Not that I could give any ETA.
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: Do we want to make Ant's build reproducible?
Posted by Dominique Devienne <dd...@gmail.com>.
On Sat, Apr 11, 2026 at 4:45 PM Stefan Bodewig <bo...@apache.org> wrote:
> The issue is "Ant should support reproducible builds" [...]
> I still have "creating SBOMs" on my TODO list [...]
Hi Stefan. First, thanks for the release.
Second, with the EU's emphasis on the [CRA][1],
I'd think SBOMs would take priority, although reproducible
build by themselves are a good thing, and a wirthy goal. --DD
[1] https://digital-strategy.ec.europa.eu/en/policies/cyber-resilience-act
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: Do we want to make Ant's build reproducible?
Posted by Emmanuel Bourg <eb...@apache.org>.
Le 11/04/2026 à 16:44, Stefan Bodewig a écrit :
> Hi all
>
> https://bz.apache.org/bugzilla/show_bug.cgi?id=61269 is not exactly a
> new issue but I completely forgot about it until Elliotte Rusty Harold
> asked about its state yesterday.
>
> The issue is "Ant should support reproducible builds" where the request
> is more general than "Ant's own build should be reproducible". For a
> definition of reproducible builds and the things that need to be done,
> see https://reproducible-builds.org/docs/
>
> For example this defines a SOURCE_DATE_EPOCH environment variable for a
> deterministic timestamp of the build output. <tstamp> already support
> this.
>
> Given the nature of Ant builds I don't beliieve we can magically make
> arbitrary build processes reproducible but IMHO it would be a good idea
> to enable people to do so and not make it more difficult. Some things
> are already possible today like <zip>'s modificationtime attribute that
> ensures there the resulting archive does not depend on file times (I
> believe it still depends on filesystem traversal order right now).
The entries should be sorted if possible. In Debian there is a post
build normalization that sorts the entries in the archives [1].
> Ant could even go further and - in the example above - could implicitly
> set <zip>'s modificationtime to the value of SOURCE_DATE_EPOCH if the
> attribute was not set and the environment variable present. In a similar
> way we could use default values for other things (locale in javadoc is
> something the Debian folks set, for example) if the variable is present
> - using it as a signal for "this build should be reproducible".
In Debian I used SOURCE_DATE_EPOCH as a trigger for locale and timezone
normalization to not deviate too far from Ant upstream, but ideally the
builds should be reproducible by default. In my opinion any task relying
on the default locale or timezone should be modified to use default
values unless the user provides specific values, whether
SOURCE_DATE_EPOCH is set or not.
Emmanuel Bourg
[1] https://github.com/esoule/strip-nondeterminism
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org