Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Apache pom 24 and make build reproductible #313

Merged
merged 3 commits into from
Jul 25, 2021

Conversation

fpapon
Copy link
Member

@fpapon fpapon commented Jul 16, 2021

No description provided.

@fpapon fpapon requested review from bdemers and bmarwell July 16, 2021 21:24
Copy link
Contributor

@bmarwell bmarwell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit

pom.xml Outdated Show resolved Hide resolved
@bdemers
Copy link
Member

bdemers commented Jul 19, 2021

I'm a little confused, and I haven't been following the history of the project.build.outputTimestamp property. So I'm going to make some guesses and assumptions (I could be miss remembering, or referencing topics not relevant to this PR, if so just ignore me 🤣)

project.build.outputTimestamp is used so that multiple builds from the same source will produce identical binaries (same checksums, etc). (likely this gets deeper into trust as well). There are a bunch of other small problems related to this. One source is the MANIFEST (which contains the name of the builder and which JVM was used, the 1.7.1 build example)

Setting the value to 1 disables this feature:
https://github.com/apache/maven-release/blob/a9e30c63ea8071234e9a7bb1f433178963ecf93c/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java#L350-L375

Ideally, we remove all timestamps from the build's output, but either way, until we resolve the other issues we probably want to keep things simple and disable it (rather than having changing timestamp in the pom and the potential merge conflicts that could add)? (maybe these have already been worked in plugin updates, and bumping the parent fixes most/all of that?)

That said, I'm +0 on the change.

@fpapon
Copy link
Member Author

fpapon commented Jul 19, 2021

I'm a little confused, and I haven't been following the history of the project.build.outputTimestamp property. So I'm going to make some guesses and assumptions (I could be miss remembering, or referencing topics not relevant to this PR, if so just ignore me rofl)

project.build.outputTimestamp is used so that multiple builds from the same source will produce identical binaries (same checksums, etc). (likely this gets deeper into trust as well). There are a bunch of other small problems related to this. One source is the MANIFEST (which contains the name of the builder and which JVM was used, the 1.7.1 build example)

Setting the value to 1 disables this feature:
https://github.com/apache/maven-release/blob/a9e30c63ea8071234e9a7bb1f433178963ecf93c/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java#L350-L375

Ideally, we remove all timestamps from the build's output, but either way, until we resolve the other issues we probably want to keep things simple and disable it (rather than having changing timestamp in the pom and the potential merge conflicts that could add)? (maybe these have already been worked in plugin updates, and bumping the parent fixes most/all of that?)

That said, I'm +0 on the change.

I didn't go deeper on reproductible build and this is related to the changes in the new apache pom parent which has a maven profile with an enforce rule about this property.

@bmarwell
Copy link
Contributor

I'm a little confused, and I haven't been following the history of the project.build.outputTimestamp property. So I'm going to make some guesses and assumptions (I could be miss remembering, or referencing topics not relevant to this PR, if so just ignore me rofl)
project.build.outputTimestamp is used so that multiple builds from the same source will produce identical binaries (same checksums, etc). (likely this gets deeper into trust as well). There are a bunch of other small problems related to this. One source is the MANIFEST (which contains the name of the builder and which JVM was used, the 1.7.1 build example)
Setting the value to 1 disables this feature:
https://github.com/apache/maven-release/blob/a9e30c63ea8071234e9a7bb1f433178963ecf93c/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java#L350-L375
Ideally, we remove all timestamps from the build's output, but either way, until we resolve the other issues we probably want to keep things simple and disable it (rather than having changing timestamp in the pom and the potential merge conflicts that could add)? (maybe these have already been worked in plugin updates, and bumping the parent fixes most/all of that?)
That said, I'm +0 on the change.

I didn't go deeper on reproductible build and this is related to the changes in the new apache pom parent which has a maven profile with an enforce rule about this property.

Maybe we can go step by step? I would be okay with this change if we only started an epic "reproducible builds" here.
See https://repository.apache.org/service/local/repositories/releases/archive/org/apache/maven/maven-core/3.8.1/maven-core-3.8.1.jar/!/META-INF/MANIFEST.MF for example. They have way less information in their files.

@fpapon
Copy link
Member Author

fpapon commented Jul 19, 2021

I'm a little confused, and I haven't been following the history of the project.build.outputTimestamp property. So I'm going to make some guesses and assumptions (I could be miss remembering, or referencing topics not relevant to this PR, if so just ignore me rofl)

project.build.outputTimestamp is used so that multiple builds from the same source will produce identical binaries (same checksums, etc). (likely this gets deeper into trust as well). There are a bunch of other small problems related to this. One source is the MANIFEST (which contains the name of the builder and which JVM was used, the 1.7.1 build example)

Setting the value to 1 disables this feature:
https://github.com/apache/maven-release/blob/a9e30c63ea8071234e9a7bb1f433178963ecf93c/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java#L350-L375

Ideally, we remove all timestamps from the build's output, but either way, until we resolve the other issues we probably want to keep things simple and disable it (rather than having changing timestamp in the pom and the potential merge conflicts that could add)? (maybe these have already been worked in plugin updates, and bumping the parent fixes most/all of that?)

That said, I'm +0 on the change.

I didn't go deeper on reproductible build and this is related to the changes in the new apache pom parent which has a maven profile with an enforce rule about this property.

I'm a little confused, and I haven't been following the history of the project.build.outputTimestamp property. So I'm going to make some guesses and assumptions (I could be miss remembering, or referencing topics not relevant to this PR, if so just ignore me rofl)
project.build.outputTimestamp is used so that multiple builds from the same source will produce identical binaries (same checksums, etc). (likely this gets deeper into trust as well). There are a bunch of other small problems related to this. One source is the MANIFEST (which contains the name of the builder and which JVM was used, the 1.7.1 build example)
Setting the value to 1 disables this feature:
https://github.com/apache/maven-release/blob/a9e30c63ea8071234e9a7bb1f433178963ecf93c/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java#L350-L375
Ideally, we remove all timestamps from the build's output, but either way, until we resolve the other issues we probably want to keep things simple and disable it (rather than having changing timestamp in the pom and the potential merge conflicts that could add)? (maybe these have already been worked in plugin updates, and bumping the parent fixes most/all of that?)
That said, I'm +0 on the change.

I didn't go deeper on reproductible build and this is related to the changes in the new apache pom parent which has a maven profile with an enforce rule about this property.

Maybe we can go step by step? I would be okay with this change if we only started an epic "reproducible builds" here.
See https://repository.apache.org/service/local/repositories/releases/archive/org/apache/maven/maven-core/3.8.1/maven-core-3.8.1.jar/!/META-INF/MANIFEST.MF for example. They have way less information in their files.

They have less information in the MANIFEST.MF because it's not a bundle, so they don't have OSGi metadata.

@bdemers
Copy link
Member

bdemers commented Jul 19, 2021

Ahh, that Maven manifest does look a lot better! 😄

@fpapon fpapon requested a review from bmarwell July 21, 2021 08:39
@fpapon
Copy link
Member Author

fpapon commented Jul 21, 2021

@bdemers @bmarwell I merged the PR for reproductible build thanks to @hboutemy

@bdemers
Copy link
Member

bdemers commented Jul 21, 2021

@fpapon Nice!!

Copy link
Contributor

@bmarwell bmarwell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I just wonder: will the username still be in the META-INF/MAINFEST.MF files? But we can check afterwards.

@fpapon fpapon merged commit 0554a2d into apache:main Jul 25, 2021
@fpapon fpapon deleted the apache-pom branch July 25, 2021 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants