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

support for SOURCE_DATE_EPOCH #440

Merged
merged 2 commits into from
Apr 29, 2022
Merged

support for SOURCE_DATE_EPOCH #440

merged 2 commits into from
Apr 29, 2022

Conversation

bakkot
Copy link
Contributor

@bakkot bakkot commented Apr 24, 2022

Fixes #390, cc @ljharb.

This lets you do e.g. SOURCE_DATE_EPOCH=$(date -r in.emu '+%s') ecmarkup in.emu out.html to set the date in the rendered specification to the last modified date of in.emu, for reproducible builds.

src/cli.ts Outdated Show resolved Hide resolved
src/cli.ts Show resolved Hide resolved
@bakkot bakkot merged commit 309e336 into main Apr 29, 2022
@bakkot bakkot deleted the source-date-epoch branch April 29, 2022 21:28
@ljharb
Copy link
Member

ljharb commented Jul 10, 2022

@bakkot this helps, but it'd be much easier to make it work on windows as well if it was something ecmarkup could do - either by default, or via a flag.

@bakkot
Copy link
Contributor Author

bakkot commented Jul 10, 2022

@ljharb I am pretty sure you can set environment variables on Windows; what makes Windows special here?

@ljharb
Copy link
Member

ljharb commented Jul 10, 2022

date isn't available on windows, and i think the syntax to set env vars on windows is different, but maybe cross-env can help.

There's also the issue i'm seeing in the pattern matching repo where despite builds now being reproducible on my machine, CI still finds a difference.

@bakkot
Copy link
Contributor Author

bakkot commented Jul 10, 2022

I am pretty sure there's a way to get the equivalent on Windows, though I don't have a machine in front of me to test. I would very much prefer to stick to the standard option here, if it's at all practical, rather than adding more CLI options.

If you're successfully setting the relevant environment variable and still seeing builds not being reproducible I can look into that; open an issue with a repro?

@ljharb
Copy link
Member

ljharb commented Jul 10, 2022

Filed #470.

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.

Determine draft date by the last modified date of the ecmarkup
2 participants