Commit Graph

43 Commits (943dbe5b5098b243cea5e174cc2238f24d884253)

Author SHA1 Message Date
Andrew Kelley 943dbe5b50 zig build: improved API for installing C build artifacts
see #332
2017-04-30 21:03:23 -04:00
Andrew Kelley 97f6b6093c zig build can build and install static C libraries
See #332
2017-04-30 20:29:33 -04:00
Andrew Kelley 2c6827064c fix regression from previous commit 2017-04-30 20:11:35 -04:00
Andrew Kelley 1ec89b0286 zig build: refactor CLibrary and CExecutable into same struct 2017-04-30 19:48:45 -04:00
Andrew Kelley 363d9038c9 zig build: organize build artifacts
closes #328
2017-04-30 18:56:24 -04:00
Andrew Kelley 38a04a267c zig build: when compiling C files put .o files in cache dir
See #328
2017-04-30 13:01:35 -04:00
Andrew Kelley d04d3ec775 build system: remove setLinkerScriptContents 2017-04-28 10:46:01 -04:00
Andrew Kelley a147f06585 zig puts temporary object files in zig-cache folder
See #298
2017-04-28 02:22:12 -04:00
Andrew Kelley 2e512a0e6e add compile error for returning local variable address
closes #344
2017-04-27 19:40:35 -04:00
Andrew Kelley 7b0542d08b build system: consolidate duplicate code and more
* add ability to add assembly files when building an exe, obj, or lib
 * add implicit cast from `[N]T` to `?[]const T` (closes #343)
 * remove link_exe and link_lib in favor of allowing build_exe and
   build_lib support no root zig source file
2017-04-26 19:17:05 -04:00
Andrew Kelley 09bc4d6ba3 build system: addAssembly and addObject functions
for building executables
2017-04-26 12:56:10 -04:00
Josh Wolfe c6605cba83 blocks check that their statements are void
closes #291

This changes the error message "return value ignored" to "expression value is ignored".
This is because this error also applies to {1;}, which has no function calls.

Also fix ignored expression values in std and test.
This caught a bug in debug.readAllocBytes where an early Eof error would have been missed.
See #219.
2017-04-23 21:15:15 -07:00
Andrew Kelley f9fa768dca zig build system: installFile and installClibrary
See #332
2017-04-23 11:09:26 -04:00
Andrew Kelley 0cce115476 update syntax for try and nullable unwrapping
closes #285
2017-04-21 16:46:33 -04:00
Andrew Kelley ecb71d1dd3 add example which exercises addObject in the zig build system
closes #329
2017-04-21 02:26:48 -04:00
Andrew Kelley fb492d19eb zig build system supports building a library
See #329

Supporting work:
 * move std.cstr.Buffer0 to std.buffer.Buffer
 * add build.zig to example/shared_library/ and add an automated test
   for it
 * add std.list.List.resizeDown
 * improve std.os.makePath
   - no longer recursive
   - takes into account . and ..
 * add std.os.path.isAbsolute
 * add std.os.path.resolve
 * reimplement std.os.path.dirname
   - no longer requires an allocator
   - handles edge cases correctly
2017-04-21 01:56:12 -04:00
Andrew Kelley 8654bc1810 delete test_artifacts directory when tests complete
* add std.os.deleteTree
 * add std.os.deleteDir
 * add std.os.page_size
 * add std.os API for iterating over directories
 * refactor duplication in build.zig
 * update documentation on how to run tests
2017-04-20 02:26:36 -04:00
Andrew Kelley d12f1f5b49 test framework supports name prefix and filter argument
rename self hosted tests to behavior tests
2017-04-19 15:38:12 -04:00
Andrew Kelley d1e01e43d3 convert assemble and link tests to zig build system 2017-04-19 14:00:12 -04:00
Andrew Kelley 37b9a2e6a4 convert compare-output tests to use zig build system 2017-04-19 01:15:20 -04:00
Andrew Kelley a791417552 add `@fieldParentPtr` builtin function
closes #320
2017-04-18 02:28:05 -04:00
Andrew Kelley 216e14891e zig build system creates symlinks atomically
* add std.base64
 * add std.os.rename
 * add std.os.atomicSymLink
2017-04-17 19:08:41 -04:00
Andrew Kelley 05b3082121 zig build system: progress toward install and uninstall
also:
 * add std.os.path.join
 * add std.os.deleteFile
2017-04-17 06:47:20 -04:00
Andrew Kelley e4ec2d10c6 zig build system: implement custom command step 2017-04-17 06:47:20 -04:00
Andrew Kelley 47336abae3 improvements to zig build system and unwrap error safety
* zig build system: create standard dynamic library sym links
 * unwrapping an error results in a panic message that contains
   the error name
 * rename error.SysResources to error.SystemResources
 * add std.os.symLink
 * add std.os.deleteFile
2017-04-17 06:47:20 -04:00
Andrew Kelley d16ce67106 zig build system: ability to link against dynamic library step 2017-04-17 06:47:20 -04:00
Andrew Kelley 5fdefe58e4 zig build system understands the concept of dependencies
See #204
2017-04-13 17:21:00 -04:00
Andrew Kelley 095591f0b0 add enumTagName builtin function
closes #299
2017-04-08 17:45:22 -04:00
Andrew Kelley 7611ed3484 allow implicit cast from `[N]T` to `&const []const T`
closes #296
2017-04-07 17:56:01 -04:00
Andrew Kelley 273cebdf4d peer resolve types [N]T, [M]T as []const T
closes #125
2017-04-06 18:07:38 -04:00
Andrew Kelley 10dbc735fe zig build: use -D for options instead of -O
because -O is usually optimization level
2017-04-06 13:59:11 -04:00
Andrew Kelley 6fbe1632d0 Update zig build system to support user defined options
* Fix assertion failure when switching on type.
   Closes #310
 * Update zig build system to support user defined options.
   See #204
 * fmt.format supports {sNNN} to set padding for a buffer arg.
 * add std.fmt.bufPrint and std.fmt.allocPrint
 * std.hash_map.HashMap.put returns the previous value
 * add std.mem.startsWith
2017-04-06 05:34:04 -04:00
Andrew Kelley 9c803af044 zig build system: fix cleanup on error, report spawn error 2017-04-04 06:47:42 -04:00
Andrew Kelley 1c6000d047 zig build system improvements, add some std API
* add std.buf_map.BufMap
 * add std.buf_set.BufSet
 * add std.mem.split
 * zig build system improvements (See #204)
   - automatically parses NIX_CFLAGS_COMPILE and NIX_LDFLAGS
   - add builder.addCIncludePath
   - add builder.addRPath
   - add builder.addLibPath
   - add exe.linkLibrary
2017-04-04 01:52:20 -04:00
Andrew Kelley 72fb2443e0 API for command line args
closes #300
2017-04-04 00:17:24 -04:00
Andrew Kelley c9ae30d27e delete alloca builtin function
See #225

introduce os.EnvMap
2017-04-03 18:11:57 -04:00
Andrew Kelley c400cb429a zig build system: add setLinkerScript and setTarget
* See #204 - zig build system
 * allow builtin types Os, Environ, Arch to be used at runtime.
   they have zero_bits=false and debug info now.
 * Eradicate use of `@alloca` in std for syscalls. See #225
 * add `std.io.writeFile`
 * `std.debug.panic` adds a newline to format
2017-04-03 05:04:46 -04:00
Andrew Kelley a1363b5227 proof of concept build system
see #204
2017-04-02 20:44:04 -04:00
Andrew Kelley 8fd0fddce5 zig build system progress
* In-progress os.ChildProcess.spawn implementation. See #204
 * Add explicit cast from integer to error. Closes #294
 * fix casting from error to integer
 * fix compiler crash when initializing variable to undefined
   with no type
2017-04-02 18:19:59 -04:00
Andrew Kelley 3ca027ca82 first pass at zig build system
* `zig build --export [obj|lib|exe]` changed to `zig build_obj`,
   `zig build_lib` and `zig build_exe` respectively.
 * `--name` parameter is optional when it can be inferred from the
   root source filename. closes #207
 * `zig build` now looks for `build.zig` which interacts with
   `std.build.Builder` to describe the targets, and then the zig
   build system prints TODO: build these targets. See #204
 * add `@bitcast` which is mainly used for pointer reinterpret
   casting and make explicit casting not do pointer reinterpretation.
   Closes #290
 * fix debug info for byval parameters
 * sort command line help options
 * `std.debug.panic` supports format string printing
 * add `std.mem.IncrementingAllocator`
 * fix const ptr to a variable with data changing at runtime.
   closes #289
2017-03-31 05:55:41 -04:00
Andrew Kelley 5bc9feb5cb organize std and make import relative to current file
closes #216
2017-03-26 06:39:28 -04:00
Andrew Kelley d6856859d3 improvements for windows and libc integration
* standard library knows if it is linking against libc and will
   sometimes call libc functions in that case instead of providing
   redundant definitions
 * fix infinite loop bug when resolving use declarations
 * allow calling the same C function from different C imports.
   closes #277
 * push more logic from compiler to std/bootstrap.zig
 * standard library provides way to access errno
   closes #274
 * fix compile error in standard library for windows
 * add implementation of getRandomBytes for windows
2017-03-23 02:59:58 -04:00
Andrew Kelley 87bc97daef unify main entry point regardless of whether linking libc
closes #248
2017-03-22 11:26:30 -04:00