3097 Commits

Author SHA1 Message Date
LemonBoy
bb72b0e800 Fix compilation error on FreeBSD 2020-12-13 20:36:34 +01:00
LemonBoy
97ba3d9a66 std: Drop struct prefixes in FreeBSD siginfo
I'm not sure this prefix-free style is a good idea, but let's roll with
it for the moment.
2020-12-13 19:45:11 +01:00
Alex Cameron
7515922907 Fix Sigaction struct on FreeBSD. 2020-12-13 19:37:13 +01:00
LemonBoy
3a759fdb17 Disable sigaction test on i386 because of #7427 2020-12-13 19:35:40 +01:00
LemonBoy
3375a580be std: Update more siginfo bits for BSDs 2020-12-13 19:28:38 +01:00
LemonBoy
fc70db5ab5 std: Fixes for siginfo test on macos
Xnu's sigaction() only supports fetching a limited set of sa_flags, test
SA_SIGINFO instead of SA_RESETHAND as that's supported everywhere.

Add another check to make sure SA_RESETHAND works.

Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
2020-12-13 19:17:04 +01:00
LemonBoy
629cc6cf28 std: Further siginfo refinements
* Define siginfo and sigaction for Darwin
* Define sigaction/handler union for maximum libc compatibility
* Minor correction to some type definitions
2020-12-12 16:44:10 +01:00
LemonBoy
1d9b28403a std: Correct check in signal test
Ooops.
2020-12-12 15:34:26 +01:00
LemonBoy
beae3cea17 std: Improve sigaction interface
Add a smoke test to prevent regressions.
2020-12-12 13:57:25 +01:00
Andrew Kelley
d569e37cb5 std.fs.path.extension: different behavior for ending dot
extension("a.") now returns "." instead of "".

This matches both Python and Node.js standard library behavior as well
as my personal opinion on how this function should be defined.

Apologies for missing this in the code review.
2020-12-11 18:20:57 -07:00
Andrew Kelley
52bc1442d6 std.fs.path.extension: add additional API guarantee
Added:

The returned slice is guaranteed to have its pointer
within the start and end pointer address range of `path`,
even if it is length zero.
2020-12-11 17:41:34 -07:00
Andrew Kelley
1852dc7e13
Merge pull request #7098 from MasterQ32/std.fs.path.extension
Implements std.fs.path.extension
2020-12-11 19:32:21 -05:00
LemonBoy
fa6449dac0 zig fmt: Fix alignment of initializer elements
Resetting `column_counter` is not needed as the effective column number
is calculated by taking that value modulo `row_size`.

Closes #7289
2020-12-11 02:34:44 -05:00
antlilja
26399b5249 Added global-cache argument to build system + removed extra args.
* Field global_cache_root was added to Builder struct along with
mandatory argument for build_runner.zig. Logic for using the custom
global cache was also added.

* The arguments --cache-dir and --global-cache-dir are no longer passed
directly through to build_runner.zig and are instead only passed through the
mandatory cache_root and global_cache_root arguments.
2020-12-10 18:06:19 -05:00
Andrew Kelley
a3de27ef3b
Merge pull request #7372 from LemonBoy/atomicint
Improvements for std.atomic.{Int,Bool}
2020-12-10 16:13:36 -05:00
Andrew Kelley
5a5389128d
Merge pull request #7369 from jorangreef/io_uring_timeout
Add io_uring TIMEOUT and TIMEOUT_REMOVE operations:
2020-12-10 15:45:38 -05:00
Vexu
afc21a2f1c
make std.json.unescapeString pub 2020-12-10 21:19:41 +02:00
Joran Dirk Greef
b5a9fd9f98 Skip timeout_remove test where not supported by the kernel 2020-12-10 11:34:20 +02:00
LemonBoy
88e3a7d6dc std: Fix misuse of atomic.Int 2020-12-10 09:23:48 +01:00
LemonBoy
5e91cc2fe3 std: Validate the atomic ordering parameter in atomic.Int 2020-12-10 09:23:48 +01:00
LemonBoy
5844511408 std: prevent instantiation of atomic.Int with non-integral types 2020-12-10 09:23:48 +01:00
LemonBoy
ef7db9717e std: introduce meta.traits.is{Integral,Float} 2020-12-10 09:23:48 +01:00
Jakub Konka
23c1b7faee
Merge pull request #7368 from kubkon/macho-trie-cleanup
stage2: MachO export trie cleanup
2020-12-10 08:32:59 +01:00
Joran Dirk Greef
dd3eac2eb1 Debug CI io_uring unsupported op 2020-12-10 08:36:33 +02:00
Andrew Kelley
6e636064e6 MoveFileEx can return ACCESS_DENIED
I observed this on Windows 10, trying to use MoveFileEx with
MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH
to overwrite a running executable.
2020-12-09 15:03:17 -07:00
Jakub Konka
4c3e6c5bff macho: cleanup export trie generation and parsing
Now, ExportTrie is becoming usable for larger linking contexts such
as linking in multiple object files, or relinking dylibs, etc.
2020-12-09 20:36:58 +01:00
Andrew Kelley
f291194834
Merge pull request #7362 from Vexu/std
zig fmt improvement and small miscellaneous fixes
2020-12-09 14:29:15 -05:00
Andrew Kelley
5ff0f364a5
Merge pull request #7366 from LemonBoy/fix-7346
Some compiler-rt fixes
2020-12-09 14:19:58 -05:00
Joran Dirk Greef
349d32dc2c Add io_uring TIMEOUT and TIMEOUT_REMOVE operations:
ring.timeout() to queue a IORING_OP_TIMEOUT operation
ring.timeout_remove() to queue a IORING_OP_TIMEOUT_REMOVE operation

