21262 Commits

Author SHA1 Message Date
Jakub Konka
f348fbc024 windows: revert changes to definition of HKEY 2022-11-28 17:07:34 +01:00
Jakub Konka
7473ef98e9 windows: implement simplistic CPU model parser 2022-11-28 17:07:34 +01:00
Jakub Konka
7ea2c7fbcd windows: use RtlQueryRegistryValues to query reg in a single syscall 2022-11-28 17:07:34 +01:00
Jakub Konka
153afed877 windows: impl some primitives for getting registry keys 2022-11-28 17:07:34 +01:00
Jakub Konka
e74b6f0a4b windows: detect couple more aarch64 CPU features 2022-11-28 17:07:34 +01:00
Jakub Konka
29aafdcd55 windows: detect native CPU features for aarch64 SoCs 2022-11-28 17:07:34 +01:00
Jakub Konka
6edf9127fe windows: add missing enum values for ProcessorFeatures enumeration 2022-11-28 17:07:34 +01:00
Jakub Konka
625415d738 windows: add zig impl of IsProcessorFeaturePresent syscall 2022-11-28 17:07:34 +01:00
Jakub Konka
1eac3c57ec windows: add processor feature enumeration 2022-11-28 17:07:33 +01:00
Jacob Young
d9a51648e6 std.big.int.Mutable: fix set(@as(DoubleLimb, 0))
Previously, this would set len to 1 but fail to initialize any limbs.
2022-11-28 07:40:09 -05:00
notcancername
f98aac9db4 document std.heap.StackFallbackAllocator 2022-11-28 14:31:57 +02:00
Andrew Kelley
3ae4931dc1 CLI: more careful resolution of paths
In general, we prefer compiler code to use relative paths based on open
directory handles because this is the most portable. However, sometimes
absolute paths are used, and sometimes relative paths are used that go
up a directory.

The recent improvements in 81d2135ca6ebd71b8c121a19957c8fbf7f87125b
regressed the use case when an absolute path is used for the zig lib
directory mixed with a relative path used for the root source file. This
could happen when, for example, running the standard library tests, like
this:

stage3/bin/zig test ../lib/std/std.zig

This happened because the zig lib dir was inferred to be an absolute
directory based on the zig executable directory, while the root source
file was detected as a relative path. There was no common prefix and so
it was not determined that the std.zig file was inside the lib
directory.

