Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[11:10] "hmm, let's stop procrastinating and add the
Path::glob()
, finally, can't be that hard"[21:25] WHERE IS MY FLAMETHROWER
When I hit a bug in musl, which is used by Emscripten, I thought "okay fine, one minor wart, easy to workaround". When I hit another bug in an older version of musl, used by older Emscripten, which was impossible to workaround, I said "fine, let's just XFAIL this case". When I subsequently discovered that Windows conflates the error for "directory doesn't exist" and "no matching files found in said directory" I was a bit shaken already, but still managed to invent a workaround that isn't too complex.
But when I saw that the Windows CI is getting stuck on an ASSERT DIALOG BOX THAT I HAVE TO CLICK because I changed PluginManager to use
glob()
instead oflist()
+if(!filename.hasSuffix(ext)) continue;
, and the error was that it matched a*.modconf
instead of a*.mod
file (and gotta say, I was lucky to have that test case uncover this GIANT problem), I started getting furious. Then, I discovered this amazing answer, and thought "okay, silly defaults and over-the-top backwards compatibility, I can understand".Implemented, pushed ...and nothing changed. The reduced repro case matching
*.txt
files still matched also*.txtlol
. Ultimately, what made me snap, was this post from Raymond Chen. YES, AMAZING JOB EXPLAINING HOW YOU "CAN'T" OR "IMPOSSIBLE" OR "OUT OF QUESTION". IT'S BEEN 17 YEARS SINCE THAT POST, WHY DOES IT TAKE SO DAMN LONG TO ADD ONE MORE FLAG TO FIX THIS?! TheFindFirstFileEx()
has so many possible extension points it makes me sweat, and yet there's still this damn issue where*.xls
matches also*.xlsx
,*.dat
also*.data
, THE WHOLE WORLD SUFFERS and you do nothing!!So, since this is impossible, other options:
FindFirstFileEx()
call because it does not add any value*.docx
,*.xlsx
, ...). Am I Microsoft? No I'm not!fnmatch()
, on Windows there seems to be ... PathMatchSpecEx that I could use as a post-glob filter? "Nice?" I even forgot such word existed.list()
usingglob()
on Windows, revert thatBulldog.dll
that a*.dll
query cannot find it?! Figure out and fix. I hope it's something silly and not the damn glob not returning files it should besides returning files it shouldn't, because then it would be really crappy.path/to/symlinked-dir/../*.txt
may look somewhere entirely different thanpath/to/
Path::normalize()
and/orPath::realPath()