io_uring_prep_timeout() to prep a IORING_OP_TIMEOUT sqe
io_uring_prep_timeout_remove() to prep a IORING_OP_TIMEOUT_REMOVE sqe
2020-12-09 19:06:28 +02:00
LemonBoy
6f220bb7ca std: explicitly cast indices to usize
This is needed for platforms where usize=u16, eg. MSP430.
2020-12-09 16:48:41 +01:00
LemonBoy
afd491c07e compiler-rt: Fix compilation of clzsi for armv6 targets 2020-12-09 16:48:02 +01:00
LemonBoy
518168edb2 compiler-rt: Avoid exposing atomic builtins when not supported
Let's a void any kind of compilation/LLVM errors for niche targets such
as AVR/MSP430 or ARM v6m. By not exporting any atomic builtin anymore
the user is free to provide their own implementation (that disable the
IRQs) or to provide the --single-threaded switch and forget about this.
2020-12-09 16:33:53 +01:00
Vexu
7e30e83900
small fixes and zig fmt 2020-12-09 13:54:26 +02:00
Vexu
be71994fb1
zig fmt: improve var decl initializer formatting 2020-12-09 13:47:22 +02:00
Andrew Kelley
4592fd26b9 add std.testing.expectStringEndsWith 2020-12-08 21:59:24 -07:00
xackus
21550bb7cd std.json: unreachable -> expect in tests 2020-12-08 19:16:17 -05:00
antlilja
c796c4528e Add option to override default stack size in build system. 2020-12-08 16:18:16 -05:00
Nathanaƫl Courant
81890e30e2 Fix general purpose allocator incorrectly modifying total_requested_bytes in some cases 2020-12-08 15:53:34 -05:00
Andrew Kelley
5a65caa2a3 ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:

 * The cmake path. Requirements: cmake, system C++ compiler, system
   LLVM, LLD, Clang libraries, compiled by the system C++ compiler.

 * The zig path. Requirements: a zig installation, system LLVM, LLD,
   Clang libraries, compiled by the zig installation.

Note that the former can be used to now take the latter path.

Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.

cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.

`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.

build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.

Zig build system addBuildOption supports a couple new types.

The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-07 17:27:09 -07:00
Luna
5f7b97e84c add AddressFamilyNotSupported to SendError 2020-12-07 16:40:03 -05:00
xackus
85dc039632 std.c: freeing null is a no-op 2020-12-07 16:33:27 -05:00
LemonBoy
fd8fa55129
std: Add a few helpers for matching ascii strings (#7300)
* startsWithIgnoreCase
* endsWithIgnoreCase
2020-12-04 15:27:28 -05:00
LemonBoy
ac443b941d std: Restore file locking test on Windows
Make it even more robust wrt timing problems.

Closes #7010
2020-12-04 12:24:50 -08:00
Isaac Yonemoto
fd18252a71 makes the implementation public 2020-12-03 15:14:59 -08:00
Isaac Yonemoto
a2cd9dc3bd
Gpa mutex configurable (#7234)
* makes the mutex for the gpa configurable

* fixed logic, added test

* updates docstring; pushes logic to one place, better duck-type
2020-12-03 15:49:35 -05:00
Miles Alan
7bbd369fbb std/event: Fix import path for WaitGroup 2020-12-03 12:43:55 -08:00
Jakub Konka
a8e543bd6b
Merge pull request #7280 from leecannon/master
Add `readUntilDelimiterOrEofArrayList` & `readUntilDelimiterOrEofAlloc`
2020-12-03 21:03:48 +01:00
Lee Cannon
f598245836 Make zig fmt happy with multiline arguments for readAllArrayListAligned 2020-12-03 10:24:49 +00:00
LemonBoy
cb63ecd6e9 std: Add nosuspend around stderr.print calls 2020-12-02 16:34:51 -08:00
Vexu
d4c167f3cd std.build: addBuildOption special handling for SemanticVersion 2020-12-02 16:33:27 -08:00