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

Fix checkout behavior and FileVersion #3337

Merged
merged 1 commit into from
Oct 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Run
uses: docker/bake-action@v1
Expand Down
2 changes: 1 addition & 1 deletion scripts/build/mkversioninfo
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ cat > ./cli/winresources/versioninfo.json <<EOL
"Comments": "",
"CompanyName": "${COMPANY_NAME}",
"FileDescription": "Docker Client",
"FileVersion": "${VERSION_QUAD}",
"FileVersion": "${VERSION}",
Copy link
Member

Choose a reason for hiding this comment

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

Given that this previously used VERSION_QUAD, is this field expected to be SemVer(ish)? If so, this will break if our CalVer version has a leading 0 (19.03.9, e.g.)

Copy link
Member

Choose a reason for hiding this comment

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

from https://docs.microsoft.com/en-us/windows/win32/menurc/versioninfo-resource

FILEVERSION

Binary version number for the file. The version consists of two 32-bit integers, defined by four 16-bit integers. For example, "FILEVERSION 3,10,0,61" is translated into two doublewords: 0x0003000a and 0x0000003d, in that order. Therefore, if version is defined by the DWORD values dw1 and dw2, they need to appear in the FILEVERSION statement as follows: HIWORD(dw1), LOWORD(dw1), HIWORD(dw2), LOWORD(dw2).

PRODUCTVERSION

Binary version number for the product with which the file is distributed. The version parameter is two 32-bit integers, defined by four 16-bit integers. For more information about version, see the FILEVERSION description.

Copy link
Member

Choose a reason for hiding this comment

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

Further down, the description is different (sigh)

FileVersion
Version number of the file for example, "3.10" or "5.00.RC2". This string is required.

ProductVersion
Version of the product with which the file is distributed?for example, "3.10" or "5.00.RC2". This string is required

Copy link
Member Author

@crazy-max crazy-max Oct 12, 2021

Choose a reason for hiding this comment

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

Further down, the description is different (sigh)

Yeah can be misleading, VERSIONINFO.FILEVERSION != StringFileInfo.FileVersion. In our case:

VERSIONINFO.FILEVERSION = goversioninfo FixedFileInfo.FileVersion

"FixedFileInfo":
  {
    "FileVersion": {
      "Major": $(echo "$VERSION_QUAD" | cut -d. -f1),
      "Minor": $(echo "$VERSION_QUAD" | cut -d. -f2),
      "Patch": $(echo "$VERSION_QUAD" | cut -d. -f3),
      "Build": $(echo "$VERSION_QUAD" | cut -d. -f4)
    },
  }

StringFileInfo.FileVersion = goversioninfo StringFileInfo.FileVersion

"StringFileInfo":
  {
    "FileVersion": "${VERSION}",
  }

Copy link
Member

Choose a reason for hiding this comment

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

Argh.. yes, that's confusing, thanks!

"InternalName": "",
"LegalCopyright": "Copyright © 2015-$(date +'%Y') Docker Inc.",
"LegalTrademarks": "",
Expand Down