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

common-updater-scripts: update-source-version option to update SOURCE_DATE_EPOCH #358569

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

carlossless
Copy link
Contributor

@carlossless carlossless commented Nov 23, 2024

Adds an update-source-version option to conveniently update the SOURCE_DATE_EPOCH attr.

This is useful for update scripts that need to update SOURCE_DATE_EPOCH with each version update. It can also be seen as a step in the direction mentioned in #256270 (comment).

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

…_DATE_EPOCH

Adds an option to conveniently update the SOURCE_DATE_EPOCH attr
@raboof
Copy link
Member

raboof commented Jan 9, 2025

This looks reasonable to me.

Perhaps it's safe/simple enough to not need a test, but is there a package you could apply this to, so we can see the feature 'in action'?

@jtojnar
Copy link
Member

jtojnar commented Jan 9, 2025

Sorry for not reviewing this sooner.

Would not separate invocation with --ignore-same-hash --version-key=SOURCE_DATE_EPOCH be sufficient?

This is quite niche and generally, I would like the trim the arguments down a bit in favour of more generic ones.

@carlossless
Copy link
Contributor Author

carlossless commented Jan 12, 2025

Perhaps it's safe/simple enough to not need a test, but is there a package you could apply this to, so we can see the feature 'in action'?

@raboof I had tested it and prepared a branch using this change for q2pro here

Would not separate invocation with --ignore-same-hash --version-key=SOURCE_DATE_EPOCH be sufficient?

@jtojnar I haven't really considered that before. I tried it and It does indeed work for my use case. That said, I don't feel that the approach is very clear.

Perhaps it would be worthwhile to allow this script to set a variable number of generic attributes in a single invocation? Something like:

update-source-version "$attr" "$version" --rev="$rev" -a revCount=1234 -a SOURCE_DATE_EPOCH=2025-01-02

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Other
Development

Successfully merging this pull request may close these issues.

3 participants