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

28.1 breaks pex? #74

Open
tradergt opened this issue Sep 5, 2019 · 4 comments
Open

28.1 breaks pex? #74

tradergt opened this issue Sep 5, 2019 · 4 comments

Comments

@tradergt
Copy link

tradergt commented Sep 5, 2019

It may have broken before this version but I was trying out using pex and it seems like its broken. This is me cloning master and seeing if it works.

Starting local Bazel server and connecting to it...
ERROR: /home/tradergt/modules/bazel_rules_pex/pex/pex_rules.bzl:49:18: name 'FileType' is not defined
ERROR: error loading package '': Extension 'pex/pex_rules.bzl' has errors
ERROR: error loading package '': Extension 'pex/pex_rules.bzl' has errors
INFO: Elapsed time: 3.955s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)

@benley
Copy link
Owner

benley commented Sep 5, 2019

Thanks for the report! So yeah, I think these rules will need some updates for bazel >= 0.27. I have not had time to work on Bazel-related stuff for a while because work has had me busy with so many other things, but I would be happy to merge fixes if you or someone else can contribute them.

@tradergt
Copy link
Author

I might have it pretty close but I cant figure out what I need to change this too..

native.http_file(
name = 'pytest_whl',
url = 'https://pypi.python.org/packages/8c/7d/f5d71f0e28af32388e07bd4ce0dbd2b3539693aadcae4403266173ec87fa/pytest-3.2.3-py2.py3-none-any.whl',
sha256 = '81a25f36a97da3313e1125fce9e7bbbba565bc7fec3c5beb14c262ddab238ac1'
)

	native.http_file(name = "pytest_whl", url = "https:...", ...")

type 'struct' has no method http_file()

I cant find any example of what I need to change this too.

@benley
Copy link
Owner

benley commented Oct 16, 2019

I think the http_file rule has been mode into a skylark module: https://docs.bazel.build/versions/master/repo/http.html

So you can get it back with

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file", "http_archive")

@tradergt
Copy link
Author

I had tried that but it did not work while it was still in that function. What did make it work is moving that function, essentially, to the workspace file itself. Which does not seem right to me but it works. Now I am on to this error and need to sort it:

import imp
Could not find a version that satisfies the requirement pex (from versions: )
No matching distribution found for pex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants