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

Makefile,*: use tailscale.com/cmd/mkversion #546

Merged
merged 1 commit into from
Oct 31, 2024
Merged

Makefile,*: use tailscale.com/cmd/mkversion #546

merged 1 commit into from
Oct 31, 2024

Conversation

raggi
Copy link
Member

@raggi raggi commented Oct 18, 2024

We've suffered misalignment in versioning and toolchain usage due to the
shell invocations downstream of ./version/tailscale-version.sh, but also
the whole version data scheme in the Makefile was quite complicated, and
required synchronization in the build.grade.

  • Makfile no longer needs to be version aware itself.
  • A Makefile target tailscale.version refreshes a local cached output
    from tailscale.com/cmd/mkversion which is updated when go.mod / go.sum
    change.
  • build.gradle loads tailscale.version to get the version string.
  • ldflags are produced from tailscale.version via version-ldflags.sh

Updates tailscale/tailscale#13850

@raggi raggi force-pushed the raggi/versioning branch 3 times, most recently from 29cc00f to e2b3b51 Compare October 18, 2024 20:29
@@ -38,3 +38,5 @@ tailscale.jks
libtailscale.aar
libtailscale-sources.jar
.DS_Store

tailscale.version
Copy link
Member

Choose a reason for hiding this comment

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

I thought we were going to check this file in to the repo? Or did you not git add it?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was hoping to, but as it contains the local git sha as well, that would get stale, so I wanted to reduce the possibility of the file not being updated and the stale version information being included.

Comment on lines +131 to +132
$(shell ./tool/go run tailscale.com/cmd/mkversion > tailscale.version)

Copy link
Member

Choose a reason for hiding this comment

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

oh, so we're still doing the full git clone pain, just hidden behind this tool

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, at least we now are down to one implementation of that behavior though!

Copy link
Member

Choose a reason for hiding this comment

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

hah. lolsob.

Copy link
Member

@bradfitz bradfitz left a comment

Choose a reason for hiding this comment

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

Updates

You can use the F-Droid woes bug: tailscale/tailscale#13850

@raggi raggi force-pushed the raggi/versioning branch 2 times, most recently from 5bc9fc0 to 9a98b16 Compare October 18, 2024 21:08
@raggi raggi requested a review from bradfitz October 19, 2024 00:55
Makefile Outdated Show resolved Hide resolved
Comment on lines +131 to +132
$(shell ./tool/go run tailscale.com/cmd/mkversion > tailscale.version)

Copy link
Member

Choose a reason for hiding this comment

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

hah. lolsob.

@@ -38,7 +38,7 @@ android {
minSdkVersion 26
targetSdkVersion 34
versionCode 241
versionName "1.77.12-ta8f9c0d6e-g753b8d3fb4b"
versionName getVersionProperty("VERSION_LONG")
Copy link
Member

Choose a reason for hiding this comment

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

ooooh hell yeah

Comment on lines +186 to +194
def getVersionProperty(key) {
// tailscale.version is created / updated by the makefile, it is in a loosely
// Makfile/envfile format, which is also loosely a properties file format.
// make tailscale.version
def versionProps = new Properties()
versionProps.load(project.file('../tailscale.version').newDataInputStream())
return versionProps.getProperty(key).replaceAll('^\"|\"$', '')
}
Copy link
Member

Choose a reason for hiding this comment

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

groovy!

Makefile Show resolved Hide resolved
We've suffered misalignment in versioning and toolchain usage due to the
shell invocations downstream of ./version/tailscale-version.sh, but also
the whole version data scheme in the Makefile was quite complicated, and
required synchronization in the build.grade.

- Makfile no longer needs to be version aware itself.
- A Makefile target tailscale.version refreshes a local cached output
  from tailscale.com/cmd/mkversion which is updated when go.mod / go.sum
  change.
- build.gradle loads tailscale.version to get the version string.
- ldflags are produced from tailscale.version via version-ldflags.sh

Updates tailscale/tailscale#13850

Signed-off-by: James Tucker <[email protected]>
@raggi raggi merged commit e7325f7 into main Oct 31, 2024
4 checks passed
@raggi raggi deleted the raggi/versioning branch October 31, 2024 18:21
raggi added a commit that referenced this pull request Oct 31, 2024
The explicit target was removed during patch production, but the
dependency wasn't removed from the clean action.

Updates #546
Updates tailscale/tailscale#13850
raggi added a commit that referenced this pull request Oct 31, 2024
The explicit target was removed during patch production, but the
dependency wasn't removed from the clean action.

Updates #546
Updates tailscale/tailscale#13850
raggi added a commit that referenced this pull request Oct 31, 2024
The explicit target was removed during patch production, but the
dependency wasn't removed from the clean action.

Updates #546
Updates tailscale/tailscale#13850

Signed-off-by: James Tucker <[email protected]>
raggi added a commit that referenced this pull request Oct 31, 2024
The explicit target was removed during patch production, but the
dependency wasn't removed from the clean action.

Updates #546
Updates tailscale/tailscale#13850

Signed-off-by: James Tucker <[email protected]>
raggi added a commit that referenced this pull request Oct 31, 2024
The explicit target was removed during patch production, but the
dependency wasn't removed from the clean action.

Updates #546
Updates tailscale/tailscale#13850

Signed-off-by: James Tucker <[email protected]>
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