21066 Commits

Author SHA1 Message Date
Andrew Kelley
bcc2fb66f3 std.debug: disable sporadically failing test
see tracking issue #13963
2023-01-09 15:05:51 -07:00
IntegratedQuantum
d6faa4e868 Fix tautological big_int tests. 2023-01-09 15:04:55 -07:00
Frechdachs
f8ea292d09 std: Fix update() method in PriorityQueue and PriorityDequeue (#13908)
Previously the update() method would iterate over its capacity, which may contain uninitialized memory or already removed elements.
2023-01-09 15:04:28 -07:00
Tom Maenan Read Cutting
b5222f86ee Add 0-length buffer checks to os.read & os.write
This helps prevent errors related to undefined pointers being passed
through to some OS apis when slices have 0 length.

Tests have also been added to catch these cases.
2023-01-09 15:04:10 -07:00
fsh
7d0d99aac0 std: fix bug in Pcg32 fill function (#13894)
The PCG32 fill function seems to have been copy-pasted from code using u64, so requesting `n` bytes where `(n & 7) > 4` bytes would cause the last few bytes to be all 0.
2023-01-09 15:04:04 -07:00
Jan Philipp Hafer
cdcb746cc2 std.os.linux: fix timerfd test
Remove timerfd timeout and fix timerfd_settime flag.
CI tests should not rely on timings to succeed.

Closes #13721.
2023-01-09 15:03:40 -07:00
Jakub Konka
3e2ddbfdd7 Remove incorrect assertion in readMachODebugInfo panicking during panic
This fixes a class of bugs on macOS where a segfault happening in
a loaded dylib with no debug info would cause a panic in the panic
handler instead of simply noting that the dylib has no valid debug
info via `error.MissingDebugInfo`. An example could be code linking
some system dylib and causing some routine to segfault on say invalid
pointer value, which should normally cause Zig to print an incomplete
stack trace anchored at the currently loaded image and backtrace all
the way back to the Zig binary with valid debug info. Currently, in
a situation like this we would trigger a panic within a panic.
2023-01-09 15:03:16 -07:00
Takeshi Yoneda
6f39ce93ce wasi: fixes os.isatty on type mismatch (#13813) 2023-01-09 15:03:00 -07:00
Andrew Kelley
07f6fc3000 Compilation: revert asking for exclusive locks on cache hits
We definitely want a shared lock on a cache hit. Without this, we get a
deadlock when Zig is asked to compile the same C source file multiple
times as part of the same compilation.

This is a partial revert of 8ccb9a6ad327a4d7fbc321b33d4aa66a27a1f5ee.

cc @kcbanner
2023-01-09 15:02:38 -07:00
Casey Banner
a4418a8fd6 cache: Fix LockViolation during C compilation paths (#13591)
- C compilation flows didn't hold an exclusive lock on the cache manifest file when writing to it in all cases
- On windows, explicitly unlock the file lock before closing it
2023-01-09 15:00:03 -07:00
Andrew Kelley
bb957a976d Sema: resolve elem type for non-default aligned ptrs
Before this commit, I observe a crash from this abiSize call because the
element type is a struct that is not yet resolved. This is triggered by
running the behavior tests with -ofmt=c -target x86_64-windows.
2023-01-09 14:59:28 -07:00
Andrew Kelley
f8f65aebe6 zig cc: fix wrong flag name from earlier commit
In dfe942024461a3598fc872ea79e7859a8744b550, I made a typo. This commit
corrects it. I tested this commit via a patch to zig-bootstrap.
2023-01-09 14:59:19 -07:00
Andrew Kelley
3bc70ea2dd compiler_rt: avoid using weak aliases
This is a partial revert of 0d533433e21621177fb291e2a4901bee11834501,
which regressed this behavior. The idea here is to avoid aliases, which
happens when the same function is exported with multiple names. The
problem with aliases is that weak aliases don't seem to work, causing
symbol collisions when multiple of the same symbol are provided, despite
the desired behavior that weak symbols are overridden.

In this case we export redundant functions with different names. Thanks
to -ffunction-sections, the unused functions will be garbage-collected
at link time. This leaves us with the best of both worlds: Zig's
compiler-rt will provide both sets of symbols, and it will be
binary-compatible with different compilers that expect different names,
while still resulting in binaries without garbage.
2023-01-09 14:58:38 -07:00
Andrew Kelley
9067daeb94 zig cc: support -stack in addition to --stack for linker arg 2023-01-09 14:58:22 -07:00
Andrew Kelley
290874a24e CI: adjust logic for cancelling workflows
This prevents clobbering when two contributors' PRs have the same head
ref.
2023-01-09 14:58:07 -07:00
nc
033dcf7811 std.atomic.Queue: fix unget implementation and add doc 2023-01-09 14:57:56 -07:00
Andrew Kelley
39c3889df1 CI: use cache directories local to the CI run
Override the cache directories because they won't actually help other CI
runs which will be testing alternate versions of zig, and ultimately
would just fill up space on the hard drive for no reason.

In practice we did see one of the CI servers fill up too many files
inside ~/.cache/zig, which caused certain file system operations to
start returning ENOSPC, despite the hard drive having plenty of space
left.
2023-01-09 14:57:31 -07:00
Veikka Tuominen
594158a692 Merge pull request #13142 from mllken/gzip-safety
gzip: add missing header fields and bounds for header parsing
2023-01-09 14:57:23 -07:00
Andrew Kelley
af958e95cc Merge pull request #13744 from Vexu/stage2-fixes
Improve error messages, fix dependency loops
2023-01-09 14:55:12 -07:00
Andrew Kelley
fd57487e35 CI: update tarballs to 0.11.0-dev.448+e6e459e9e
Notably this contains a fix to zig cc that enables the syntax
`-Wl,-z,stack-size=0x10000`.
2023-01-09 14:54:01 -07:00
Andrew Kelley
5fc7424a8d zig cc: detect -z stack-size arguments 2023-01-09 14:53:42 -07:00
Jakub Konka
ffb27a8bd0 Merge pull request #13725 from mathetake/fixreaddir
wasi: fixes IterableDir.nextWasi for large directory
2023-01-09 14:52:57 -07:00
Andrew Kelley
be5b1ab7ed Merge branch 'ci-add-debug-aarch64-linux' 2023-01-09 14:52:42 -07:00
Jacob Young
6e30359894 zig.h: fix disastrous typo 2023-01-09 14:52:21 -07:00
Andrew Kelley
77c583b4c9 std.os.test: disable flaky timerfd test
See tracking issue #13721
2023-01-09 14:51:55 -07:00
Andrew Kelley
fb7ca1ad48 Sema: fix merge conflict regarding identifiers matching primitives 2023-01-09 14:51:03 -07:00
Veikka Tuominen
aa7e65d5ba Merge pull request #13719 from Vexu/debug
Improve debuggability of programs built by the self hosted compiler
2023-01-09 14:48:00 -07:00
Andrew Kelley
c2ad78922a std.os.windows.ReadLink: add missing alignment of local data buffer 2023-01-09 14:47:00 -07:00
Andrew Kelley
9d214f6f9d LLVM: fix canElideLoad behavior with loops
closes #13546
2023-01-09 14:46:40 -07:00
Jakub Konka
3b892f4316 libstd: skip problematic tests on aarch64-windows 2023-01-09 14:46:14 -07:00
Jakub Konka
fa30458e84 Merge pull request #13701 from ziglang/arm-win-more-features
Improve aarch64 feature detection based on the readouts from privileged system registers
2023-01-09 14:46:09 -07:00
Jakub Konka
0313426ce8 Merge pull request #13625 from kcbanner/windows_disable_symlink_tests
Skip linker tests requiring symlinks on Windows
2023-01-09 14:45:49 -07:00
Jakub Konka
970b7efec7 aarch64-windows: skip failing standalone tests 2023-01-09 14:45:40 -07:00
Jakub Konka
282c54a9c9 aarch64-windows: skip failing align behavior test 2023-01-09 14:45:26 -07:00
Jakub Konka
1f61a00a41 Merge pull request #13659 from ziglang/arm-win-cpu-features
windows: add native CPU and features detection for Armv8 chips
2023-01-09 14:45:21 -07:00
Veikka Tuominen
3357425b87 llvm: improve emitted debug info
* ensure parameter debug info is in the subroutine di scope
* slit sub file path into basename and dirname

Closes #12257
Closes #12665
2023-01-09 14:44:53 -07:00
Ryan Liptak
5404d06ea9 os.windows.OpenFile: Add USER_MAPPED_FILE as a possible error
Ran into this when using a program that uses CreateFileMapping and then trying to call `std.fs.createFile` on the mapped file. More info can be found here:

https://stackoverflow.com/questions/41844842/when-error-1224-error-user-mapped-file-occurs

Before:

```
error.Unexpected NTSTATUS=0xc0000243
C:\Users\Ryan\Programming\Zig\zig\lib\std\os\windows.zig:138:40: 0x7ff74e957466 in OpenFile (test.exe.obj)
        else => return unexpectedStatus(rc),
                                       ^
```

After:

```
FAIL (AccessDenied)
C:\Users\Ryan\Programming\Zig\zig\lib\std\os\windows.zig:137:30: 0x7ff7f5b776ea in OpenFile (test.exe.obj)
        .USER_MAPPED_FILE => return error.AccessDenied,
                             ^
```
2023-01-09 14:44:34 -07:00
zooster
f986cb1f90 std.Thread.Futex.PosixImpl.Address.from: fix alignment type
Fixes #13673
2023-01-09 14:44:14 -07:00
Jacob Young
2f11de4f51 std.big.int.Mutable: fix set(@as(DoubleLimb, 0))
Previously, this would set len to 1 but fail to initialize any limbs.
2023-01-09 14:44:09 -07:00
notcancername
e5d76176b9 document std.heap.StackFallbackAllocator 2023-01-09 14:44:05 -07:00
Igor Anić
76c729c967 stdlib: remove flaky test
fixes ziglang#13660
2023-01-09 14:43:43 -07:00
Andrew Kelley
82b8689122 CI: move some stuff to the website repo 2023-01-09 14:43:38 -07:00
Andrew Kelley
d824471489 disable spuriously failing std lib test case
see tracking issue #13660
2023-01-09 14:43:33 -07:00
Cody Tapscott
fff7f15fb8 std.os: Fix std.os.chdir for WASI
Test coverage was lacking for chdir() on WASI, allowing this to
regress.

This change makes os.chdir() compile again, and improves the test
logic to use our standard CWD support for WASI.
2023-01-09 14:43:29 -07:00
Veikka Tuominen
b75197ef88 Merge pull request #13637 from Vexu/stage2-fixes
Stage2 bug fixes
2023-01-09 14:42:52 -07:00
Matt Chudleigh
ddfcf0246e Bug fix: Prevent uninitialized parse nodes
If a parse node is reserved but never set the node remains
uninitialized and can crash tools doing a linear scan of the nodes
(like ZLS) when switching on the tag.
2023-01-09 14:42:42 -07:00
Loris Cro
c4cac21b72 ci: remove manual run feature 2023-01-09 14:42:29 -07:00
Loris Cro
1d34eafe6c ci: windows: fetch before checking out specific commit 2023-01-09 14:42:26 -07:00
Loris Cro
71355ef0e2 ci: windows: unshallow repository before checking specific commit 2023-01-09 14:42:22 -07:00
Loris Cro
a6e7c43136 ci: give name to manually run workflows 2023-01-09 14:42:19 -07:00