Skip to content

Support overriding 1.2.0+ nix package #374

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

Merged

Conversation

MattSturgeon
Copy link
Contributor

@MattSturgeon MattSturgeon commented Feb 14, 2025

Prepare for the upcoming version bump in nixpkgs, by making the unnecessary or conflicting overrides conditional on the version of the package being overridden.

This is compatible with nixpkgs inputs both with and without NixOS/nixpkgs#381975, because we can check the base-package's version and choose an override impl based on that.

If the base package is older than 1.2.0, we use the old/current impl. If the package is 1.2.0 or newer, we can drop those overrides and only use the newer simpler impl.

I've split the old & new impl into separate files to simplify the diff and make the eventual removal easier.

Testing

To test the "old" impl, you can simply clone this PR and run nix build.

To test the "new" impl, against NixOS/nixpkgs#381975, you can override the nixpkgs input and then build:

nix flake lock --override-input nixpkgs 'github:nixos/nixpkgs?ref=pull/381975/merge'

nix build

Tip

Use ref=pull/<number>/merge to test a PR merged with the latest nixpkgs master
or use ref=pull/<number>/head to test the PR itself.

cc @beh-10257 @LovingMelody @diniamo @R1kaB3rN

Nixpkgs PR NixOS/nixpkgs#381975

Prepare for the upcoming version bump in nixpkgs, by making the
unnecessary or conflicting overrides conditional.
@MattSturgeon MattSturgeon force-pushed the flake/prep-for-nixpkgs-bump branch from 1b9e757 to a0e341d Compare February 17, 2025 09:22
@MattSturgeon MattSturgeon changed the title Support overriding 1.2.1 nix package Support overriding 1.2.0+ nix package Feb 17, 2025
@MattSturgeon MattSturgeon marked this pull request as ready for review February 17, 2025 09:38
@R1kaB3rN
Copy link
Member

Great, the relevant pull request was finally merged in nixpkgs. @LovingMelody are you fine/have any strong feelings for these changes?

If not, then I can go ahead and merge this.

(prev.pythonPath or [])
++ [
urllib3
(callPackage ./pyzstd.nix {})
Copy link
Member

Choose a reason for hiding this comment

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

I believe we can drop this once it lands in unstable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we're confident that we have an up-to-date nixpkgs revision, then the entire old-unwrapped.nix file can go, along with the pyzstd package.

It is only kept to allow for a smoother transition for end users who may end up bumping their umu input but their nixpkgs input remains slightly behind.

We should be able to drop it in a few weeks. Maybe throwing an error if a v1.1.4 base package is still found.


# Broken? Tests parse_args with no options (./umu_run.py)
# Fails with AssertionError: SystemExit not raised
"test_parse_args_noopts"
Copy link
Member

Choose a reason for hiding this comment

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

I understand why the game drive tests fail but am not sure for this one. I suppose it's related to the other tests failing, and I am not too interested in looking into it.

@R1kaB3rN
Copy link
Member

Aside: If either pyzstd or zstd get updated, which will happen soon, then I imagine it will require a rebuild for the upstream nixpkg, correct?

@MattSturgeon
Copy link
Contributor Author

Aside: If either pyzstd or zstd get updated, which will happen soon, then I imagine it will require a rebuild for the upstream nixpkg, correct?

Typically nixpkgs will update shortly after a new version is released. If umu still needs the old version, then nixpkgs may consider packaging both versions. Or the dependency can be overridden to use the old version, specifically for umu.

Otherwise, if umu requires the new version before it is available in nixpkgs, then we can apply overrides here.

How much effort we put in here would depend on how important it is for umu to have a specific version of zstd.

@LovingMelody
Copy link
Contributor

No strong feelings on this pr

@R1kaB3rN R1kaB3rN merged commit d5888b8 into Open-Wine-Components:main Feb 21, 2025
15 checks passed
@MattSturgeon MattSturgeon deleted the flake/prep-for-nixpkgs-bump branch February 21, 2025 03: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.

3 participants