Commit graph

9004 commits

Author SHA1 Message Date
Krzysztof Wolicki
bffe65c18f std.ChildProcess: fix error in killWindows 2023-10-18 19:11:28 -04:00
Andrew Kelley
8804d72684 std certs: solaris can use the BSD path 2023-10-18 12:51:45 -04:00
Andrew Kelley
e8f3c4c4b1
Merge pull request #13610 from bcrist/child_process_already_terminated
return error.AlreadyTerminated from std.ChildProcess.kill when necessary
2023-10-18 10:23:23 -04:00
Andrew Kelley
149f2f8adb
Merge pull request #17524 from Vexu/aro-translate-c
Add ability to test Aro based `translate-c`
2023-10-18 00:32:59 -04:00
Ben Crist
fb9376bd04 Double check that child processes have really exited when
TerminateProcess reports ACCESS_DENIED
2023-10-17 16:56:39 -07:00
Ben Crist
6d47198303 return error.AlreadyTerminated from std.ChildProcess.kill when necessary 2023-10-17 16:56:15 -07:00
Tobias Simetsreiter
7a9500fd80
Fix rendering ast in zon mode (#17547)
Co-authored-by: Tobias Simetsreiter <tobias.simetsreiter@wabtec.com>
2023-10-17 19:04:01 -04:00
David
364c54460f
Deflate: fix missing value in reset 2023-10-17 21:46:47 +00:00
David
5c8912d7a4
XXH3 Implementation for Zig STD (#17530)
XXH3 is the faster alternative to XXH64 which utilizes SIMD
when hashing large chunks of memory and similar mixing to
WyHash (64x64 -> 128 mul) for smaller inputs.

Co-authored-by: Reixcon226 <87927264+Rexicon226@users.noreply.github.com>

---------

Co-authored-by: kprotty <kbutcher6200@gmail.com>
2023-10-17 13:55:01 -05:00
Andrew Kelley
3b21c15782
Merge pull request #17562 from ziglang/fetch-symlink-normalize-sep
Package.Fetch: normalize path separators in symlinks
2023-10-17 14:35:39 -04:00
kcbanner
68ed787751 windows: fix ReadLink not using a synchronous file handle 2023-10-17 14:33:55 -04:00
Andrew Kelley
877393d17a std.fs: fix relative symbolic links on Windows
closes #17564
2023-10-17 06:27:07 -04:00
Veikka Tuominen
e765495b11 tests: translate-c and run-translated-c to the test harness 2023-10-17 11:55:17 +03:00
Andrew Kelley
f1a9344ffe std.fs.openDir: handle OBJECT_NAME_INVALID 2023-10-16 17:22:24 -07:00
Andrew Kelley
b171a6f25d Package.Fetch: normalize path separators in symlinks
closes #17549
2023-10-16 16:47:47 -07:00
Andrew Kelley
1456f95b3c std: disable flaky test on aarch64-windows
tracked by #17134
2023-10-16 16:13:46 -07:00
joadnacer
7b9165b375 std.mem: Improve writeIntSlice performance 2023-10-16 08:49:05 -04:00
Jacob Young
fbd90e487b Build: fix some issues with ConfigHeader step
* include path was using bad default for dependency lazy paths
 * unhashed config options caused changes to not trigger a rebuild
2023-10-16 03:50:47 -04:00
Andrew Kelley
ca690ffa22
Merge pull request #17448 from squeek502/win32-manifest
Add preliminary support for Windows `.manifest` files
2023-10-15 19:47:27 -07:00
Robin Voetter
fd6b3db342
Merge pull request #17293 from Snektron/spirv-aaaa
spirv: more instructions
2023-10-16 02:04:09 +02:00
Ryan Liptak
5f15acc463 Add preliminary support for Windows .manifest files
An embedded manifest file is really just XML data embedded as a RT_MANIFEST resource (ID = 24). Typically, the Windows-only 'Manifest Tool' (`mt.exe`) is used to embed manifest files, and `mt.exe` also seems to perform some transformation of the manifest data before embedding, but in testing it doesn't seem like the transformations are necessary to get the intended result.

So, to handle embedding manifest files, Zig now takes the following approach:

- Generate a .rc file with the contents `1 24 "path-to-manifest.manifest"`
- Compile that generated .rc file into a .res file
- Link the .res file into the final binary

This effectively achieves the same thing as `mt.exe` minus the validation/transformations of the XML data that it performs.

How this is used:

On the command line:
```
zig build-exe main.zig main.manifest
```
(on the command line, specifying a .manifest file when the target object format is not COFF is an error)

or in build.zig:

```
const exe = b.addExecutable(.{
    .name = "manifest-test",
    .root_source_file = .{ .path = "main.zig" },
    .target = target,
    .optimize = optimize,
    .win32_manifest = .{ .path = "main.manifest" },
});
```
(in build.zig, the manifest file is ignored if the target object format is not COFF)

Note: Currently, only one manifest file can be specified per compilation. This is because the ID of the manifest resource is currently always 1. Specifying multiple manifests could be supported if a way for the user to specify an ID for each manifest is added (manifest IDs must be a u16).

Closes #17406

options
2023-10-15 13:33:16 -07:00
Johan Jansson
a1e0b9979a std.heap.ArenaAllocator: fix doc comment typo
Fixes #17537
2023-10-15 21:20:48 +03:00
Robin Voetter
3ca1f88898
std.testing: disable expectEqualSlices printing for spirv 2023-10-15 14:00:26 +02:00
Robin Voetter
dc44baf763
std.testing: allow print() at comptime
This allows functions like expectEqual to be performed at comptime. If
an error is detected, the result is logged via a compile error.
2023-10-15 14:00:08 +02:00
joadnacer
a241cf90d6 std.base64: Improve Encoder/Decoder performance 2023-10-14 23:28:19 -07:00
JustinWayland
895c81ce72
Add a missing period in Future's description 2023-10-14 11:20:11 +03:00
Andrew Kelley
2d7d037c48
Merge pull request #17510 from Vexu/vector
Fix `@Vector` source locations being swapped
2023-10-13 16:04:47 -07:00
radar roark
244233da2a remove redundant use of pathFromRoot 2023-10-13 07:20:45 -07:00
Veikka Tuominen
c919e9a280 std.simd: return comptime_int from suggestVectorSize 2023-10-13 16:58:05 +03:00
Andrew Kelley
027aabf497 drop for loop syntax upgrade mechanisms 2023-10-13 03:43:54 -07:00
Koakuma
375bb5f4a1 lib: Fix asm code in _start for SPARC
SPARCs have delayed branches, that is, it will unconditionally
run the next instruction following a branch.
Slightly reorder the _start code sequence to prevent it from
accidentally executing stray instructions, which may result in odd
program behavior.
2023-10-12 16:13:32 -07:00
JustinWayland
b37fdf387a Fix minor typo in the description of Progress 2023-10-13 00:44:30 +03:00
Kai Jellinghaus
2254882ebe Fix compilation failure in valgrind.zig 2023-10-12 10:17:49 -07:00
Alexander Heinrich
4e188dd66c Update docs of PriorityQueue.iterator() and PriorityDeque.iterator() 2023-10-12 04:48:22 +03:00
Krzysztof Wolicki
7edba14d7c
Step.Run: change cwd to ?Build.LazyPath (#17418)
closes #17409
2023-10-10 18:39:44 -04:00
Krzysztof Wolicki
7abf9b3a83
Step.Compile: add options struct for addCSourceFiles (#17420)
Closes #17410
2023-10-10 14:29:26 -04:00
Eric Joldasov
1f6d82ec01 std.cstr: remove deprecated namespace
Followup to 0a868dacdd .

Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-10-10 02:08:03 +03:00
Jonathan Marler
3a47bc7154 Grammar: Use ContainerDeclaration* instead of ContainerDeclarations
`ContainerDeclarations` is an abstraction of `ContainerDeclaration*`.
Removing this abstraction allows the `ContainerMembers` rule to contain
more concrete information without having to look at the definition
of `ContainerDeclarations`.
2023-10-10 00:51:58 +03:00
Andrew Kelley
f7bc55c013
Merge pull request #17392 from ziglang/fetch
rework package manager
2023-10-09 11:47:37 -07:00
Karl Seguin
75b48ef503
std.mem: use indexOfScalarPos when indexOf is called where needle.len == 1
When `std.mem.indexOf` is called with a single-item needle, use `indexOfScalarPos` which is significantly faster than the more general `indexOfPosLinear`.  This can be done without introducing overhead to normal cases (where `needle.len > 1`).
2023-10-09 16:50:16 +03:00
Pat Tullmann
57874ce619
lib/std/fs/test.zig: cleanup (#17443)
* fs/test.zig: use arena allocator more consistently

* fs/test.zig: remove unnecessary type information

Zig can (now?) implicitly cast a `&.{ "foo"}` when passed to
`fs.path.join()`, so the `[_][]const u8` is unnecessary.

* fs/test.zig: Use fs.path.join() for longer paths

Replace long path constructions (that use several "++ path_sep ++")
with a single call to `fs.path.join`.  Seems more readable to me.

* fs/test.zig: fmt
2023-10-09 16:44:14 +03:00
Andrew Kelley
efbfa8ef3e std.fs.path.resolve: add test cases for empty string
Since I'm about to rely on this behavior.
2023-10-08 19:18:21 -07:00
Andrew Kelley
47a413361d Package.Fetch: fix handling of relative paths 2023-10-08 16:54:31 -07:00
Andrew Kelley
7b25d050e6 std.tar: fix creation of symlinks with omit_empty_directories 2023-10-08 16:54:31 -07:00
Andrew Kelley
e5c2a7dbca finish hooking up new dependency tree logic
* add Module instances for each package's build.zig and attach it to the
  dependencies.zig module with the hash digest hex string as the name.
* fix incorrectly skipping the wrong packages for creating
  dependencies.zig
* a couple more renaming of "package" to "module"
2023-10-08 16:54:31 -07:00
Andrew Kelley
9eb21541ec make Package.Path support string escape formatting 2023-10-08 16:54:31 -07:00
Andrew Kelley
cbb9b5d9f0 std: add unstable sorting to array hash maps
closes #17426
2023-10-08 16:54:31 -07:00
Andrew Kelley
f708c5fafc CLI: finish updating module API usage
Finish the work started in 4c4fb839972f66f55aa44fc0aca5f80b0608c731.
Now the compiler compiles again.

Wire up dependency tree fetching code in the CLI for `zig build`.
Everything is hooked up except for `createDependenciesModule` is not yet
implemented.
2023-10-08 16:54:31 -07:00
Andrew Kelley
d0bcc390e8 get zig fetch working with the new system
* start renaming "package" to "module" (see #14307)
  - build system gains `main_mod_path` and `main_pkg_path` is still
    there but it is deprecated.
* eliminate the object-oriented memory management style of what was
  previously `*Package`. Now it is `*Package.Module` and all pointers
  point to externally managed memory.
* fixes to get the new Fetch.zig code working. The previous commit was
  work-in-progress. There are still two commented out code paths, the
  one that leads to `Compilation.create` and the one for `zig build`
  that fetches the entire dependency tree and creates the required
  modules for the build runner.
2023-10-08 16:54:31 -07:00
Andrew Kelley
24c8adc6ac std.zig.ErrorBundle: add some explicit error sets 2023-10-08 16:54:30 -07:00