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

import: Use micro-editor/json5 instead of zyedidia/json5 #3595

Merged
merged 2 commits into from
Jan 5, 2025

Conversation

JoeKar
Copy link
Collaborator

@JoeKar JoeKar commented Jan 1, 2025

Using the latest forked version of titanous/json5 requires the minimal go version to be bumped to v1.19.

Fixes #2950

@JoeKar
Copy link
Collaborator Author

JoeKar commented Jan 1, 2025

Maybe it is better to apply the same replace-approach, as it is done here:

micro/go.mod

Line 36 in d0b3e44

replace github.com/kballard/go-shellquote => github.com/zyedidia/go-shellquote v0.0.0-20200613203517-eccd813c0655

This prevents us from rewriting all the import paths used within the forked dependencies. 🤔

@@ -39,4 +39,4 @@ replace github.com/mattn/go-runewidth => github.com/zyedidia/go-runewidth v0.0.1

replace layeh.com/gopher-luar => github.com/layeh/gopher-luar v1.0.7

go 1.17
go 1.19
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go 1.18 as minimum version would be feasible too.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can build it even with 1.17. (Only when I run go mod tidy, it complains "go.mod file indicates go 1.19, but maximum supported version is 1.17", but otherwise seemingly no issue.)

titanous/json5@18a6ca9 doesn't explain why was 1.19 chosen as the minimum version.

Well, 1.19 is already oldish, Debian 12 seems to ship 1.19, so it's probably not a problem if we bump it to 1.19 now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only when I run go mod tidy

That was the command which guided me in that direction.

titanous/json5@18a6ca9 doesn't explain why was 1.19 chosen as the minimum version.

Maybe a copy-paste "issue".

Well, 1.19 is already oldish, Debian 12 seems to ship 1.19, [...]

Yep, it comes with 1.191.

[...] so it's probably not a problem if we bump it to 1.19 now.

Hopefully.

Footnotes

  1. https://packages.debian.org/bookworm/golang

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even in the bullseye-backports there is the v1.191.

Footnotes

  1. https://packages.debian.org/bullseye-backports/golang

github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rivo/uniseg v0.1.0 h1:+2KBaVoUmb9XzDsrx/Ct0W/EYOSFf/nWTauy++DprtY=
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/robertkrimen/otto v0.2.1 h1:FVP0PJ0AHIjC+N4pKCG9yCDz6LHNPCwi/GKID5pGGF0=
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note: I see you dropped the commit zyedidia/json5@2da050b, I don't know intentionally or not, but as a result you added pulling of this https://github.com/robertkrimen/otto repo which is apparently a JS interpreter (so no wonder it is 1.5MB size, larger than any other micro's external dependencies, including gopher-lua which is only 1MB), which we certainly don't need in micro.

Well, I've checked that it doesn't seem to increase the size of the micro binary (it is the same with and without your PR), so the issue is only in needless downloading and storing of this 1.5MB repo (if the user builds micro from source), which is probably not a big deal if it helps to minimize downstream changes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know intentionally or not

It was intentional to keep our downstream changes as low as possible. When we wouldn't use micro-editor/json5@9569b62 then there is even no reason to use a fork at all, as patched by the Debian maintainer(s):

@JoeKar JoeKar merged commit a883c14 into zyedidia:master Jan 5, 2025
6 checks passed
@JoeKar JoeKar deleted the import/json5 branch January 5, 2025 11:13
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.

Binding raw escape sequences doesn't work
2 participants