scele / rules_python

Experimental Bazel Python Rules
Apache License 2.0
2 stars 8 forks source link

Move purelib instead of symlinking #4

Closed mirandaconrado closed 6 years ago

mirandaconrado commented 6 years ago

Symlinking is the preferred way as it keeps all references alive, but purelibs effectively mean that the inner folder representing the package is the one that matters. With symlinks, the content of the package is duplicated when some functionality that doesn't support it (e.g. creating a layer with rules_docker).

As a specific example, this patch reduces the external layer of an image depending on TensorFlow from 2G (537M compressed) to 1.2G (335M compressed) because the heavy library isn't included twice.

scele commented 6 years ago

I wonder if we should invoke pip to extract the wheel, instead of unzip + a bunch of manual steps.