Andrew Kelley
24ff8a1a5f
zig build: use multihash for the hash field
...
https://multiformats.io/multihash/
Still, only SHA2-256 is supported. This is only intended to future-proof
the hash field of the manifest.
closes #14284
2023-02-01 20:02:35 -07:00
Andrew Kelley
ea6e0e33a7
zig build: add executable bit and file path to package hash
...
Unfortunately, due to the Windows equivalent of executable permissions
being a bit tricky, there is follow-up work to be done.
What is done in this commit is the hash modifications. At the fetch
layer, executable bits inside packages are ignored. In the hash
computation layer, executable bit is implemented for POSIX but not yet
for Windows. This means that the hash will not break again in the future
for packages that do not have any executable files, but it will break
for packages that do.
This is a hash-breaking change.
Closes #14308
2023-02-01 18:42:29 -07:00
Jakub Konka
304420b99c
Merge pull request #14502 from ziglang/link-owned-atoms
...
link: move ownership of linker atom from frontend to the linkers
2023-02-02 01:39:01 +01:00
Veikka Tuominen
629c3108aa
AstGen: fix orelse type coercion in call arguments
...
Closes #14506
2023-02-02 00:31:35 +02:00
Josh Holland
1fba88450d
langref: add paragraph and examples about indexing non-ASCII strings
...
PR #10610 addressed most of the points from #1854 . This
additional paragraph and examples covers the OMISSIONS section
clarifying issues about indexing into non-ASCII strings (whether valid
UTF-8 or not). I think this finally closes #1854 .
2023-02-01 21:46:46 +02:00
Evan Typanski
86ec26b1f0
translate-c: Fix types on assign expression bool
2023-02-01 21:45:53 +02:00
ominitay
3c8d968194
fmt: Make default_max_depth configurable
2023-02-01 21:43:36 +02:00
Veikka Tuominen
490addde27
Sema: fix error location on comptime arg to typed generic param
...
Closes #14505
2023-02-01 20:50:43 +02:00
Jakub Konka
beb20d29db
link: remove union types which are now internal to backends
2023-02-01 19:32:54 +01:00
Luuk de Gram
46f54b23ae
link: make Wasm atoms fully owned by the linker
2023-02-01 19:10:56 +01:00
Jakub Konka
1aa0f8aa2f
link: fix pointer invalidation issues in Elf, MachO and Coff
2023-02-01 17:46:57 +01:00
Jakub Konka
e0f3975fc8
link: make SpirV atoms fully owned by the linker
2023-02-01 16:01:43 +01:00
Jakub Konka
5de2aae63c
link: decouple DI atoms from linker atoms, and manage them in Dwarf linker
2023-02-01 15:03:55 +01:00
Jakub Konka
d98fc53b8f
link: use strtab.StringTable in Dwarf
2023-02-01 11:49:07 +01:00
Jakub Konka
b3277c8936
link: make Plan9 atoms fully owned by the linker
2023-02-01 11:12:53 +01:00
Jakub Konka
9fdc32c96e
link: clean up type resolution in Elf.Atom and MachO.Atom
2023-02-01 09:13:49 +01:00
praschke
2ccff51154
mingw: repair msvcrt-os build flags
...
__LIBMSVCRT__ is still used and is distinct from __LIBMSVCRT_OS__
2023-01-31 23:25:02 -05:00
Andrew Kelley
efa25e7d5b
Merge pull request #14498 from ziglang/zig-build-api
...
Several enhancements to the build system. Many breaking changes to the API.
* combine `std.build` and `std.build.Builder` into `std.Build`
* eliminate `setTarget` and `setBuildMode`; use an options struct for `b.addExecutable` and friends
* implement passing options to dependency packages. closes #14285
* rename `LibExeObjStep` to `CompileStep`
* move src.type.CType to std lib, use it from std.Build, this helps with populating config.h files.
2023-01-31 23:15:59 -05:00
Andrew Kelley
8d37c6f71c
std.Build.CompileStep: fix API usage in unit test
2023-01-31 15:34:08 -07:00
Luuk de Gram
6f13a725a3
Merge pull request #14494 from Techatrix/wasm-optional-slice
...
wasm: correctly handle optional slices
2023-01-31 23:11:58 +01:00
Andrew Kelley
7d14baec90
tests: fix missing target for C ABI tests
...
This regressed earlier in this branch.
2023-01-31 15:09:35 -07:00
Andrew Kelley
3c1fc3f566
std.Build.ConfigHeaderStep: support more types
2023-01-31 15:09:35 -07:00
Andrew Kelley
2f5892671e
move compiler's CType logic to std.Target
...
This API only depends on std.Target and is extremely useful in build
scripts when populating configure files.
2023-01-31 15:09:35 -07:00
Andrew Kelley
90e48d4b34
std.Build: avoid use of catch unreachable
...
Usage of `catch unreachable` in build scripts is completely harmless
because build scripts are always run in Debug mode, however, it sets a
poor example for beginners to learn from.
2023-01-31 15:09:35 -07:00
Andrew Kelley
13a9616540
std.Build: add deprecated declarations
...
These declarations are now aliases of their new APIs and marked as
deprecated via doc comments:
* std.build.Builder
* std.build
* std.Build.LibExeObjStep
2023-01-31 15:09:35 -07:00
Andrew Kelley
16cdd1297e
rename std.Build.LibExeObjStep to std.Build.CompileStep
...
This matches the nomenclature internally: a Compilation is the main type
that represents a single invokation of the compiler.
2023-01-31 15:09:35 -07:00
Andrew Kelley
77544683dd
fix init-exe, init-lib templates
2023-01-31 15:09:35 -07:00
Andrew Kelley
34b3145099
update test case for new std.builtin.OptimizeMode API
2023-01-31 15:09:35 -07:00
Andrew Kelley
9a29f4e038
langref updates for new std.Build API
2023-01-31 15:09:35 -07:00
Andrew Kelley
5129fae4e8
std.Build: accept host Target in create()
...
And only detect native target in LibExeObjStep once, in create().
2023-01-31 15:09:35 -07:00
Andrew Kelley
60c4befad3
build.zig: remove dead list of unused source files
2023-01-31 15:09:35 -07:00
Andrew Kelley
36e2d992dd
combine std.build and std.build.Builder into std.Build
...
I've been wanting to do this for along time.
2023-01-31 15:09:35 -07:00
Andrew Kelley
73cf7b6429
update build.zig API usage
2023-01-31 15:09:35 -07:00
Andrew Kelley
71ff60f126
std.build: eliminate setTarget and setBuildMode
...
This is a breaking change that makes the API for creating build
artifacts no longer have any period of time where the target and
optimization mode are not set.
2023-01-31 15:09:35 -07:00
Andrew Kelley
063888afff
std.build: implement passing options to dependency packages
...
* introduce the concept of maps to user input options, but don't
implement it for command line arg parsing yet.
* remove setPreferredReleaseMode and standardReleaseOptions in favor of
standardOptimizeOption which has a future-proof options parameter.
2023-01-31 15:09:35 -07:00
Jakub Konka
c430e9afa7
link: make Coff atoms fully owned by the linker
2023-01-31 20:27:17 +01:00
leap123
ef8f694d77
std.os.uefi: fix shift in pool allocator (again) ( #14497 )
2023-01-31 13:08:30 -05:00
Jakub Konka
4404c4d200
link: make Elf atoms fully owned by the linker
2023-01-31 17:54:12 +01:00
Techatrix
47ff57ed7d
wasm: apply request change
2023-01-31 17:01:56 +01:00
r00ster91
17404f8e6e
Sema: emit compile error for comptime or inline call of function pointer
2023-01-31 17:15:34 +02:00
Andrew Kelley
d6b430b520
std.Target: remove workaround
...
This was working around a stage1 compiler bug.
2023-01-31 02:28:16 -05:00
Techatrix
1f64432196
wasm: correctly handle optional slices
2023-01-31 00:59:18 +01:00
Jakub Konka
d42a931051
link: make MachO atoms fully owned by the linker
2023-01-31 00:43:25 +01:00
Veikka Tuominen
f3bb1957fa
update zig1.wasm to include @qualCast
2023-01-30 18:55:58 +02:00
Veikka Tuominen
f16c10a86b
implement @qualCast
2023-01-30 18:55:57 +02:00
Veikka Tuominen
fe4ea31f7e
Sema: replace backticks with single quotes
...
Most error messages already use single quotes for everything
so this makes the remaining ones consistent.
2023-01-30 15:20:16 +02:00
Veikka Tuominen
a9785fe8ee
Sema: add helpful notes to invalid @ptrCast operations
...
Closes #14474
2023-01-30 15:20:16 +02:00
Veikka Tuominen
b129350cb5
AstGen: fix crash on invalid decltest
...
Closes #14476
2023-01-30 15:20:16 +02:00
Veikka Tuominen
dd300d47b2
add test for already implemented proposal
...
Closes #1564
2023-01-30 15:20:16 +02:00
Veikka Tuominen
720d82721f
Sema: ensure args to inline comptime args are comptime-known
...
Closes #14413
2023-01-30 15:20:16 +02:00