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

umu-launcher: 1.1.4 -> 1.2.3 & init pyzstd #381975

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

MattSturgeon
Copy link
Contributor

@MattSturgeon MattSturgeon commented Feb 14, 2025

Changelogs:

Incorporates work done in the upstream flake: Open-Wine-Components/umu-launcher#345

All patches removed.

Now also uses cargo for some dependencies. See Compiling non-Rust packages that include Rust code in the nixpkgs manual.

Used the new configure flags to specify "vendored" dependencies don't need to be built, since we install them nixpkgs packages.

Adds withTruststore and withDeltaUpdates package args, that allow configuring the new optional dependencies, as-per the upstream flake.

Adds check phase using pytestCheckHook.

Includes the dependency pyzstd, cherry-picked from #365111.

Package builds ok. I've not tested using it at runtime yet.

Fixes #381960
Fixes #371859

cc maintainers @LovingMelody @diniamo
cc upstream @R1kaB3rN

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • 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.

@nix-owners nix-owners bot requested a review from natsukium February 14, 2025 07:58
@MattSturgeon MattSturgeon changed the title umu-launcher{-unwrapped}: 1.2.4 -> 1.2.1 umu-launcher{-unwrapped}: 1.1.4 -> 1.2.1 Feb 14, 2025
@diniamo
Copy link
Contributor

diniamo commented Feb 14, 2025

I don't think a cherry-picked commit from another PR should be merged as a part of this. We should try to get that one merged first, and keep this as a draft until then.

Edit: oh, the other PR adds it as a dep as well. Well, it might be fine then, but separating it to a different PR might be more ideal still.

@MattSturgeon
Copy link
Contributor Author

I don't think a cherry-picked commit from another PR should be merged as a part of this.

I disagree. It's a minor dependency for that PR, this one, and also a third one.

Including minor dependencies in a larger PR is fine IMO.

We should try to get that one merged first, and keep this as a draft until then.

#365111 has been inactive for a few weeks and still needs some cleanup work before being merged. It also has merge conflicts.

#356882 is another PR that packages pyzstd as a transitive dependency, but that is even more stale and also has merge conflicts.

@diniamo
Copy link
Contributor

diniamo commented Feb 14, 2025

At least indicate it in the title then?

@MattSturgeon MattSturgeon changed the title umu-launcher{-unwrapped}: 1.1.4 -> 1.2.1 umu-launcher: 1.1.4 -> 1.2.1 & new dependencies Feb 14, 2025
@MattSturgeon
Copy link
Contributor Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 381975


x86_64-linux

✅ 4 packages built:
  • python312Packages.pyzstd
  • python313Packages.pyzstd
  • umu-launcher
  • umu-launcher-unwrapped

pkgs/by-name/um/umu-launcher-unwrapped/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/um/umu-launcher-unwrapped/package.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/pyzstd/default.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/pyzstd/default.nix Outdated Show resolved Hide resolved
Copy link
Contributor

@diniamo diniamo left a comment

Choose a reason for hiding this comment

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

Diff looks good

@MattSturgeon MattSturgeon added 8.has: package (new) This PR adds a new package 8.has: package (update) This PR updates a package to a newer version 11.by: package-maintainer This PR was created by the maintainer of the package it changes 12.approvals: 1 This PR was reviewed and approved by one reputable person 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in the package labels Feb 14, 2025
@MattSturgeon MattSturgeon changed the title umu-launcher: 1.1.4 -> 1.2.1 & new dependencies umu-launcher: 1.1.4 -> 1.2.3 & init pyzstd Feb 14, 2025
@MattSturgeon MattSturgeon added 12.approvals: 2 This PR was reviewed and approved by two reputable people and removed 12.approvals: 1 This PR was reviewed and approved by one reputable person labels Feb 14, 2025
@khaneliman
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 381975


x86_64-linux

✅ 4 packages built:
  • python312Packages.pyzstd
  • python313Packages.pyzstd
  • umu-launcher
  • umu-launcher-unwrapped

aarch64-linux

✅ 4 packages built:
  • python312Packages.pyzstd
  • python313Packages.pyzstd
  • umu-launcher
  • umu-launcher-unwrapped

x86_64-darwin

✅ 2 packages built:
  • python312Packages.pyzstd
  • python313Packages.pyzstd

aarch64-darwin

✅ 2 packages built:
  • python312Packages.pyzstd
  • python313Packages.pyzstd

@poperigby
Copy link
Contributor

Feel free to fixup pyzstd. I won't be able to get to it for awhile.

@MattSturgeon MattSturgeon added 12.approvals: 1 This PR was reviewed and approved by one reputable person and removed 12.approvals: 2 This PR was reviewed and approved by two reputable people labels Feb 15, 2025
pkgs/top-level/python-packages.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/pyzstd/default.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/pyzstd/default.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/pyzstd/default.nix Outdated Show resolved Hide resolved
@MattSturgeon
Copy link
Contributor Author

Looks like umu also has some tests, mostly in the form of shell scripts. I don't want to block this PR on it, but it'd be nice for those to also be part of the package.

Looking at the CI workflows, most are run in the e2e workflow, while umu_test.py and umu_test_plugins.py are also run by the umu-python workflow.

My first thought is that some tests should be included in the package build, and if some of the other tests are more intensive they can be passthru.tests packages.

@MattSturgeon
Copy link
Contributor Author

MattSturgeon commented Feb 15, 2025

Looks like umu also has some tests. I don't want to block this PR on it, but it'd be nice for those to also be part of the package.

Added a check phase using pytestCheckHook.

I had to disable 5/97 tests and configure a writable $HOME. When building the latest upstream main, this was reduced to 3 tests as test_env_vars_none & test_env_vars_wine were working

Not sure how much of the 5 skipped tests are upstream issues vs environment issues.

Build log with all tests enabled:

this derivation will be built:
  /nix/store/l6a4c48flnhd8r0h1nbjvn4479vnf5mj-python3.12-umu-launcher-unwrapped-1.2.3.drv
