srctree

328a7411 expose tls cipher suites config to init
Gregory Mullen parent 58ecb1c8
58ecb1c8 add a more helpful error for previous versions
Gregory Mullen parent a93abe23
a93abe23 move tls certificate errors into a certificate error namespace
Gregory Mullen parent bcb534c2
bcb534c2 Merge branch 'llvm18'
Upgrades the LLVM, Clang, and LLD dependencies to LLVM 18.x Related to #16270
Andrew Kelley parent d9b00ee4parent 74f52954
d9b00ee4 standalone: support relative cache path
Jacob Young parent 6bc0cef6
6bc0cef6 Merge pull request #19826 from jacobly0/outdirarg
Run: add output directory arguments
Andrew Kelley parent 5c9eb408parent dee9f82f
5c9eb408 cmake: make static curses configurable
Not sure why this exists in the first place, but disabling it reduces the required dependencies of a CI runner.
Jacob Young parent 67455c5e
67455c5e fs: handle `OBJECT_NAME_COLLISION` in `makeOpenPath`
This fixes a race condition when two threads/processes try to `makeOpenPath` the same path simultaneously.
Jacob Young parent db890dba
db890dba InternPool: eliminate `var_args_param_type`
This was a "fake" type used to handle C varargs parameters, much like generic poison. In fact, it is treated identically to generic poison in all cases other than one (the final coercion of a call argument), which is trivially special-cased. Thus, it makes sense to remove this special tag and instead use `generic_poison_type` in its place. This fixes several bugs in Sema related to missing handling of this tag. Resolves: #19781
mlugg parent 5bbb2f96
5bbb2f96 link: restore lost passthrough behavior
Fixes bug introduced by 3b5be9fb6e06f6494ca05fb087a2121e220beb3f
Jacob Young parent 16d368d0
16d368d0 introduce std.process.raiseFileDescriptorLimit
Andrew Kelley parent a7229251
a7229251 add std.Thread.Pool.spawnWg
This function accepts a WaitGroup parameter and manages the reference counting therein. It also is infallible. The existing `spawn` function is still handy when the job wants to further schedule more tasks.
Andrew Kelley parent a96b78c1
a96b78c1 add std.zip and support zip files in build.zig.zon
fixes #17408 Helpful reviewers/testers include Joshe Wolfe, Auguste Rame, Andrew Kelley and Jacob Young. Co-authored-by: Joel Gustafson <joelg@mit.edu>
Jonathan Marler parent b86c4bde
b86c4bde Rename Dir.writeFile2 -> Dir.writeFile and update all callsites
writeFile was deprecated in favor of writeFile2 in f645022d16361865e24582d28f1e62312fbc73bb. This commit renames writeFile2 to writeFile and makes writeFile2 a compile error.
Ryan Liptak parent a52f12af
a52f12af Delete compile errors for deprecated decls
Ryan Liptak parent 3b5be9fb
3b5be9fb lld: use a response file on `NameTooLong`
Jacob Young parent 44db92d1
44db92d1 std.StaticStringMap: bump eval branch quota
closes #19803 by changing quota from (30 * N) to (10 * N * log2(N)) where N = kvs_list.len * adds reported adversarial test case * update doc comment of getLongestPrefix()
Travis Staloch parent ea9d817a
ea9d817a Build system: Allow specifying Win32 resource include paths using LazyPath
Adds an `include_paths` field to RcSourceFile that takes a slice of LazyPaths. The paths are resolved and subsequently appended to the -rcflags as `/I <resolved path>`. This fixes an accidental regression from https://github.com/ziglang/zig/pull/19174. Before that PR, all Win32 resource compilation would inherit the CC flags (via `addCCArgs`), which included things like include directories. After that PR, though, that is no longer the case. However, this commit intentionally does not restore the previous behavior (inheriting the C include paths). Instead, each .rc file will need to have its include paths specified directly and the include paths only apply to one particular resource script. This allows more fine-grained control and has less potentially surprising behavior (at the cost of some convenience). Closes #19605
Ryan Liptak parent 8ea4283d
8ea4283d Change `std.os` to `std.posix` in error messages
reokodoku parent 20b9b54e
20b9b54e LLVM: Fix panic when using tagged union backed by enum with negative values
Anton Lilja parent 5571c03a
5571c03a Sema: Don't generate runtime instructions on zirSplat if dest_ty doesn't have runtime bits
Antonio Gomes parent d841f84b
d841f84b std.tar: fix finding tar root_dir (#19829)
For issue #19820.
Igor Anić parent e8dd79ca
e8dd79ca cbe: fix ub with integer `@abs`
Jacob Young parent a69788ba
a69788ba std.Build.Step.CheckObject: fix parseDumpNames
This function incorrectly assumed that module name subsections, function name subsections, and local name subsections are encoded the same, however according to [the specification](https://webassembly.github.io/spec/core/appendix/custom.html) they are encoded differently. This commit adds support for parsing module name subsections correctly, which started appearing after upgrading to LLVM 18.
Andrew Kelley parent 1c9bb6a7
1c9bb6a7 C backend: avoid memcpy when len=0
As of Clang 18, calling memcpy() with a misaligned pointer trips UBSAN, even if the length is zero. This unfortunately includes any call to `@memcpy` when source or destination are undefined and the length is zero. This patch makes the C backend avoid calling memcpy when the length is zero, thereby avoiding undefined behavior. A zig1.wasm update will be needed in the llvm18 branch to activate this code.
Andrew Kelley parent 956f53be
956f53be NetBSD: avoid ldd error on executables. zig cc produce 4 PT_LOAD segments, wheras on NetBSD, only 2 PT_LOAD are usually produced by other compilers (tested with host gcc and clang).
$ ldd -v main_4segs .../main_4segs: wrong number of segments (4 != 2) .../main_4segs: invalid ELF class 2; expected 1
Alain Greppin parent fc45e5b3
fc45e5b3 Merge pull request #19784 from tiehuis/simplify-hash-crc32
std.hash.crc: simplify api
Andrew Kelley parent 497f37ceparent 5f0ecafa
497f37ce test/link/glibc_compat: fix incorrect strlcpy result
daurnimator parent 4303400e
4303400e Sema+llvm: properly implement `Interrupt` callconv
Co-authored-by: Veikka Tuominen <git@vexu.eu>
Julian parent 8a36a1f9
8a36a1f9 std.crypto.hash.sha2: cleanup add add more docs (#19744)
* std.crypto.hash.sha2: generalize sha512 truncation Replace `Sha512224`, `Sha512256`, and `Sha512T224` with `fn Sha512Truncated(digest_bits: comptime_int)`. This required refactoring `Sha2x64(comptime params)` to `Sha2x64(comptime iv: [8]u64, digest_bits: comptime_int)` for user-specified `digest_bits`. I left #19697 alone but added a compile-time check that digest_bits is divisible by 8. Remove docs which restate type name. Add module docs and reference where IVs come from. * std.crypto.sha2: make Sha512_224 and Sha512_256 pub * make generic type implementation detail, add comments * fix iv * address @jedisct1 feedback * fix typo * renaming * add truncation clarifying comment and Sha259T192 tests
clickingbuttons parent 25f1526f
25f1526f Fix ELF alignment for freestanding targets (#19766)
* Fix the ELF binaries for freestanding target created with the self-hosted linker. The ELF specification (generic ABI) states that ``loadable process segments must have congruent values for p_vaddr and p_offset, modulo the page size''. Linux refuses to load binaries that don't meet this requirement (execve() fails with EINVAL).
Alexandre Janon parent aecd9cc6
aecd9cc6 std.posix.iovec: use .base and .len instead of .iov_base and .iov_len
Nameless parent c231d949
c231d949 LLVM: Remove deprecated or soon to be deprecated constant expressions
antlilja parent 3648d7df
3648d7df fix: object size error in archive
zhylmzr parent 1b90888f
1b90888f migrate langref documentation generation to the build system
Andrew Kelley parent 9d64332a
9d64332a Merge pull request #19698 from squeek502/windows-batbadbut
std.process.Child: Mitigate arbitrary command execution vulnerability on Windows (BatBadBut)
Andrew Kelley parent a0f1825cparent 422464d5
a0f1825c windows.GetFinalPathNameByHandle: Support volumes mounted as paths
A volume can be mounted as a NTFS path, e.g. as C:\Mnt\Foo. In that case, IOCTL_MOUNTMGR_QUERY_POINTS gives us a mount point with a symlink value something like `\??\Volume{383da0b0-717f-41b6-8c36-00500992b58d}`. In order to get the `C:\Mnt\Foo` path, we can query the mountmgr again using IOCTL_MOUNTMGR_QUERY_DOS_VOLUME_PATH. Fixes #19731
Ryan Liptak parent 1a6485d1
1a6485d1 Clarify the blocking behavior of `RwLock.lockShared()`. (#19752)
IntegratedQuantum parent f6f7a47a
f6f7a47a Update fmt.zig tests
Changed uses of `std.testing.expect` to `std.testing.expectEqual`, `std.testing.expectError`, and `std.testing.expectEqualStrings` where appropriate
Sean parent 857c1d4f
857c1d4f std.zig.system: fix ELF file search
* Adjust buffer length a bit. * Fix detecting if file is a script. Logic below was unreachable, because 99% of scripts failed "At least 255 bytes long" check and were detected as ELF files. It should be "At least 4" instead (minimum value of "ELF magic length" and "smallest possible interpreter path length"). * Fix parsing interpreter path, when text after shebang: 1. does not have newline, 2. has leading spaces and tabs, 3. separates interpreter and arguments by tab or NUL. * Remove empty error set from `defaultAbiAndDynamicLinker`. Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>
Eric Joldasov parent 7cf3167e
7cf3167e std.crypto: make ff.ct_unprotected.limbsCmpLt compile (#19741)
* std.crypto: make ff.ct_unprotected.limbsCmpLt compile * std.crypto: add ff.ct test * fix testCt to work on x86 * disable test on stage2-c --------- Co-authored-by: Frank Denis <124872+jedisct1@users.noreply.github.com>
clickingbuttons parent b87baad0
b87baad0 error on `undefined` end index
David Rubin parent e8f28cda
e8f28cda std.Build: Install Windows DLLs to `<prefix>/bin/` by default
Windows does not support RPATH and only searches for DLLs in a small number of predetermined paths by default, with one of them being the directory from which the application loaded. Installing both executables and DLLs to `bin/` by default helps ensure that the executable can find any DLL artifacts it has linked to. DLL import libraries are still installed to `lib/`. These defaults match CMake's behavior.
Carl Åstholm parent c947e79d
c947e79d std.meta: give TagPayloadByName unreachable a better @compileError message
clickingbuttons parent 8af59d1f
8af59d1f ComptimeStringMap: return a regular struct and optimize
this patch renames ComptimeStringMap to StaticStringMap, makes it accept only a single type parameter, and return a known struct type instead of an anonymous struct. initial motivation for these changes was to reduce the 'very long type names' issue described here https://github.com/ziglang/zig/pull/19682. this breaks the previous API. users will now need to write: `const map = std.StaticStringMap(T).initComptime(kvs_list);` * move `kvs_list` param from type param to an `initComptime()` param * new public methods * `keys()`, `values()` helpers * `init(allocator)`, `deinit(allocator)` for runtime data * `getLongestPrefix(str)`, `getLongestPrefixIndex(str)` - i'm not sure these belong but have left in for now incase they are deemed useful * performance notes: * i posted some benchmarking results here: https://github.com/travisstaloch/comptime-string-map-revised/issues/1 * i noticed a speedup reducing the size of the struct from 48 to 32 bytes and thus use u32s instead of usize for all length fields * i noticed speedup storing KVs as a struct of arrays * latest benchmark shows these wall_time improvements for debug/safe/small/fast builds: -6.6% / -10.2% / -19.1% / -8.9%. full output in link above.
Travis Staloch parent fefdbca6
fefdbca6 Fix WASI threads, again
Properly call the entrypoint when it doesn't return an optional error, and use the per-thread copy of the arguments list.
Frank Denis parent 5d745d94
5d745d94 x86_64: fix C abi for unions
Closes #19721
Jacob Young parent 6fd09f8d
6fd09f8d link/macho: make --verbose-link represent the actual linker line
Jakub Konka parent a7e4d172
a7e4d172 link/macho: introduce Atom extras for out-of-band data
Jakub Konka parent 3c5e8407
3c5e8407 Merge pull request #19714 from ziglang/elf-merge-strings
link/elf: implement string merging
Jakub Konka parent e0d7a98bparent da55af1c
More