Commit graph

6834 commits

Author SHA1 Message Date
Andrew Kelley
bb1f4d2bda translate-c tests: skip_foreign_checks=true 2024-05-27 20:56:49 -07:00
Andrew Kelley
a5e4fe5487 std.Build.Step.Run: account for new environment variable
Introduces `disable_zig_progress` which prevents the build runner from
assigning the child process a progress node.

This is needed for the empty_env test which requires the environment to
be completely empty.
2024-05-27 20:56:49 -07:00
Andrew Kelley
f97c2f28fd update the codebase for the new std.Progress API 2024-05-27 20:56:48 -07:00
Andrew Kelley
759c2211c2 test cases: try running foreign binaries
You don't know if it's possible to run a binary until you try. The build
system already integrates with executors and has the
`skip_foreign_checks` for exactly this use case.
2024-05-27 19:15:40 -04:00
Andrew Kelley
f47824f24d std: restructure child process namespace 2024-05-26 09:31:55 -07:00
Jakub Konka
19f41d390f test/link/macho: add symbol stabs smoke test 2024-05-24 22:43:23 +02:00
Jakub Konka
d31eb744ce link/macho: fix 32bit build 2024-05-23 12:04:17 +02:00
Jakub Konka
78b441e8de test/link/macho: test merge literals on x86_64 2024-05-23 12:04:17 +02:00
Jakub Konka
03d0a68356 test/link/macho: clean up merge literals tests on aarch64 2024-05-23 12:04:17 +02:00
Jakub Konka
28d08dd8a6 link/macho: test merging literals targeting ObjC 2024-05-23 12:04:17 +02:00
Jakub Konka
8fc0c7dce1 link/macho: apply fixes to deduping logic
* test non-ObjC literal deduping logic
2024-05-23 12:04:17 +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
Jakub Konka
d78968c1b5 test/link: actually run tests requiring symlinks on non-Win
Fixes regression introduced by 5d5e89aa8d

Turns out since landing that PR we haven't run any tests requiring
symlinks or any Apple SDK on a macOS host. Not great.
2024-05-22 14:59:32 +02:00
Veikka Tuominen
5fe9f88b13
Merge pull request #20023 from Vexu/fixes
Minor LLVM backend fixes
2024-05-22 11:54:38 +03:00
Veikka Tuominen
eb0f871cb9
Merge pull request #19961 from wooster0/errorstuff
Sema: improvements to error messages related to the handling of (error) values
2024-05-21 22:37:00 +03:00
wooster0
ac55685a94 Sema: add missing declared here note 2024-05-22 02:16:56 +09:00
Veikka Tuominen
f776e70c39 llvm: fix lowering of packed structs with optional pointers
Closes #20022
2024-05-21 19:52:25 +03: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
Wooster
f14cf13ff8 Sema: suggest using try/catch/if on method call on error union 2024-05-14 01:13:49 +09:00
r00ster91
9ae43567a3 Sema: improve error set/union discard/ignore errors
Previously the error had a note suggesting to use `try`, `catch`, or
`if`, even for error sets where none of those work.
Instead, in case of an error set the way you can handle the error
depends very much on the specific case. For example you might be in a
`catch` where you are discarding or ignoring the error set capture
value, in which case one way to handle the error might be to `return`
the error.
So, in that case, we do not attach that error note.

Additionally, this makes the error tell you what kind of an error it is:
is it an error set or an error union? This distinction is very relevant
in how to handle the error.
2024-05-14 01:13:49 +09:00
r00ster91
8579904ddd Sema: add error note for !?Type types when optional type is expected 2024-05-14 01:13:49 +09:00
r00ster91
60830e36e3 Sema error: talk about discarding instead of suppressing
Maybe I'm just being pedantic here (most likely) but I don't like how we're
just telling the user here how to "suppress this error" by "assigning the value to '_'".
I think it's better if we use the word "discard" here which I think is
the official terminology and also tells the user what it actually means
to "assign the value to '_'".

