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

USWDS - Bug: Release has bogus file dates #5746

Closed
2 tasks done
bkline opened this issue Jan 25, 2024 · 5 comments
Closed
2 tasks done

USWDS - Bug: Release has bogus file dates #5746

bkline opened this issue Jan 25, 2024 · 5 comments
Assignees
Labels
Affects: Dependencies Relates to project dependencies Needs: Discussion We need to discuss an approach to this issue Type: Bug A problem in the code

Comments

@bkline
Copy link

bkline commented Jan 25, 2024

Describe the bug

The tar file for the latest release has files with timestamps back in October 26, 1985.

Steps to reproduce the bug

  1. Download https://github.com/uswds/uswds/releases/download/v3.7.1/uswds-uswds-3.7.1.tgz
  2. Unpack the tarfile
  3. Look at the timestamps on the unpacked file

Expected Behavior

The files in the release tar file correctly reflect the date/time of creation.

Related code

No response

Screenshots

No response

System setup

No response

Additional context

No response

Code of Conduct

@bkline bkline added Needs: Confirmation We need to confirm that this is an issue Type: Bug A problem in the code labels Jan 25, 2024
@github-actions github-actions bot added the Status: Triage We're triaging this issue and grooming if necessary label Jan 25, 2024
@mejiaj mejiaj added Affects: Dependencies Relates to project dependencies and removed Needs: Confirmation We need to confirm that this is an issue Status: Triage We're triaging this issue and grooming if necessary labels Jan 26, 2024
@mejiaj
Copy link
Contributor

mejiaj commented Jan 26, 2024

Thanks for reporting @bkline!

Confirming on mac OS 14.1.1.
image

Need to look into possible NPM issue and release script. This is using built-in npm pack, so no security concerns.

const zip = spawn("npm", ["pack"]);

@mejiaj mejiaj added this to the 2024.02 February milestone Jan 29, 2024
@mahoneycm
Copy link
Contributor

mahoneycm commented Feb 8, 2024

It looks like this is actually the intended behavior from the node team based on this issue discussion.

Initial answer

The reason for this was so two separate npm pack calls done from the same commit -- even on separate computers, would be able to generate hash-identical tarballs. We didn't really expect that random software out there would have... pathological issues with old timestamps. We still want to preserve the feature, though, so picking an arbitrary date more recent than 1980 seemed like the way to go. Hopefully there's no more incompatibilities! 1

Follow-up

We have every intention of keeping the consistent dates going forward because they enable reproducible builds for npm packages. 2

We should discuss what that means for USWDS and if we want to find a way to update this value to eliminate confusion for users who download and unzip the file.

Footnotes

  1. https://github.com/npm/npm/issues/19968#issuecomment-372799983

  2. https://github.com/npm/npm/issues/19968#issuecomment-383988984

@mahoneycm mahoneycm added the Needs: Discussion We need to discuss an approach to this issue label Feb 8, 2024
@mejiaj
Copy link
Contributor

mejiaj commented Feb 16, 2024

@mahoneycm thanks for looking into it. You're right, we'll need to discuss whether we continue for find an alternative.

@bkline
Copy link
Author

bkline commented Feb 16, 2024

If nothing else, assuming this odd practice is continued, I would strongly suggest a prominent notice explaining the dates which otherwise seem highly suspicious, and suggest tampering.

@mahoneycm
Copy link
Contributor

Since this is intended NPM behavior, we are going to close this ticket and update the website with the following note to inform users:

Note: The file date defaults to October 26, 1985, when you download and install this package. This is intentional. NPM sets a default date to ensure reproducible builds for npm packages.

We will continue to track this work at uswds/uswds-site#2499.

Thank you for flagging @bkline !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Affects: Dependencies Relates to project dependencies Needs: Discussion We need to discuss an approach to this issue Type: Bug A problem in the code
Projects
Status: Done
Development

No branches or pull requests

3 participants