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

Use cmake TIMESTAMP function #455

Merged
merged 1 commit into from Feb 12, 2022
Merged

Use cmake TIMESTAMP function #455

merged 1 commit into from Feb 12, 2022

Conversation

bmwiedemann
Copy link
Contributor

Use cmake TIMESTAMP function
because it is not only platform independent
but also allows to override the build date

Also adds UTC flag, to be independent of timezone
and uses ISO-8601 date format
to avoid the possibility of locale-dependent month names.

This PR was done while working on reproducible builds for openSUSE.

HTCondor Pull Request Checklist for internal reviewers

  • Verify that (GitHub thinks) the merge is clean. If it isn't, and you're confident you can resolve the conflicts, do so. Otherwise, send it back to the original developer.
  • Verify that the related Jira ticket exists and has a target version number and that it is correct.
  • Verify that the Jira ticket is in review status and is assigned to the reviewer.
  • Verify that the Jira ticket (HTCONDOR-xxx) is mentioned at the beginning of the title. Edit it, if not
  • Verify that the branch destination of the PR matches the target version of the ticket
  • Check for correctness of change
  • Check for regression test(s) of new features and bugfixes (if the feature doesn't require root)
  • Check for documentation, if needed
  • Check for version history, if needed
  • Check BaTLab dashboard for successful build (https://batlab.chtc.wisc.edu/results/workspace.php) and test for either the PR or a workspace build by the developer that has the Jira ticket as a comment.
  • Check that commit message references the Jira ticket (HTCONDOR-xxx)

After the above

  • Hit the merge button if the pull request is approved and it is not a security patch (security changes require 2 additional reviews)
  • If the pull request is approved, take the ticket out of review state
  • Assign JIRA Ticket back to the developer

@bmwiedemann
Copy link
Contributor Author

bmwiedemann commented Feb 11, 2022

Fixed. Needs some testing. Somehow with the patch, the -DBUILD_DATE= was missing in the produced build.ninja

because it is not only platform independent
but also allows to override the build date

Also adds UTC flag, to be independent of timezone
and uses ISO-8601 date format
to avoid the possibility of locale-dependent month names.

This PR was done while working on reproducible builds for openSUSE.
Copy link
Member

@GregThain GregThain left a comment

Choose a reason for hiding this comment

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

Thanks -- this looks great. It does one of my favorite things in the world -- adding functionality by removing code. FYI, the reason this macro was originally written the way it was is that HTCondor started with Cmake 2.6, which didn't have the string TIMESTAMP function.

@GregThain GregThain merged commit 8974edf into htcondor:master Feb 12, 2022
1 check passed
@bmwiedemann bmwiedemann deleted the date branch February 12, 2022 02:02
@bmwiedemann
Copy link
Contributor Author

I fully agree on that.
btw: I noticed that both macros are used exactly once, so you might want to inline that one-liner to improve readability by reducing indirection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants