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

pantalaimon: 0.6.3 -> 0.6.4; pythonPackages.matrix-nio: 0.12.0 -> 0.14.1 #91968

Merged
merged 2 commits into from Jul 3, 2020

Conversation

colemickens
Copy link
Member

Motivation for this change

Update pantalaimon and pythonPackages.matrix-nio to latest stable.

This is done in a single commit due to version compatibility. See: #84150 (comment)

This includes an extra commit relaxing pantalaimon's requirements on matrix-nio. This should be considered by reviewers.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@colemickens
Copy link
Member Author

[colemickens@aarch64:~/nixpkgs]$ nixpkgs-review rev c2d10d5d584ef4f5cef4054dbb574e7fe5a6125b
$ git -c fetch.prune=false fetch --force https://github.com/NixOS/nixpkgs master:refs/nixpkgs-review/0
$ git worktree add /home/colemickens/.cache/nixpkgs-review/rev-c2d10d5d584ef4f5cef4054dbb574e7fe5a6125b-1/nixpkgs 55668eb671b915b49bcaaeec4518cc49d8de0a99
Preparing worktree (detached HEAD 55668eb671b)
Updating files: 100% (22017/22017), done.
HEAD is now at 55668eb671b inxi: 3.1.03-1 -> 3.1.04-1
$ nix-env -f /home/colemickens/.cache/nixpkgs-review/rev-c2d10d5d584ef4f5cef4054dbb574e7fe5a6125b-1/nixpkgs -qaP --xml --out-path --show-trace
$ git merge --no-commit c2d10d5d584ef4f5cef4054dbb574e7fe5a6125b
Automatic merge went well; stopped before committing as requested
$ nix-env -f /home/colemickens/.cache/nixpkgs-review/rev-c2d10d5d584ef4f5cef4054dbb574e7fe5a6125b-1/nixpkgs -qaP --xml --out-path --show-trace --meta
4 packages updated:
pantalaimon (0.6.3 → 0.6.4) python37Packages.matrix-nio (0.12.0 → 0.14.1) python38Packages.matrix-nio (0.12.0 → 0.14.1) python3.8-weechat-matrix

$ nix build --no-link --keep-going --option build-use-sandbox relaxed -f /home/colemickens/.cache/nixpkgs-review/rev-c2d10d5d584ef4f5cef4054dbb574e7fe5a6125b-1/build.nix
[8 built, 51 copied (99.7 MiB), 25.3 MiB DL]
4 packages built:
pantalaimon python37Packages.matrix-nio python38Packages.matrix-nio weechatScripts.weechat-matrix

$ nix-shell /home/colemickens/.cache/nixpkgs-review/rev-c2d10d5d584ef4f5cef4054dbb574e7fe5a6125b-1/shell.nix

[nix-shell:~/.cache/nixpkgs-review/rev-c2d10d5d584ef4f5cef4054dbb574e7fe5a6125b-1]$

