Commit graph

9923 commits

Author SHA1 Message Date
Andrew Kelley
df46f5af69 std.Progress: include subtrees from child processes 2024-05-27 20:56:48 -07:00
Andrew Kelley
f07116404a std.Progress: child process sends updates via IPC 2024-05-27 20:56:48 -07:00
Andrew Kelley
ed36470af1 std.Progress: truncate trailing newline 2024-05-27 20:56:48 -07:00
Andrew Kelley
67e08e7b3c fix clearing and sibling iteration 2024-05-27 20:56:48 -07:00
Andrew Kelley
582acdf721 keep the cursor at the end instead of beginning 2024-05-27 20:56:48 -07:00
Andrew Kelley
66c3b6ac65 fix terminal repainting
the clear, save, restore thing doesn't work when the terminal is at the
bottom
2024-05-27 20:56:48 -07:00
Andrew Kelley
a3c9511ab9 rework std.Progress again
This time, we preallocate a fixed set of nodes and have the user-visible
Node only be an index into them. This allows for lock-free management of
the node storage.

Only the parent indexes are stored, and the update thread makes a
serialized copy of the state before trying to compute children lists.

The update thread then walks the tree and outputs an entire tree of
progress rather than only one line.

There is a problem with clearing from the cursor to the end of the
screen when the cursor is at the bottom of the terminal.
2024-05-27 20:56:48 -07:00
Andrew Kelley
e1e4de2776 progress progress
Move the mutex into the nodes

Track the whole tree instead of only recently activated node
2024-05-27 20:56:48 -07:00
Andrew Kelley
d6e8ba3f97 start reworking std.Progress
New design ideas:
* One global instance, don't try to play nicely with other instances
  except via IPC.
* One process owns the terminal and the other processes communicate via
  IPC.
* Clear the whole terminal and use multiple lines.

What's implemented so far:
* Query the terminal for size.
* Register a SIGWINCH handler.
* Use a thread for redraws.

To be done:
* IPC
* Handling single threaded targets
* Porting to Windows
* More intelligent display of the progress tree rather than only using
  one line.
