bonede / tree-sitter-ng

Next generation Tree Sitter Java binding.
MIT License
71 stars 10 forks source link

Version Semantic Change Request #35

Closed sepatel closed 3 months ago

sepatel commented 3 months ago

It looks like you release patches using the letter system on the semantic versioning of the libraries. For example the latest release was 0.22.6a but a lot of things that reference 0.22.6 end up resolving to that instead of the a version. This is because the maven and gradle dependency resolution strategies only apply to the numeric portions of the versioning.

It would be awesome if you could instead do something like 0.22.6.1 instead for any patch/security fixes instead as that allows the build systems to correctly resolve that if you ask for the 0.22.6.1 version that it is newer not older than the 0.22.6 version that was requested and allow everything to resolve cleanly. Currently it ends up pulling in both artifacts when you pull in multiple dependencies because of how it works.

bonede commented 3 months ago

Please check the dependency tree by running mvn dependency:tree.

$ mvn dependency:tree
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ myartifactid ---
[INFO] mygroupid:myartifactid:jar:0.0-SNAPSHOT
[INFO] +- junit:junit:jar:4.12:compile
[INFO] |  \- org.hamcrest:hamcrest-core:jar:1.3:compile
[INFO] +- io.github.bonede:tree-sitter:jar:0.22.6a:compile
[INFO] \- io.github.bonede:tree-sitter-json:jar:0.21.0a:compile

Looks fine to me.

Here is the pom.xml


<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>mygroupid</groupId>
  <artifactId>myartifactid</artifactId>
  <version>0.0-SNAPSHOT</version>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <type>jar</type>
    </dependency>
    <dependency>
      <groupId>io.github.bonede</groupId>
      <artifactId>tree-sitter</artifactId>
      <version>0.22.6a</version>
    </dependency>
    <!-- add json parser -->
    <dependency>
      <groupId>io.github.bonede</groupId>
      <artifactId>tree-sitter-json</artifactId>
      <version>0.21.0a</version>
    </dependency>
  </dependencies>
</project>
sepatel commented 3 months ago

We are using gradle and we obviously have a lot more dependencies but I'll paste the relevant parts of the tree for you to see and the gradle as well.

Also, in the java world, it is considered that letters are "pre-releases" of the final version so proper resolution of dependencies typically put letters after the non-letters. It's commonly used for things like alpha, beta, rc, etc. Because of that it becomes possible to do things like have version ranges, snapshots, and patchsets. You can read more at https://maven.apache.org/pom.html#Version_Order_Specification and https://docs.oracle.com/middleware/1212/core/MAVEN/maven_version.htm#MAVEN8855

Snippet of build.gradle.kts