This commit adds a function for resolving paths that preserves relative
path names while allowing absolute paths, and converting relative
upwards paths (e.g. "../foo") to absolute paths. This restores the
previous functionality while remaining compatible with systems such as
WASI that cannot deal with absolute paths.
2022-11-28 01:23:39 -05:00
Frank Denis
7411be3c9e
std.crypto.edwards25519: add a rejectLowOrder() function (#13668)
Does what the name says: rejects generators of low-order groups.

`clearCofactor()` was previously used to do it, but for e.g.
cofactored signature verification, we don't need the result of an
actual multiplication. Only check that we didn't end up with a
low-order point, which is a faster operation.
2022-11-28 00:34:13 +01:00
Jimmi Holst Christensen
6097165241 Use a slice for InstMap instead of std.HashMap
The `sema.inst_map` datastructure is very often accessed. All
instructions that reference the result of other instructions does a
lookup into this field. Because of this, a significant amount of time,
is spent in `std.HashMap.get`.

This commit replaces the `HashMap` with a simpler data structure that
uses the zir indexes to index into a slice for the result. See the data
structure doc comment for more info.
2022-11-27 02:10:00 -05:00
bfredl
0196010b0c linux.bpf: expose map_get_next_key
Returning a bool allows to conveniently use it as the condition
of a while loop.

Also remove restriction that ST cannot be double-word.
While imm is only 32-bit, this value is extended into a 64-bit
memory location.
2022-11-27 02:07:49 -05:00
Igor Anić
87a14f2b03 stdlib: remove flaky test
fixes ziglang#13660
2022-11-27 01:46:06 -05:00
Andrew Kelley
2df47df390 CI: move some stuff to the website repo 2022-11-26 15:34:35 -07:00
Andrew Kelley
d5e41bf15b disable spuriously failing std lib test case
see tracking issue #13660
2022-11-26 14:54:56 -07:00
Cody Tapscott
a0af3c7a19 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.
2022-11-26 22:06:15 +02:00
Veikka Tuominen
304e828088
Merge pull request #13637 from Vexu/stage2-fixes
Stage2 bug fixes
2022-11-26 22:03:49 +02:00
Matt Chudleigh
f61c5f3f52 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.
2022-11-26 18:06:39 +02:00
Veikka Tuominen
71937f75d8 Sema: correctly detect union target in zirSwitchBlock
Closes #13655
2022-11-26 18:05:27 +02:00
Veikka Tuominen
fe38898246 Sema: pass c_import_buf to child block in more places
Closes  #13651
2022-11-26 18:05:27 +02:00
Veikka Tuominen
587ef60a28 Sema: resolve union fields before using getTagType
Closes #13649
2022-11-26 18:05:27 +02:00
Veikka Tuominen
bf62cb453b Sema: handle anytype parameter requiring comptime
Closes #13645
2022-11-26 18:05:27 +02:00
Veikka Tuominen
d0dd0bda1c Sema: resolve requires_comptime as part of resolveTypeLayout
This was already partially done for structs but it needs to be done
for Unions too and more thoroughly.

Closes #13609
2022-11-26 18:05:27 +02:00
Veikka Tuominen
72fa8d4880 Sema: fix overflow arithmetic with runtime vectors
It should return a a vector of bools for compatibility with scalar
operands and stage1 until #10248 can be implemented.

Closes #13201
2022-11-26 18:05:27 +02:00
Andrew Kelley
30eb2a1753
Merge pull request #13627 from Vexu/tuple-decls
Implement tuple type declarations
2022-11-25 18:06:09 -05:00
Loris Cro
a2403d354f ci: remove manual run feature 2022-11-25 22:28:36 +01:00
Loris Cro
5b9d0a446a ci: windows: fetch before checking out specific commit 2022-11-25 20:46:02 +01:00
Loris Cro
45120f929c ci: windows: unshallow repository before checking specific commit 2022-11-25 20:41:33 +01:00
Loris Cro
f4c63400f0 ci: give name to manually run workflows 2022-11-25 20:37:15 +01:00
Loris Cro
c59d60893b ci: windows: prevent del errors when the directory doesn't exist 2022-11-25 20:35:39 +01:00
Loris Cro
e096f972d0 ci: windows: use correct windows powershell syntax 2022-11-25 20:19:25 +01:00
Loris Cro
bc90f2ae3c ci: when running the workflow manually, preserve newer ci folder
This is the main way this feature is supposed to work:

1. you discover that a test started failing at some point
   but a misconfiguration in the CI script didn't catch that
   causing a bunch of false negative (ie false green) CIs
   over time
2. you fix the script and now want to figure out when the
   test started failing
3. you want to rebuild older commits, potentially only on specific
   targets, but with the new fixed CI script that correctly
   catches failures

This is what this commit enables
2022-11-25 20:08:57 +01:00
Loris Cro
764651c840 ci: fix syntax error in workflow file 2022-11-25 20:02:51 +01:00
Loris Cro
f1ec438069 ci: introduce support for manual runs on specific commit & targets 2022-11-25 19:57:36 +01:00
Loris Cro
7fd34f18c5 ci: windows: add missing check to last test 2022-11-25 19:41:37 +01:00
sv99
d9a754e5e3
add arm-features.h from glibc source (#12346) 2022-11-25 12:43:37 +01:00
Andrew Kelley
972c040241
Merge pull request #13611 from Snektron/spirv-assembler
spirv: assembler
2022-11-24 17:48:39 -05:00
Loris Cro
a3552a6c50 ci: remove gh action job output as it's not used anymore 2022-11-24 16:53:22 +01:00
Frank Denis
feb806a212
std.crypto.ed25519 incremental signatures: hash the fallback noise (#13643)
If the noise parameter was null, we didn't use any noise at all.

We unconditionally generated random noise (`noise2`) but didn't use it.

Spotted by @cryptocode, thanks!
2022-11-24 12:13:37 +01:00
Andrew Kelley
02e1facc72
Merge pull request #13632 from ziglang/cbe 2022-11-23 22:49:13 -05:00
Loris Cro
dcb16731cf ci: cancel pending CI jobs when a PR gets updated 2022-11-24 00:07:58 +01:00
Loris Cro
bcb8ef50ff ci: fix zig executable path to obtain zig version 2022-11-24 00:05:46 +01:00
Andrew Kelley
1d7faf30f9
Merge pull request #13577 from ianic/issue-12877
stdlib: fix condition variable broadcast FutexImpl
2022-11-23 16:24:55 -05:00
Veikka Tuominen
9f055e2eb0 Sema: improve compile error for tuple coercion mismatch 2022-11-23 22:16:31 +02:00
Veikka Tuominen
8eea73fb92 add tests for tuple declarations 2022-11-23 22:16:31 +02:00
Jimmi Holst Christensen
258bee41bf Get panic messages from builtin instead of creating anon decls
The TODO comment in safetyPanic mentions introducing the concept of
reference-counted decls. That sounds like Zig current semantics for
normal declarations. By placing the panic messages in builtin there is
no need for another concept in the compiler.
2022-11-23 14:57:39 -05:00
Andrew Kelley
81d2135ca6
Merge pull request #13596 from ziglang/cache-path-prefixes
Cache: introduce prefixes to manifests
2022-11-23 14:51:22 -05:00