Skip to content

Conversation

@bk2204
Copy link
Member

@bk2204 bk2204 commented Mar 20, 2023

As some have recently noticed, our Windows CI has been broken due to the t/t-track.sh test failing, which has been caused by a change to our CI in Go 1.20 wherein it always “helpfully” includes a dot component for relative paths with no other directory. This is not very helpful in our case, and patch 2 here fixes that problem.

Patch 3 also fixes a problem that had gone unnoticed by our testsuite but that is related.

As usual, these commits all have their own reasonable commit messages and explain independently why they're valuable.

bk2204 added 2 commits March 20, 2023 19:37
Right now, we have a function which can trim the relative path prefix,
but that is only available in the `commands` package.  In the future,
we'll want to use it elsewhere as well, so let's move it somewhere more
accessible.
In Go 1.20, `filepath.Rel` always produces a path starting with `.` on
Windows if the path is relative to the current directory.  While this is
valid, it's not helpful, because we want to trim off the leading
directory portion leaving us with a bare relative path.  If we accepted
this behaviour, we'd break our checking for already-present patterns in
`git lfs track`, and more importantly, we wouldn't recognize raw
patterns wherever they are in the tree, since we'd falsely believe that
those patterns were specified with a leading dot.

To fix this, always trim the current directory prefix from our relative
directory and explicitly check for `.` and turn it into an empty string.
Abuchtela referenced this pull request Mar 21, 2023
`cinst` is deprecated in favour of `choco install`.  Convert our CI
system and release process to the new form and move the `-y` to its
proper place before the package name for better compatibility.
When we compare a pattern path with the version in the `.gitattributes`
file, use slashes, since that's what the pattern in the file will be
using.  To do so, use the `path` module, not `filepath`, the latter of
which uses the OS's path separators, which on Windows is backslashes.
@bk2204 bk2204 force-pushed the windows-ci-relative-path branch from 643cb7b to 34c680b Compare March 22, 2023 19:54
@bk2204 bk2204 marked this pull request as ready for review March 23, 2023 12:41
@bk2204 bk2204 requested a review from a team as a code owner March 23, 2023 12:41
Copy link
Member

@chrisd8088 chrisd8088 left a comment

Choose a reason for hiding this comment

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

Great detective work, thank you!

@bk2204 bk2204 merged commit 7a4005c into git-lfs:main Mar 23, 2023
@bk2204 bk2204 deleted the windows-ci-relative-path branch March 23, 2023 16:51
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.

2 participants