@@ -51,6 +51,12 @@ buildPythonApplication rec {
# darwin has difficulty communicating with server, fails some integration tests
doCheck = !stdenv.isDarwin;

postPatch = ''
set -x
sed -i 's/"matrix-nio\[e2e\] <= 0.14"/"matrix-nio[e2e] >= 0.14, < 0.15"/' setup.py
Copy link
Contributor

@jonringer jonringer Jul 1, 2020

Choose a reason for hiding this comment

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

"future-proof"
tests will make sure the package is still valid

Suggested change
sed -i 's/"matrix-nio\[e2e\] <= 0.14"/"matrix-nio[e2e] >= 0.14, < 0.15"/' setup.py
sed -i 's/"matrix-nio\[e2e\] <= 0.14"/"matrix-nio[e2e]"/' setup.py

Copy link
Member Author

Choose a reason for hiding this comment

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

Hm, that feels a bit aggressive to me. Imagine: matrix-nio changes some security aspect of how it's used in a subtle, non-breaking way, and mentions it in release notes. WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

I'm in favor of removing upper bounds.

Copy link
Contributor

Choose a reason for hiding this comment

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

Imagine: matrix-nio changes some security aspect of how it's used in a subtle, non-breaking way, and mentions it in release notes. WDYT

Usually, only part of the API changes, and it might be a part that the downstream packages don't even use. That's why I usually prefer the "remove version bounds, but validate correctness" for python packages.

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay. I appreciate the feedback and will keep it in mind. That having been said, there's a new release and they clamped the way I had. I'll bump to this release and back out my fix, should be good for now.

@symphorien
Copy link
Member

It does not work:

[nix-shell:~/.cache/nixpkgs-review/pr-91968]$ pantalaimon --version
Traceback (most recent call last):
  File "/nix/store/klnhc6nvfp6g411zrg1mj3krxbq8lbs4-pantalaimon-0.6.4/bin/.pantalaimon-wrapped", line 6, in <module>
    from pantalaimon.main import main
  File "/nix/store/klnhc6nvfp6g411zrg1mj3krxbq8lbs4-pantalaimon-0.6.4/lib/python3.8/site-packages/pantalaimon/main.py", line 24, in <module>
    import nio
  File "/nix/store/9kv6l8xfp4jbn9933gclrhsigvjiq02n-python3.7-matrix-nio-0.14.1/lib/python3.7/site-packages/nio/__init__.py", line 2, in <module>
    from .client import *
  File "/nix/store/9kv6l8xfp4jbn9933gclrhsigvjiq02n-python3.7-matrix-nio-0.14.1/lib/python3.7/site-packages/nio/client/__init__.py", line 3, in <module>
    from .base_client import Client, ClientConfig
  File "/nix/store/9kv6l8xfp4jbn9933gclrhsigvjiq02n-python3.7-matrix-nio-0.14.1/lib/python3.7/site-packages/nio/client/base_client.py", line 35, in <module>
    from ..crypto import ENCRYPTION_ENABLED
  File "/nix/store/9kv6l8xfp4jbn9933gclrhsigvjiq02n-python3.7-matrix-nio-0.14.1/lib/python3.7/site-packages/nio/crypto/__init__.py", line 16, in <module>
    from .attachments import encrypt_attachment, decrypt_attachment
  File "/nix/store/9kv6l8xfp4jbn9933gclrhsigvjiq02n-python3.7-matrix-nio-0.14.1/lib/python3.7/site-packages/nio/crypto/attachments.py", line 25, in <module>
    from Crypto.Cipher import AES
  File "/nix/store/5i9l7ys3ci47ln52pkmc1p15p20bni87-python3.7-pycryptodome-3.9.7/lib/python3.7/site-packages/Crypto/Cipher/__init__.py", line 27, in <module>
    from Crypto.Cipher._mode_ecb import _create_ecb_cipher
  File "/nix/store/5i9l7ys3ci47ln52pkmc1p15p20bni87-python3.7-pycryptodome-3.9.7/lib/python3.7/site-packages/Crypto/Cipher/_mode_ecb.py", line 35, in <module>
    raw_ecb_lib = load_pycryptodome_raw_lib("Crypto.Cipher._raw_ecb", """
  File "/nix/store/5i9l7ys3ci47ln52pkmc1p15p20bni87-python3.7-pycryptodome-3.9.7/lib/python3.7/site-packages/Crypto/Util/_raw_api.py", line 303, in load_pycryptodome_raw_lib
    raise OSError("Cannot load native module '%s': %s" % (name, ", ".join(attempts)))
OSError: Cannot load native module 'Crypto.Cipher._raw_ecb': Trying '_raw_ecb.cpython-38-x86_64-linux-gnu.so': cannot load library '/nix/store/5i9l7ys3ci47ln52pkmc1p15p20bni87-python3.7-pycryptodome-3.9.7/lib/python3.7/site-packages/Crypto/Util/../Cipher/_raw_ecb.cpython-38-x86_64-linux-gnu.so': /nix/store/5i9l7ys3ci47ln52pkmc1p15p20bni87-python3.7-pycryptodome-3.9.7/lib/python3.7/site-packages/Crypto/Util/../Cipher/_raw_ecb.cpython-38-x86_64-linux-gnu.so: cannot open shared object file: No such file or directory.  Additionally, ctypes.util.find_library() did not manage to locate a library called '/nix/store/5i9l7ys3ci47ln52pkmc1p15p20bni87-python3.7-pycryptodome-3.9.7/lib/python3.7/site-packages/Crypto/Util/../Cipher/_raw_ecb.cpython-38-x86_64-linux-gnu.so', Trying '_raw_ecb.abi3.so': cannot load library '/nix/store/5i9l7ys3ci47ln52pkmc1p15p20bni87-python3.7-pycryptodome-3.9.7/lib/python3.7/site-packages/Crypto/Util/../Cipher/_raw_ecb.abi3.so': /nix/store/5i9l7ys3ci47ln52pkmc1p15p20bni87-python3.7-pycryptodome-3.9.7/lib/python3.7/site-packages/Crypto/Util/../Cipher/_raw_ecb.abi3.so: cannot open shared object file: No such file or directory.  Additionally, ctypes.util.find_library() did not manage to locate a library called '/nix/store/5i9l7ys3ci47ln52pkmc1p15p20bni87-python3.7-pycryptodome-3.9.7/lib/python3.7/site-packages/Crypto/Util/../Cipher/_raw_ecb.abi3.so', Trying '_raw_ecb.so': cannot load library '/nix/store/5i9l7ys3ci47ln52pkmc1p15p20bni87-python3.7-pycryptodome-3.9.7/lib/python3.7/site-packages/Crypto/Util/../Cipher/_raw_ecb.so': /nix/store/5i9l7ys3ci47ln52pkmc1p15p20bni87-python3.7-pycryptodome-3.9.7/lib/python3.7/site-packages/Crypto/Util/../Cipher/_raw_ecb.so: cannot open shared object file: No such file or directory.  Additionally, ctypes.util.find_library() did not manage to locate a library called '/nix/store/5i9l7ys3ci47ln52pkmc1p15p20bni87-python3.7-pycryptodome-3.9.7/lib/python3.7/site-packages/Crypto/Util/../Cipher/_raw_ecb.so'

@jonringer
Copy link
Contributor

File "/nix/store/5i9l7ys3ci47ln52pkmc1p15p20bni87-python3.7-pycryptodome-3.9.7/lib/python3.7/site-packages/Crypto/Util/_raw_api.py", line 303, in load_pycryptodome_raw_lib
raise OSError("Cannot load native module '%s': %s" % (name, ", ".join(attempts)))
OSError: Cannot load native module 'Crypto.Cipher._raw_ecb': Trying '_raw_ecb.cpython-38-x86_64-linux-gnu.so': cannot load library '/nix/store/5i9l7ys3ci47ln52pkmc1p15p20bni87-python3.7-pycryptodome-3.9.7/lib/python3.7/site-packages/Crypto/Util/../Cipher/_raw_ecb.cpython-38-x86_64-linux-gnu.so': /nix/store/5i9l7ys3ci47ln52pkmc1p15p20bni87-python3.7-pycryptodome-3.9.7/lib/python3.7/site-packages/Crypto/Util/../Cipher/_raw_ecb.cpython-38-x86_64-linux-gnu.so: cannot open shared object file: No such file or directory. Additionally, ctypes.util.find_library() did not manage to locate a library called '/nix/store/5i9l7ys3ci47ln52pkmc1p15p20bni87-python3.7-pycryptodome-3.9.7/lib/python3.7/site-packages/Crypto/Util/../Cipher/_raw_ecb.cpython-38-x86_64-linux-gnu.so', Trying '_raw_ecb.abi3.so': cannot load library '/nix/store/5i9l7ys3ci47ln52pkmc1p15p20bni87-python3.7-pycryptodome-3.9.7/lib/python3.7/site-packages/Crypto/Util/../Cipher/_raw_ecb.abi3.so': /nix/store/5i9l7ys3ci47ln52pkmc1p15p20bni87-python3.7-pycryptodome-3.9.7/lib/python3.7/site-packages/Crypto/Util/../Cipher/_raw_ecb.abi3.so: cannot open shared object file: No such file or directory. Additionally, ctypes.util.find_library() did not manage to locate a library called '/nix/store/5i9l7ys3ci47ln52pkmc1p15p20bni87-python3.7-pycryptodome-3.9.7/lib/python3.7/site-packages/Crypto/Util/../Cipher/_raw_ecb.abi3.so', Trying '_raw_ecb.so': cannot load library '/nix/store/5i9l7ys3ci47ln52pkmc1p15p20bni87-python3.7-pycryptodome-3.9.7/lib/python3.7/site-packages/Crypto/Util/../Cipher/_raw_ecb.so': /nix/store/5i9l7ys3ci47ln52pkmc1p15p20bni87-python3.7-pycryptodome-3.9.7/lib/python3.7/site-packages/Crypto/Util/../Cipher/_raw_ecb.so: cannot open shared object file: No such file or directory. Additionally, ctypes.util.find_library() did not manage to locate a library called '/nix/store/5i9l7ys3ci47ln52pkmc1p15p20bni87-python3.7-pycryptodome-3.9.7/lib/python3.7/site-packages/Crypto/Util/../Cipher/_raw_ecb.so'

looks like an issue with pycryptodome, not this PR

Copy link
Member

@symphorien symphorien left a comment

Choose a reason for hiding this comment

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

Actually it works outside of nix-shell. I tested it by sending a few messsages.

@colemickens
Copy link
Member Author

[colemickens@aarch64:~/nixpkgs]$ nixpkgs-review rev 4befe00445e
$ git -c fetch.prune=false fetch --force https://github.com/NixOS/nixpkgs master:refs/nixpkgs-review/0
$ git worktree add /home/colemickens/.cache/nixpkgs-review/rev-4befe00445e5a1f6cf29352f9f4d07676636074a/nixpkgs fd2f00633c8a976cd5d0fb1a9f357452ad90b77a
Preparing worktree (detached HEAD fd2f00633c8)
Updating files: 100% (22015/22015), done.
HEAD is now at fd2f00633c8 Merge pull request #92058 from r-ryantm/auto-update/nuspell
$ nix-env -f /home/colemickens/.cache/nixpkgs-review/rev-4befe00445e5a1f6cf29352f9f4d07676636074a/nixpkgs -qaP --xml --out-path --show-trace
$ git merge --no-commit 4befe00445e5a1f6cf29352f9f4d07676636074a
Automatic merge went well; stopped before committing as requested
$ nix-env -f /home/colemickens/.cache/nixpkgs-review/rev-4befe00445e5a1f6cf29352f9f4d07676636074a/nixpkgs -qaP --xml --out-path --show-trace --meta
4 packages updated:
pantalaimon (0.6.3 → 0.6.5) python37Packages.matrix-nio (0.12.0 → 0.14.1) python38Packages.matrix-nio (0.12.0 → 0.14.1) python3.8-weechat-matrix

$ nix build --no-link --keep-going --option build-use-sandbox relaxed -f /home/colemickens/.cache/nixpkgs-review/rev-4befe00445e5a1f6cf29352f9f4d07676636074a/build.nix
[2 built, 0.0 MiB DL]
4 packages built:
pantalaimon python37Packages.matrix-nio python38Packages.matrix-nio weechatScripts.weechat-matrix

$ nix-shell /home/colemickens/.cache/nixpkgs-review/rev-4befe00445e5a1f6cf29352f9f4d07676636074a/shell.nix

[nix-shell:~/.cache/nixpkgs-review/rev-4befe00445e5a1f6cf29352f9f4d07676636074a]$

This rev (4befe00) passes nixpkgs-review, has no manual patch for version since it uses the latest Pantalaimon. I am going to force push once more to get rid of a whitespace error, but I'm not going to run nixpkgs-review again.

@colemickens
Copy link
Member Author

[colemickens@aarch64:~/nixpkgs]$ nixpkgs-review rev dda7c9c459a
$ git -c fetch.prune=false fetch --force https://github.com/NixOS/nixpkgs master:refs/nixpkgs-review/0
From https://github.com/NixOS/nixpkgs
   fd2f00633c8..83eb5ed90c6  master     -> refs/nixpkgs-review/0
$ git worktree add /home/colemickens/.cache/nixpkgs-review/rev-dda7c9c459a24b5429dc98ed3eea6c99f4d1e43f/nixpkgs 83eb5ed90c6d9697d26740c28baaffe9a11cafd4
Preparing worktree (detached HEAD 83eb5ed90c6)
Updating files: 100% (22015/22015), done.
HEAD is now at 83eb5ed90c6 Merge pull request #91927 from jojosch/mycli-1.21.1
$ nix-env -f /home/colemickens/.cache/nixpkgs-review/rev-dda7c9c459a24b5429dc98ed3eea6c99f4d1e43f/nixpkgs -qaP --xml --out-path --show-trace
$ git merge --no-commit dda7c9c459a24b5429dc98ed3eea6c99f4d1e43f
Automatic merge went well; stopped before committing as requested
$ nix-env -f /home/colemickens/.cache/nixpkgs-review/rev-dda7c9c459a24b5429dc98ed3eea6c99f4d1e43f/nixpkgs -qaP --xml --out-path --show-trace --meta
4 packages updated:
pantalaimon (0.6.3 → 0.6.5) python37Packages.matrix-nio (0.12.0 → 0.14.1) python38Packages.matrix-nio (0.12.0 → 0.14.1) python3.8-weechat-matrix

$ nix build --no-link --keep-going --option build-use-sandbox relaxed -f /home/colemickens/.cache/nixpkgs-review/rev-dda7c9c459a24b5429dc98ed3eea6c99f4d1e43f/build.nix
4 packages built:
pantalaimon python37Packages.matrix-nio python38Packages.matrix-nio weechatScripts.weechat-matrix

$ nix-shell /home/colemickens/.cache/nixpkgs-review/rev-dda7c9c459a24b5429dc98ed3eea6c99f4d1e43f/shell.nix

[nix-shell:~/.cache/nixpkgs-review/rev-dda7c9c459a24b5429dc98ed3eea6c99f4d1e43f]$

Should be good to go.

Copy link
Member

@symphorien symphorien left a comment

Choose a reason for hiding this comment

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

tested pantalaimon and it works

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

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

LGTM

Result of nixpkgs-review pr 91968 1

4 packages built: - pantalaimon - python37Packages.matrix-nio - python38Packages.matrix-nio - weechatScripts.weechat-matrix

@jonringer jonringer merged commit 2a05a94 into NixOS:master Jul 3, 2020
@colemickens colemickens deleted the pantalaimon branch December 30, 2022 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants