Commit Graph

33 Commits (599213463d51bf3946df53e04091f6cda3d8ee0e)

Author SHA1 Message Date
mogud 688d02176c build support list options 2020-01-07 13:59:53 -05:00
emekoi 156e43b463 added -- to pass args to zig build commands 2020-01-07 13:59:16 -05:00
Andrew Kelley 4e4ba6c3e1
test harness: show annotated case name when translate-c test fails 2020-01-07 13:40:17 -05:00
Andrew Kelley 242f5d10d5
fix test-gen-h and test-compile-errors regression 2020-01-05 13:08:18 -05:00
Andrew Kelley a690a5085d
rework and improve some of the zig build steps
* `RunStep` moved to lib/std/build/run.zig and gains ability to compare
   output and exit code against expected values. Multiple redundant
   locations in the test harness code are replaced to use `RunStep`.
 * `WriteFileStep` moved to lib/std/build/write_file.zig and gains
   ability to write more than one file into the cache directory, for
   when the files need to be relative to each other. This makes
   usage of `WriteFileStep` no longer problematic when parallelizing
   zig build.
 * Added `CheckFileStep`, which can be used to validate that the output
   of another step produced a valid file. Multiple redundant locations
   in the test harness code are replaced to use `CheckFileStep`.
 * Added `TranslateCStep`. This exposes `zig translate-c` to the build
   system, which is likely to be rarely useful by most Zig users;
   however Zig's own test suite uses it both for translate-c tests and
   for run-translated-c tests.
 * Refactored ad-hoc code to handle source files coming from multiple
   kinds of sources, into `std.build.FileSource`.
 * Added `std.build.Builder.addExecutableFromWriteFileStep`.
 * Added `std.build.Builder.addExecutableSource`.
 * Added `std.build.Builder.addWriteFiles`.
 * Added `std.build.Builder.addTranslateC`.
 * Added `std.build.LibExeObjStep.addCSourceFileSource`.
 * Added `std.build.LibExeObjStep.addAssemblyFileFromWriteFileStep`.
 * Added `std.build.LibExeObjStep.addAssemblyFileSource`.
 * Exposed `std.fs.base64_encoder`.
2020-01-05 02:19:22 -05:00
mogud d972d1c942 generate header in separate folder 2019-12-31 02:25:57 -05:00
Andrew Kelley b1abe4a172
Revert "added -- to pass args to zig build commands"
This reverts commit d4e56ae6ae.

This broke the build
2019-12-16 16:36:42 -05:00
emekoi d4e56ae6ae added -- to pass args to zig build commands 2019-12-16 16:24:54 -05:00
Andrew Kelley 839b3a61ad
expose the ability to disable C sanitization
and disable C sanitization when building libcs.
Empirically, they seem to trigger undef-sanitization.
2019-12-16 13:51:21 -05:00
dbandstra 3388c777fa print call in build.zig needs to use a tuple argument 2019-12-10 10:18:57 -05:00
Andrew Kelley 8b2622cdd5
std.fmt.format: tuple parameter instead of var args 2019-12-08 22:53:51 -05:00
Andrew Kelley b36c07a95a
Merge remote-tracking branch 'origin/master' into remove-array-type-coercion 2019-12-01 09:56:01 -05:00
Andrew Kelley 413f9a5cfc
move `std.fs.Dir.cwd` to `std.fs.cwd`
update to non-deprecated std.fs APIs throughout the codebase

Related: #3811
2019-11-30 15:35:27 -05:00
Michael Dusan ca61a5f0b7 Windows: fix test/standalone/shared_library
- on Windows use first found env var { "Path", "PATH" }

Bug Description: `build test` results in the following error on in
a msys64 shell with "PATH" env var instead of "Path":

    error while loading shared libraries: mathtest.dll:
    cannot open shared object file: No such file or directory
2019-11-27 19:24:06 -05:00
Andrew Kelley bf3ac66150
remove type coercion from array values to references
* Implements #3768. This is a sweeping breaking change that requires
   many (trivial) edits to Zig source code. Array values no longer
   coerced to slices; however one may use `&` to obtain a reference to
   an array value, which may then be coerced to a slice.

 * Adds `IrInstruction::dump`, for debugging purposes. It's useful to
   call to inspect the instruction when debugging Zig IR.

 * Fixes bugs with result location semantics. See the new behavior test
   cases, and compile error test cases.

 * Fixes bugs with `@typeInfo` not properly resolving const values.

 * Behavior tests are passing but std lib tests are not yet. There
   is more work to do before merging this branch.
