Git Product home page Git Product logo

rules_antlr's People

Contributors

marcohu avatar vmax avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rules_antlr's Issues

Support different ANTLR release versions

Instead of shipping each rule only with a single ANTLR dependency, it would be better to bundle several releases and let the user pick one. This way updating to a new rules_antlr release would be possible without having to care about the dependencies.

Instead of just

antlr_dependencies(4)

also support the more specific

antlr_dependencies(471)

Directory issue with Python3 use

When I make my rule, doing

antlr(
    name = "simple_boolean",
    srcs = ["SimpleBoolean.g4"],
    language = "Python3",
    listener = False,
    visitor = True,
)

it puts the generated files into:

bazel-bin/utils/rule_engine/simple_boolean.py

Am I missing something about doing python imports? I can't find a way to import a package that has a . in it. But I see the code this is very explicitly doing this step. What am I missing to be able to then import and use these generated files?

It works fine when I run antlr myself, instead of via this.

It works fine in my golang side implementation.

Thanks for any help.

srcjars are not deterministic

The src jars are not deterministically generated, as the jars include modified timestamps. Please consider using something like bazel's javatools's jarcreator.

thomasbao12@f845d76

Note that the above change makes the jar's layout mirror the output directory's layout

Is this repository maintained?

Im noticing that there have been no updates to this repo in almost 2 years, and issues/prs dont seem to be addressed.

wondering if the repo is still maintained, or whether there are any maintained forks

Deterministic comments in the generated go files

// Code generated from /home/sustrik/.cache/bazel/_bazel_sustrik/329223ef44c790813be2d08fc6e228b5/sandbox/linux-sandbox/832/execroot/__main__/Foo.g4 by ANTLR 4.7.2. DO NOT EDIT.

Would it be possible to change that to:

// Code generated from Foo.g4 by ANTLR 4.7.2. DO NOT EDIT.

AFAICS this can be achieved by running the generator from the directory in question.

Proposal: Revamp and Migrate rules_antlr to bazel-contrib

TL;DR

The canonical reference to rules_antlr is lost. The proposal is to transfer it to bazel-contrib. Help wanted.

Context

I'm creating this issue as @marcohu hasn't been active on GitHub since 2022, and this repo hasn't been maintained for much longer (as evidenced by issue #19).

The only other contributor besides @marcohu is @vmax, who I believe does not have write access and also has stale PRs (see PR #18).

I've also tried to find "Marco Hunsicker" on LinkedIn without success. If anyone knows how to contact him, please let me know.

That said, there are some forks available, but they do not inspire confidence in terms of maintainability and are not suitable for various use cases. These forks seem to be one-time efforts to add specific features or support for certain ANTLR versions and haven't been updated since.

Bzlmod

In its current state, the project can't be published to the Bazel Central Registry (BCR), and projects relying on it won't be able to leverage Bzlmod to pull this dependency. There's an issue requesting its inclusion (see issue #1575), and another project is awaiting its inclusion (see issue #137).

Proposal

Following @EdSchouten's suggestion (see issue comment), I propose a "hostile takeover" to migrate these rules to @bazel-contrib.

The guidance is provided at Hosting rules repositories in the bazel-contrib org, which states:

Criteria for accepting rule sets into this repo and avoid them from getting stale:

  1. Must use an OSI-approved OSS license, preferably Apache-2.0.
  2. Must have wide applicability in the community.
  3. Must have a clear point of contact who answers questions from the SIG.
  4. Must be "production quality":
    • clear README or other documentation outlining the goal of these rules, how to use them etc.
    • generated API documentation
    • include examples of use
    • tests that are running continuously
  5. Must reply to issues/PRs in 2-3 weeks (exact service level agreement TBD)
  6. Must have more than one person who is committed to review/approve PRs
    • We recommend encoding this as a CODEOWNERS file.
  7. Must publish semver releases.
    • Optional: follow the same release pattern as the rules-template does.
  8. Must work with LTS Bazel version
  9. Must publish the rules to the Bazel Central Registry, keep that CI green

Call to Action

The project clearly does not comply with all these items. In the meantime, I've created a fork at my repository, and my intention is to uplift it, reconcile it with other forks (when possible), and hand it over.

However, I would love not to do this alone, so I'm asking for help or volunteers.

I also want to highlight items 5 and 6, which state that we will need people willing to review and approve PRs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.