Commit Graph

286 Commits

Author SHA1 Message Date
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
29defd705d back to AT&T syntax for assembly
this reverts 5c04730534.

sadly the quality of the intel dialect in llvm's assembly
parser has many frustrating bugs, and generally has unfortunate
syntax.

the plan is to use AT&T for now since it at least works,
and eventually zig will have its own assembly parser for
x86 and it will be as close to NASM as possible.
2017-04-30 11:28:11 -04:00
Andrew Kelley
cbfe4b4bae add implicit cast from [0]T to %[]T
closes #347

also add std.os.path.relative
2017-04-29 19:23:33 -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
7e11ef79d6 zig test no longer requires a separate test_runner.o file
See #298
2017-04-27 16:19:20 -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
Andrew Kelley
d72fb2abad update README 2017-04-24 16:17:28 -04:00
Andrew Kelley
6cd725c24b stack traces support compile units with no pc range 2017-04-24 13:03:32 -04:00
Andrew Kelley
245eed8afe better stack traces for ELF x86_64 2017-04-24 12:14:45 -04:00
Josh Wolfe
ac7971122d fix check-statement-is-void. add tests
see #291
2017-04-23 21:50:34 -07: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
e0b635e825 std.os.ChildProcess: fix closing wrong file descriptors 2017-04-22 11:36:42 -04:00
Andrew Kelley
0cce115476 update syntax for try and nullable unwrapping
closes #285
2017-04-21 16:46:33 -04:00
Andrew Kelley
bee1ae68ef std: fix PATH resolution when spawning child 2017-04-21 13:27:11 -04:00
Andrew Kelley
e3c524c1d4 rename @ptrcast to @ptrCast to follow convention 2017-04-21 10:39:13 -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
237dfdbdc6 error when building exe with no entry point
closes #30
2017-04-18 14:04:48 -04:00
Andrew Kelley
9021bb7969 std.rand API follows idiomatic convention for init 2017-04-18 02:47:10 -04:00
Andrew Kelley
a791417552 add @fieldParentPtr builtin function
closes #320
2017-04-18 02:28:05 -04:00
Andrew Kelley
407916cd2f rename @intType to @IntType to follow convention
closes #327
2017-04-18 00:05:09 -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
2864359950 zig build system writes template build.zig file when none exists
see #204
2017-04-11 06:14:46 -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
5eb78ba177 fix std.mem.IncrementingAllocator
updating ptr casting because of previous commit
2017-04-07 15:38:31 -04:00
Andrew Kelley
f7e9d7aa5d ability to implicitly cast integer literal to &const Int
where Int is an integer type

also introduce `@intToPtr` builtin for converting a usize
to a pointer. users now have to use this instead of `(&T)(int)`.

closes #311
2017-04-07 15:35:38 -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
d15bcdce69 std: ChildProcess.spawn looks at PATH env var
closes #303
2017-04-05 17:55:50 -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
55dd2676ef fix std build for darwin 2017-04-03 19:30:03 -04:00