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

Centralize SOURCE_DATE_EPOCH parsing. #767

Merged
merged 1 commit into from
Oct 19, 2023

Conversation

wlynch
Copy link
Member

@wlynch wlynch commented Oct 19, 2023

Before we could get into weird situations where SOURCE_DATE_EPOCH="" particularly with Makefiles doing conditional setting. os.LookupEnv will treat "" as the env being set (https://go.dev/play/p/sOI08BfjdhV) which means that we can get inconsistent behavior where the melanage build will default SOURCE_DATE_EPOCH to 0, but the SBOM generation would not.

This consolidates the parsing behavior so we are consistent everywhere we are parsing the environment var.

Melange Pull Request Template

Functional Changes

  • This change can build all of Wolfi without errors (describe results in notes)

Notes:

SCA Changes

  • Examining several representative APKs show no regression / the desired effect (details in notes)

Notes:

Linter

  • The new check is clean across Wolfi
  • The new check is opt-in or a warning

Notes:

Before we could get into weird situations where `SOURCE_DATE_EPOCH=""`
particularly with Makefiles doing conditional setting. os.LookupEnv will
treat "" as the env being set (https://go.dev/play/p/sOI08BfjdhV) which
means that we can get inconsistent behavior where the melanage build
will default SOURCE_DATE_EPOCH to 0, but the SBOM generation would not.

This consolidates the parsing behavior so we are consistent everywhere
we are parsing the environment var.

Signed-off-by: Billy Lynch <[email protected]>
@wlynch wlynch requested review from imjasonh and jennpeare October 19, 2023 16:46
@imjasonh imjasonh merged commit 4cdad80 into chainguard-dev:main Oct 19, 2023
26 checks passed
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.

3 participants