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

force date into a semver-compliant version #148

Merged
merged 1 commit into from
Jul 16, 2021

Conversation

jeremyd2019
Copy link
Member

The version with year-month-day was not passing a semver.valid check, and thus causing tool-cache to not find a previously-cached version. They really should fail when trying to cache an "invalid" version, if they're going to fail to find it later.

@jeremyd2019
Copy link
Member Author

I am testing this more in my fork now...

@jeremyd2019 jeremyd2019 marked this pull request as draft July 6, 2021 02:48
@jeremyd2019
Copy link
Member Author

jeremyd2019 commented Jul 6, 2021

Note further complicating testing is that my self-hosted runner is running Windows 10 20H2 ARM64, which cannot run x64 binaries. So I'm having to use my fork branch that installs 32-bit msys2. But, this version format seems to make it happy:

  ##[debug]isExplicit: 0.0.20210704
  ##[debug]explicit? true
  ##[debug]checking cache: C:\runner\_work\_tool\msys2-installer\0.0.20210704\x86
  ##[debug]Found tool in cache msys2-installer 0.0.20210704 x86

as opposed to:

  ##[debug]isExplicit: 
  ##[debug]explicit? false
  ##[debug]isExplicit: 
  ##[debug]explicit? false
  ##[debug]evaluating 0 versions
  ##[debug]match not found
  ##[debug]Downloading https://github.com/jeremyd2019/msys2-installer/releases/download//2021-07-04-build32/msys2-base-i686-20210704.sfx.exe

@jeremyd2019 jeremyd2019 marked this pull request as ready for review July 6, 2021 03:05
@lazka lazka merged commit 7a8c699 into msys2:master Jul 16, 2021
@@ -46,14 +46,15 @@ function parseInput() {
}

async function downloadInstaller() {
const inst_path = tc.find('msys2-installer', inst_version, 'x64');
const version = `0.0.${inst_version.replace(/-/g, '')}`
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the problem with the follwing?

const version = `${inst_version.replace(/-/g, '.')}`

Copy link
Member

Choose a reason for hiding this comment

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

Using the last part only makes the version incompatible to all other versions according to semver.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks! I will add a comment about it!

Copy link
Member

Choose a reason for hiding this comment

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

good idea. (though I don't know if anything does any semver related version comparison here, but that's one advantage I could think of)

Copy link
Member Author

Choose a reason for hiding this comment

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

what I was thinking is that if msys2 ever wanted to use 'real' versions, version numbers up to 2021 (or even newer) would be considered 'older' than version 1.0.

I do think there is some semver comparison going on in the tool-cache too.

@jeremyd2019 jeremyd2019 deleted the toolcache-installer branch July 16, 2021 20:18
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