dependencies {
    // Tree Sitter
    implementation("io.github.bonede:tree-sitter:0.22.6a")

    // Parsers
    implementation("io.github.bonede:tree-sitter-agda:1.2.1a") // agda
    implementation("io.github.bonede:tree-sitter-apex:0.0.10a") // apex
    implementation("io.github.bonede:tree-sitter-bash:0.20.5") // 0.21 does not work
    implementation("io.github.bonede:tree-sitter-c:0.20.7a")
    implementation("io.github.bonede:tree-sitter-c-sharp:0.20.0a")
    implementation("io.github.bonede:tree-sitter-capnp:1.5.0a") // capn proto
    implementation("io.github.bonede:tree-sitter-clojure:0.0.12a") // clojure
    implementation("io.github.bonede:tree-sitter-cmake:0.4.1a") // cmake, not verified
    implementation("io.github.bonede:tree-sitter-comment:0.1.0a") // comment -- this one is interesting
    implementation("io.github.bonede:tree-sitter-commonlisp:0.3.3") // commonlisp
    implementation("io.github.bonede:tree-sitter-cpp:0.22.0a")
    implementation("io.github.bonede:tree-sitter-css:0.21.0") // css
    implementation("io.github.bonede:tree-sitter-cuda:0.20.4") // cuda
    implementation("io.github.bonede:tree-sitter-d:0.4.0") // d
    implementation("io.github.bonede:tree-sitter-dockerfile:0.2.0")
    implementation("io.github.bonede:tree-sitter-elisp:1.3.0a")
    implementation("io.github.bonede:tree-sitter-elixir:0.2.0")
    implementation("io.github.bonede:tree-sitter-elm:5.7.0a")
    implementation("io.github.bonede:tree-sitter-embedded-template:0.21.0") // unclear what this is
    implementation("io.github.bonede:tree-sitter-eno:0.1.2a")
    implementation("io.github.bonede:tree-sitter-erlang:0.1.0a")
    implementation("io.github.bonede:tree-sitter-gitattributes:0.1.6")
    implementation("io.github.bonede:tree-sitter-gleam:1.0.0")
    implementation("io.github.bonede:tree-sitter-glsl:0.1.8")
    implementation("io.github.bonede:tree-sitter-go:0.21.0a")
    implementation("io.github.bonede:tree-sitter-go-mod:1.0.2")
    implementation("io.github.bonede:tree-sitter-haskell:0.21.0")
    implementation("io.github.bonede:tree-sitter-hcl:1.1.0a") // hcl
    implementation("io.github.bonede:tree-sitter-html:0.20.3") // html
    implementation("io.github.bonede:tree-sitter-java:0.21.0a")
    implementation("io.github.bonede:tree-sitter-javascript:0.21.2")
    implementation("io.github.bonede:tree-sitter-json:0.21.0a")
    implementation("io.github.bonede:tree-sitter-julia:0.22.0a")
    implementation("io.github.bonede:tree-sitter-kotlin:0.3.6")
    implementation("io.github.bonede:tree-sitter-latex:0.3.0a")
    implementation("io.github.bonede:tree-sitter-lua:2.1.3a")
    implementation("io.github.bonede:tree-sitter-m68k:0.2.7a")
    implementation("io.github.bonede:tree-sitter-markdown:0.7.1a")
    implementation("io.github.bonede:tree-sitter-meson:1.2.1")
    implementation("io.github.bonede:tree-sitter-nim:0.6.0")
    implementation("io.github.bonede:tree-sitter-ocaml:0.22.0a") // ocaml
    implementation("io.github.bonede:tree-sitter-org:1.3.1a") // org
    implementation("io.github.bonede:tree-sitter-pascal:0.9.1a") // pascal
    implementation("io.github.bonede:tree-sitter-perl:1.1.0") // perl
    implementation("io.github.bonede:tree-sitter-pgn:1.0.5")
    implementation("io.github.bonede:tree-sitter-php:0.22.4")
    implementation("io.github.bonede:tree-sitter-python:0.21.0a") // python
    implementation("io.github.bonede:tree-sitter-qmljs:0.1.2a")
    implementation("io.github.bonede:tree-sitter-query:0.3.0")
    implementation("io.github.bonede:tree-sitter-racket:0.3.0a")
    implementation("io.github.bonede:tree-sitter-rasi:0.1.0a")
    implementation("io.github.bonede:tree-sitter-regex:1.0.0")
    implementation("io.github.bonede:tree-sitter-rst:0.1.0a")
    implementation("io.github.bonede:tree-sitter-ruby:0.21.0")
    implementation("io.github.bonede:tree-sitter-rust:0.21.2") // unused
    implementation("io.github.bonede:tree-sitter-scala:0.21.0a")
    implementation("io.github.bonede:tree-sitter-scheme:0.6.0a")
    implementation("io.github.bonede:tree-sitter-scss:1.0.0a") // + does *not* work for this
    implementation("io.github.bonede:tree-sitter-smali:1.0.0a") // this is actually assembly for android
    implementation("io.github.bonede:tree-sitter-sourcepawn:0.7.2")
    implementation("io.github.bonede:tree-sitter-sparql:0.1.0a")
    implementation("io.github.bonede:tree-sitter-sql-bigquery:0.6.+")
    implementation("io.github.bonede:tree-sitter-ssh-client-config:2024.5.9")
    implementation("io.github.bonede:tree-sitter-svelte:0.11.0a")
    implementation("io.github.bonede:tree-sitter-swift:0.5.0")
    implementation("io.github.bonede:tree-sitter-thrift:0.5.0a")
    implementation("io.github.bonede:tree-sitter-toml:0.5.1a")
    implementation("io.github.bonede:tree-sitter-turtle:0.1.0a")
    implementation("io.github.bonede:tree-sitter-twig:1.0.2a")
    implementation("io.github.bonede:tree-sitter-typescript:0.21.+") // typescript
    implementation("io.github.bonede:tree-sitter-vue:0.2.1a")
    implementation("io.github.bonede:tree-sitter-yaml:0.5.0a")

    testImplementation("io.kotest:kotest-runner-junit5:${properties["kotest_version"]}")
    testImplementation("io.kotest:kotest-assertions-core:${properties["kotest_version"]}")
    testImplementation("io.kotest:kotest-property:${properties["kotest_version"]}")
}

