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

qbittorrent: add python as a runtime dependency for tracker search #59293

Closed
wants to merge 1 commit into from

Conversation

kira-bruneau
Copy link
Contributor

@kira-bruneau kira-bruneau commented Apr 11, 2019

Motivation for this change

This change wraps qbittorrent with python as a run-time dependency. This ensures that python is included in the resulting closure for tracker search support.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS (aarch64_linux, built with guiSupport = false)
    • Arch Linux (x86_64-linux)
    • macOS
  • 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 nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
    • qbittorrent-nox (requires building with guiSupport = false)
    • qbittorrent
  • Determined the impact on package closure size (by running nix path-info -S before and after)
    • 387 224 920 bytes → 451 423 776 bytes
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@kira-bruneau
Copy link
Contributor Author

@GrahamcOfBorg eval

@worldofpeace
Copy link
Contributor

@GrahamcOfBorg eval

@Anton-Latukha
Copy link
Contributor

Anton-Latukha commented Apr 11, 2019

Could call for the maintainer, if we do the patching.

@kira-bruneau
Copy link
Contributor Author

kira-bruneau commented Apr 11, 2019

Could call for the maintainer, if we do the patching.

Do you mean I should add myself as a maintainer? If you want to avoid patching upstream code we could use wrapProgram instead. It would wrap qbittorrent with a shell script, but it would probably be easier to maintain.

There is a similar discussion in #57590.

@@ -25,6 +27,17 @@ stdenv.mkDerivation rec {
buildInputs = [ boost libtorrentRasterbar qtbase qttools qtsvg ]
++ optional guiSupport dbus; # D(esktop)-Bus depends on GUI support

patchPhase = ''
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not really a fan of this approach.
Do we really need to keep the patch to patch upstream code to delete their tests just to add Python3 as a runtime dep?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, if suddenly user would have python3 installed - does he still acquires what is set - no search in qbittorrent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The goal of this patch was to avoid reading python from PATH at runtime so this would only ever use the version of python specified at build time.

Copy link
Contributor

Choose a reason for hiding this comment

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

This was needed to be in the comments. All special cases code should be noted.
Indeed, but in the wrapper case, the python would also be preserved.
So there is a question of maybe leaving runtime dep to the user to install.

This is a Nix package manager limitation.

@@ -3,9 +3,11 @@
, debugSupport ? false # Debugging
, guiSupport ? true, dbus ? null # GUI (disable to run headless)
, webuiSupport ? true # WebUI
, searchSupport ? true, python ? null # Search
Copy link
Contributor

Choose a reason for hiding this comment

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

Do not see the point in this option.
WebUI support - ok.
GUI/headless - ok.
Does anyone really would want the torrent without search support particularly.

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 don't see why anyone would want to disable it, but the INSTALL file in qbittorrent says that python is optional so I decided to add an option.

@Anton-Latukha
Copy link
Contributor

Anton-Latukha commented Apr 11, 2019

@MetaDark
No - I meant - I am a maintainer.
The wrapper is better in a long term.

You'd provided more information about the problem you have. And it is not about regular search, it is about search on torrent trackers.

@kira-bruneau
Copy link
Contributor Author

You'd provided more information about the problem you have. And it is not about regular search, it is about search on torrent trackers.

Regular search is referred to as filtering in qbittorrent, but I could rename the option to searchEngineSupport to make it less ambiguous.

@Anton-Latukha
Copy link
Contributor

Anton-Latukha commented Apr 11, 2019

In NixOS distribution it is more logical to name things not in terms of qbittorrent, but in terms of user perspective who installs the software.
Seems like no shorter than:
searchTrackersForTorrentsSupport
maybe
trackersSearchSupport
searchContentOnStackersSupport

BTW, if you after adding python - just add wrapper.

If you want to have switch for these search on trackers - it seems reasonable only if that support can be disabled at build-time through build keys. So I would say - if you don't need it - don't bother, there is no reason to add and support a feature if it had no user with a reason asking for it.

@kira-bruneau kira-bruneau changed the title qbittorrent: add python as a runtime dependency for search qbittorrent: add python as a runtime dependency for tracker search Apr 11, 2019
Copy link
Contributor

@Anton-Latukha Anton-Latukha left a comment

Choose a reason for hiding this comment

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

Now the package does not change the upstream code.

Well, now recent python3 would be included in the closure, because qbittorent has by default Search Engines UI (search on trackers) feature.

@Anton-Latukha
Copy link
Contributor

Anton-Latukha commented Apr 12, 2019

@MetaDark
In the future please add comments to the special code, what is the merit of the code. So people even years after would know what that code was about. And so they would be able to reason about the whole codebase they see. And so also see the merit of that special code particularly in the code base scope.

You also can use TODO (mark point for the future work), NOTE, FIXME (code that is for the time being and needs to be rewritten), HACK (hacking, working around the upstream code). These are the most standardized tags that everyone understands.

I do also supply the date of the comment in ISO format:

# NOTE: 2019-04-12: This is because ...

Making a status and date in front of eyes makes it easier even for me myself to review my own code.
If comment is from 2019-2018 - no need to bother - it is probably still true, if 2010 - you know you need to review it.

@Anton-Latukha
Copy link
Contributor

@GrahamcOfBorg build qbittorrent

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

5 participants