0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
zig/lib/std
Andrew Kelley 12de7e3472 WIP: move many global settings to become per-Module
Much of the logic from Compilation.create() is extracted into
Compilation.Config.resolve() which accepts many optional settings and
produces concrete settings. This separate step is needed by API users of
Compilation so that they can pass the resolved global settings to the
Module creation function, which itself needs to resolve per-Module
settings.

Since the target and other things are no longer global settings, I did
not want them stored in link.File (in the `options` field). That options
field was already a kludge; those options should be resolved into
concrete settings. This commit also starts to work on that, deleting
link.Options, moving the fields into Compilation and
ObjectFormat-specific structs instead. Some fields were ephemeral and
should not have been stored at all, such as symbol_size_hint.

The link.File object of Compilation is now a `?*link.File` and `null`
when -fno-emit-bin is passed. It is now arena-allocated along with
Compilation itself, avoiding some messy cleanup code that was there
before.

On the command line, it is now possible to configure the standard
library itself by using `--mod std` just like any other module. This
meant that the CLI needed to create the standard library module rather
than having Compilation create it.

There are a lot of changes in this commit and it's still not done. I
didn't realize how quickly this changeset was going to balloon out of
control, and there are still many lines that need to be changed before
it even compiles successfully.

* introduce std.Build.Cache.HashHelper.oneShot
* add error_tracing to std.Build.Module
* extract build.zig file generation into src/Builtin.zig
* each CSourceFile and RcSourceFile now has a Module owner, which
  determines some of the C compiler flags.