building '/nix/store/l6a4c48flnhd8r0h1nbjvn4479vnf5mj-python3.12-umu-launcher-unwrapped-1.2.3.drv'...
Sourcing python-remove-tests-dir-hook
Sourcing python-catch-conflicts-hook.sh
Sourcing python-remove-bin-bytecode-hook.sh
Sourcing python-imports-check-hook.sh
Using pythonImportsCheckPhase
Sourcing python-namespaces-hook
Sourcing pytest-check-hook
Using pytestCheckPhase
Running phase: unpackPhase
unpacking source archive /nix/store/79rjb75j20px6rlhh3bwy9nl9zaf3ljy-source
source root is source
Executing cargoSetupPostUnpackHook
Finished cargoSetupPostUnpackHook
setting SOURCE_DATE_EPOCH to timestamp 315619200 of file "source/umu/umu_util.py"
Running phase: patchPhase
Executing cargoSetupPostPatchHook
Validating consistency between /build/source/Cargo.lock and /build/cargo-deps-vendor/Cargo.lock
Finished cargoSetupPostPatchHook
Running phase: updateAutotoolsGnuConfigScriptsPhase
Running phase: configurePhase
patching script interpreter paths in ./configure.sh
./configure.sh: interpreter directive changed from "#!/usr/bin/env bash" to "/nix/store/fd118hwh7d1ncib4mdw56ylv3g9k0iyj-bash-5.2p37/bin/bash"
configure flags: --prefix=/nix/store/9xdghg7pjlnjxg3s7ri4n5hbcb9ghpy8-python3.12-umu-launcher-unwrapped-1.2.3 --use-system-pyzstd --use-system-urllib
:: Created ./Makefile, now run "make" to build.
Running phase: buildPhase
build flags: SHELL=/nix/store/fd118hwh7d1ncib4mdw56ylv3g9k0iyj-bash-5.2p37/bin/bash PYTHONDIR=\$\(PREFIX\)/lib/python3.12/site-packages PYTHON_INTERPRETER=/nix/store/0l539chjmcq5kdd43j6dgdjky4sjl7hl-python3-3.12.8/bin/python3.12 RELEASEDIR=umu-launcher-unwrapped-1.2.3 SHELL_INTERPRETER=/nix/store/fd118hwh7d1ncib4mdw56ylv3g9k0iyj-bash-5.2p37/bin/bash
/nix/store/fd118hwh7d1ncib4mdw56ylv3g9k0iyj-bash-5.2p37/bin/bash: line 1: git: command not found
:: Building umu 
/nix/store/0l539chjmcq5kdd43j6dgdjky4sjl7hl-python3-3.12.8/bin/python3.12 -m build --wheel --skip-dependency-check --no-isolation --outdir=builddir
* Building wheel...
Successfully built umu_launcher-1.2.3-py3-none-any.whl
touch builddir/.build-umu-dist
:: Building umu man pages 
scdoc < docs/umu.1.scd > builddir/umu.1
scdoc < docs/umu.5.scd > builddir/umu.5
touch builddir/.build-umu-docs
:: Building umu-launcher 
sed 's|##INSTALL_PATH##|/nix/store/9xdghg7pjlnjxg3s7ri4n5hbcb9ghpy8-python3.12-umu-launcher-unwrapped-1.2.3/bin/umu-run|g' umu/umu-launcher/umu-run.in > builddir/umu-launcher-run
touch builddir/.build-umu-launcher
:: Building vendored dependencies 
touch builddir/.build-umu-vendored
:: Building delta dependencies 
cargo build -r --target-dir builddir
   Compiling target-lexicon v0.12.16
   Compiling version_check v0.9.5
   Compiling typenum v1.17.0
   Compiling proc-macro2 v1.0.92
   Compiling once_cell v1.20.2
   Compiling unicode-ident v1.0.14
   Compiling semver v1.0.24
   Compiling cfg-if v1.0.0
   Compiling cpufeatures v0.2.16
   Compiling base64ct v1.6.0
   Compiling autocfg v1.4.0
   Compiling libc v0.2.169
   Compiling pem-rfc7468 v0.7.0
   Compiling generic-array v0.14.7
   Compiling rustc_version v0.4.1
   Compiling memoffset v0.9.1
   Compiling subtle v2.6.1
   Compiling heck v0.5.0
   Compiling signature v2.2.0
   Compiling ed25519 v2.2.3
   Compiling quote v1.0.38
   Compiling curve25519-dalek v4.1.3
   Compiling pyo3-build-config v0.23.4
   Compiling indoc v2.0.5
   Compiling syn v2.0.96
   Compiling unindent v0.2.3
   Compiling rand_core v0.6.4
   Compiling zeroize v1.8.1
   Compiling base16ct v0.2.0
   Compiling crypto-common v0.1.6
   Compiling block-buffer v0.10.4
   Compiling inout v0.1.3
   Compiling cipher v0.4.4
   Compiling digest v0.10.7
   Compiling pyo3-macros-backend v0.23.4
   Compiling pyo3-ffi v0.23.4
   Compiling pyo3 v0.23.4
   Compiling sha2 v0.10.8
   Compiling ssh-encoding v0.2.0
   Compiling ssh-cipher v0.2.0
   Compiling curve25519-dalek-derive v0.1.1
   Compiling ed25519-dalek v2.1.1
   Compiling ssh-key v0.6.7
   Compiling pyo3-macros v0.23.4
   Compiling umu v0.1.0 (/build/source)
    Finished `release` profile [optimized] target(s) in 36.83s