Output of dependencies

runtimeClasspath - Runtime classpath of null/main.
+--- io.github.bonede:tree-sitter:0.22.6a -> 0.22.6
+--- io.github.bonede:tree-sitter-agda:1.2.1a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-apex:0.0.10a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-bash:0.20.5
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-c:0.20.7a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-c-sharp:0.20.0a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-capnp:1.5.0a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-clojure:0.0.12a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-cmake:0.4.1a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-comment:0.1.0a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-commonlisp:0.3.3
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-cpp:0.22.0a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-css:0.21.0
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-cuda:0.20.4
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-d:0.4.0
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-dockerfile:0.2.0
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-elisp:1.3.0a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-elixir:0.2.0
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-elm:5.7.0a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-embedded-template:0.21.0
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-eno:0.1.2a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-erlang:0.1.0a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-gitattributes:0.1.6
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-gleam:1.0.0
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-glsl:0.1.8
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-go:0.21.0a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-go-mod:1.0.2
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-haskell:0.21.0
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-hcl:1.1.0a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-html:0.20.3
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-java:0.21.0a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-javascript:0.21.2
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-json:0.21.0a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-julia:0.22.0a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-kotlin:0.3.6
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-latex:0.3.0a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-lua:2.1.3a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-m68k:0.2.7a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-markdown:0.7.1a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-meson:1.2.1
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-nim:0.6.0
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-ocaml:0.22.0a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-org:1.3.1a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-pascal:0.9.1a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-perl:1.1.0
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-pgn:1.0.5
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-php:0.22.4
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-python:0.21.0a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-qmljs:0.1.2a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-query:0.3.0
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-racket:0.3.0a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-rasi:0.1.0a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-regex:1.0.0
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-rst:0.1.0a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-ruby:0.21.0
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-rust:0.21.2
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-scala:0.21.0a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-scheme:0.6.0a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-scss:1.0.0a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-smali:1.0.0a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-sourcepawn:0.7.2
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-sparql:0.1.0a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-sql-bigquery:0.6.+ -> 0.6.0
|    \--- io.github.bonede:tree-sitter:0.20.8 -> 0.22.6
+--- io.github.bonede:tree-sitter-ssh-client-config:2024.5.9
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-svelte:0.11.0a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-swift:0.5.0
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-thrift:0.5.0a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-toml:0.5.1a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-turtle:0.1.0a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-twig:1.0.2a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-typescript:0.21.+ -> 0.21.1
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-vue:0.2.1a
|    \--- io.github.bonede:tree-sitter:0.22.6
+--- io.github.bonede:tree-sitter-yaml:0.5.0a
|    \--- io.github.bonede:tree-sitter:0.22.6
bonede commented 3 months ago

Please upgrade to 0.22.6.1. This should fix the versioning issue.

sepatel commented 3 months ago

Please upgrade to 0.22.6.1. This should fix the versioning issue.

Thanks, that fixed it :)

sepatel commented 3 months ago

Confirmed that we've experienced no further issues now that the 0.22.6.1 nomenclature is being used. I'm going to assume this is something that'll continue with future releases and thus am closing out this issue as well.

Thanks @bonede