1027 Commits

Author SHA1 Message Date
LemonBoy
95a71e29f8
zig fmt: Fix callconv rewriting for extern + string
Closes #4473
2020-02-18 18:18:15 -05:00
Andrew Kelley
ccca4b5a5e
Merge pull request #4474 from LemonBoy/saukerkraut
Patches
2020-02-18 18:15:11 -05:00
Andrew Kelley
a8d7652001
avoid a @ptrCast with an array literal 2020-02-18 16:48:26 -05:00
daurnimator
3632f31ec2
std: use LinearFifo to implement io.BufferedOutStreamCustom 2020-02-18 16:47:03 -05:00
daurnimator
dd75cc214d
std: let PeekStream have static/dynamic variants
This completes a TODO in the existing implementation
2020-02-18 16:47:03 -05:00
daurnimator
38ad7daebb
std: use LinearFifo to implement io.PeekStream 2020-02-18 16:47:03 -05:00
daurnimator
bdff2f43bd
std: use LinearFifo to implement io.BufferedInStreamCustom 2020-02-18 16:47:03 -05:00
Andrew Kelley
d056c7732b
fix std.meta.refAllDecls 2020-02-18 15:34:13 -05:00
Andrew Kelley
e8a84927ab
Merge pull request #4478 from ziglang/self-host-libc-detection
self-hosted libc and dynamic linker detection
2020-02-17 22:45:49 -05:00
Andrew Kelley
35f0cb049e
stage2: fix invalid iteration code in std.ast.Node.Asm
closes #4480
2020-02-17 20:25:02 -05:00
Andrew Kelley
b53afc510c
update dl_iterate_phdr test case to new API 2020-02-17 17:22:32 -05:00
Andrew Kelley
4b91e4c91f fix dynamic linker detection on windows (where there isn't one) 2020-02-17 16:03:01 -05:00
Andrew Kelley
e26f063b22 support the concept of a target not having a dynamic linker 2020-02-17 15:46:53 -05:00
Andrew Kelley
2f9c5c0644
self-host dynamic linker detection 2020-02-17 15:23:59 -05:00
Andrew Kelley
44c14749a1
expand argv[0] when spawning system C compiler
Some C compilers, such as Clang, are known to rely on
argv[0] to find the path to their own executable,
without even bothering to resolve PATH. This results
in the message:

error: unable to execute command: Executable "" doesn't exist!

So we tell ChildProcess to expand argv[0] to the absolute path
to give them a helping hand.
2020-02-17 00:58:30 -05:00
Andrew Kelley
5c54d7bee7
add missing implementations of libc installation to detect msvc paths 2020-02-16 19:58:27 -05:00
Andrew Kelley
8173fbfb66
implement os.faccessat for Windows 2020-02-16 17:10:43 -05:00
LemonBoy
59a243ce24 std: Remove now-superflous hack 2020-02-16 19:53:53 +01:00
Andrew Kelley
4b02a39aa9
self-hosted libc detection
* libc_installation.cpp is deleted.
   src-self-hosted/libc_installation.zig is now used for both stage1 and
   stage2 compilers.
 * (breaking) move `std.fs.File.access` to `std.fs.Dir.access`. The API
   now encourages use with an open directory handle.
 * Add `std.os.faccessat` and related functions.
 * Deprecate the "C" suffix naming convention for null-terminated
   parameters. "C" should be used when it is related to libc. However
   null-terminated parameters often have to do with the native system
   ABI rather than libc. "Z" suffix is the new convention. For example,
   `std.os.openC` is deprecated in favor of `std.os.openZ`.
 * Add `std.mem.dupeZ` for using an allocator to copy memory and add a
   null terminator.
 * Remove dead struct field `std.ChildProcess.llnode`.
 * Introduce `std.event.Batch`. This API allows expressing concurrency
   without forcing code to be async. It requires no Allocator and does
   not introduce any failure conditions. However it is not thread-safe.
 * There is now an ongoing experiment to transition away from
   `std.event.Group` in favor of `std.event.Batch`.
 * `std.os.execvpeC` calls `getenvZ` rather than `getenv`. This is
   slightly more efficient on most systems, and works around a
   limitation of `getenv` lack of integration with libc.
 * (breaking) `std.os.AccessError` gains `FileBusy`, `SymLinkLoop`, and
   `ReadOnlyFileSystem`. Previously these error codes were all reported
   as `PermissionDenied`.
 * Add `std.Target.isDragonFlyBSD`.
 * stage2: access to the windows_sdk functions is done with a manually
   maintained .zig binding file instead of `@cImport`.
 * Update src-self-hosted/libc_installation.zig with all the
   improvements that stage1 has seen to src/libc_installation.cpp until
   now. In addition, it now takes advantage of Batch so that evented I/O
   mode takes advantage of concurrency, but it still works in blocking
   I/O mode, which is how it is used in stage1.
2020-02-16 13:25:30 -05:00
Andrew Kelley
cb3a818699
zig fmt: support noasync await 2020-02-16 01:44:52 -05:00
Vexu
b15958c557 fix c tokenizer bug 2020-02-14 18:57:57 -05:00
Andrew Kelley
40b9db7cad
Merge pull request #4451 from daurnimator/use-testing.allocator
Migrate (more) tests from FixedBufferAllocator to testing.allocator
2020-02-14 09:40:08 -05:00
xackus
7396b144ba modernize std.meta 2020-02-14 09:35:38 -05:00
daurnimator
6ea6d5a4bd
std: use testing.allocator in tests 2020-02-14 19:15:09 +11:00
daurnimator
ca41567924
std: use testing.allocator in big int tests 2020-02-14 18:59:40 +11:00
daurnimator
f20ba7c32c
std: increase memory available to testing allocator 2020-02-14 18:59:25 +11:00
daurnimator
b61e53cc40
std: bigint.deinit() shouldn't need a mutable pointer 2020-02-14 18:59:07 +11:00
Felix (xq) Queißner
cf67d30cdc Makes ArenaAllocator.deinit() not require a mutable reference. 2020-02-13 16:19:34 -05:00
Andrew Kelley
e8dfc5e7f6
Merge pull request #4442 from fengb/testing-allocator-calls
Migrate tests from FixedBufferAllocator to testing.allocator
2020-02-13 16:17:21 -05:00
Andrew Kelley
cdba521a06
annotate skipped test with issue link 2020-02-13 16:13:53 -05:00
data-man
948a463cf1
fmt: vector formatting 2020-02-13 16:12:54 -05:00
Andrew Kelley
1675d4f82b
Merge pull request #4443 from LemonBoy/werkzeug
A train of small patches
2020-02-13 13:12:18 -05:00
Vexu
fa377dbd15 fix c tokenizer bug 2020-02-13 12:21:28 -05:00
LemonBoy
f93c219f30 Minor changes for a test case 2020-02-13 12:13:56 +01:00
data-man
4578d13b49 Vector comparison in meta and testing 2020-02-13 12:13:55 +01:00
Benjamin Feng
a81ae1223d Convert a lot of json tests to use testing.allocator 2020-02-12 17:17:56 -06:00
Benjamin Feng
699c50a375 Switch a bunch of FBA to use testing.allocator 2020-02-12 17:17:56 -06:00
vegecode
d06bfc2e2a Correct comment to include comptime attribute on format output fn parameter
Without comptime, printing custom type through the stream interface fails
2020-02-12 13:16:32 -06:00
LemonBoy
b81c5be451 riscv: Remove 'relax' from the baseline cpu features
LLD doesn't implement relaxations at the moment.
2020-02-11 17:03:11 +01:00
LemonBoy
ea8755fda9 compiler-rt: Export the AEABI builtins when targeting thumb 2020-02-11 15:24:18 +01:00
LemonBoy
3237528a59 fmt: Pass the fmt string to the inner formatters 2020-02-10 19:43:11 -05:00
Andrew Kelley
702398dd0e
Revert "windows: remove the 'A' versions of psapi functions"
This reverts commit 1cdefeb10b7496126bbb7d00709235abfee56a4a.

See #4426
2020-02-10 12:30:20 -05:00
Andrew Kelley
1cdefeb10b
windows: remove the 'A' versions of psapi functions
See #534
2020-02-10 12:03:11 -05:00
Vexu
ae5ba369e1 translate-c float fixes 2020-02-10 11:02:29 -05:00
Andrew Kelley
014f66e6de Merge pull request #4404 from ziglang/async-std
a big step towards std lib integration with async I/O
2020-02-10 00:22:59 -05:00
Andrew Kelley
3b622f4494
fix off-by-one error in std.unicode.utf8ToUtf16LeWithNull
and fix larger-than-one-byte sentinels when being freed

Thank you to João Pedro for identifying both problems and
providing example code to solve them.

closes #4413
2020-02-09 14:56:19 -05:00
LemonBoy
c4d0f97b4c compiler_rt: Fix clzsi2 implementation for Thumb1
The LUT contains the number of bits set, not the number of leading zeros
as we're subtracting from the total number of bits in a word.

Closes #4415
2020-02-09 14:12:01 -05:00
Andrew Kelley
5b10d9f917
std: fix bitrotted evented code 2020-02-08 16:24:26 -05:00
Andrew Kelley
6ae36807b7
solve recursion in std.atomic.Queue.dump
by adding a maximum depth
2020-02-08 16:22:53 -05:00
Andrew Kelley
c48831512b
std lib typo fixups 2020-02-08 01:38:01 -05:00