2024-05-27 20:56:48 -07:00
Sean
c0da92f714 hash_map.zig: Pass self by value and less pointer-int conversion
- Used `Self` instead of `*const Self` where appropriate (orignally proposed in #19770)
 - Replaced `@intFromPtr` and `@ptrFromInt` with `@ptrCast`, `@alignCast`, and pointer arithmetic where appropriate

With this, the only remaining instance on pointer-int conversion in hash_map.zig is in `HashMapUnmanaged.removeByPtr`, which easily be able to be eliminated once pointer subtraction is supported.
2024-05-27 13:22:50 +03:00
Matthew Lugg
389181f6be std.process.Child: prevent racing children from inheriting one another's pipes
The added comment explains the issue here relatively well. The new
progress API made this bug obvious because it became visibly clear that
certain Compile steps were seemingly "hanging" until other steps
completed. As it turned out, these child processes had raced to spawn,
and hence one had inherited the other's stdio pipes, meaning the `poll`
call in `std.Build.Step.evalZigProcess` was not identifying the child
stdout as closed until an unrelated process terminated.
2024-05-26 16:44:14 -04:00
Andrew Kelley
591bbafee3
Merge pull request #20049 from ziglang/std.process.Child
std: restructure child process namespace
2024-05-26 16:20:07 -04:00
Jacob Young
b9b7f18523 EnumMap: fix init 2024-05-26 16:13:54 -04:00
Ryan Liptak
aa463adc91 std.process.Child: Improve doc comments of Windows argv -> command line functions 2024-05-26 09:37:14 -07:00
Andrew Kelley
f47824f24d std: restructure child process namespace 2024-05-26 09:31:55 -07:00
Jakub Konka
8e52d54c25 Step/CheckObject: handle stab entries when dumping MachO symtab 2024-05-24 22:32:14 +02:00
Andrew Kelley
9be8a9000f Revert "implement @expect builtin (#19658)"
This reverts commit a7de02e052.

This did not implement the accepted proposal, and I did not sign off
on the changes. I would like a chance to review this, please.
2024-05-22 09:57:43 -07:00
David Rubin
a7de02e052
implement @expect builtin (#19658)
* implement `@expect`

* add docs

* add a second arg for expected bool

* fix typo

* move `expect` to use BinOp

* update to newer langref format
2024-05-22 10:51:16 -05:00
Andrew Kelley
0286970b19 std autodocs server: don't trim all URLs
This is a partial revert of 6635360dbd.
2024-05-22 07:13:08 -07:00
Veikka Tuominen
0fb2015fd3 llvm: fix @wasmMemory{Size,Grow} for wasm64
Closes #19942
2024-05-22 09:48:52 -04:00
Jiacai Liu
6635360dbd
std-docs: use open for macOS. 2024-05-21 23:21:17 +03:00
orvit
ae44e199a8
use constant in formatType 2024-05-21 14:41:49 +00:00
poypoyan
aa07366513
std.math.big.int.Managed: adjust size of arg for limbs_buffer in format() 2024-05-21 13:28:05 +00:00
Simon Brown
33d7815813 Implement addManyAsSlice for BoundedArray 2024-05-21 13:46:05 +03:00
Andrew Kelley
50a1419457 update libcxx and libcxxabi to llvm 18.1.6
Contains fixes for OpenBSD
2024-05-20 16:12:36 -04:00
Alex Kladov
9f4f43cf7f std: align PriorityQueue and ArrayList API-wise
ArrayList uses `items` slice  to store len initialized items, while
PriorityQueue stores `capacity` potentially uninitialized items.

This is a surprising difference in the API that leads to bugs!

https://github.com/tigerbeetle/tigerbeetle/pull/1948
2024-05-20 12:04:20 -04:00
Veikka Tuominen
8aae0d87b5 Target: add OpenHarmonyOS ABI
Closes #20009
2024-05-20 09:25:52 -04:00
Jacob Young
ad72172293 Build.Step.Run: fix cache management when there are side effects
Closes #19947
2024-05-20 07:45:31 -04:00
Andrew Kelley
657442485a
Merge pull request #19987 from Frojdholm/fix-gpa-double-free-stack-traces
gpa: Fix GeneralPurposeAllocator double free stack traces
2024-05-20 07:37:41 -04:00
february cozzocrea
d67d9fa357 Minor follow-up improvements to PR #19227 for aro translate-c 2024-05-20 07:35:10 -04:00
Wes Koerber
4239a0d9c3 fix: incorrect field sizes in std.os.linux.ifmap 2024-05-20 13:50:06 +03:00
Hampus Fröjdholm
762e2a4b52 gpa: Fix GeneralPurposeAllocator double free stack traces
The wrong `size_class` was used when fetching stack traces from empty
buckets. The `size_class` would always be the maximum value after
exhausting the search of active buckets rather than the actual
`size_class` of the allocation.
2024-05-18 11:46:37 +02:00
Hampus Fröjdholm
61f1b2db70 gpa: Add helper to calculate size class of empty buckets
Empty buckets have their `alloc_cursor` set to `slot_count` to allow the
size class to be calculated later. This happens deep within the free
function.

This adds a helper and a test to verify that the size class of empty
buckets is indeed recoverable.
2024-05-18 11:43:42 +02:00
Jakub Konka
6a65561e3e
Merge pull request #19958 from ziglang/macho-check-object
Step.CheckObject: add support for dumping raw section contents for MachO
2024-05-14 07:11:41 +02:00
Jakub Konka
2d537da6bd Step.CheckObject: support dumping raw section contents for MachO 2024-05-13 09:14:35 +02:00
Jakub Konka
5d619da2de Step.CheckObject: put MachO object parsing logic in ObjectContext wrapper 2024-05-13 08:56:15 +02:00
Andrew Kelley
e2ec54bb38
Merge pull request #19926 from squeek502/windows-sdk-cachepath-registry
WindowsSdk: Fix finding the _Instances directory when it's not in the default location
2024-05-12 09:39:13 -04:00
Ronald Chen
c77afca957 [std] Fixed bug missing optional for lpName param on CreateEventExW. fixes #19946
https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-createeventexw
2024-05-12 07:45:40 +02:00
Georgijs
084c2cd90f
windows: use permissive file share flags everywhere (#19505)
* use permissive file share flags everywhere

* remove file_share_delete from createnamedpipefile
2024-05-11 23:34:40 +02:00
Jakub Konka
86d8688c7f
Merge pull request #19431 from Rexicon226/revive-riscv
revive STAGE2 RISCV64 backend
2024-05-11 21:35:18 +02:00
Andrew Kelley
661a9be66b std.Build.Step.Run: add missing call to writeManifest
fixes #19938
2024-05-11 06:28:45 -07:00
David Rubin
ffb63a05a3 riscv: finally fix bug + airAggregateInit
i just hadn't realized that I placed the `riscv_start` branch in the non-simplified
starts
2024-05-11 02:17:24 -07:00
David Rubin
d9e0cafe64 riscv: add stage2_riscv to test matrix and bypass failing tests 2024-05-11 02:17:24 -07:00
David Rubin
e622485df8 riscv: actually working test runner 2024-05-11 02:17:11 -07:00
David Rubin
d19b77d63f riscv: back to hello world panics 2024-05-11 02:17:11 -07:00
David Rubin
6740c1f084 riscv: big rewrite to use latest liveness
this one is even harder to document then the last large overhaul.

TLDR;
- split apart Emit.zig into an Emit.zig and a Lower.zig
- created seperate files for the encoding, and now adding a new instruction
is as simple as just adding it to a couple of switch statements and providing the encoding.
- relocs are handled in a more sane maner, and we have a clear defining boundary between
lea_symbol and load_symbol now.
- a lot of different abstractions for things like the stack, memory, registers, and others.
- we're using x86_64's FrameIndex now, which simplifies a lot of the tougher design process.
- a lot more that I don't have the energy to document. at this point, just read the commit itself :p
2024-05-11 02:17:11 -07:00
David Rubin
8ac239ebce riscv: add enough components to get a test runner working 2024-05-11 02:17:11 -07:00
David Rubin
3bf008a3d0 riscv: implement slices 2024-05-11 02:17:11 -07:00
David Rubin
350ad90cee riscv: totally rewrite how we do loads and stores
this commit is a little too large to document fully, however the main gist of it this

- finish the `genInlineMemcpy` implement
- rename `setValue` to `genCopy` as I agree with jacob that it's a better name
- add in `genVarDbgInfo` for a better gdb experience
- follow the x86_64's method for genCall, as the procedure is very similar for us
- add `airSliceLen` as it's trivial
- change up the `airAddWithOverflow implementation a bit
- make sure to not spill of the elem_ty is 0 size
- correctly follow the RISC-V calling convention and spill the used calle saved registers in the prologue
and restore them in the epilogue
- add `address`, `deref`, and `offset` helper functions for MCValue. I must say I love these,
they make the code very readable and super verbose :)
- fix a `register_manager.zig` issue where when using the last register in the set, the value would overflow at comptime.
was happening because we were adding to `max_id` before subtracting from it.
2024-05-11 02:17:11 -07:00
David Rubin
cbf62bd6dc riscv: switch default_panic to use the message 2024-05-11 02:17:11 -07:00