zig/lib/std
Ryan Liptak 3f7166eb8b child_process: Fix regression on Windows for FAT filesystems
This fixes a regression caused by https://github.com/ziglang/zig/pull/13993

As an optimization, the first call to `NtQueryDirectoryFile` would only ask for a single result and assume that if the result returned did not match the app_name exactly, then the unappended app_name did not exist. However, this relied on the assumption that the unappended app_name would always be returned first, but that only seems to be the case on NTFS. On FAT filesystems, the order of returned files can be different, which meant that it could assume the unappended file doesn't exist when it actually does.

This commit fixes that by fully iterating the wildcard matches via `NtQueryDirectoryFile` and taking note of any unappended/PATHEXT-appended filenames it finds. In practice, this strategy does not introduce a speed regression compared to the previous (buggy) implementation.

Benchmark 1 (10 runs): winpathbench-master.exe
  measurement          mean ± σ            min … max           outliers         delta
  wall_time           508ms ± 4.08ms     502ms …  517ms          1 (10%)        0%
  peak_rss           3.62MB ± 2.76KB    3.62MB … 3.63MB          0 ( 0%)        0%
Benchmark 2 (10 runs): winpathbench-fat32-fix.exe
  measurement          mean ± σ            min … max           outliers         delta
  wall_time           500ms ± 21.4ms     480ms …  535ms          0 ( 0%)          -  1.5% ±  2.8%
  peak_rss           3.62MB ± 2.76KB    3.62MB … 3.63MB          0 ( 0%)          -  0.0% ±  0.1%

---

Partially addresses #16374 (it fixes `zig build` on FAT32 when no `zig-cache` is present)
2023-07-23 19:09:20 -07:00
..
atomic all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
Build move installation logic to the build script where it belongs 2023-07-22 00:16:27 -07:00
c darwin: update mcontext_t definition for aarch64 to add neon state 2023-07-20 22:58:14 -04:00
compress all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
crypto Be more conservative in the description of Aegis256Mac (#16452) 2023-07-19 23:59:24 +00:00
dwarf dwarf: implement aarch64 default register rules 2023-07-20 22:58:16 -04:00
event all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
fmt reduce AstGen.numberLiteral stack usage 2023-07-20 12:51:18 -07:00
fs Consolidate 'delete a read-only file on windows' test cases 2023-07-23 01:26:26 -07:00
hash all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
heap std: fix doc comment of GPA deinit 2023-07-03 01:14:20 -07:00
http Fix the http.Server test and add it to the set of tests in http.zig 2023-07-23 13:58:34 -07:00
io Merge pull request #15879 from r00ster91/more_stage1_test_coverage 2023-07-03 15:59:54 -07:00
json std.json: support parsing json at comptime using FixedBufferAllocator (#16488) 2023-07-22 18:52:26 -04:00
math std.math.big.int: better name for equal function 2023-07-03 11:00:13 -07:00
mem Optimize Allocator functions to create less duplicate code for similar types (#16332) 2023-07-06 14:41:49 -04:00
meta all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
net
os child_process: Fix regression on Windows for FAT filesystems 2023-07-23 19:09:20 -07:00
rand is has -> has 2023-06-25 23:30:25 -07:00
sort improve documentation of std.sort.*Context functions (#16145) 2023-06-27 00:51:06 -07:00
target all: zig fmt and rename "@XToY" to "@YFromX" 2023-06-19 12:34:42 -07:00
testing all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
Thread std: implement detach for WASI-threads 2023-06-26 20:00:58 +02:00
time all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
tz
unicode all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
valgrind all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
zig std.zig.Parse: Fix assertion (#16500) 2023-07-23 20:18:02 -04:00
array_hash_map.zig compiler: rework inferred error sets 2023-07-18 19:02:05 -07:00
array_list.zig std: reword some comments 2023-07-16 18:32:52 -07:00
ascii.zig migration: std.math.{min, min3, max, max3} -> @min & @max 2023-06-16 13:44:09 -07:00
atomic.zig
base64.zig all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
bit_set.zig all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
BitStack.zig std.json: Unify stringify and writeStream (#16405) 2023-07-21 19:56:46 -04:00
bounded_array.zig Smaller memory footprint for BoundedArray (#16299) 2023-07-03 13:58:03 -04:00
buf_map.zig
buf_set.zig
Build.zig Build: make InstallDirStep use a FileSource 2023-06-26 15:59:53 -07:00
builtin.zig Merge pull request #15775 from r00ster91/newlines 2023-07-11 23:06:12 -07:00
c.zig c: fixup getcontext 2023-07-20 22:58:14 -04:00
child_process.zig child_process: Fix regression on Windows for FAT filesystems 2023-07-23 19:09:20 -07:00
coff.zig dwarf: fixup integer overflow in readEhPointer 2023-07-20 22:58:16 -04:00
compress.zig
comptime_string_map.zig std.sort.block: add safety check for lessThan return value 2023-06-26 17:50:10 -07:00
crypto.zig std.crypto.ff - Alloc-free, constant-time field arithmetic for crypto (#15795) 2023-05-22 16:11:06 +02:00
cstr.zig std.cstr: deprecate namespace 2023-06-25 14:51:03 -07:00
debug.zig dwarf: move macho unwind code from macho -> dwarf 2023-07-20 22:58:16 -04:00
dwarf.zig dwarf: move macho unwind code from macho -> dwarf 2023-07-20 22:58:16 -04:00
dynamic_library.zig all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
elf.zig debug: support loading elf debug info from external files 2023-07-20 22:58:12 -04:00
enums.zig std.sort.block: add safety check for lessThan return value 2023-06-26 17:50:10 -07:00
event.zig
fifo.zig migration: std.math.{min, min3, max, max3} -> @min & @max 2023-06-16 13:44:09 -07:00
fmt.zig all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
fs.zig all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
hash.zig add std.hash.uint32 2023-06-10 20:42:30 -07:00
hash_map.zig std.hash_map: Fix casing of keyPtr variables 2023-07-20 12:52:05 -07:00
heap.zig std.json: support parsing json at comptime using FixedBufferAllocator (#16488) 2023-07-22 18:52:26 -04:00
http.zig Fix the http.Server test and add it to the set of tests in http.zig 2023-07-23 13:58:34 -07:00
Ini.zig
io.zig all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
json.zig std.json: Unify stringify and writeStream (#16405) 2023-07-21 19:56:46 -04:00
leb128.zig all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
linked_list.zig SinglyLinkedList: rename invert -> reverse 2023-07-15 21:37:54 -07:00
log.zig all: zig fmt and rename "@XToY" to "@YFromX" 2023-06-19 12:34:42 -07:00
macho.zig dwarf: move macho unwind code from macho -> dwarf 2023-07-20 22:58:16 -04:00
math.zig Remove len parameter from splat in standard lib 2023-07-12 15:35:57 -07:00
mem.zig Remove len parameter from splat in standard lib 2023-07-12 15:35:57 -07:00
meta.zig Remove len parameter from splat in standard lib 2023-07-12 15:35:57 -07:00
multi_array_list.zig Add more sorting functions to MultiArrayList (#16377) 2023-07-11 06:37:51 +00:00
net.zig Unrevert "Sema: preserve extern struct field alignment" 2023-06-30 23:24:52 -04:00
once.zig
os.zig getenv: remove unnessary small key block 2023-07-18 11:44:23 +02:00
packed_int_array.zig all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
pdb.zig std.pdb: fix incorrect field alignment in ptrCast 2023-06-30 23:23:03 -04:00
priority_dequeue.zig [priority_dequeue] Fix out-of-bounds access 2023-06-22 02:03:53 -07:00
priority_queue.zig
process.zig all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
Progress.zig all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
rand.zig all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
RingBuffer.zig all: zig fmt and rename "@XToY" to "@YFromX" 2023-06-19 12:34:42 -07:00
segmented_list.zig all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
SemanticVersion.zig std: replace builtin.Version with SemanticVersion 2023-06-17 13:17:34 -07:00
simd.zig Remove len parameter from splat in standard lib 2023-07-12 15:35:57 -07:00
sort.zig improve documentation of std.sort.*Context functions (#16145) 2023-06-27 00:51:06 -07:00
start.zig all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
start_windows_tls.zig all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
std.zig std.json: Unify stringify and writeStream (#16405) 2023-07-21 19:56:46 -04:00
tar.zig all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
target.zig llvm: fix various crashes 2023-07-19 23:38:40 -04:00
testing.zig Remove len parameter from splat in standard lib 2023-07-12 15:35:57 -07:00
Thread.zig default to single-threaded for WebAssembly 2023-06-26 20:00:58 +02:00
time.zig implement std.time.sleep for uefi 2023-07-07 11:57:09 -07:00
treap.zig all: zig fmt and rename "@XToY" to "@YFromX" 2023-06-19 12:34:42 -07:00
tz.zig all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
unicode.zig all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
Uri.zig std.Uri: allow getting the mutable result from (un)escape 2023-06-26 15:46:04 +03:00
valgrind.zig all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
wasm.zig all: zig fmt and rename "@XToY" to "@YFromX" 2023-06-19 12:34:42 -07:00
zig.zig all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00