Skip to content

Append module version to package names - #325

Open
benignbala wants to merge 4 commits into
Debian:masterfrom
benignbala:feat/add-modver-to-pkg-names
Open

Append module version to package names#325
benignbala wants to merge 4 commits into
Debian:masterfrom
benignbala:feat/add-modver-to-pkg-names

Conversation

@benignbala

Copy link
Copy Markdown

This change adds the version names to source and the -dev binary package when generating a new package configuration. This change gets the module information from just the argument passed to dh-make-golang

This change adds the version names to source and the -dev binary package when
generating a new package configuration. This change gets the module information
from just the argument passed to dh-make-golang
@benignbala
benignbala marked this pull request as draft August 11, 2026 17:24
* The src and binary packges now have the `-vxx` version embedded
* Moved away from the now deprecated golang.org/x/tools/vcs to a local implementation
* Update tests for the same
@benignbala
benignbala marked this pull request as ready for review August 15, 2026 07:26
@jas4711

jas4711 commented Aug 15, 2026

Copy link
Copy Markdown

I didn't test the actual commit here, but I believe this is the right conceptually thing to do: using versioned Debian source package names avoids all the hassles with major API transitions.

Comment thread make.go Outdated
return ""
}

var versionSuffixRegExp = regexp.MustCompile(`^v[2-9][0-9]*$`)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this is not completely correct. The regex does not match versions which start with a "1", e. g. from 10 to 19, like v10 or later v127, v1827 (if those get released ...).

So I think the correct regex should be this:

regexp.MustCompile(`^v[0-9]+$`)

In order to not match v0 and v1, you need to check against those two versions specifically before checking with the rexex:

if suffix == "v0" || suffix == "v1" {
	return ""
}

it would be good to include tests for this, see my second comment.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks @toddy15 - Sorry about that. It is a bad oversight from my side. Will fix that and add tests as suggested.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great, thanks! And one more nitpick: could you please run go fmt on your PR? Otherwise, the CI tests fail immediately.

Comment thread make_test.go
{"git.sr.ht/~sircmpwn/getopt", typeGuess, "", "golang-sourcehut-sircmpwn-getopt"},
{"golang.org/x/term", typeLibrary, "", "golang-golang-x-term"},
{"github.com/cli/cli", typeProgram, "gh", "gh"},
{"github.com/Debian/test-pkg/v2", typeLibrary, "", "golang-github-debian-test-pkg-v2"},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please add more tests for the version matching, see comment above. Possible tests:

{"github.com/Debian/test-pkg/v0", typeLibrary, "", "golang-github-debian-test-pkg"},
{"github.com/Debian/test-pkg/v1", typeLibrary, "", "golang-github-debian-test-pkg"},
{"github.com/Debian/test-pkg/v15", typeLibrary, "", "golang-github-debian-test-pkg-v15"},
{"github.com/Debian/test-pkg/v37", typeLibrary, "", "golang-github-debian-test-pkg-v37"},

This change removes the extractModMajorVersion func and makes the check
part of the debian name derivation from Go package name.
@benignbala

Copy link
Copy Markdown
Author

The CI is failing in the deb install step. GitHub has had CI/CD outages regularly this week. Would it be ok to retrigger it please @toddy15 ? Thanks

@toddy15

toddy15 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

@benignbala Sure, done now.

@benignbala

Copy link
Copy Markdown
Author

Thanks, @toddy15. The CI/CD checks are passing. Do I create a new PR for the other changes from the DebConf wiki page?

@benignbala

Copy link
Copy Markdown
Author

@toddy15 - What are the next steps in this? As I am new to this, I could be missing something and hence asking. Thanks

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.

3 participants