Commit Graph

6502 Commits

Author SHA1 Message Date
kprotty
b535e86cc0 move SpinLock definitions around 2019-11-07 15:32:20 -06:00
kprotty
92dac89d01 lock the mutex on pthread_cond_signal() 2019-11-07 09:23:02 -06:00
kprotty
7045f1e875 skip std.ThreadParker test on single-threaded 2019-11-06 17:23:44 -06:00
kprotty
4dbfc48ab3 Disable asm("yield") for arm in SpinLock.yieldCpu() because of CI 2019-11-05 16:16:03 -06:00
kprotty
c9db420a09 Adaptive Mutex:
- uses std.ThreadParker
- supports static initialization (deprecates StaticallyInitializedMutex)
2019-11-05 16:14:43 -06:00
kprotty
465ebf494d ThreadParker implementation 2019-11-05 15:58:58 -06:00
kprotty
14209cf615 make SpinLock.Backoff pub 2019-11-05 13:43:17 -06:00
kprotty
84e370d0b2 Move hybrid yielding into its own struct 2019-11-05 09:31:29 -06:00
kprotty
0d4f4aad9e adaptive SpinLock 2019-11-05 08:16:08 -06:00
kprotty
bb6ad1a6c2 Remove StaticallyInitializedMutex 2019-11-03 21:09:51 -06:00
Andrew Kelley
0860b1919b
ci: work around pip install permission denied 2019-11-03 21:44:39 -05:00
Andrew Kelley
1a820067d0
ci: hail mary running git.exe in the windows bat file 2019-11-03 18:58:54 -05:00
Andrew Kelley
96984e3033
ci: avoid leaking oauth access token 2019-11-03 14:55:21 -05:00
Andrew Kelley
629b91da61
ci: use heredoc and alpine/edge for faster sr.ht job 2019-11-03 14:20:35 -05:00
Andrew Kelley
5001faa690
ci: stop assuming that azure will complete last
Each of the 3 CI services now trigger a sr.ht build via
the on_master_success script. The sr.ht build checks if all builds have
completed successfully by trying to download the JSON file for the
particular version. If all builds have completed successfully then this
sr.ht job will update the download page.
2019-11-03 14:00:28 -05:00
Michael Dusan
10046f9a52 stage1: add linux XDG Base Directory support
- define zig global cache based on XDG spec:

    if env XDG_CACHE_HOME {
        "$XDG_CACHE_HOME/zig"
    } else {
        "$HOME/.cache/zig"
    }

- old definition "$HOME/.local/share/zig" is retired
- closes #3573
2019-11-02 18:30:07 -04:00
Luna
2e0dd5733f add FileNotFound to os.ConnectError error set 2019-11-02 15:49:15 -04:00
Luna
d535bf2c7d add FileNotFound error to os.connect 2019-11-02 15:49:15 -04:00
Andrew Kelley
f749bf0942
std.os: fix sendto, poll, recvfrom when linking libc
Thank you to Brendan Hansknecht for this patch.
2019-11-02 15:15:56 -04:00
Andrew Kelley
d6dec80261
startup code respects root source file's event_loop if present 2019-10-31 14:21:04 -04:00
Andrew Kelley
081c62fc00
fix regression in std.os.dirent64 on linux 2019-10-31 13:56:15 -04:00
Tse
00382f6dae DragonFlyBSD tidyup 2019-10-31 13:53:32 -04:00
Andrew Kelley
790d439ce2
util.cpp: canonicalize the order of includes 2019-10-31 13:47:20 -04:00
Andrew Kelley
d3d3e4e374
startup code sets up event loop if I/O mode is declared evented 2019-10-31 11:41:39 -04:00
Andrew Kelley
788848e123
std.net: fix reference to incorrect constant name 2019-10-30 23:03:49 -04:00
Andrew Kelley
61d5a0bf48
Merge branch 'std.net' 2019-10-30 21:30:16 -04:00
Andrew Kelley
6a15e8a7a7
add comments to disabled tests linking to the tracking issue 2019-10-30 21:29:45 -04:00
Tse
33cc204481 DragonFlyBSD support 2019-10-30 21:21:58 -04:00
Henry Wu
7c73503451 generated docs: move color to box-shadow CSS prop 2019-10-30 21:20:02 -04:00
Andrew Kelley
7b7ba51642
fix os.sockaddr being a union instead of a struct 2019-10-30 20:57:20 -04:00
Andrew Kelley
d7f15aa2cb
Merge remote-tracking branch 'origin/master' into std.net 2019-10-30 20:43:56 -04:00
Andrew Kelley
c52ee6efca
canonicalize std.os IPPROTO constants 2019-10-30 20:41:28 -04:00
Andrew Kelley
0de862e8ba
make std.net more portable
* Delete `std.net.TmpWinAddr`. I don't think that was ever meant to
   be a real thing.
 * Delete `std.net.OsAddress`. This abstraction was not helpful.
 * Rename `std.net.Address` to `std.net.IpAddress`. It is now an extern
   union of IPv4 and IPv6 addresses.
 * Move `std.net.parseIp4` and `std.net.parseIp6` to the
   `std.net.IpAddress` namespace. They now return `IpAddress` instead of
   `u32` and `std.net.Ip6Addr`, which is deleted.
 * Add `std.net.IpAddress.parse` which accepts a port and parses either
   an IPv4 or IPv6 address.
 * Add `std.net.IpAddress.parseExpectingFamily` which additionally
   accepts a `family` parameter.
 * `std.net.IpAddress.initIp4` and `std.net.IpAddress.initIp6` are
   improved to directly take the address fields instead of a weird
   in-between type.
 * `std.net.IpAddress.port` is renamed to `std.net.IpAddress.getPort`.
 * Added `std.net.IpAddress.setPort`.
 * `os.sockaddr` struct on all targets is improved to match the
   corresponding system struct. Previously I had made it a union of
   sockaddr_in, sockaddr_in6, and sockaddr_un. The new abstraction for
   this is now `std.net.IpAddress`.
 * `os.sockaddr` and related bits are added for Windows.
 * `os.sockaddr` and related bits now have the `zero` fields default
   to zero initialization, and `len` fields default to the correct size.
   This is enough to abstract the differences across targets, and so
   no more switch on the target OS is needed in `std.net.IpAddress`.
 * Add the missing `os.sockaddr_un` on FreeBSD and NetBSD.
 * `std.net.IpAddress.initPosix` now takes a pointer to `os.sockaddr`.
