-
Notifications
You must be signed in to change notification settings - Fork 82
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
Fix go mod publishing #185
Conversation
@@ -55,30 +55,46 @@ func updateGomodWithTaggedDependencies(tag string, depsRepo []string) (bool, err | |||
rev := commit.String() | |||
pseudoVersion := fmt.Sprintf("v0.0.0-%s-%s", commitTime.UTC().Format("20060102150405"), rev[:12]) | |||
|
|||
downloadCommand := exec.Command("go", "mod", "download") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will this always pick the right go version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not always, but it could if the pseudo version doesn't change. Added a comment.
/cc @liggitt |
The zip file created by go mod download has extra normalization over the zip file created by git archive. The normalization process is done below. While the normalization can also be achieved via a simple zip command, the zip file created by go mod download has the `00-00-1980 00:00` timestamp in the file header for all files in the zip archive. This is not a valid UNIX timestamp and cannot be set easily. This is, however, valid in MSDOS. The `archive/zip` package uses the MSDOS version so we create the zip file using this package.
@@ -193,11 +193,6 @@ func main() { | |||
continue | |||
} | |||
|
|||
// temporarily publish only alpha tags | |||
if !strings.Contains(bName, "alpha") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the alpha tags restriction. PTAL.
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nikhita, sttts The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold cancel |
This PR has the following changes:
exec.Command
.go mod download
before packaging up a dependency and before updating the require and replace directives. This will help in avoiding packaging up, when the pseudo version is the same but we don't have it in the local cache.gomod-zip
for creating the zip file that would have the same hash as that of the zip file if it were downloaded bygo mod download
. The zip file created by gomod differs from the former:-x
and-D
options.00-00-1980 00:00
timestamp in the file header for all files in the zip archive. This is not a valid UNIX timestamp and cannot be set easily. This is, however, valid in MSDOS. Thearchive/zip
package uses the MSDOS version so we create the zip file using this package.git archive
: go uses this.archive/zip
package to re-create the zip file from that created usinggit archive
.For the record: we had to do a
GO111MODULE=on go mod clean -modcache
first to clear the old zip files in our cache. Did this throughkubectl exec
, not using this PR.For additional context, this slack thread has more details.
/hold
doesn't fix the error yet, but I figured I'll open a PR to get my latest changes in