-
-
Notifications
You must be signed in to change notification settings - Fork 632
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
Move ivy and coursier bootstrapping to BinaryUtil. #8637
Move ivy and coursier bootstrapping to BinaryUtil. #8637
Conversation
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
urls = [self.get_options().bootstrap_jar_url] | ||
else: | ||
urls = list(self.get_options().bootstrap_jar_urls) | ||
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
9883541
to
1e4bd45
Compare
except ivy.Error as e: | ||
safe_delete(classpath) | ||
raise self.Error('Failed to bootstrap an ivy classpath! {}'.format(e)) | ||
with safe_concurrent_creation(classpath) as safe_classpath: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we actually need ivy to bootstrap itself? Why not directly fetch the version we want to use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess because of plugins?
pants/src/python/pants/ivy/bootstrapper.py
Lines 31 to 34 in c12fcbb
After bootstrapping, ivy will re-resolve itself. By default it does this via maven central, but | |
a custom ivy tool classpath can be specified by using the ``--ivy-ivy-profile`` option to point to | |
a custom ivy profile ivy.xml. This can be useful to upgrade ivy to a version released after pants | |
or else mix in auxiliary jars that provide ivy plugins. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay green CI! Thank you!
else: | ||
workunit.set_outcome(WorkUnit.SUCCESS) | ||
def __init__(self, template_urls): | ||
super(CoursierUrlGenerator, self).__init__() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be super().__init__()
.
class IvyUrlGenerator(BinaryToolUrlGenerator): | ||
|
||
def __init__(self, template_urls): | ||
super(IvyUrlGenerator, self).__init__() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto on Py3 style super()
. I will add both these changes to the type checking PR I have up.
Problem
ivy
andcoursier
both use an older pattern to bootstrap their initial jar (ivy continues on to actually resolve itself), meaning that they don't support multiple bootstrap URLs.Solution
Swap them to
BinaryTool
/BinaryUtil
, with a slight twist to allow them to use multiple bootstrap URLs in addition to accessing our S3 bucket.Result
Better defaults and less flaky bootstrapping of those tools.