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

Rework SOURCE_DATE_EPOCH usage be portable #19705

Merged
merged 1 commit into from Feb 14, 2022
Merged

Conversation

bmwiedemann
Copy link
Contributor

Checklist

  • Closing issues: #issue
  • Mark this if you consider it ready to merge
  • I've added tests (optional)
  • I wrote some lines in the radare2book

Description

As a follow-up of #19699,
Rework SOURCE_DATE_EPOCH usage in meson to be portable
to make @rofl0r and FreeBSD users happy.

Please test.

meson.build Outdated Show resolved Hide resolved
@eli-schwartz
Copy link
Contributor

Alternatively, the standard __DATE__ and __TIME__ macros in C could be used GCC since 2017 will respect the SOURCE_DATE_EPOCH environment variable for you and you don't have to do anything in meson.build (in fact you can just remove complexity from both that and configure/make).

@trufae
Copy link
Collaborator

trufae commented Feb 13, 2022

What's your proposal then?

@eli-schwartz
Copy link
Contributor

s = r_str_appendf (s, "commit: "R2_GITTIP" build: "R2_BIRTH);

pj_ks (pj, "birth", R2_BIRTH);

These two locations can be modified to use __DATE__. They will switch from YYYY-MM-DD to MMM DD YYYY, and when SOURCE_DATE_EPOCH is set the compiler (at least GCC) will use that epoch. When it isn't set, or you use some compiler that doesn't itself support the reproducible builds standard (I assume MSVC probably doesn't?) it will just use the time that the compiler was invoked on that file.

@trufae
Copy link
Collaborator

trufae commented Feb 14, 2022

I'm fine to merge this PR and i understand your proposal, but im not sure if it will work as its intended to have the same timestamp across all binaries. That would be another behaviour, that maybe we can discuss and use if agreed. Would you like to make a PR to continue the discussion there?

@trufae trufae merged commit a2b0bfa into radareorg:master Feb 14, 2022
32 checks passed
@bmwiedemann bmwiedemann deleted the date branch February 14, 2022 05:56
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.

None yet

4 participants