Commit Graph

70 Commits

Author SHA1 Message Date
Aaron Sikes
72039f2349 Allow arbitrary arrays in build options 2021-10-23 13:30:20 -04:00
Aaron Sikes
f98f5e0bcd Fix enums with non-ident fields 2021-10-23 12:46:22 -04:00
Aaron Sikes
07bb8681e9 Ensure any custom printing here remains valid zig syntax 2021-10-23 11:22:22 -04:00
Aaron Sikes
371d3f12a2 Fix std.builtin.Version build option formatting 2021-10-23 10:55:52 -04:00
Jonathan Marler
e2a2e6c14f InstallRawStep: handle empty segments
This fixes InstallRawStep to handle the cases when there are empty segments (segments with no sections).  Before this change, if there was an empty segment with no sections, then the fixup of binaryOffsets is skipped.  This fixes that by looping through each segment until a non-empty one is found and then fixing up the sections. This fixed an issue I was having with InstallRawStep for a bootloader I'm writing.
2021-10-21 17:03:44 -04:00
Jonathan Marler
da2b615efb distinguish between unexpected child process exit code and unclean exit
This modifies the error for an unexpected exit code from the ChildProcess of RunStep to be UnexpectedExitCode rather than UncleanExit.  This allows the handler of the error to distinguish between an error reported by the ChildProcess, and an error executing the ChildProcess, which is an important dinstinction when it comes to know what information to report to the user.  For example, if you have a ChildProcess that you know reports its own errors, an unexpected exit code would mean the error is already reported, but an unclean exit would mean that child process was not able to report any error.
2021-10-21 17:03:00 -04:00
Andrew Kelley
6115cf2240 migrate from std.Target.current to @import("builtin").target
closes #9388
closes #9321
2021-10-04 23:48:55 -07:00
Evan Haas
742fe65f3e
stdlib: Add test for generating HEX files.
Co-authored-by: Akbar Dhanaliwala <akbar.dhanaliwala@gmail.com>
2021-09-01 12:21:30 -07:00
Evan Haas
bf0d436087
stdlib: Add Intel HEX support to InstallRawStep
This allows writing HEX files with `exe.installRaw`, where `exe` is a
`LibExeObjStep`. A HEX file will be written if the file extension is `.hex`
or `.ihex`, otherwise a binfile will be written. The output format can be
explicitly chosen with `exe.installRawWithFormat("filename", .hex);`
(or `.bin`)

Part of #2826

Co-authored-by: Akbar Dhanaliwala <akbar.dhanaliwala@gmail.com>
2021-09-01 12:21:22 -07:00
Lee Cannon
311797f686
Rework build system build_options API (#9623)
* rework `build_options` to integrate with the FileSource abstraction
* support mapping as an arbitrarily named package
* support mapping to multiple different artifacts
* use hash of contents for options filename
2021-08-26 19:53:23 -04:00
Andrew Kelley
d29871977f remove redundant license headers from zig standard library
We already have a LICENSE file that covers the Zig Standard Library. We
no longer need to remind everyone that the license is MIT in every single
file.

Previously this was introduced to clarify the situation for a fork of
Zig that made Zig's LICENSE file harder to find, and replaced it with
their own license that required annual payments to their company.
However that fork now appears to be dead. So there is no need to
reinforce the copyright notice in every single file.
2021-08-24 12:25:09 -07:00
Lee Cannon
c234d4790e
Add option to hide build command on compilation error to build_runner (#8513)
Co-authored-by: Veikka Tuominen <git@vexu.eu>
2021-07-27 21:30:53 -04:00
Jacob G-W
9fffffb07b fix code broken from previous commit 2021-06-21 17:03:03 -07:00
Veikka Tuominen
2b2efa24d0 std.build: don't default to static linkage 2021-06-12 14:23:07 +03:00
Veikka Tuominen
4b72b0560d make remaining enums in build.zig snake_case 2021-06-11 16:01:30 +03:00
Felix (xq) Queißner
98941cf27c Makes output path stuff more sane. 2021-06-11 10:43:38 +03:00
Felix (xq) Queißner
27bd0971bb Changes to .path instead of .getPathFn. Changes LibExeObjStep to also provide FileSource. 2021-06-11 10:39:50 +03:00
Felix (xq) Queißner
07acb1ccc9 Changes createExecutable parameter is_dynamic to a enum to make code more readable . 2021-06-11 10:38:57 +03:00
Felix (xq) Queißner
56cb0b5ca0 Moves files to file-global struct layout. 2021-06-11 10:33:27 +03:00
Felix (xq) Queißner
8501bb04ad Adds a lot of missing dupes, some more snakes. 2021-06-11 10:33:26 +03:00
Felix (xq) Queißner
4ed567d12e Adds more FileSources everywhere. 2021-06-11 10:33:26 +03:00
Felix (xq) Queißner
437f81aa9a Starts to replace special cases in std.build.FileSource. 2021-06-11 10:33:10 +03:00
Martin Wickham
fc9430f567 Breaking hash map changes for 0.8.0
- hash/eql functions moved into a Context object
- *Context functions pass an explicit context
- *Adapted functions pass specialized keys and contexts
- new getPtr() function returns a pointer to value
- remove functions renamed to fetchRemove
- new remove functions return bool
- removeAssertDiscard deleted, use assert(remove(...)) instead
- Keys and values are stored in separate arrays
- Entry is now {*K, *V}, the new KV is {K, V}
- BufSet/BufMap functions renamed to match other set/map types
- fixed iterating-while-modifying bug in src/link/C.zig
2021-06-03 17:02:16 -05:00
Daniele Cocca
44e480aa2c translate_c: remove unused WriteFileStep import 2021-05-23 14:35:19 -04:00
g-w1
e9e91b4ed0
std.build: if using a RunStep, show the command run on verbose (#8571) 2021-05-01 08:17:17 +02:00
Andrew Kelley
ffb2568a9f
Merge pull request #7763 from kivikakk/zig-elf-parse
std.elf: expose parsing decoupled from std.fs.File
2021-03-04 11:56:31 -08:00
Martin Wickham
1032a69321 Dupe strings on all public api points for std.build 2021-02-01 12:31:24 -08:00
LemonBoy
134f5fd3d6 std: Update test "" to test where it makes sense 2021-01-22 15:46:58 +01:00
Asherah Connor
affb57aad9 use interfaces 2021-01-15 10:34:53 +11:00
Asherah Connor
32d69d70cf expose phdr, shdr parsing 2021-01-14 15:30:28 +11:00
Jay Petacat
a9b505fa77 Reduce use of deprecated IO types
Related: #4917
2021-01-07 23:48:58 -08:00
LemonBoy
dd973fb365 std: Use {s} instead of {} when printing strings 2021-01-02 17:12:57 -07:00
Frank Denis
6c2e0c2046 Year++ 2020-12-31 15:45:24 -08:00
frmdstryr
577b57784a Return encoded slice from base64 encode 2020-12-24 01:27:21 +02:00
Josh Holland
c25b157dda remove deprecated uses of ArrayList.span 2020-11-07 11:15:44 +00:00
Tadeo Kondrak
e892ee17e6 std: move std.meta.refAllDecls to std.testing 2020-10-15 20:34:22 -04:00
Andrew Kelley
800a4a6ceb eliminate dependency of libzigcpp.a on libzigstage1.a
This allows us to create a build of self-hosted with LLVM extensions
enabled but without the stage1 backend.
2020-09-23 00:00:24 -07:00
Frank Denis
eef111fe78 Fix missing init() update in std/build/write_file.zig 2020-08-20 19:21:10 -04:00
Frank Denis
6f9ea9eaef Breaking: sort std/crypto functions into categories
Instead of having all primitives and constructions share the same namespace,
they are now organized by category and function family.

Types within the same category are expected to share the exact same API.
2020-08-20 23:02:05 +02:00
Andrew Kelley
4a69b11e74 add license header to all std lib files
add SPDX license identifier
copyright ownership is zig contributors
2020-08-20 16:07:04 -04:00
Jay Petacat
cf15b4c269 elf: Iterate over headers w/o need for allocator 2020-08-01 16:01:48 +00:00
Felix (xq) Queißner
fb9d5529da Adds support for RunStep to use the result of a WriteFileStep. 2020-07-27 19:46:15 +00:00
Vexu
e85fe13e44
run zig fmt on std lib and self hosted 2020-07-11 20:41:19 +03:00
Vexu
caaa26c9f0 reference emit_raw in std lib tests 2020-06-18 20:17:53 -04:00
Cassidy Dingenskirchen
57f1ed5325 Fix a few std.sort.sort invocations 2020-06-12 13:33:31 -04:00
Noam Preil
e9f344dcd4 Add include dirs to translate-c (close #5098) 2020-05-29 13:39:16 -04:00
Alexandros Naskos
d268e0cf2e Added and id and a cast function to build steps 2020-05-25 11:20:31 +03:00
markfirmware
5974a88794 Update emit_raw.zig 2020-04-14 16:19:01 -04:00
xackus
7a28c644aa new ArrayList API: fix everything else 2020-04-02 16:12:08 +02:00
Andrew Kelley
9e7ae06249
std lib API deprecations for the upcoming 0.6.0 release
See #3811
2020-03-30 14:23:22 -04:00