2019-11-27 03:37:50 -05:00
syscall0 a6ef83cccf Fix build system crash when compiling windows dll 2019-11-26 15:40:31 -05:00
Andrew Kelley 659c1bdeee
Merge branch 'wasi-run-tests' of https://github.com/fengb/zig into fengb-wasi-run-tests 2019-11-25 17:53:26 -05:00
Andrew Kelley cb38bd0a14
rename std.heap.direct_allocator to std.heap.page_allocator
std.heap.direct_allocator is still available for now but it is marked
deprecated.
2019-11-25 17:25:06 -05:00
Benjamin Feng d27721f58c Add .enable_wasmtime build flag 2019-11-20 12:06:21 -06:00
Sahnvour 956ba8b0e7
Merge pull request #3447 from Sahnvour/vcpkg
build: initial support for using vcpkg libraries
2019-11-12 20:16:01 +01:00
Andrew Kelley d44a69689e
std.ChildProcess.spawn has a consistent error set
across targets. Also fix detection of pkg-config not
installed on Windows when using zig build.
2019-11-10 15:40:27 -05:00
Sahnvour def5462d05 build: initial support for using vcpkg libraries 2019-11-09 12:37:38 +01:00
Andrew Kelley 9bc4f8ea77
zig build: addIncludeDir does -I instead of -isystem 2019-11-05 14:32:17 -05:00
Andrew Kelley 60cd11bd4b
get rid of std.os.foo.is_the_target
It had the downside of running all the comptime blocks and resolving
all the usingnamespaces of each system, when just trying to discover if
the current system is a particular one.

For Darwin, where it's nice to use `std.Target.current.isDarwin()`, this
demonstrates the utility that #425 would provide.
2019-10-24 01:14:52 -04:00
Andrew Kelley 17eb24a7e4
move types from builtin to std
* All the data types from `@import("builtin")` are moved to
  `@import("std").builtin`. The target-related types are moved
  to `std.Target`. This allows the data types to have methods, such as
  `std.Target.current.isDarwin()`.
 * `std.os.windows.subsystem` is moved to
   `std.Target.current.subsystem`.
 * Remove the concept of the panic package from the compiler
   implementation. Instead, `std.builtin.panic` is always the panic
   function. It checks for `@hasDecl(@import("root"), "panic")`,
   or else provides a default implementation.

This is an important step for multibuilds (#3028). Without this change,
the types inside the builtin namespace look like different types, when
trying to merge builds with different target settings. With this change,
Zig can figure out that, e.g., `std.builtin.Os` (the enum type) from one
compilation and `std.builtin.Os` from another compilation are the same
type, even if the target OS value differs.
2019-10-23 19:09:49 -04:00
Andrew Kelley e839250c51
Merge branch 'stratact-no-dir-allocators'
closes #2885
closes #2886
closes #2888
closes #3249
2019-10-21 23:54:29 -04:00
stratact e78d3750c5
Use 8192 sized buffers and remove allocator parameters 2019-10-19 14:04:51 -04:00
Nick Erdmann c8dec5729c
std/build: make subsystem configurable 2019-10-18 20:11:28 +02:00
Andrew Kelley c4e4fa2287
zig build: bump default max exec output size to 400 KB
closes #3415
2019-10-09 15:24:15 -04:00
Andrew Kelley 7688100b17 stage1: enable PIC for libuserland
we don't really have a way to determine whether the stage1
zig compiler requires PIC so to be safe we always enable it
when building libuserland.

fixes build on some configurations of alpine linux.
2019-10-08 00:06:28 -04:00
Andrew Kelley 7481a4ad08
zig build: fix exe file ext to match target.cpp 2019-10-03 16:02:24 -04:00
Andrew Kelley dc7016344e
remove --override-std-dir. fix issues caused by moving std lib 2019-09-25 23:59:07 -04:00
Andrew Kelley ed36dbbd9c
mv std/ lib/
that's all this commit does. further commits will fix cli flags and
such.

see #2221
2019-09-25 23:35:41 -04:00