nixpkgs/pkgs/top-level
Austin Seipp 6054dabc11 foundationdb: rework python bindings, build system
FoundationDB uses Python at build time for some code generation.
However, it also has the official python bindings inside the source code
too, and the code for the Python bindings has some of it auto-generated
at compile time.

This made building python packages unattractive: we want to use the
source code generated from the FoundationDB build, but we don't want to
rebuild it. Previously we would override the 'python' input to the
FoundationDB module, but this meant we would do a complete rebuild, as
it was a necessary build time dependency, even though the resulting
generated code itself would not change. Furthermore, FoundationDB
versions < 6.0 don't properly support Python 3 *for the build system*,
though the bindings supported it, so that caused build failures. But the
first effect is the worst: it meant building separate python2 and
python3 packages implied two complete rebuilds of a single FoundationDB
version. This meant rather than 3 FDB builds, we'd do 3*N where N = the
number of major Python versions we support.

Finally, because we did not use pip to generate a wheel that we install
with metadata recorded for the installation, the FoundationDB python
package couldn't be used as an input to other setup.py-based packages:
there would be no recorded metadata in the dist-info folder which would
say this is the foundationdb package. This greatly limits its utility.

To fix all this, we do a few things:

  - Apply some patches to fix the build system with Python 3.x for
    older FoundationDB versions. (This is nice if end-users have
    overridden the global Python version for some reason.)
  - Move python directly into nativeBuildInputs, so it is only a
    build time dependency.
  - Take the python source code from the ./bindings directory and
    tar it up use later after the build is done, so we get to keep
    the generated code. This is the new 'pythonsrc' output from the
    build. This code doesn't change based on whether or not the input
    or resulting package is using Python 2 or 3, it's totally
    deterministic.
  - The build system also patches up the python source code a little,
    so it can be installed directly with setup.py (it needs a little
    stuff that it normally expects the build system to do.)
  - Rework the python package to a separate file that uses
    buildPythonPackage directly. Because the source code is already
    prepared, it needs almost nothing else. Furthermore, this kills
    the override itself for the foundationdb package, meaning rebuilds
    are no longer needed.
  - This package is very simple and just uses foundationdb.pythonsrc
    as its source input. It also ensures a link to libfdb_c.so can
    be found by ctypes (using substituteInPlace)
  - python-packages.nix now just uses callPackage directly.

The net effect of this is, most importantly, that python packages do not
imply a full rebuild of the server source code: building python2 and
python3 packages from a version of FoundationDB now does not need to
override the foundationdb python input, reducing the number of needless
builds. They instead just run setup.py with the given version as input.

The second biggest effect is that wheel metadata is recorded correctly,
meaning dependent-python-packages that want to use the FoundationDB
bindings e.g. from PyPi should now work fine with buildPythonPackage.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2018-11-16 20:34:19 -06:00
..
aliases.nix Merge pull request #49776 from matthewbauer/atlas-remove 2018-11-13 19:18:35 -06:00
all-packages.nix nodePackages: 8_x -> 10_x 2018-11-16 21:31:44 +00:00
beam-packages.nix beam-packages: default erlangR19 -> erlangR20 2018-08-07 23:27:41 +02:00
coq-packages.nix mkCoqPackages: look for “dontFilter” in coq derivation 2018-11-04 20:49:38 +00:00
darwin-packages.nix darwin.trash: add cf-private 2018-11-07 19:15:43 +01:00
default.nix top-level: Move comma for stylistic consistency 2018-03-20 15:37:34 -04:00
dotnet-packages.nix dotnetPackages.SharpFont: 3.1.0 -> 4.0.1 (#49545) 2018-10-31 21:04:31 +01:00
emacs-packages.nix elpy: fix build dep 2018-09-09 17:14:59 +02:00
emscripten-packages.nix Emscripten 1.37.16 to 1.37.36 (#37291) 2018-03-18 13:34:46 +01:00
haskell-packages.nix ghc: drop unused 7.10.3-binary compiler 2018-11-08 17:39:13 +01:00
haxe-packages.nix pkgs/*: remove unreferenced function arguments 2018-07-21 02:48:04 +00:00
impure.nix impure.nix: fix handling of localSystem 2018-06-25 17:13:02 -04:00
java-packages.nix pkgs/*: remove unreferenced function arguments 2018-07-21 02:48:04 +00:00
lua-packages.nix luaPackages.luadbi: 0.5 -> 0.6 (#47156) 2018-09-22 22:27:35 +02:00
make-tarball.nix tarball job: more --show-trace 2018-09-03 14:24:42 +02:00
metrics.nix Revert "release/metrics: drop requiredSystemFeatures" 2018-07-30 10:46:20 +02:00
ocaml-packages.nix Merge pull request #49822 from marsam/feature/update-flow 2018-11-07 15:05:57 +00:00
perl-packages.nix Add description and license to HashDiff 2018-11-14 21:59:44 -08:00
php-packages.nix php72Packages.apcu_bc: init at 1.0.4 2018-11-05 17:25:52 +01:00
pure-packages.nix
python-packages.nix foundationdb: rework python bindings, build system 2018-11-16 20:34:19 -06:00
release-cross.nix Merge pull request #50282 from vincrusher/master 2018-11-12 15:57:23 -05:00
release-lib.nix release-lib: Fix pkgsFor 2018-11-05 11:27:50 -05:00
release-python.nix pkgs/*: remove unreferenced function arguments 2018-07-21 02:48:04 +00:00
release-small.nix atlas: remove 2018-11-04 20:23:12 -06:00
release.nix darwin-tested: readd wireshark 2018-11-07 13:02:51 -06:00
splice.nix xorg: don't splice scope attributes into main package set 2018-10-11 15:03:07 -04:00
stage.nix Merge remote-tracking branch 'upstream/master' into nixos-nixpkgs-pkgs-use-overlays 2018-11-04 21:33:16 +01:00
unix-tools.nix treewide: Remove usage of remaining redundant platform compatability stuff 2018-08-30 17:20:32 -04:00
wine-packages.nix wine: build wineWow packages on hydra 2018-07-03 21:29:32 +03:00