Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: remove server subcommand from slim binaries#5747

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
deansheather merged 4 commits intomainfromdean/slim
Jan 17, 2023
Merged

Conversation

deansheather
Copy link
Member

@deansheatherdeansheather commentedJan 17, 2023
edited
Loading

  • Addslim tag if this is a slim build
  • AddIsSlim() andIsAGPL() tobuildinfo, and add those details tocoder version
  • Addsserver_slim.go (in both AGPL and enterprise CLI) which only builds withslim tag
  • MoveserveHandler fromserver.go toagent.go

This doesn't fully remove the server code from slim binaries, as the packages are still imported, but it disables them.

Copy link
Member

@mafredrimafredri left a comment

Choose a reason for hiding this comment

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

Looking good, had some small suggestions but pre-approving.

@@ -73,6 +75,16 @@ func IsDev() bool {
return strings.HasPrefix(Version(), develPrefix)
}

// IsSlim returns true if this is a slim build.
func IsSlim() bool {
return strings.Contains(slim, "t")
Copy link
Member

@mafredrimafredriJan 17, 2023
edited
Loading

Choose a reason for hiding this comment

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

Could we set this via build tag so that it's present when doinggo build as well? (I.e. we don't need to inject it via ldflags.)

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Like by usinggo build -tags slim?

Copy link
Member

Choose a reason for hiding this comment

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

Yup

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Sure, but we won't be able to detect agpl this way since we don't use a flag for it.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Done for slim, AGPL still uses ldflags. I've added a comment tobuild_go.sh why we don't provide anagpl build flag

"github.com/spf13/viper"

"github.com/coder/coder/cli/deployment"
"github.com/coder/coder/coderd"
Copy link
Member

Choose a reason for hiding this comment

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

Importingcoderd here is unfortunate. I think we could reduce binary size if we didn't but I might be wrong. I think we can avoid it if we change enterprise slim too?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Sadly alsoroot.go uses this function so the signature needs to match on both. I think this could be done as a second improvement, but I want to get this in so we can unblock the community PR#5738

Copy link
Member

Choose a reason for hiding this comment

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

Ah, didn't think of that. Yes makes sense 👍🏻.

@deansheatherdeansheatherenabled auto-merge (squash)January 17, 2023 16:51
@deansheatherdeansheather merged commit7f5dcc3 intomainJan 17, 2023
@deansheatherdeansheather deleted the dean/slim branchJanuary 17, 2023 16:58
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJan 17, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@mafredrimafredrimafredri approved these changes

@coadlercoadlerAwaiting requested review from coadler

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@deansheather@mafredri

[8]ページ先頭

©2009-2025 Movatter.jp