Also, using the value would also be a way to "suppress the error".
It is just one of the two options: discard or use.
2024-05-14 01:13:48 +09:00
Jakub Konka
6f117dbca4 test/standalone: fix iOS smoke test 2024-05-13 08:55:27 +02:00
David Rubin
75372f12ef riscv: update behaviour tests again 2024-05-11 02:17:24 -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
2fd83d8c0a riscv: by-value structs + @min 2024-05-11 02:17:24 -07:00
David Rubin
a30af172e8 riscv: math progress 2024-05-11 02:17:24 -07:00
David Rubin
a615fbc1f8 riscv: mutable globals 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
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
Dominic
1550b5b16d
astgen: fix result info for catch switch_block_err_union 2024-05-11 12:06:13 +03:00
Andrew Kelley
68629fedef
Merge pull request #19918 from ziglang/xros
Add support for VisionOS
2024-05-09 15:45:42 -07:00
february cozzocrea
c9ad1b5199 aro translate-c: support for record types added 2024-05-09 13:46:50 -07:00
Jakub Konka
47e840a9b9 test/llvm_targets: add watchos, tvos and visionos to test matrix 2024-05-09 22:19:45 +02:00
Andrew Kelley
e89d6fc503 fix wrong int alignment for i65..i127 on x86 arch 2024-05-08 19:37:30 -07:00
Jacob Young
08cecc1c7e x86_64: fix C abi of incomplete sse register 2024-05-08 19:37:29 -07:00
Andrew Kelley
badc28c06e disable regressed test from LLVM 18 upgrade
tracked by #19825
2024-05-08 19:37:29 -07:00
Andrew Kelley
200e06b239 update maxIntAlignment for x86 to 16
LLVMABIAlignmentOfType(i128) reports 16 on this target, however the C
ABI uses align(4).

Clang in LLVM 17 does this:

%struct.foo = type { i32, i128 }

Clang in LLVM 18 does this:

%struct.foo = type <{ i32, i128 }>

Clang is working around the 16-byte alignment to use align(4) for the C
ABI by making the LLVM struct packed.
2024-05-08 19:37:29 -07:00
Andrew Kelley
927f24a6ff disable regressed test from LLVM 18 upgrade
tracked by #19824
2024-05-08 19:37:29 -07:00
Andrew Kelley
b7799ef322 std.Target.maxIntAlignment: move to compiler implementation
This should not be a public API, and the x86 backend does not support
the value 16.
2024-05-08 19:37:29 -07:00
Andrew Kelley
a6856ef6d2 LLVM 18 uses 16 byte alignment for x86_64 i128 2024-05-08 19:37:28 -07:00
Jacob Young
d9b00ee4ba standalone: support relative cache path 2024-05-08 19:37:03 -07:00
Jacob Young
dee9f82f69 Run: add output directory arguments
This allows running commands that take an output directory argument. The
main thing that was needed for this feature was generated file subpaths,
to allow access to the files in a generated directory. Additionally, a
minor change was required to so that the correct directory is created
for output directory args.
2024-05-05 15:58:08 -04:00
Jacob Young
e3424332d3 Build: cleanup
* `doc/langref` formatting
 * upgrade `.{ .path = "..." }` to `b.path("...")`
 * avoid using arguments named `self`
 * make `Build.Step.Id` usage more consistent
 * add `Build.pathResolve`
 * use `pathJoin` and `pathResolve` everywhere
 * make sure `Build.LazyPath.getPath2` returns an absolute path
2024-05-05 09:42:51 -04:00
Ryan Liptak
b86c4bde64 Rename Dir.writeFile2 -> Dir.writeFile and update all callsites
writeFile was deprecated in favor of writeFile2 in f645022d16. This commit renames writeFile2 to writeFile and makes writeFile2 a compile error.
2024-05-03 13:29:22 -07:00
Ryan Liptak
ea9d817a90 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
2024-05-02 22:08:00 -07:00
Anton Lilja
20b9b54e6b
LLVM: Fix panic when using tagged union backed by enum with negative values 2024-05-02 14:15:44 +00:00
daurnimator
497f37ce92 test/link/glibc_compat: fix incorrect strlcpy result 2024-04-28 22:03:08 -07:00
Andrew Kelley
9d64332a59
Merge pull request #19698 from squeek502/windows-batbadbut
std.process.Child: Mitigate arbitrary command execution vulnerability on Windows (BatBadBut)
2024-04-24 13:49:43 -07:00