xyproto / orbiton

Configuration-free text editor and IDE limited to VT100. Suitable for writing git commit messages, editing Markdown, config files, source code, man pages and for quick edit-format-compile cycles when programming. Has syntax highlighting, jump-to-error, rainbow parentheses, macros, llm tab completion, cut/paste portals and a simple gdb front-end.
https://roboticoverlords.org/orbiton
BSD 3-Clause "New" or "Revised" License
501 stars 15 forks source link

Go indexing server doesn't have a proper version of "o" #5

Closed yurivict closed 2 years ago

yurivict commented 3 years ago

I use this script to retrieve versions:

$ cat go-retrieve-all-packages.sh 
#!/bin/sh

SINCE=$1 # like 2021-08-01T00:00:00Z

while [ -n "${SINCE}" ]; do

    # download
    echo "downloading SINCE=${SINCE}"
    wget "https://index.golang.org/index?limit=2000&since=${SINCE}" -q -O output-${SINCE}.json

    # get last since
    SINCE_NEW=`tail -1 output-${SINCE}.json | sed -e 's|.*"Timestamp":"||; s|".*||'`

    # EOF?
    if [ "${SINCE_NEW}" = "${SINCE}" ] || [ -z "${SINCE_NEW}" ]; then
        echo "=== End of project list reached @ ${SINCE} ==="
        exit 0
    else
        SINCE=${SINCE_NEW}
    fi
done

This script shows "o" versions that aren't in the same format as 2.43.1:

$ go-retrieve-all-packages.sh 2021-08-22T00:00:00Z && grep xyproto/o *.json
output-2021-08-23T11:05:48.79719Z.json:{"Path":"github.com/xyproto/o","Version":"v0.0.0-20210823111912-8a6dae6583cc","Timestamp":"2021-08-23T11:21:35.834589Z"}
output-2021-08-23T11:05:48.79719Z.json:{"Path":"github.com/xyproto/o","Version":"v0.0.0-20210823115816-f5d0db86c30a","Timestamp":"2021-08-23T12:10:25.814772Z"}

Correct version isn't being picked up for some reason.

xyproto commented 3 years ago

Ah, yes, Go requires version tags to either start with ie.1 or v, but never 2.

I added a v2.43.1 tag. Did that help?

yurivict commented 3 years ago

It would be possible to say with the next release if that helped.

xyproto commented 3 years ago

Thanks for reporting. Please re-open this issue if it's still a problem with the next release.

yurivict commented 2 years ago

The module URL github.com/xyproto/o should end with /v2 for Google servers to pick up the project.

This is still an issue.

xyproto commented 2 years ago

But reading the documentation for v2: https://go.dev/blog/v2-go-modules, it seems to me that it only applies to modules.

o is not a Go module, though. It only has a main package, and compiles down to an executable.

Is there a benefit to either removing all v2* tags (which I won't do) or moving all source code into a v2 directory (which I might, but it does not feel like a clean solution)?

I started moving all source files, go.mod and go.sum to v2/, which only lives in the v2 branch, for now.

Is the script also meant for executables (package main), or only for Go modules?

yurivict commented 2 years ago

But reading the documentation for v2: https://go.dev/blog/v2-go-modules, it seems to me that it only applies to modules.

No, it applies to applications too.

Go projects are downloaded by the FreeBSD framework from Go servers, otherwise dependencies are often messed up.

xyproto commented 2 years ago

I tried all sorts of things.

Does it work now?

https://index.golang.org/index?limit=1&since=2022-02-09T17:29:00Z

yurivict commented 2 years ago

1.2.48 is backwards from 2.47.0.

You need to add /v2 to the module URL.

xyproto commented 2 years ago

Thanks for the help.

I think it might be fixed now. I added a /v2 directory and added /v2 to go.mod:

https://index.golang.org/index?limit=1&since=2022-02-10T09:53:00Z

go install github.com/xyproto/o/v2@latest also works here now.

xyproto commented 2 years ago

Assuming this works now.

I had never imagined that versioning over 1.0 would be so logistically demanding.

yurivict commented 2 years ago

Assuming this works now.

It works, thanks!

I had never imagined that versioning over 1.0 would be so logistically demanding.

Large companies produce poor quality code. That's surprising!