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

Documentation: Mention dirMode and fileMode in reproducible archives section #10900

Open
sdavids opened this issue Sep 27, 2019 · 8 comments
Open
Labels
a:documentation Documentation content in:file-tasks copy sync zip tar rename delete

Comments

@sdavids
Copy link
Contributor

sdavids commented Sep 27, 2019

https://docs.gradle.org/current/userguide/working_with_files.html#sec:reproducible_archives

dirMode and fileMode should be mentioned in this section also:

Groovy:

tasks.withType(AbstractArchiveTask).configureEach {
    preserveFileTimestamps = false
    reproducibleFileOrder = true
    dirMode = 0755
    fileMode = 0644
}

Kotlin:

tasks.withType<AbstractArchiveTask>().configureEach {
  isPreserveFileTimestamps = false
  isReproducibleFileOrder = true
  dirMode = 493  // 0755
  fileMode = 420 // 0644
}

Different OSes, different umasks, and/or the version control system of choice might lead to non-reproducible builds if one do not set dirMode and fileMode explicitly.

@lptr
Copy link
Member

lptr commented Nov 6, 2019

Perhaps we should have a single switch to turn these all on at once? I mean, for most users the intention is to have reproducible archives, and the ability to configure each necessary aspect individually is just confusing and leads to unexpected results (=non-reproducible archives).

One way to achieve this would be to adopt https://github.com/Johni0702/gradle-reproducible-builds-plugin as a built-in feature.

@DPUkyle
Copy link
Contributor

DPUkyle commented Dec 3, 2019

@lptr I'm a bit nervous about forcefully setting dirMode and fileMode for all archive tasks. For example, the order in which these CopySpecs are mutated isn't clear, and I worry that some other child CopySpec which attempts to set unique permissions for particular files/dirs would be clobbered by the "global" configuration.

@wolfs
Copy link
Member

wolfs commented Jan 22, 2020

@DPUkyle if the {dir,file}Mode of the child copy spec is explicitly set, then it will take precedence over the setting in the root spec.

@stale
Copy link

stale bot commented Jan 21, 2021

This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. If you're interested in how we try to keep the backlog in a healthy state, please read our blog post on how we refine our backlog. If you feel this is something you could contribute, please have a look at our Contributor Guide. Thank you for your contribution.

@stale stale bot added the stale label Jan 21, 2021
@wolfs
Copy link
Member

wolfs commented Jan 21, 2021

We should update the documentation.

@stale stale bot removed the stale label Jan 21, 2021
@lptr
Copy link
Member

lptr commented Feb 18, 2021

This somehow got into the "Epics" column!

@wolfs wolfs added a:documentation Documentation content in:file-tasks copy sync zip tar rename delete labels May 10, 2021
@stale
Copy link

stale bot commented Jun 12, 2022

This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. If you're interested in how we try to keep the backlog in a healthy state, please read our blog post on how we refine our backlog. If you feel this is something you could contribute, please have a look at our Contributor Guide. Thank you for your contribution.

@msgilligan
Copy link

We should update the documentation.

The documentation really needs to be updated. I (and another contributor) spent hours tracking this issue down after having too much confidence that Gradle was configured correctly given it's announced support for "reproducible builds" and me having read the documentation thoroughly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:documentation Documentation content in:file-tasks copy sync zip tar rename delete
Projects
None yet
Development

No branches or pull requests

8 participants