21231 Commits

Author SHA1 Message Date
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
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
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
Andrew Kelley
8fe3d67c79 work around stage1 compile error 2022-11-23 12:21:45 -07:00
Robin Voetter
bd6a571093
fmt 2022-11-23 19:17:58 +01:00
Robin Voetter
5299c57060
adapt update_spriv_features to changed std pattern 2022-11-23 19:17:58 +01:00
Robin Voetter
074ba69ba6
spirv: assembler
spirv: introduce SpvModule.Fn to generate function code into

spirv: assembler error message setup

spirv: runtime spec info

spirv: inline assembly tokenizer

spirv: inline assembly lhs result/opcode parsing

spirv: forgot to fmt

spirv: tokenize opcodes and assigned result-ids

spirv: operand parsing setup

spirv: assembler string literals

spirv: assembler integer literals

spirv: assembler value enums

spirv: assembler bit masks

spirv: update assembler to new asm air format

spirv: target 1.5 for now

Current vulkan sdk version (1.3.204) ships spirv tools targetting 1.5,
and so these do not work with binaries targetting 1.6 yet. In the
future, this version number should be decided by the target.

spirv: store operands in flat arraylist.

Instead of having dedicated Operand variants for variadic operands,
just flatten them and store them in the normal inst.operands list.
This is a little simpler, but is not easily decodable in the operand
data representation.

spirv: parse variadic assembly operands

spirv: improve assembler result-id tokenization

spirv: begin instruction processing

spirv: only remove decl if it was actually allocated

spirv: work around weird miscompilation

Seems like there are problems with switch in anonymous struct literals.

spirv: begin resolving some types in assembler

spirv: improve instruction processing

spirv: rename some types + process OpTypeInt

spirv: process OpTypeVector

spirv: process OpTypeMatrix and OpTypeSampler

spirv: add opcode class to spec, remove @exclude'd instructions

spirv: process more type instructions

spirv: OpTypeFunction

spirv: OpTypeOpaque

spirv: parse LiteralContextDependentNumber operands

spirv: emit assembly instruction into right section

spirv: parse OpPhi parameters

spirv: inline assembly inputs

spirv: also copy air types

spirv: inline assembly outputs

spirv: spir-v address spaces

spirv: basic vector constants/types and shuffle

spirv: assembler OpTypeImage

spirv: some stuff

spirv: remove spirv address spaces for now
2022-11-23 19:17:58 +01:00
Andrew Kelley
4ec27a4e25 C backend: implement vector reduce and overflow intrinsics 2022-11-22 23:33:58 -07:00
Andrew Kelley
0b28133ec2 zig.h: avoid binary literals
gcc -pedantic complains about these
2022-11-22 22:33:16 -07:00
Andrew Kelley
984acae12d CI: use consistent relative/absolute paths for zig test commands
Standard library tests require the root source file to be the
corresponding file inside the Zig lib directory. In other words, there
may not be two copies of the standard library. After the changes in this
branch, Zig no longer notices that `../lib/std.zig` and
`$(pwd)/../lib/std.zig` are the same file because one is relative and
one is absolute.
2022-11-22 21:08:09 -07:00
Andrew Kelley
7717cacacb CLI: resolve zig lib directory before using it
Fixes issues with trailing slashes and things like this.
2022-11-22 20:58:13 -07:00
Andrew Kelley
58d3ee2a08 Compilation: avoid Cache hash dependency on zig lib path
* Update for the breaking changes to std.fs.path.resolve. This had a
   happy side effect of deleting some error handling code which is no
   longer needed.
 * Introduce cache_exempt_flags field to CSourceFile. This is used only
   for include directories when building libc++ and libc++abi which
   depend only on the zig lib path.
 * libc_include_dir_list is only added to the cache hash when it
   contains directories which have been obtained from system probing. It
   is exempt when the directories depend only on the zig lib path.
2022-11-22 20:57:56 -07:00
Andrew Kelley
d24aaf8847 std.fs.path.resolve: eliminate getcwd() syscall
This is a breaking change to the API. Instead of the first path
implicitly being the current working directory, it now asserts that the
number of paths passed is greater than zero.

Importantly, it never calls getcwd(); instead, it can possibly return
".", or a series of "../". This changes the error set to only be
`error{OutOfMemory}`.

