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

Move ivy and coursier bootstrapping to BinaryUtil. #8637

Merged

Conversation

stuhood
Copy link
Sponsor Member

@stuhood stuhood commented Nov 16, 2019

Problem

ivy and coursier 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.

@stuhood

This comment has been minimized.

Copy link
Contributor

@wisechengyi wisechengyi left a 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)
print

This comment was marked as resolved.

@stuhood stuhood force-pushed the stuhood/ivy-and-coursier-on-binaryutil branch from 9883541 to 1e4bd45 Compare November 17, 2019 01:17
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:
Copy link
Sponsor Contributor

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?

Copy link
Sponsor Member Author

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?

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.

@stuhood stuhood merged commit 7c3389c into pantsbuild:master Nov 17, 2019
@stuhood stuhood deleted the stuhood/ivy-and-coursier-on-binaryutil branch November 17, 2019 19:56
Copy link
Contributor

@Eric-Arellano Eric-Arellano left a 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__()
Copy link
Contributor

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__()
Copy link
Contributor

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.

Eric-Arellano added a commit to Eric-Arellano/pants that referenced this pull request Nov 17, 2019
Eric-Arellano added a commit to Eric-Arellano/pants that referenced this pull request Nov 18, 2019
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

Successfully merging this pull request may close these issues.

None yet

4 participants