Skip to content

Conversation

@charlycoste
Copy link

@charlycoste charlycoste commented Nov 27, 2025

Q A
Branch? 8.1
Bug fix? no
New feature? yes
Deprecations? no
License MIT

If you care about reproducible builds, you probably already use the kernel.container_build_time parameter to "pin" the build date of your service container.

Nevertheless, the SOURCE_DATE_EPOCH standardized environment variable provides a better flexibility.

For instance, if you want to use the date of the last commit :

export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)
bin/console cache:clear

This pull request intends to add support for this env var but gives priority to kernel.container_build_time if set.

@carsonbot carsonbot added this to the 8.1 milestone Nov 27, 2025
@charlycoste charlycoste changed the title [HttpKernel] Add support for SOURCE_DATA_EPOCH environment variable [HttpKernel] Add support for SOURCE_DATE_EPOCH environment variable Nov 27, 2025
@charlycoste
Copy link
Author

charlycoste commented Nov 27, 2025

Damn ! Sorry for the typos… Corrected.
Last push. Waiting for reviews, now.

Copy link
Contributor

@Spomky Spomky left a comment

Choose a reason for hiding this comment

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

Many thanks 👍🏽

@OskarStark OskarStark changed the title [HttpKernel] Add support for SOURCE_DATE_EPOCH environment variable [HttpKernel] Add support for SOURCE_DATE_EPOCH environment variable Nov 29, 2025
@nicolas-grekas
Copy link
Member

Thanks for letting us know about this env var. 2 things:

  • please add tests :)
  • should we populate kernel.container_build_time with this instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants