Hello! Wow, thank you for looking so quickly and carefully. It sounds like you figured it out, but I will add a platform-specific dependency to the example repo. For details:Cross platform packages are a challenge. Here is our current approach, which is very flawed:
* No cross-compilation: For now, if you build on OS X, you get a binary that runs on OS X. (This is also a place where Pex is more sophisticated: it supports cross-platform Pexes). If you want to build a Docker container, this means you need to run bazel build (target) on Linux. It should be possible to support cross-complication, but I don't understand how this works in Bazel. It seems easier to not worry about this for now.
* Binary wheels must exist on PyPI: My pip_generate tool looks for platform-specific wheels. If it finds them, it tries to find other platforms. This is pretty hard coded to just Mac and Linux for now.* If wheels don't exist on PyPI: It uses pip wheel to save them to some directory. The intention is you will upload them somewhere (e.g. a Google Cloud Storage bucket, S3?), so they can be downloaded by future builds. For some targets, this means I need to manually run the generate tool on Linux and Mac and manually edit the output.It sounds like you figured it out though!
--
You received this message because you are subscribed to a topic in the Google Groups "bazel-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bazel-discuss/oXz0o6B9tAI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to bazel-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/49bd3e17-fc26-4498-89de-43f9913e0407%40googlegroups.com.
Seems like, it's would be enough for our case - we can store platform-specific wheels in our repository (using git LFS for instance) or in special "vendor" repository with blobs (using git LFS, to keep pre-push/pre-commit hooks clean for internal usage).I will test this behavior for our case tomorrow, if everything fine - will rethink again about the missed binary wheels, probably we DON'T need any patches.And you community contribution motivate me to complete work on "panda" BUILD file generate and provide it to your repo as out-of-the-box solution.
After that rules_pyz will be very close to rules_go (the single difference after that - download specific version of python to platform need to be implemented, and rules_pyz will be as cool as rules_go cool).
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/CACRPLjhH3bKFrFCzzyCfr5qq2%3DV%2BOoLZjVnkeakL840KyeBGOg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "bazel-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bazel-discuss/oXz0o6B9tAI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to bazel-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/7f7bea61-75c5-4e6f-a27c-25c2cdd1d2fb%40googlegroups.com.
In general, I guess you can avoid zip-stage, it's would be enough just wrap native.py_{binary,library,test}.We checked: you can copy wrapper and runfiles somewhere or inside docker, and everything works fine.
So, your solution with requirements.bzl is brilliant, I think, this is the most "bazel" way to work with external dependencies."wtool" way for rules_go - is not completed movement in this direction :)
On Wed, Jan 31, 2018 at 9:51 AM, Oleg Tsarev <ol...@oleg.sh> wrote:In general, I guess you can avoid zip-stage, it's would be enough just wrap native.py_{binary,library,test}.We checked: you can copy wrapper and runfiles somewhere or inside docker, and everything works fine.The problem I had without zipping a directory tree is namespace packages. The way that the native rules leave everything in the "workspace" paths and try to fix PYTHONPATH to find all of them does not work: https://github.com/bazelbuild/rules_python/issues/55Putting everything into a single directory tree makes the layout look the same as when packages are pip installed. I wish this was not necessary, and maybe it isn't, but it works for us at the moment!
So, your solution with requirements.bzl is brilliant, I think, this is the most "bazel" way to work with external dependencies."wtool" way for rules_go - is not completed movement in this direction :)Thanks! I totally just copied the design from the Go rules and from bazel-deps!
Evan
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/f831b58a-94dc-40ff-a9ec-064caf32aa21%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.