aboutsummaryrefslogtreecommitdiff
path: root/lib/std/build
AgeCommit message (Collapse)Author
2023-01-31combine std.build and std.build.Builder into std.BuildAndrew Kelley
I've been wanting to do this for along time.
2023-01-31update build.zig API usageAndrew Kelley
2023-01-31std.build: eliminate setTarget and setBuildModeAndrew Kelley
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-31std.build: implement passing options to dependency packagesAndrew Kelley
* 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-29build: .c ofmt does not produce a pdbkcbanner
2023-01-25zig build system: add LibExeObjStep.installLibraryHeadersAndrew Kelley
This function is needed when a library exposes one of its own library dependency's headers as part of its own public API. Also, improve error message when a file system error occurs during install file step.
2023-01-24build: Fix red zone flagDavid Gonzalez Martin
2023-01-23build: fix incorrect name in InstallArtifactStepManlio Perillo
Rename the full_pdb_path variable to full_h_path, in the InstallArtifactStep.make method.
2023-01-20std.build.LibExeObjStep: avoid putting static libs inside static libsAndrew Kelley
2023-01-20std.build.LibExeObjStep: better handle transitive depsAndrew Kelley
* no longer repeat -lc on the linker line redundantly * when using linkLibrary() with a static library, it will now also put the static library's static library dependencies on the linker line, recursively. * refactor out a common pattern to an addFlag function
2023-01-17std.build.LibExeObjStep: change installHeader APIAndrew Kelley
Now it always takes a dest_rel_path parameter, making it slightly more verbose, and much more useful.
2023-01-17std.build.ConfigHeaderStep: support cmake syntaxAndrew Kelley
It's not fully implemented yet, for example `@FOO@` syntax is not handled.
2023-01-16add std.build.LibExeObjStep.installHeadersDirectoryOptionsAndrew Kelley
For when you need options such as excluding certain extensions.
2023-01-11zig build: add Artifact.installHeadersDirectoryAndrew Kelley
This one is useful for when the C library has a "include" directory but it needs to get renamed to, e.g. "lame" when being installed.
2023-01-11zig build: support libraries aware of installed headersAndrew Kelley
2023-01-07std.build.WriteFileStep: fix regression in this branchAndrew Kelley
This branch makes WriteFileStep use the same hashing algorithm as our cache system, reducing the divergence between zig build and the cache system.
2023-01-07std.build.ConfigHeaderStep: stub out cmake styleAndrew Kelley
2023-01-07add std.build.ConfigHeaderStepAndrew Kelley
This API converts a config.h.in file into config.h. This is useful when introducing a build.zig file to an existing C/C++ project that is configured with autotools or cmake. The cmake syntax is not implemented yet.
2023-01-05ELF linker: support common-page-size and max-page-size lld optsFrank Denis
These linker flags are required to build static ELF binaries that can run under the Blink emulator: https://github.com/jart/blink/issues/14
2022-12-29Merge pull request #14102 from Luukdegram/wasm-undefined-symbolsAndrew Kelley
WebAssembly: remove unconditional --allow-undefined flag
2022-12-28std: remove hack in test stepLuuk de Gram
This hack was initially introduced as we would export all symbols unconditionally, including non-function definitions. This would cause an error from the Wasmtime runtime engine, which this flag would suppress. As we now properly export symbols, this flag is no longer needed and any user running into this error can manually include it. This commit also adds the `--import-symbols` ability to build.zig
2022-12-27link-tests: redo macho strict validation test to match libstuffJakub Konka
2022-12-23link-tests: add macho strict validation testJakub Konka
Support more operators when running simple arithmetic tests, and allow for int literals in the program spec.
2022-12-16macho: add uuid link testJakub Konka
2022-12-13add `zig objcopy` subcommandAndrew Kelley
This commit moves the logic from `std.build.InstallRawStep` into `zig objcopy`. The options here are limited, but we can add features as needed. closes #9261 New issues can be opened for specific objcopy flag support.
2022-12-11std.build.InstallRawStep: fix compilation on wasm32-wasiAndrew Kelley
2022-12-11std.build.OptionsStep: fix regressed testsAndrew Kelley
2022-12-11std.build: extract steps to separate filesAndrew Kelley
There are intended to be no functional changes in this commit.
2022-12-07AstGen: make `@compileError` operand implicitly comptimeVeikka Tuominen
This matches the language reference.
2022-12-06remove most conditional compilation based on stage1Andrew Kelley
There are still a few occurrences of "stage1" in the standard library and self-hosted compiler source, however, these instances need a bit more careful inspection to ensure no breakage.
2022-12-06remove `-fstage1` optionAndrew Kelley
After this commit, the self-hosted compiler does not offer the option to use stage1 as a backend anymore.
2022-11-15std.build: fix typoGethDW
This would only fail to compile when building *on* WASI.
2022-11-12Make invalidFmtError public and use in place of compileErrors for bad format ↵Nick Cernis
strings (#13526) * Export invalidFmtErr To allow consistent use of "invalid format string" compile error response for badly formatted format strings. See https://github.com/ziglang/zig/pull/13489#issuecomment-1311759340. * Replace format compile errors with invalidFmtErr - Provides more consistent compile errors. - Gives user info about the type of the badly formated value. * Rename invalidFmtErr as invalidFmtError For consistency. Zig seems to use “Error” more often than “Err”. * std: add invalid format string checks to remaining custom formatters * pass reference-trace to comp when building build file; fix checkobjectstep
2022-11-04all: rename i386 to x86Ali Chraghi
2022-10-25CheckObjectStep: parse and dump `target_features`Luuk de Gram
When an object file or binary contains the target_features section we can now parse and then dump its contents in string format so we can use them in our linker tests to verify the features section.
2022-10-19Merge pull request #13218 from Luukdegram/fix-emulatable-stepLuuk de Gram
std: CheckObject - correctly depend on its own step when creating an EmulatableRunStep
2022-10-18CheckObjectStep: correctly depend on its own stepLuuk de Gram
When creating an `EmulatableRunStep`, it now correctly depends on its own step rather than only the executable that was created. This means we do not need to add extra `dependOn` statements on both the emulatable step as well as the check object step.
2022-10-18all: rename `@maximum` to `@max` and `@minimum` to `@min`Ali Chraghi
2022-10-18Sema: implement linksection on functionsjacobly0
* Sema: implement linksection on functions * Implement function linksection in Sema. * Don't clobber function linksection/align/addrspace in Sema. * Fix copy-paste typo in tests. * Add a bunch of missing test_step.dependOn. * Fix checkInSymtab match. Closes #12546
2022-10-08CheckObjectStep: parsing and dumping producersLuuk de Gram
2022-09-29Fix `Step.cast` for `OptionsStep` and `CheckObjectStep`Lee Cannon
2022-09-08std.zig.system.NativeTargetInfo: detection ignores self exeAndrew Kelley
Before, native glibc and dynamic linker detection attempted to use the executable's own binary if it was dynamically linked to answer both the C ABI question and the dynamic linker question. However, this could be problematic on a system that uses a RUNPATH for the compiler binary, locking it to an older glibc version, while system binaries such as /usr/bin/env use a newer glibc version. The problem is that libc.so.6 glibc version will match that of the system while the dynamic linker will match that of the compiler binary. Executables with these versions mismatching will fail to run. Therefore, this commit changes the logic to be the same regardless of whether the compiler binary is dynamically or statically linked. It inspects `/usr/bin/env` as an ELF file to find the answer to these questions, or if there is a shebang line, then it chases the referenced file recursively. If that does not provide the answer, then the function falls back to defaults. This commit also solves a TODO to remove an Allocator parameter to the detect() function.
2022-08-24Enables std.build.TranslateCStep to use stage1/stage2 selectively. Unbreaks ↵Felix "xq" Queißner
projects using stage1 and manual TranslateC
2022-08-21std: fix EmulatableRunStepLuuk de Gram
Fixes a compilation error when using the `EmulatableRunStep` that is being generated from a step directly using `runEmulatable`.
2022-08-18build: Allow comptime_int in OptionsStep.addOptionBen Fiedler
2022-08-03macho: sync with zldJakub Konka
gitrev a2c32e972f8c5adfcda8ed2d99379ae868f59c24 https://github.com/kubkon/zld/commit/a2c32e972f8c5adfcda8ed2d99379ae868f59c24
2022-07-23Share logic between EmulatableRunStep & RunStepLuuk de Gram
2022-07-23Use `EmulatableRunStep` for MachO linker testsLuuk de Gram
2022-07-23rename:RunCompareStep -> EmulatableRunStepLuuk de Gram
Renamed to better convery the intention of the step
2022-07-23show/hide warning for incompatible warningsLuuk de Gram
Implements running and verifying the expected output when a binary is run. Also adds warnings when a binary is skipped because of incompatibility. This warning can be hidden by either setting the option manually through build.zig, or by providing the option `-Dhide_foreign_warnings`.