closes #13613
2022-11-22 20:57:56 -07:00
Andrew Kelley
21bd13626d Cache: introduce prefixes to manifests
Before, cache manifest files would have absolute file paths. This is
problematic for two reasons:

 * Absolute file paths are not portable. Some operating systems such as
   WASI have trouble with them. The files themselves are less portable;
   they cannot be migrated from one user's home directory to another's.
   And finally they can break due to file paths exceeding maximum path
   component size.
 * They would prevent some advanced use cases of Zig, where the lib dir
   has a different path in a different invocation but is ultimately the
   same Zig version and lib directory as before.

This commit adds a new column that specifies the prefix directory for
each file. 0 is an escape hatch and has the previous behavior. The other
two prefixes introduced are zig lib directory, and the cache directory.
This means files in zig-cache manifests can reference files local to
these directories.

In practice, this means it is possible to use a different file path for
the zig lib directory in a subsequent run of zig and have it still take
advantage of the global cache, provided that the files inside remain
unchanged.

closes #13050
2022-11-22 20:57:56 -07:00
Andrew Kelley
32ce2f91a9 CI: fix wrong path name in x86_64-linux release script
I verified that the script will pass with this change.
2022-11-22 20:54:30 -07:00
Loris Cro
5453ec86eb ci: only run CI on pull requests and master branch pushes
To get the CI to run on branches other than master, create a corresponding PR.
2022-11-23 03:00:39 +01:00
Andrew Kelley
c24c6fe210 CI: disable building docs on x86_64-linux debug
See tracking issue #13546
2022-11-22 15:15:04 -07:00
Veikka Tuominen
fc5209c139 llvm: fix x86_64 sysV ABI of big vectors on avx512 enabled CPUs
Closes #13629
2022-11-23 00:05:07 +02:00
Andrew Kelley
3a616f51c0 Merge branch 'ci-secure' 2022-11-22 14:14:28 -07:00
Andrew Kelley
b3b507ad8f CI: disable building tarballs; x86 self-hosted 2022-11-22 14:13:58 -07:00
Loris Cro
942a104457 ci: use test a job to provide ZIG_VERSION to build-tarball job 2022-11-22 13:40:31 -07:00
Loris Cro
671fb4ac47 ci: move tarball creation and publishing to github-hosted runners 2022-11-22 13:40:31 -07:00
Andrew Kelley
5e42378227 disable failing C ABI test
see tracking issue #13629
2022-11-22 13:06:09 -07:00
Frank Denis
ea05223b63
std.crypto.auth: add AEGIS MAC (#13607)
* Update the AEGIS specification URL to the current draft

* std.crypto.auth: add AEGIS MAC

The Pelican-based authentication function of the AEGIS construction
can be used independently from authenticated encryption, as a faster
and more secure alternative to GHASH/POLYVAL/Poly1305.

We already expose GHASH, POLYVAL and Poly1305 for use outside AES-GCM
and ChaChaPoly, so there are no reasons not to expose the MAC from AEGIS
as well.

Like other 128-bit hash functions, finding a collision only requires
~2^64 attempts or inputs, which may still be acceptable for many
practical applications.

Benchmark (Apple M1):

    siphash128-1-3:       3222 MiB/s
             ghash:       8682 MiB/s
    aegis-128l mac:      12544 MiB/s

Benchmark (Zen 2):

    siphash128-1-3:       4732 MiB/s
             ghash:       5563 MiB/s
    aegis-128l mac:      19270 MiB/s
2022-11-22 18:16:04 +01:00
Jakub Konka
114244f770 value: account for undef value for ptr in slice in hashUncoerced 2022-11-22 14:01:20 +02:00
Cody Tapscott
3fa226a80c AstGen: Pop error trace for continue
PR #12837 handled control flow for break and return, but I forgot
about `continue`. This is effectively another break, so we just
need another `.restore_err_ret_index` ZIR instruction.

Resolves #13618.
2022-11-22 14:00:41 +02:00
Andrew Kelley
283c92e362 CI: add missing backslash 2022-11-22 01:28:08 -08:00
Andrew Kelley
936b44e50a CI: fix wrong directory paths 2022-11-22 01:20:22 -08:00
Andrew Kelley
ab680250e1 CI: fix wrong lib dir path 2022-11-22 01:05:59 -07:00
Andrew Kelley
e18d310afd CI: build from old zig on x86_64-linux debug
This is to work around OOM on the CI server. Once #13560 is complete,
we can avoid having to replace the tarballs so often.
2022-11-22 00:56:44 -07:00