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

git-remote-hg: fix; refactor #93298

Merged
merged 3 commits into from Aug 19, 2020
Merged

Conversation

alyssais
Copy link
Member

Motivation for this change
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.

This package needs to use the same Python as Mercurial, but the
released version doesn't support Python 3.
This exposes mercurial as a Python library.  Packages that call into
Mercurial from Python can now do so in a less hacky way.
@@ -1,36 +1,38 @@
{ stdenv, lib, fetchFromGitHub, mercurial, makeWrapper
{ stdenv, lib, fetchFromGitHub, python3Packages, makeWrapper
, asciidoc, xmlto, docbook_xsl, docbook_xml_dtd_45, libxslt, libxml2
}:

stdenv.mkDerivation rec {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't we use buildPythonApplication? This brings in wrapPython and does that postFixup thingy etc.

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.

diff LGTM

doCheck = false;

installFlags = [ "HOME=\${out}" "install-doc" ];
pythonPath = with python3Packages; [ mercurial ];
Copy link
Contributor

Choose a reason for hiding this comment

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

now that it's a pythonApplication

Suggested change
pythonPath = with python3Packages; [ mercurial ];
propagatedBuilInputs = with python3Packages; [ mercurial ];

but it doesn't really matter

Copy link
Member Author

Choose a reason for hiding this comment

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

How come it needs to be propagated? This isn’t a library, so it should only be used through the executable wrapper, which includes Mercurial anyway, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

it's how python packaging works on nixpkgs https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/python.section.md#buildpythonapplication-function, the transitive python package set is constructed off of propagated python packages.

buildPythonApplication will "end" this propagation to other packages which use git-remote-hg

This is much cleaner than constructing PYTHONPATH using interpolated
subshells.
@worldofpeace worldofpeace merged commit ab77cf8 into NixOS:master Aug 19, 2020
@alyssais alyssais deleted the git-remote-hg branch April 9, 2021 21:13
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