open-im-server icon indicating copy to clipboard operation
open-im-server copied to clipboard

The expectation is for the branch and tag versions to align with the server version

Open skiffer-git opened this issue 1 year ago β€’ 13 comments

Checklist

  • [X] I've searched for similar issues and couldn't find anything matching
  • [X] I've discussed this feature request in the OpenIMSDK Slack and got positive feedback

Is this feature request related to a problem?

None

Problem Description

Solution Description

The expectation is for the branch and tag versions to align with the server version, and for the server to print the actual version information upon startup.

Benefits

The expectation is for the branch and tag versions to align with the server version, and for the server to print the actual version information upon startup.

Potential Drawbacks

No response

Additional Information

No response

skiffer-git avatar Jul 15 '23 03:07 skiffer-git

This issue is available for anyone to work on. Make sure to reference this issue in your pull request. :sparkles: Thank you for your contribution! :sparkles: Join slack πŸ€– to connect and communicate with our developers. If you wish to accept this assignment, please leave a comment in the comments section: /accept.🎯

kubbot avatar Jul 25 '23 09:07 kubbot

/accept

cubxxw avatar Jul 25 '23 09:07 cubxxw

@cubxxw Glad to see you accepted this issue🀲, this issue has been assigned to you. I set the milestones for this issue to , We are looking forward to your PR!

openimbot avatar Jul 25 '23 09:07 openimbot

The SemVer specification format is [name]x.y.z-[state+buildmetadata], for example, v2.1.5 and v1.2.3-alpha-1 +001.

cubxxw avatar Jul 25 '23 09:07 cubxxw

go build -ldflags can pass the specified arguments to go tool's link in the format: -ldflags '[pattern=]arg list', for example: -X importpath.name=value. Run go tool link -h:

root@PS2023EVRHNCXG:~/workspaces/openim/Open-IM-Server# go tool link -h  | grep "-X"
grep: option requires an argument -- 'X'
Usage: grep [OPTION]... PATTERNS [FILE]...
Try 'grep --help' for more information.
usage: link [options] main.o
  -B note
        add an ELF NT_GNU_BUILD_ID note when using ELF
  -E entry
        set entry symbol name
  -H type
        set header type
  -I linker
        use linker as ELF dynamic linker
  -L directory
        add specified directory to library path
  -R quantum
        set address rounding quantum (default -1)
  -T address
        set text segment address (default -1)
  -V    print version and exit
  -X definition
        add string value definition of the form importpath.name=value

cubxxw avatar Jul 25 '23 09:07 cubxxw

You can see that -X importpath.name=value tells the Go linker to assign value to the name variable in the importpath package. Note: name must be a string variable, otherwise the compiler will report the following error

cubxxw avatar Jul 25 '23 09:07 cubxxw

go build -ldflags "-X main.GitVersion=v1.0.0 -X main.BuildDate=$(date +%F)" -o version main.go

cubxxw avatar Jul 25 '23 09:07 cubxxw

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

kubbot avatar Sep 29 '23 08:09 kubbot

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

kubbot avatar Dec 06 '23 08:12 kubbot

This issue was closed because it has been stalled for 7 days with no activity.

kubbot avatar Mar 02 '24 08:03 kubbot

restart

cubxxw avatar Mar 11 '24 04:03 cubxxw

Bot detected the issue body's language is not English, translate it automatically. πŸ‘―πŸ‘­πŸ»πŸ§‘β€πŸ€β€πŸ§‘πŸ‘«πŸ§‘πŸΏβ€πŸ€β€πŸ§‘πŸ»πŸ‘©πŸΎβ€πŸ€β€πŸ‘¨πŸΏπŸ‘¬πŸΏ


restart

kubbot avatar Mar 11 '24 04:03 kubbot

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

kubbot avatar May 20 '24 08:05 kubbot