2019-10-30 20:22:05 -04:00
Andrew Kelley
618ee5b63a fixes for macos and 32 bit arches 2019-10-30 14:43:55 -04:00
Andrew Kelley
24b3da871d
fix regressions 2019-10-30 12:49:37 -04:00
Andrew Kelley
f5ff36271b
Merge branch 'testAddresses' of https://github.com/marler8997/zig into std.net 2019-10-30 12:33:47 -04:00
Andrew Kelley
0fb1388031
std.net: enable test for resolving DNS 2019-10-30 12:16:47 -04:00
Nathan Michaels
1f0bcefe4a Document PriorityQueue. 2019-10-30 01:05:00 -04:00
Andrew Kelley
16397241f6
fix std.net tests and std.net.TcpServer docs 2019-10-30 00:50:30 -04:00
Andrew Kelley
b3c80418a8
fix regression in behavior tests 2019-10-30 00:40:17 -04:00
Andrew Kelley
d5e438b36e
rename std.net.Server to TcpServer and simplify it 2019-10-30 00:34:30 -04:00
Andrew Kelley
c3d816a98e
std lib networking improvements, especially non-blocking I/O
* delete the std/event/net directory
 * `std.event.Loop.waitUntilFdReadable` and related functions
   no longer have possibility of failure. On Linux, they fall
   back to poll() and then fall back to sleep().
 * add some missing `noasync` decorations in `std.event.Loop`
 * redo the `std.net.Server` API. it's quite nice now, but
   shutdown does not work cleanly. There is a race condition with
   close() that I am actively working on.
 * move `std.io.OutStream` to its own file to match `std.io.InStream`.
   I started working on making `write` integrated with evented I/O,
   but it got tricky so I backed off and filed #3557. However
   I did integrate `std.os.writev` and `std.os.pwritev` with evented I/O.
 * add `std.Target.stack_align`
 * move networking tests to `lib/std/net/test.zig`
 * add `std.net.tcpConnectToHost` and `std.net.tcpConnectToAddress`.
 * rename `error.UnknownName` to `error.UnknownHostName` within the
   context of DNS resolution.
 * add `std.os.readv`, which is integrated with evented I/O.
 * `std.os.preadv`, is now integrated with evented I/O.
 * `std.os.accept4` now asserts that ENOTSOCK and EOPNOTSUPP never
    occur (misuse of API), instead of returning errors.
 * `std.os.connect` is now integrated with evented I/O.
   `std.os.connect_async` is gone. Just use `std.os.connect`.
 * fix false positive dependency loop regarding async function frames
 * add more compile notes to help when dependency loops occur
   in determining whether a function is async.
 * ir: change an assert to ir_assert to make it easier to find
   workarounds for when such an assert is triggered. In this case
   it was trying to parse an IPv4 address at comptime.
2019-10-29 22:59:30 -04:00
lukechampine
48b5dc0516 inline path separator loop 2019-10-29 21:32:02 -04:00
Andrew Kelley
8d3b7689ad
std.net: port the RFC 3484/6724 destination...
...address selection from musl libc
2019-10-29 16:10:14 -04:00
Andrew Kelley
9ade31faaf
implement CNAME expansion 2019-10-29 14:03:39 -04:00
Jonathan Marler
4e0c2ed443 Add tests for ip address formatting 2019-10-29 00:27:45 -06:00
Andrew Kelley
67058b9b70
basic DNS address resolution for linux without libc 2019-10-29 02:19:22 -04:00
Andrew Kelley
d5865f5319
move libc/linux bits around 2019-10-28 15:29:50 -04:00
Andrew Kelley
845be4ea3e
fix regression in translate-c 2019-10-28 15:29:50 -04:00
Andrew Kelley
f4c244b3d0
partial no-libc implementation of std.net.getAddressList 2019-10-28 15:29:50 -04:00