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

[BUG] All templates should contain the current year in the copyright #325

Closed
vyasr opened this issue Dec 8, 2022 · 1 comment · Fixed by #519
Closed

[BUG] All templates should contain the current year in the copyright #325

vyasr opened this issue Dec 8, 2022 · 1 comment · Fixed by #519
Labels
? - Needs Triage Need team to review and classify bug Something isn't working

Comments

@vyasr
Copy link
Contributor

vyasr commented Dec 8, 2022

Describe the bug
rapids-cmake has multiple functions that generate CMake files such as Find*.cmake or *-config.cmake files. These templates all currently have the year hardcoded, resulting in the produced files being out of date.

Steps/Code to reproduce bug
The error is visible in every template file that contains a copyright header, here is one example.

Expected behavior
The copyright year should be written at build time when the file is being generated.

Additional context
I am happy to submit a patch but I am not sure what the best approach is. AFAICT there is no built-in way to accomplish this in CMake, so most likely we will need to use execute_process to run shell commands to get the values unless there is a better alternative.

@vyasr vyasr added bug Something isn't working ? - Needs Triage Need team to review and classify labels Dec 8, 2022
@robertmaynard
Copy link
Contributor

I am happy to review a patch to correct this issue :)

The best approach is to use string(TIMESTAMP to get the current year.

So something like:

string(TIMESTAMP current_year [[%Y]] UTC)
configure_file(.... @ONLY)

And the template file would have:

Copyright (c) @current_year@, NVIDIA CORPORATION.

KyleFromNVIDIA added a commit to KyleFromNVIDIA/rapids-cmake that referenced this issue Jan 11, 2024
Rather than hard-coding the copyright year in each template file,
get the current year at build time and write it in the template.
KyleFromNVIDIA added a commit to KyleFromNVIDIA/rapids-cmake that referenced this issue Jan 11, 2024
Rather than hard-coding the copyright year in each template file,
get the current year at build time and write it in the template.
KyleFromNVIDIA added a commit to KyleFromNVIDIA/rapids-cmake that referenced this issue Jan 11, 2024
Rather than hard-coding the copyright year in each template file,
get the current year at build time and write it in the template.
KyleFromNVIDIA added a commit to KyleFromNVIDIA/rapids-cmake that referenced this issue Jan 11, 2024
Rather than hard-coding the copyright year in each template file,
get the current year at build time and write it in the template.
KyleFromNVIDIA added a commit to KyleFromNVIDIA/rapids-cmake that referenced this issue Jan 11, 2024
Rather than hard-coding the copyright year in each template file,
get the current year at build time and write it in the template.
KyleFromNVIDIA added a commit to KyleFromNVIDIA/rapids-cmake that referenced this issue Jan 11, 2024
Rather than hard-coding the copyright year in each template file,
get the current year at build time and write it in the template.
@rapids-bot rapids-bot bot closed this as completed in #519 Jan 12, 2024
rapids-bot bot pushed a commit that referenced this issue Jan 12, 2024
PointKernel pushed a commit to PointKernel/rapids-cmake that referenced this issue Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
? - Needs Triage Need team to review and classify bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants