set_SOURCE_TIME

Function set_SOURCE_TIME 

Source
pub fn set_SOURCE_TIME() -> Result<(), String>
Expand description

Sets the SOURCE_TIME env variable.

Call this from build.rs. Use env! in your main.rs to use the variable.

Example value: "03:25:07Z"

Reads the SOURCE_DATE_EPOCH env var if set. Otherwise, runs git to get the value.

ยงErrors

Returns an error when:

  • SOURCE_DATE_EPOCH env var is non-empty and invalid
  • it fails to get the timestamp from git