[build] Fix for #4647: get Antlr4 Tool .jar from github.#4821
Merged
Conversation
…gsinst github.com instead of Maven Central, fixing antlr#4647.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR vendors a modified copy of the antlr4-tools Python package into the repository and updates CI to install it from the local _scripts/antlr4-tools directory, aiming to avoid Maven Central flakiness by downloading the ANTLR tool jar from GitHub instead.
Changes:
- Add a vendored
antlr4-toolspackage under_scripts/antlr4-tools, including a modifiedantlr4_tool_runner.pythat fetches the ANTLR jar from GitHub and adds retry behavior. - Update GitHub Actions workflow to
pip install _scripts/antlr4-tools(local install) and show the installed package info. - Minor markdown formatting change in
abb/readme.md.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| abb/readme.md | Minor formatting (trailing blank line). |
| _scripts/antlr4-tools/setup.py | Adds local packaging metadata/entrypoints for the vendored antlr4-tools. |
| _scripts/antlr4-tools/developer-cert-of-origin.txt | Adds DCO text file for the vendored package directory. |
| _scripts/antlr4-tools/antlr4_tool_runner.py | Implements GitHub-based jar fetch with retries and local caching; provides antlr4/antlr4-parse entrypoints. |
| _scripts/antlr4-tools/README.md | Adds documentation for using the tool and Windows notes. |
| _scripts/antlr4-tools/LICENSE | Adds MIT license text for the vendored package. |
| .github/workflows/main.yml | Switches CI to install antlr4-tools from the vendored local path. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…and UX. - Replace sonatype.com version lookup with GitHub Releases API - Add os.path.isdir check before falling back to cached versions - Fix version_dirs.pop() to version_dirs[0] (reverse-sorted list) - Add missing import time; remove unused import argparse - Replace argparse -v handling with manual argv scan to avoid -visitor conflict - Fix HTTPError/URLError catch order (HTTPError is subclass of URLError) - Break immediately on HTTPError (no retry); print friendly message on 404 - Print "Using ANTLR version X" on every invocation - Remove unused find_packages import from setup.py Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Member
|
@kaby76 thanks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes #4647, where builds would fail due to Maven Central rejecting download requests, typically during a weekday afternoon. To fix this, a copy of the antlr4-tools Python package was added to the repo, and the tool was modified to work against github.com instead of Maven Central. This is the best way to avoid download problems because Maven Central rejects download requests when it is heavily loaded, whereas GitHub does not. Besides, the Antlr.org download page itself points to GitHub, not Maven Central (https://www.antlr.org/download.html, last sentence on webpage). This change also eliminates the extra dependency on the external antlr4 Python wrapper tool. Builds will still fail when other servers are heavily loaded, but it's less likely to occur.