Skip to content

Python: use fixed point combinator#16784

Closed
FRidh wants to merge 2 commits intoNixOS:masterfrom
FRidh:fixpoint
Closed

Python: use fixed point combinator#16784
FRidh wants to merge 2 commits intoNixOS:masterfrom
FRidh:fixpoint

Conversation

@FRidh
Copy link
Member

@FRidh FRidh commented Jul 7, 2016

Motivation for this change

Curious to see how we could use a fixed-point combinator like is done with Haskell. This should make it a lot easier when we have #16005 in. But, this is going to break a lot of code.

  • Interpreters are moved, and share layout
  • Fixed-point combinator is used.

Notes:

  • interpreter: pythonNew.cpython35.interpreter or pythonNew.cpython35.pkgs.python
  • Overriding interpreter: first pythonNew.cpython35.interpreter, and then pythonNew.cpython35
  • toolz package: pythonNew.cpython35.pkgs.toolz
  • Building environment with pythonNew.cpython35.buildEnv or pythonNew.cpython35.withpackages
Things done
  • Tested using sandboxing
    (nix.useChroot on NixOS,
    or option build-use-chroot in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • OS X
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

This is mostly just an experiment. I think if we're going this direction we might have to find a way to keep the current route working.

Move Python interpreters (CPython, PyPy) to same folder and share
layout.
@FRidh FRidh added 6.topic: python Python is a high-level, general-purpose programming language. 2.status: work-in-progress labels Jul 7, 2016
@FRidh FRidh self-assigned this Jul 7, 2016
@FRidh FRidh force-pushed the fixpoint branch 3 times, most recently from 0689cb5 to bc806b7 Compare July 8, 2016 08:03
@FRidh
Copy link
Member Author

FRidh commented Jul 8, 2016

buildEnv is currently broken

$ nix-shell -E 'with import <nixpkgs> {}; (pkgs.pythonNew.cpython35.withPackages (ps: [ps.django])).env' -I nixpkgs=~/Code/libraries/nixpkgs
these derivations will be built:
  /nix/store/sh46h5s4azs3x06hb72by2qs1ccp85y4-python3-3.5.1-env.drv
building path(s) ‘/nix/store/l520qidycrz8m7p1d40f6vmfd1048i66-python3-3.5.1-env’
collision between `/nix/store/7kxhz3g05w60vrg01jv8g1jbax7ffx5c-python3-3.5.1/bin/easy_install-3.5' and `/nix/store/8j34nkm96s19znxvj7bnbs9dhicki0gp-python3.5m-setuptools-19.4/bin/easy_install-3.5'
builder for ‘/nix/store/sh46h5s4azs3x06hb72by2qs1ccp85y4-python3-3.5.1-env.drv’ failed with exit code 25
error: build of ‘/nix/store/sh46h5s4azs3x06hb72by2qs1ccp85y4-python3-3.5.1-env.drv’ failed
/run/current-system/sw/bin/nix-shell: failed to build all dependencies

@bennofs do you have any idea how I broke it here?

@FRidh
Copy link
Member Author

FRidh commented Jul 28, 2016

I will continue with this further but will close it now since it can't be merged anyway in this state.

@FRidh FRidh closed this Jul 28, 2016
@FRidh FRidh mentioned this pull request Jul 28, 2016
7 tasks
@FRidh FRidh mentioned this pull request Aug 12, 2016
4 tasks
@FRidh FRidh added the 0.kind: enhancement Add something new or improve an existing system. label Dec 4, 2016
FRidh added a commit to FRidh/nixpkgs that referenced this pull request Dec 5, 2016
Use a fixed-point combinator for the Python package set to allow easier overriding of its contents.
Earlier implementations were proposed in NixOS#16784 and NixOS#17428. This commit is by comparison much smaller
and changes only what is needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0.kind: enhancement Add something new or improve an existing system. 6.topic: python Python is a high-level, general-purpose programming language.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant