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

alist: add update.nix #358335

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

alist: add update.nix #358335

wants to merge 1 commit into from

Conversation

Moraxyc
Copy link
Contributor

@Moraxyc Moraxyc commented Nov 23, 2024

Add update.sh to bump version automatically.

https://github.com/AlistGo/alist/releases/tag/v3.40.0

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.

pkgs/by-name/al/alist/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/al/alist/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/al/alist/update.sh Outdated Show resolved Hide resolved
pkgs/by-name/al/alist/update.nix Show resolved Hide resolved
pkgs/by-name/al/alist/update.nix Outdated Show resolved Hide resolved
pkgs/by-name/al/alist/update.nix Outdated Show resolved Hide resolved
pkgs/by-name/al/alist/update.sh Outdated Show resolved Hide resolved
Copy link
Contributor

@jian-lin jian-lin left a comment

Choose a reason for hiding this comment

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

With these comments addressed, I think this PR is good to go.

Comment on lines 6 to 7
coreutils,
gnused,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
coreutils,
gnused,

Not used.

# The solution is to run update-source-version for web after nix-update to ensure that webVersion is correct.
nix-update alist --version "$version"

# The --ignore-same-hash flag bypasses errors caused by the unchanged hash when the URL relies on a non-default version-key.
Copy link
Contributor

Choose a reason for hiding this comment

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

I do not think the reason is correct.

Before nix-update, webVersion is 3.39.2. After nix-update, webVersion is changed to 3.40.0, which is wrong. (Maybe open an issue to nix-update?) Then, update-source-version changes webVersion to its latest version 3.39.2 which is the same as the original one, so its hash remains the same.

nix-update alist --version "$version"

# The --ignore-same-hash flag bypasses errors caused by the unchanged hash when the URL relies on a non-default version-key.
update-source-version alist "$webVersion" --source-key=web --version-key=webVersion --ignore-same-hash
Copy link
Contributor

Choose a reason for hiding this comment

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

--ignore-same-hash is also needed.

Consider this situation: the latest webVersion is the same as version. nix-update updates both versions to 3.40.0. Then update-source-version finds the "old" webVersion (3.40.0) equals to the latest one. Without --ignore-same-hash, it will not update hash for web, which results in a wrong hash.

@Moraxyc Moraxyc marked this pull request as draft November 24, 2024 09:14
@Moraxyc
Copy link
Contributor Author

Moraxyc commented Nov 24, 2024

nix-update uses replace() to replace all matched versions directly. Solving this problem with logic will significantly increase the complexity. Therefore, this PR will continue after nix-update fixes this problem.

Mic92/nix-update#296

@Moraxyc Moraxyc changed the title alist: add update.sh; 3.39.2 -> 3.40.0 alist: add update.nix Dec 5, 2024
@Moraxyc
Copy link
Contributor Author

Moraxyc commented Dec 5, 2024

Since there is no progress on the issue, a hacky way to update vendorHash is temporarily used here.

@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Dec 5, 2024
@jian-lin jian-lin dismissed their stale review December 5, 2024 11:15

outdated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants