Igor Anić
a3cf8ec71e
tar: add pax file reader tests
2024-01-13 19:37:33 -07:00
Igor Anić
7b0bbc680f
tar: add file mode to result of tarbal iteration
...
So we have information to set executable bit on write to file system.
2024-01-13 19:37:33 -07:00
Igor Anić
2a432d3008
tar: prefix test cases with 'tar'
...
To make it little easier to filter from all stdlib tests.
2024-01-13 19:37:33 -07:00
Igor Anić
2ed9a276a7
tar: use Go test cases path from env variable
...
Skip tests if env is not set.
2024-01-13 19:37:33 -07:00
Igor Anić
6bfa7bf197
tar: use scratch buffer for file names
...
That makes names strings stable during the iteration. Otherwise string
buffers can be overwritten while reading file content.
2024-01-13 19:37:33 -07:00
Igor Anić
6e7a39c935
tar: refactor reading pax attributes
2024-01-13 19:37:33 -07:00
Igor Anić
c761dfc176
tar: add gnu path and link extensions handling
2024-01-13 19:37:33 -07:00
Igor Anić
48b160c1bf
tar: handle pax null attrs and pax attr ending
2024-01-13 19:37:33 -07:00
Igor Anić
16c40fc471
tar: add header chksum checking
2024-01-13 19:37:33 -07:00
Igor Anić
169f28d3e6
tar: fix import path
2024-01-13 19:37:33 -07:00
Igor Anić
e1424b84b8
tar: add parsing size in gnu extended format
...
Reference:
https://www.gnu.org/software/tar/manual/html_node/Extensions.html#Extensions
If the leading byte is 0x80 (128), the non-leading bytes of the field
are concatenated in big-endian order, with the result being a positive
number expressed in binary form.
2024-01-13 19:37:33 -07:00
Igor Anić
6d5283e835
tar: refactor reader and iterator
...
Make it more readable.
2024-01-13 19:37:33 -07:00
Igor Anić
be5d04ab79
tar: add pax linkpath attribute parsing
...
Name of symbolic link can be also found in pax attribute.
2024-01-13 19:37:33 -07:00
Igor Anić
1817063375
tar: add initial test cases
...
Just adding tests, without changing functionality.
2024-01-13 19:37:33 -07:00
Igor Anić
4381241237
tar: refactor Buffer
...
Move reader into Buffer and make it BufferedReader. This doesn't
introduce any new functionality just grouping similar things.
2024-01-13 19:37:33 -07:00
Igor Anić
ff8544daa5
tar: refactor code to be more testable
...
Split reading/parsing tar file and writing results to the disk in two
separate steps. So we can later test parsing part without need to write
everyting to the disk.
2024-01-13 19:37:33 -07:00
Jacob Young
7916cf6f83
std.io.GenericReader: add missing error annotations
2024-01-13 13:16:51 -08:00
Chris Boesch
d8b5831dc4
Fixed verbatim copy of trailing '%' in unescapeStr
2024-01-12 16:20:44 -08:00
Meghan Denny
f49a8c5431
std: make c.versionCheck() a comptime-known function
2024-01-12 16:17:39 -08:00
Andrew Kelley
45ec851733
zig build: handle stderr more elegantly
...
* Specifically recognize stderr as a different concept than an error
message in Step results.
* Display it differently when only stderr occurs but the build proceeds
successfully.
closes #18473
2024-01-10 17:11:26 -08:00
Andrew Kelley
e025ad7b46
std.mem: fix simd.suggestVectorLength merge conflict
...
Commits
2f8e4347b1 and
6a32d58876 had a conflict that was
undetected by source control.
2024-01-09 18:20:53 -07:00
Veikka Tuominen
828d23956d
std.heap: add runtime safety for calling stackFallback(N).get multiple times
...
Closes #16344
2024-01-09 17:18:20 -08:00
Andrew Kelley
6a32d58876
Merge pull request #18318 from castholm/simd-segfault
...
Rename `simd.suggestVectorSize` to clarify intent and fix related segfault
2024-01-09 17:13:58 -08:00
Matthew Wozniak
aaf1e0b25b
add ability to open dlls with platform-specific flags ( #18370 )
2024-01-09 20:11:22 -05:00
Bogdan Romanyuk
4a1a5ee47b
AstGen: add error for redundant comptime var in comptime scope ( #18242 )
2024-01-09 20:09:39 -05:00
Andrew Kelley
157cdaee0e
Merge pull request #18498 from castholm/cpu-cortex-m-optional-deps
...
Don't enable optional ARM Cortex-M series CPU features by default
2024-01-09 17:08:08 -08:00
PauloCampana
fcc0c5ddc7
Add std.math.gamma and lgamma ( #18449 )
...
See #7212
2024-01-09 14:53:47 -08:00
Carl Åstholm
0cd508b09f
Re-run update_cpu_features (LLVM 17)
...
release/17.x branch, commit 8f4dd44097c9ae25dd203d5ac87f3b48f854bba8
(same as the previous run)
2024-01-09 17:53:43 +01:00
dhash
9bb6430318
Add support for --(no-)undefined-version
...
Co-authored-by: Motiejus Jakštys <motiejus@jakstys.lt >
Co-authored-by: Jakub Konka <kubkon@jakubkonka.com >
Co-authored-by: Samuel Cantero <scanterog@gmail.com >
Co-authored-by: Giorgos Georgiou <giorgos.georgiou@datadoghq.com >
Co-authored-by: Carl Åstholm <carl@astholm.se >
2024-01-09 17:24:11 +01:00
Andrew Kelley
60094cc3fc
Merge pull request #18491 from ziglang/fix-mod-link-obj-path
...
std.Build.Step.Compile: fix link object paths
2024-01-09 01:11:15 -08:00
joachimschmidt557
f12ec02bd7
stage2 AArch64: get empty file compiling again
2024-01-08 23:53:24 -08:00
David Rubin
2f8e4347b1
Optimized std.mem.eql with SIMD ( #18389 )
...
* optimized memeql
* add `sched_setaffinity` to `std.os.linux`
Co-authored-by: Protty <45520026+kprotty@users.noreply.github.com >
Co-authored-by: Ryan Liptak <squeek502@hotmail.com >
2024-01-09 02:50:22 -05:00
Andrew Kelley
cf5a5dc8b5
std.Build.Step.Compile: fix link object paths
...
They were being resolved relative to the wrong owner.
closes #18460
2024-01-08 18:24:14 -07:00
Andrew Kelley
deed19496a
Merge pull request #16650 from wooster0/hexdump
...
general-use std.debug.hexdump for printing hexdumps
2024-01-08 16:25:15 -08:00
Carl Åstholm
9c8c9b7cc8
Build: Use LazyPath for version scripts
2024-01-09 01:47:54 +02:00
Amir Alawi
4cbf74bd9b
fix std.fs.Dir.makePath silent failure ( #16878 )
...
std.fs.dir.makePath silently failed if one of the items in the path already exists. For example:
cwd.makePath("foo/bar/baz")
Silently failing is OK if "bar" is already a directory - this is the intended use of makePath (like mkdir -p). But if bar is a file then the subdirectory baz cannot be created - the end result is that makePath doesn't do anything which should be a detectable error because baz is never created.
The existing code had a TODO comment that did not specifically cover this error, but the solution for this silent failure also accomplishes the TODO task - the code now stats "foo" and returns an appropriate error. The new code also handles potential race condition if "bar" is deleted/permissions changed/etc in between the initial makeDir and statFile calls.
2024-01-08 15:58:14 -05:00
Andrew Kelley
25d2e7fce0
fixups from previous commit
...
* rename the functions
* make the other function public and give it a better name
* interact with stderr_mutex
* std lib test coverage
2024-01-08 00:21:57 -07:00
Wooster
ad7a09d95a
std.testing.expectEqualSlices: some improvements
...
This mainly replaces ChunkIterator with std.mem.window and also
prints \n, \r, \t using Unicode symbols instead of periods because
they're common non-printable characters.
This same code exists in std.debug.hexdump.
At some point maybe this code could be exposed through a public
function. Then we could reuse the code in both places.
2024-01-08 00:13:21 -07:00
Wooster
dfc4d618dd
general-use std.debug.hexdump for printing hexdumps
...
Recently, when I've been working with structures of data that is not
directly in RAM but rather laid out in bytes somewhere else,
it was always very useful to print out maybe the next 50 bytes or the
previous 50 bytes or so to see what's ahead or before me.
I would usually do this with a quick
`std.debug.print("{any}\n", .{bytes});` or something but the output is
not as nice obviously.
2024-01-08 00:13:06 -07:00
Andrew Kelley
3176fdc0b9
Merge pull request #18470 from castholm/typeInfo-sentinels
...
Make `@typeInfo` return null-terminated strings
2024-01-07 22:28:24 -08:00
Eric Eastwood
2115d7d1be
Add approxEqAbs support for comptime_float
2024-01-07 22:23:06 -08:00
Carl Åstholm
92458094c8
Fix failing type reifications
2024-01-07 16:27:50 +01:00
Carl Åstholm
c8fa767f08
Work around stage1 not yet returning null-terminated @typeInfo strings
...
These changes can be reverted the next time stage1 is updated.
2024-01-07 16:21:08 +01:00
Carl Åstholm
a02bd81760
Make @typeInfo return null-terminated strings
...
Changes the types of `std.builtin.Type` `name` fields from `[]const u8`
to `[:0]const u8`, which should make them easier to pass to C APIs
expecting null-terminated strings.
This will break code that reifies types using `[]const u8` strings, such
as code that uses `std.mem.tokenize()` to construct types from strings
at comptime. Luckily, the fix is simple: simply concatenate the
`[]const u8` string with an empty string literal (`name ++ ""`) to
explicitly coerce it to `[:0]const u8`.
Co-authored-by: Krzysztof Wolicki <der.teufel.mail@gmail.com >
2024-01-07 15:35:18 +01:00
Tristan Ross
22598ef35f
std.Build: pass code model in various compile steps
2024-01-06 18:33:24 -08:00
Andrew Kelley
282ff8d3bd
Merge pull request #18453 from squeek502/makepath-parent-components
...
Add more `Dir.makePath` tests and document how `..` is handled in sub_path
2024-01-06 16:47:39 -08:00
Ryan Liptak
51946f5adc
Dir.makePath: Document/test platform differences around .. component handling
...
Closes #18452
2024-01-05 17:56:31 -08:00
Pat Tullmann
9335529b9b
std.fs: Add several more tests for makePath.
2024-01-04 23:20:35 -08:00
Pat Tullmann
04ac028a2c
std.CompTimeStringMap*: support empty initialization list
...
Add tests for empty initialization, and some more corner cases (empty key,
very long key, duplicate keys).
Fixes #18212
2024-01-05 05:09:24 +02:00
Pat Tullmann
1564cb0ab9
std/fs/test.zig: Remove work-around for stat() failures on glibc
...
glibc variants now support the stat-family of calls correctly, so
this test is safe to include.
2024-01-04 17:12:07 -07:00