antlr4 icon indicating copy to clipboard operation
antlr4 copied to clipboard

Upgrade to go 1.21, replace golang.org/x/exp/slices with slices

Open Tiscs opened this issue 1 year ago • 7 comments
trafficstars

Upgrade to go 1.21 to use slices package instead of golang.org/x/exp/slices package.

In the antlr4-go/antlr project, the go version declared in go.mod is already 1.22.

Tiscs avatar Sep 01 '24 08:09 Tiscs

I have already done this. It does not need a pr

On Fri, Oct 11, 2024 at 03:33 Stephen Kitt @.***> wrote:

@.**** approved this pull request.

— Reply to this email directly, view it on GitHub https://github.com/antlr/antlr4/pull/4688#pullrequestreview-2362379885, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJ7TMDYUOOTDQRP7PF6YPDZ26LM5AVCNFSM6AAAAABNOUCLYGVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDGNRSGM3TSOBYGU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

jimidle avatar Oct 11 '24 11:10 jimidle

I have already done this. It does not need a pr

It’s just confusing because it’s done in https://github.com/antlr4-go/antlr but not in https://github.com/antlr/antlr4/tree/dev/runtime/Go/antlr/v4 and the former says it’s a copy of the latter.

skitt avatar Oct 11 '24 11:10 skitt

Yes, but it referee to the build and release. You only use tagged versions

On Fri, Oct 11, 2024 at 05:49 Stephen Kitt @.***> wrote:

I have already done this. It does not need a pr

It’s just confusing because it’s done in https://github.com/antlr4-go/antlr but not in https://github.com/antlr/antlr4/tree/dev/runtime/Go/antlr/v4 and the former says it’s a copy of the latter.

— Reply to this email directly, view it on GitHub https://github.com/antlr/antlr4/pull/4688#issuecomment-2407245761, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJ7TMHOCVQPLV6YRUTQH7LZ263LDAVCNFSM6AAAAABNOUCLYGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBXGI2DKNZWGE . You are receiving this because you commented.Message ID: @.***>

jimidle avatar Oct 11 '24 11:10 jimidle

Yes, but it referee to the build and release. You only use tagged versions

OK, sorry for the noise.

skitt avatar Oct 11 '24 11:10 skitt

I have already done this. It does not need a pr

It’s just confusing because it’s done in https://github.com/antlr4-go/antlr but not in https://github.com/antlr/antlr4/tree/dev/runtime/Go/antlr/v4 and the former says it’s a copy of the latter.

I have previously created a PR in the antlr4-go/antlr project. but as mentioned in the project README.md, Do not submit PRs or any change requests to this repo, I closed that PR.

Tiscs avatar Oct 11 '24 12:10 Tiscs

I have already done this. It does not need a pr

@jimidle But golang.org/x/exp is still in use in the https://github.com/antlr4-go/antlr repository as of today. Did I miss anything?

2025-01-19_01-13

Juneezee avatar Jan 18 '25 17:01 Juneezee

I am confused, because the latest commit in https://github.com/antlr4-go/antlr is from May 2024 and does not contain this change. @jimidle can you clarify and maybe merge this? Thank you very much for your work!

(Reason is that I really want to drop the x/exp dependency in our project https://github.com/DAMEDIC/fhir-toolbox-go/blob/main/go.mod)

lschmierer avatar Apr 19 '25 22:04 lschmierer

I am also confused. The old exp module is still used both in this repo and in https://github.com/antlr4-go/antlr (even in the dev branch).

xrstf avatar Sep 18 '25 11:09 xrstf

@jimidle your changes seem to have been lost, I’m guessing they were deleted when https://github.com/antlr4-go/antlr was updated from this repository — I can’t find your equivalent changes any more. In any case, all the available releases of github.com/antlr4-go/antlr still use the x/exp slices package. Would it be possible to merge this PR to clean up the dependency?

skitt avatar Sep 18 '25 12:09 skitt

I previously created a fork to address this issue by using the replace directive in go.mod to eliminate the dependency on golang.org/x/exp/slices. Here's a minimal example:

// git clone https://github.com/choral-io/antlr4-go.git ../antlr4-go

module github.com/choral-io/gommerce-server-core

go 1.25.0

replace github.com/antlr4-go/antlr/v4 v4.13.1 => ../antlr4-go

require (
    github.com/antlr4-go/antlr/v4 v4.13.1
    // other dependencies...
)

This workaround worked well in our project, but I sincerely hope the official repository can resolve this cleanly.

Tiscs avatar Sep 18 '25 14:09 Tiscs

I will update it all shortly. I’ve just been too busy with work and moving

On Thu, Sep 18, 2025 at 08:35 Galen Suen @.***> wrote:

Tiscs left a comment (antlr/antlr4#4688) https://github.com/antlr/antlr4/pull/4688#issuecomment-3307820324

I previously created a fork https://github.com/choral-io/antlr4-go to address this issue by using the replace directive in go.mod to eliminate the dependency on golang.org/x/exp/slices. Here's a minimal example:

// git clone https://github.com/choral-io/antlr4-go.git ../antlr4-go module github.com/choral-io/gommerce-server-core go 1.25.0 replace github.com/antlr4-go/antlr/v4 v4.13.1 => ../antlr4-go require ( github.com/antlr4-go/antlr/v4 v4.13.1 // other dependencies... )

This workaround worked well in our project, but I sincerely hope the official repository can resolve this cleanly.

— Reply to this email directly, view it on GitHub https://github.com/antlr/antlr4/pull/4688#issuecomment-3307820324, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJ7TMF5OC2NOBBHIJTGMGL3TK7JTAVCNFSM6AAAAABNOUCLYGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTGMBXHAZDAMZSGQ . You are receiving this because you were mentioned.Message ID: @.***>

jimidle avatar Sep 19 '25 01:09 jimidle