History 2024-01-01 17:51:18 -07:00
..
Build WIP: move many global settings to become per-Module 2024-01-01 17:51:18 -07:00
c translate-c: use Aro's tokenizer 2023-11-25 12:28:19 +02:00
compress lib: correct unnecessary uses of 'var' 2023-11-19 09:55:07 +00:00
crypto std.crypto.kem.kyber: mitigate KyberSlash (#18316) 2023-12-22 15:57:16 +00:00
dwarf lib: correct unnecessary uses of 'var' 2023-11-19 09:55:07 +00:00
event rework std.atomic 2023-11-22 19:08:55 -07:00
fmt lib: correct unnecessary uses of 'var' 2023-11-19 09:55:07 +00:00
fs fs: Add tests for deleteTree not following symlinks 2023-12-22 13:47:19 +02:00
hash AstGen: add error for using inline loops in comptime only scopes 2023-12-08 16:54:32 -08:00
heap std.heap: Use @alignOf(T) rather than 0 if not manually overridden for alignment of MemoryPool items 2023-11-21 13:23:53 +00:00
http lib: correct unnecessary uses of 'var' 2023-11-19 09:55:07 +00:00
io std: remove meta.trait 2023-11-22 13:24:27 -05:00
json refact: rectifified a typo in docs of stringify.zig 2023-12-28 00:06:30 +02:00
math Deprecate math.doNotOptimizeAway, use mem.doNotOptimizeAway (#18011) 2023-11-23 15:06:32 -05:00
mem mem: explicit dupe and dupeZ error on Allocator 2023-09-07 21:56:57 +03:00
meta AstGen: add error for using inline loops in comptime only scopes 2023-12-08 16:54:32 -08:00
net std: disable flaky tcp server test 2023-12-19 12:01:09 -07:00
os Merge pull request #18328 from ExpidusOS/feat/uefi-time 2023-12-26 01:03:10 +02:00
rand lib: correct unnecessary uses of 'var' 2023-11-19 09:55:07 +00:00
sort lib: correct unnecessary uses of 'var' 2023-11-19 09:55:07 +00:00
Target std.Target.Query: fix regression with windows os version range 2024-01-01 17:51:18 -07:00
testing std: enable FailingAllocator to fail on resize 2023-09-06 19:06:32 +03:00
Thread bsd: debitrot atomic and debug 2023-11-26 14:28:22 -05:00
time all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
tz Support legacy TZ format, expose header struct to a potential writer 2022-01-01 12:47:08 +00:00
unicode all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
valgrind valgrind.memcheck: fix makeMem*() 2023-10-03 02:51:01 -07:00
zig std.Target.Query: remove deprecated API 2024-01-01 17:51:18 -07:00
array_hash_map.zig std: remove meta.trait 2023-11-22 13:24:27 -05:00
array_list.zig std.ArrayList: add initBuffer to the unmanaged array list 2023-11-22 11:32:14 -07:00
ascii.zig migration: std.math.{min, min3, max, max3} -> @min & @max 2023-06-16 13:44:09 -07:00
atomic.zig rework std.atomic 2023-11-22 19:08:55 -07:00
base64.zig lib: correct unnecessary uses of 'var' 2023-11-19 09:55:07 +00:00
bit_set.zig Merge pull request #17852 from ziglang/zig-reduce 2023-11-04 14:25:50 -04:00
BitStack.zig std.json: Unify stringify and writeStream (#16405) 2023-07-21 19:56:46 -04:00
bounded_array.zig Smaller memory footprint for BoundedArray (#16299) 2023-07-03 13:58:03 -04:00
buf_map.zig lib: correct unnecessary uses of 'var' 2023-11-19 09:55:07 +00:00
buf_set.zig lib: correct unnecessary uses of 'var' 2023-11-19 09:55:07 +00:00
Build.zig std.Build.ResolvedTarget: rename target field to result 2024-01-01 17:51:18 -07:00
builtin.zig lib: correct unnecessary uses of 'var' 2023-11-19 09:55:07 +00:00
c.zig translate-c: use Aro's tokenizer 2023-11-25 12:28:19 +02:00
child_process.zig More accurate argv-to-command-line serialization when spawning child processes on Windows 2023-12-18 23:58:26 +01:00
coff.zig lib: correct unnecessary uses of 'var' 2023-11-19 09:55:07 +00:00
compress.zig std.compress.zstd: renamed from std.compress.zstandard 2023-02-22 00:11:20 +11:00
comptime_string_map.zig ComptimeStringMap: Add version that takes an equality function 2023-09-14 11:03:15 -07:00
crypto.zig x86_64: implement 128-bit builtins 2023-10-23 22:42:18 -04:00
debug.zig test: test with -fstrip and fix failures 2023-12-01 04:34:50 +00:00
dwarf.zig lib: correct unnecessary uses of 'var' 2023-11-19 09:55:07 +00:00
dynamic_library.zig Add illumos OS tag 2023-10-02 15:31:49 -06:00
elf.zig elf: init output COMDAT group sections 2023-11-09 17:41:14 +01:00
enums.zig Add getPtrConstAssertContains(...) for compatibility with a const std.EnumMap 2023-12-11 22:04:43 +00:00
event.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
fifo.zig x86_64: implement enough to pass unicode tests 2023-10-23 22:42:18 -04:00
fmt.zig Update formatFloat* docs to reflect limitation w/ large floats 2023-12-30 14:14:54 +02:00
fs.zig std.fs.File: flatten struct 2023-11-22 15:24:57 -07:00
hash.zig XXH3 Implementation for Zig STD (#17530) 2023-10-17 13:55:01 -05:00
hash_map.zig std.hash_map: clarify error when Context is missing pub hash/eql 2023-12-23 16:15:19 +02:00
heap.zig lib: correct unnecessary uses of 'var' 2023-11-19 09:55:07 +00:00
http.zig std.http: fix crashes found via fuzzing 2023-10-21 20:52:59 -05:00
Ini.zig add std.Ini for basic .ini file parsing 2023-01-11 15:39:48 -08:00
io.zig mem: fix ub in writeInt 2023-10-31 21:37:35 -04:00
json.zig x86_64: pass more tests 2023-10-25 04:28:30 -04:00
leb128.zig Dwarf: improve x86_64 backend debug info 2023-11-12 03:21:52 -05:00
linked_list.zig Revert "std.SinglyLinkedList: add sort function" 2023-11-24 22:33:50 -07:00
log.zig all: zig fmt and rename "@XToY" to "@YFromX" 2023-06-19 12:34:42 -07:00
macho.zig macho: rename flag to EXPORT_SYMBOL_FLAGS_WEAK_DEFINITION 2023-12-06 23:29:08 +01:00
math.zig Revert "Merge pull request #17824 from kcbanner/fixup_msvc_fmax" 2024-01-01 17:49:57 -07:00
mem.zig Remove all usages of std.mem.copy and remove std.mem.set (#18143) 2023-11-29 16:03:02 -05:00
meta.zig AstGen: add error for using inline loops in comptime only scopes 2023-12-08 16:54:32 -08:00
multi_array_list.zig x86_64: fix miscompilations 2023-11-04 09:15:05 -04:00
net.zig std.net: add explicit error sets for IP parsing 2023-12-16 16:15:51 +00:00
once.zig x86_64: fix std test failures 2023-11-03 23:18:21 -04:00
os.zig use linux.perf_event_open directly 2023-12-11 17:48:18 +02:00
packed_int_array.zig std.builtin.Endian: make the tags lower case 2023-10-31 21:37:35 -04:00
pdb.zig lib: correct unnecessary uses of 'var' 2023-11-19 09:55:07 +00:00
priority_dequeue.zig lib: correct unnecessary uses of 'var' 2023-11-19 09:55:07 +00:00
priority_queue.zig lib: correct unnecessary uses of 'var' 2023-11-19 09:55:07 +00:00
process.zig Update ArgIterator on Windows to follow standard Windows parsing rules 2023-12-18 22:55:46 +01:00
Progress.zig lib: correct unnecessary uses of 'var' 2023-11-19 09:55:07 +00:00
rand.zig std: remove meta.trait 2023-11-22 13:24:27 -05:00
RingBuffer.zig std.RingBuffer.zig: Fix typo in readLastAssumeLength 2023-11-21 13:55:09 +02:00
segmented_list.zig x86_64: implement enough to pass unicode tests 2023-10-23 22:42:18 -04:00
SemanticVersion.zig std.zig.system.NativeTargetInfo: fix glibc version parsing 2023-10-23 06:00:53 -04:00
simd.zig x86_64: fix cond_br 2023-10-27 03:33:49 -04:00
sort.zig lib: correct unnecessary uses of 'var' 2023-11-19 09:55:07 +00:00
start.zig Merge pull request #17815 from Luukdegram/wasm-no-entry 2023-11-05 18:44:12 -05:00
start_windows_tls.zig all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
std.zig std.Target: flatten 2024-01-01 17:51:18 -07:00
tar.zig std.tar: trim also spaces from the beginning of file size 2023-11-21 00:55:22 -05:00
Target.zig std.Target.Query: remove deprecated API 2024-01-01 17:51:18 -07:00
testing.zig Revert "Merge pull request #12060 from Vexu/IterableDir" 2023-11-22 12:35:33 -07:00
Thread.zig doc: possible typo at std.Thread.spawn comment 2023-12-30 14:17:36 +02:00
time.zig os.uefi: add ns to epoch 2023-12-20 20:05:16 -08:00
treap.zig lib: correct unnecessary uses of 'var' 2023-11-19 09:55:07 +00:00
tz.zig std.builtin.Endian: make the tags lower case 2023-10-31 21:37:35 -04:00
unicode.zig Updated Utf8View example to format the single codepoint UTF-8 slice with {s} (#18288) 2024-01-01 18:47:27 -05:00
Uri.zig std.Uri: default some fields to null 2024-01-01 17:51:18 -07:00
valgrind.zig Fix simple doc mistakes. (#17624) 2023-10-21 21:24:55 +00:00
wasm.zig Fix simple doc mistakes. (#17624) 2023-10-21 21:24:55 +00:00
zig.zig std.Target.Query: remove deprecated API 2024-01-01 17:51:18 -07:00