touch builddir/.build-umu-delta
buildPhase completed in 38 seconds
Running phase: installPhase
install flags: SHELL=/nix/store/fd118hwh7d1ncib4mdw56ylv3g9k0iyj-bash-5.2p37/bin/bash PYTHONDIR=\$\(PREFIX\)/lib/python3.12/site-packages PYTHON_INTERPRETER=/nix/store/0l539chjmcq5kdd43j6dgdjky4sjl7hl-python3-3.12.8/bin/python3.12 RELEASEDIR=umu-launcher-unwrapped-1.2.3 SHELL_INTERPRETER=/nix/store/fd118hwh7d1ncib4mdw56ylv3g9k0iyj-bash-5.2p37/bin/bash install
/nix/store/fd118hwh7d1ncib4mdw56ylv3g9k0iyj-bash-5.2p37/bin/bash: line 1: git: command not found
:: Installing umu 
install -d /nix/store/9xdghg7pjlnjxg3s7ri4n5hbcb9ghpy8-python3.12-umu-launcher-unwrapped-1.2.3/lib/python3.12/site-packages/umu
/nix/store/0l539chjmcq5kdd43j6dgdjky4sjl7hl-python3-3.12.8/bin/python3.12 -m installer builddir/umu_launcher*.whl --prefix=/nix/store/9xdghg7pjlnjxg3s7ri4n5hbcb9ghpy8-python3.12-umu-launcher-unwrapped-1.2.3
:: Installing delta dependencies 
install -m755 builddir/release/libumu_delta.so /nix/store/9xdghg7pjlnjxg3s7ri4n5hbcb9ghpy8-python3.12-umu-launcher-unwrapped-1.2.3/lib/python3.12/site-packages/umu/umu_delta.cpython-312-x86_64-linux-gnu.so
:: Installing umu man pages 
install -d /nix/store/9xdghg7pjlnjxg3s7ri4n5hbcb9ghpy8-python3.12-umu-launcher-unwrapped-1.2.3/share/man/man1
install -d /nix/store/9xdghg7pjlnjxg3s7ri4n5hbcb9ghpy8-python3.12-umu-launcher-unwrapped-1.2.3/share/man/man5
install -m644 builddir/umu.1 /nix/store/9xdghg7pjlnjxg3s7ri4n5hbcb9ghpy8-python3.12-umu-launcher-unwrapped-1.2.3/share/man/man1/umu.1
install -m644 builddir/umu.5 /nix/store/9xdghg7pjlnjxg3s7ri4n5hbcb9ghpy8-python3.12-umu-launcher-unwrapped-1.2.3/share/man/man5/umu.5
:: Installing umu-launcher 
install -d /nix/store/9xdghg7pjlnjxg3s7ri4n5hbcb9ghpy8-python3.12-umu-launcher-unwrapped-1.2.3/share/steam/compatibilitytools.d/umu-launcher
install -Dm 644 umu/umu-launcher/compatibilitytool.vdf -t /nix/store/9xdghg7pjlnjxg3s7ri4n5hbcb9ghpy8-python3.12-umu-launcher-unwrapped-1.2.3/share/steam/compatibilitytools.d/umu-launcher
install -Dm 644 umu/umu-launcher/toolmanifest.vdf      -t /nix/store/9xdghg7pjlnjxg3s7ri4n5hbcb9ghpy8-python3.12-umu-launcher-unwrapped-1.2.3/share/steam/compatibilitytools.d/umu-launcher
install -d /nix/store/9xdghg7pjlnjxg3s7ri4n5hbcb9ghpy8-python3.12-umu-launcher-unwrapped-1.2.3/share/steam/compatibilitytools.d/umu-launcher
install -Dm 755 builddir/umu-launcher-run /nix/store/9xdghg7pjlnjxg3s7ri4n5hbcb9ghpy8-python3.12-umu-launcher-unwrapped-1.2.3/share/steam/compatibilitytools.d/umu-launcher/umu-run
:: Installing subprojects 
install -d /nix/store/9xdghg7pjlnjxg3s7ri4n5hbcb9ghpy8-python3.12-umu-launcher-unwrapped-1.2.3/lib/python3.12/site-packages/umu/_vendor
Running phase: fixupPhase
shrinking RPATHs of ELF executables and libraries in /nix/store/9xdghg7pjlnjxg3s7ri4n5hbcb9ghpy8-python3.12-umu-launcher-unwrapped-1.2.3
shrinking /nix/store/9xdghg7pjlnjxg3s7ri4n5hbcb9ghpy8-python3.12-umu-launcher-unwrapped-1.2.3/lib/python3.12/site-packages/umu/umu_delta.cpython-312-x86_64-linux-gnu.so
checking for references to /build/ in /nix/store/9xdghg7pjlnjxg3s7ri4n5hbcb9ghpy8-python3.12-umu-launcher-unwrapped-1.2.3...
gzipping man pages under /nix/store/9xdghg7pjlnjxg3s7ri4n5hbcb9ghpy8-python3.12-umu-launcher-unwrapped-1.2.3/share/man/
patching script interpreter paths in /nix/store/9xdghg7pjlnjxg3s7ri4n5hbcb9ghpy8-python3.12-umu-launcher-unwrapped-1.2.3
stripping (with command strip and flags -S -p) in  /nix/store/9xdghg7pjlnjxg3s7ri4n5hbcb9ghpy8-python3.12-umu-launcher-unwrapped-1.2.3/lib /nix/store/9xdghg7pjlnjxg3s7ri4n5hbcb9ghpy8-python3.12-umu-launcher-unwrapped-1.2.3/bin
Rewriting #!/nix/store/0l539chjmcq5kdd43j6dgdjky4sjl7hl-python3-3.12.8/bin/python3.12 to #!/nix/store/0l539chjmcq5kdd43j6dgdjky4sjl7hl-python3-3.12.8
wrapping `/nix/store/9xdghg7pjlnjxg3s7ri4n5hbcb9ghpy8-python3.12-umu-launcher-unwrapped-1.2.3/bin/umu-run'...
Executing pythonRemoveTestsDir
Finished executing pythonRemoveTestsDir
Running phase: installCheckPhase
no installcheck target in Makefile, doing nothing
Running phase: pythonCatchConflictsPhase
Running phase: pythonRemoveBinBytecodePhase
Running phase: pythonImportsCheckPhase
Executing pythonImportsCheckPhase
Running phase: pytestCheckPhase
Executing pytestCheckPhase
pytest flags: -m pytest
============================= test session starts ==============================
platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0
rootdir: /build/source
configfile: pyproject.toml
plugins: anyio-4.8.0
collected 102 items                                                            

umu/umu_test.py ..............F..F.............F.F..sssss............... [ 54%]
..............................................                           [100%]

=================================== FAILURES ===================================
_____________________ TestGameLauncher.test_env_vars_none ______________________

self = <umu.umu_test.TestGameLauncher testMethod=test_env_vars_none>

    def test_env_vars_none(self):
        """Tests check_env when setting no env vars.
    
        GAMEID should be the only strictly required env var
        """
        with (
            self.assertRaisesRegex(ValueError, "GAMEID"),
            ThreadPoolExecutor() as thread_pool,
        ):
>           umu_run.check_env(self.env, thread_pool)

umu/umu_test.py:3572: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
umu/umu_run.py:149: in check_env
    get_umu_proton(env, session_pools)
umu/umu_proton.py:71: in get_umu_proton
    assets = _fetch_releases(session_pools)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _fetch_releases(
        session_pools: SessionPools,
    ) -> tuple[tuple[str, str], tuple[str, str]] | tuple[()]:
        """Fetch the latest releases from the Github API."""
        resp: BaseHTTPResponse
        digest_asset: tuple[str, str]
        proton_asset: tuple[str, str]
        releases: list[dict[str, Any]]
>       _, http_pool = session_pools
E       TypeError: cannot unpack non-iterable ThreadPoolExecutor object

umu/umu_proton.py:145: TypeError
----------------------------- Captured stderr call -----------------------------
INFO: No GAMEID set, using umu-default
_____________________ TestGameLauncher.test_env_vars_wine ______________________

self = <umu.umu_test.TestGameLauncher testMethod=test_env_vars_wine>

    def test_env_vars_wine(self):
        """Test check_env when setting only $WINEPREFIX."""
        with (
            self.assertRaisesRegex(ValueError, "GAMEID"),
            ThreadPoolExecutor() as thread_pool,
        ):
            os.environ["WINEPREFIX"] = self.test_file
>           umu_run.check_env(self.env, thread_pool)

umu/umu_test.py:3561: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
umu/umu_run.py:149: in check_env
    get_umu_proton(env, session_pools)
umu/umu_proton.py:71: in get_umu_proton
    assets = _fetch_releases(session_pools)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _fetch_releases(
        session_pools: SessionPools,
    ) -> tuple[tuple[str, str], tuple[str, str]] | tuple[()]:
        """Fetch the latest releases from the Github API."""
        resp: BaseHTTPResponse
        digest_asset: tuple[str, str]
        proton_asset: tuple[str, str]
        releases: list[dict[str, Any]]
>       _, http_pool = session_pools
E       TypeError: cannot unpack non-iterable ThreadPoolExecutor object

umu/umu_proton.py:145: TypeError
----------------------------- Captured stderr call -----------------------------
INFO: No GAMEID set, using umu-default
____________________ TestGameLauncher.test_game_drive_empty ____________________

self = <umu.umu_test.TestGameLauncher testMethod=test_game_drive_empty>

    def test_game_drive_empty(self):
        """Test enable_steam_game_drive.
    
        WINE prefixes can be created by passing an empty string
        Example:
        WINEPREFIX= PROTONPATH= GAMEID= umu-run ""
    
        During this process, we attempt to prepare setting up game drive and
        set the values for STEAM_RUNTIME_LIBRARY_PATH and
        STEAM_COMPAT_INSTALL_PATHS
    
        The resulting value of those variables should be colon delimited
        string with no leading colons and contain only /usr/lib or /usr/lib32
    
        Ignores LD_LIBRARY_PATH, relevant to Game Drive, which is sourced in
        Ubuntu and maybe its derivatives
        """
        args = None
        result_gamedrive = None
        # Expected library paths for the container runtime framework
        Path(self.test_file + "/proton").touch()
    
        # Replicate main's execution and test up until enable_steam_game_drive
        with patch("sys.argv", ["", ""]), ThreadPoolExecutor() as thread_pool:
            os.environ["WINEPREFIX"] = self.test_file
            os.environ["PROTONPATH"] = self.test_file
            os.environ["GAMEID"] = self.test_file
            os.environ["STORE"] = self.test_file
            # Args
            args = __main__.parse_args()
            # Config
            umu_run.check_env(self.env, thread_pool)
            # Prefix
            umu_run.setup_pfx(self.env["WINEPREFIX"])
            # Env
            umu_run.set_env(self.env, args)
    
            # Some distributions source this variable (e.g. Ubuntu) and will
            # be added to the result of STEAM_RUNTIME_LIBRARY_PATH
            # Only test the case without it set
            if "LD_LIBRARY_PATH" in os.environ:
                os.environ.pop("LD_LIBRARY_PATH")
    
            # Game drive
            result_gamedrive = umu_run.enable_steam_game_drive(self.env)
    
        # Ubuntu sources this variable and will be added once game drive is
        # enabled. Just test the case without it
        if "LD_LIBRARY_PATH" in os.environ:
            os.environ.pop("LD_LIBRARY_PATH")
    
        for key, val in self.env.items():
            os.environ[key] = val
    
        # Game drive
        self.assertTrue(result_gamedrive is self.env, "Expected the same reference")
>       self.assertTrue(
            self.env["STEAM_RUNTIME_LIBRARY_PATH"],
            "Expected two elements in STEAM_RUNTIME_LIBRARY_PATHS",
        )
E       AssertionError: '' is not true : Expected two elements in STEAM_RUNTIME_LIBRARY_PATHS

umu/umu_test.py:2077: AssertionError
________________ TestGameLauncher.test_game_drive_libpath_empty ________________

self = <umu.umu_test.TestGameLauncher testMethod=test_game_drive_libpath_empty>

    def test_game_drive_libpath_empty(self):
        """Test enable_steam_game_drive when LD_LIBRARY_PATH is empty.
    
        Distributions or GUI launchers may set the LD_LIBRARY_PATH environment
        variable to reference their own runtime library paths. In the case for
        Flatpaks, if this variable is not declared and set with paths in the
        manifest then it's observed that the default is an empty string. As a
        result, the current working directory will be added to the
        STEAM_RUNTIME_LIBRARY_PATH result.
        """
        args = None
        result_gamedrive = None
        Path(self.test_file + "/proton").touch()
    
        # Replicate main's execution and test up until enable_steam_game_drive
        with patch("sys.argv", ["", ""]):
            os.environ["WINEPREFIX"] = self.test_file
            os.environ["PROTONPATH"] = self.test_file
            os.environ["GAMEID"] = self.test_file
            os.environ["STORE"] = self.test_file
            # Args
            args = __main__.parse_args()
            # Config
            umu_run.check_env(self.env, self.test_session_pools)
            # Prefix
            umu_run.setup_pfx(self.env["WINEPREFIX"])
            # Env
            umu_run.set_env(self.env, args)
    
            if "LD_LIBRARY_PATH" in os.environ:
                os.environ.pop("LD_LIBRARY_PATH")
    
            # Flatpak defaults to an empty string
            paths = ""
            os.environ["LD_LIBRARY_PATH"] = paths
    
            # Game drive
            result_gamedrive = umu_run.enable_steam_game_drive(self.env)
    
        for key, val in self.env.items():
            os.environ[key] = val
    
        # Game drive
        self.assertTrue(result_gamedrive is self.env, "Expected the same reference")
>       self.assertTrue(
            self.env["STEAM_RUNTIME_LIBRARY_PATH"],
            "Expected two elements in STEAM_RUNTIME_LIBRARY_PATHS",
        )
E       AssertionError: '' is not true : Expected two elements in STEAM_RUNTIME_LIBRARY_PATHS

umu/umu_test.py:1914: AssertionError
=========================== short test summary info ============================
FAILED umu/umu_test.py::TestGameLauncher::test_env_vars_none - TypeError: cannot unpack non-iterable ThreadPoolExecutor object
FAILED umu/umu_test.py::TestGameLauncher::test_env_vars_wine - TypeError: cannot unpack non-iterable ThreadPoolExecutor object
FAILED umu/umu_test.py::TestGameLauncher::test_game_drive_empty - AssertionError: '' is not true : Expected two elements in STEAM_RUNTIME_LIB...
FAILED umu/umu_test.py::TestGameLauncher::test_game_drive_libpath_empty - AssertionError: '' is not true : Expected two elements in STEAM_RUNTIME_LIB...
=================== 4 failed, 93 passed, 5 skipped in 2.14s ====================

Comment on lines +21 to +26
postPatch = ''
# pyzst specifies setuptools<74 because 74+ drops `distutils.msvc9compiler`,
# required for Python 3.9 under Windows
substituteInPlace pyproject.toml \
--replace-fail '"setuptools>=64,<74"' '"setuptools"'
'';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried using pythonRelaxDepsHook instead:

diff --git a/pkgs/development/python-modules/pyzstd/default.nix b/pkgs/development/python-modules/pyzstd/default.nix
index 62e77d821d08..f403a5338b00 100644
--- a/pkgs/development/python-modules/pyzstd/default.nix
+++ b/pkgs/development/python-modules/pyzstd/default.nix
@@ -3,6 +3,7 @@
   fetchFromGitHub,
   lib,
   pytestCheckHook,
+  pythonRelaxDepsHook,
   setuptools,
   zstd-c,
 }:
@@ -18,13 +19,6 @@ buildPythonPackage rec {
     hash = "sha256-Az+0m1XUFxExBZK8bcjK54Zt2d5ZlAKRMZRdr7rPcss=";
   };
 
-  postPatch = ''
-    # pyzst specifies setuptools<74 because 74+ drops `distutils.msvc9compiler`,
-    # required for Python 3.9 under Windows
-    substituteInPlace pyproject.toml \
-        --replace-fail '"setuptools>=64,<74"' '"setuptools"'
-  '';
-
   nativeBuildInputs = [
     setuptools
   ];
@@ -33,6 +27,10 @@ buildPythonPackage rec {
     setuptools
   ];
 
+  pythonRelaxDeps = [
+    "setuptools"
+  ];
+
   buildInputs = [
     zstd-c
   ];
@@ -43,6 +41,7 @@ buildPythonPackage rec {
 
   nativeCheckInputs = [
     pytestCheckHook
+    pythonRelaxDepsHook
   ];
 
   pythonImportsCheck = [

But I don't think this supports relaxing dependencies specified in pyproject.toml? The docs mention:

pythonRelaxDepsHook works by modifying the resulting wheel file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: python 8.has: package (new) This PR adds a new package 8.has: package (update) This PR updates a package to a newer version 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes 12.approvals: 1 This PR was reviewed and approved by one reputable person 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in the package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Request: umu-launcher 1.1.4 → 1.2.1 Package request: pyzstd
6 participants