Andrew Kelley
a2432b6755
Merge pull request #4735 from ziglang/renameat
...
zig build system: correctly handle multiple output artifacts
2020-03-15 17:28:12 -04:00
Andrew Kelley
a27a8561e9
adjust renameatW to always supply dest root dir
...
this fixes tests for wine
2020-03-15 17:26:29 -04:00
Andrew Kelley
7e45a3ef6a
fix typo in new mem.len test
2020-03-15 15:57:51 -04:00
Andrew Kelley
e369789062
fix std.os.renameatW
...
Ask for DELETE access when opening the source file.
Additionally, when the source and dest dir are the same, pass null
for RootDirectory.
2020-03-15 15:47:42 -04:00
Andrew Kelley
6c2b23593b
fix std.mem.span handling of sentinel-terminated arrays
...
previously this function would use the array length, but now it scans
the array looking for the first sentinel that occurs.
2020-03-15 15:46:56 -04:00
Andrew Kelley
701aaf0ddf
renameatW: handle more windows nt status codes
2020-03-15 14:46:09 -04:00
Andrew Kelley
0a69a10f2a
Merge pull request #4740 from Vexu/cleanup
...
Cleanup and a fix in self-hosted parser
2020-03-15 14:18:33 -04:00
momumi
880d8fc380
fix Serializer to work with new OutStream API
2020-03-15 14:17:16 -04:00
Vexu
57f9f07558
use anon literals in ast.zig and parse.zig
2020-03-15 01:11:58 +02:00
Vexu
5e5dee829d
remove .Cancel correct merge err set parsing
2020-03-15 01:02:33 +02:00
Andrew Kelley
66e76a0209
zig build system: correctly handle multiple output artifacts
...
Previously the zig build system incorrectly assumed that the only build
artifact was a binary. Now, when you enable the cache, only the output
dir is printed to stdout, and the zig build system iterates over the
files in that directory, copying them to the output directory.
To support this change:
* Add `std.os.renameat`, `std.os.renameatZ`, and `std.os.renameatW`.
* Fix `std.os.linux.renameat` not compiling due to typos.
* Deprecate `std.fs.updateFile` and `std.fs.updateFileMode`.
* Add `std.fs.Dir.updateFile`, which supports using open directory
handles for both the source and destination paths, as well as an
options parameter which allows overriding the mode.
* Update `std.fs.AtomicFile` to support operating based on an open
directory handle. Instead of `std.fs.AtomicFile.init`, use
`std.fs.Dir.atomicFile`.
* `std.fs.AtomicFile` deinit() better handles the situation when the
rename fails but the temporary file still exists, by still
attempting to remove the temporary file.
* `std.fs.Dir.openFileWindows` is moved to `std.os.windows.OpenFileW`.
* `std.os.RenameError` gains the error codes `NoDevice`,
`SharingViolation`, and `PipeBusy` which have been observed from
Windows.
Closes #4733
2020-03-13 21:22:08 -04:00
Andrew Kelley
4905102901
fix all the TODOs from the pull request
...
* `std.Buffer.print` is removed; use `buffer.outStream().print`
* `std.fmt.count` returns a `u64`
* `std.Fifo.print` is removed; use `fifo.outStream().print`
* `std.fmt.bufPrint` error is renamed from `BufferTooSmall`
to `NoSpaceLeft` to match `std.os.write`.
* `std.io.FixedBufferStream.getWritten` returns mutable buffer
if the buffer is mutable.
2020-03-13 12:02:58 -04:00
Andrew Kelley
2dd920ee39
Merge branch 'format-stream' of https://github.com/fengb/zig into fengb-format-stream
2020-03-13 11:31:11 -04:00
Andrew Kelley
a9297f2267
Merge pull request #4716 from LemonBoy/sys-misc
...
Introduce std.fs.file.setEndPos
2020-03-13 11:18:08 -04:00
LemonBoy
de53537f10
Add NtDll-based ftruncate implementation
2020-03-13 08:45:37 +01:00
Andrew Kelley
5dd3c8eed6
Merge pull request #4727 from nrdmn/uefi3
...
std/os/uefi: various improvements and some refactoring
2020-03-12 20:58:29 -04:00
Andrew Kelley
f51bec321b
Merge pull request #4707 from Vexu/small-atomics
...
Support atomic operations with bools and non power of two integers
2020-03-12 18:55:16 -04:00
Nick Erdmann
f44530302e
std/os/uefi: file protocol improvements
2020-03-12 23:23:21 +01:00
Nick Erdmann
92beb13914
std/os/uefi: status reform
2020-03-12 23:23:12 +01:00
Nick Erdmann
6c368b9e73
std/os/uefi: device path protocol improvements
2020-03-12 23:23:02 +01:00
Nick Erdmann
9f475dae14
std/os/uefi: Add shell parameters protocol
2020-03-12 23:22:49 +01:00
Nick Erdmann
52eb4129de
std/os/uefi: loaded image protocol improvements
2020-03-12 23:22:08 +01:00
Nick Erdmann
e617e8a798
std/os/uefi: require guid output function be comptime
2020-03-12 23:22:08 +01:00
Nick Erdmann
7c12f93734
std/os/uefi: boot services and runtime services improvements
...
- Several function signatures added
- Add getNextVariableName sentinel termination annotation
2020-03-12 23:22:08 +01:00
Vexu
71d776c3be
add note to disabled tests, improve comptime cmpxchg
2020-03-12 22:42:01 +02:00
LemonBoy
bd0b51477a
Address review comments
2020-03-12 19:40:42 +01:00
Benjamin Feng
4aae55b4cc
Replace fmt with new fmtstream
2020-03-12 10:41:09 -05:00
Benjamin Feng
786216ca5a
Slap in workaround for Fifo
2020-03-12 10:41:09 -05:00
Benjamin Feng
6a53fe7c93
Handle potential downcast when translating stream size
2020-03-12 10:41:09 -05:00
Benjamin Feng
0059d9ee3e
Convert fmt.bufPrint / fmt.allocPrint
2020-03-12 10:41:09 -05:00
Benjamin Feng
8dd078b99a
Convert Buffer to use fmtstream
2020-03-12 10:41:09 -05:00
Benjamin Feng
2429fdd73b
Convert JSON to fmtstream
2020-03-12 10:41:09 -05:00
Benjamin Feng
0fbccec000
Convert builtin to fmtstream
2020-03-12 10:41:04 -05:00
Benjamin Feng
c11d1055b8
Integrated outstreams with new formatter
2020-03-12 10:26:28 -05:00
Benjamin Feng
7364e965f4
Force error coercion of custom formatters
2020-03-12 10:26:28 -05:00
Benjamin Feng
d2e4aafd64
Fixup allocPrint
2020-03-12 10:26:27 -05:00
Benjamin Feng
1c18ab01a4
Add back max_depth test
2020-03-12 09:25:13 -05:00
Benjamin Feng
f51c8f26c1
Apply explicit error type
2020-03-12 09:19:32 -05:00
Benjamin Feng
78d12762a9
Re-enable a bunch of tests
2020-03-12 09:15:49 -05:00
Benjamin Feng
8241b96f78
Re-enable testFmt
2020-03-12 09:06:12 -05:00
Benjamin Feng
e1e9ff9546
Get formatIntBuf working
2020-03-12 09:06:10 -05:00
Benjamin Feng
278b9ec1aa
Blind translation
2020-03-12 09:04:18 -05:00
Benjamin Feng
ae3fb6df00
Copy fmtstream
2020-03-12 08:58:36 -05:00
LemonBoy
11df0d0cf8
std: Add setEndPos to fs.file
...
Allow the user to shrink/grow the file size as needed.
2020-03-12 09:43:45 +01:00
LemonBoy
89d7fc773d
std: Fix pwrite invocation on 32bit architectures
2020-03-12 09:43:45 +01:00
Heppokoyuki
3f1c8e3d58
fix bug
2020-03-12 00:29:30 -04:00
Andrew Kelley
75e9a722db
Merge pull request #4714 from mikdusan/target
...
fix -target and -mcpu issues
2020-03-11 21:47:56 -04:00
Andrew Kelley
3ded862cdf
Merge pull request #4713 from Heppokoyuki/uefi-file-protocols
...
UEFI library improvements
2020-03-11 21:44:50 -04:00
Michael Dusan
c988167377
update/apply CPU features when -mcpu native
...
- fix: features were not applied if cpu is specified as native
2020-03-11 19:33:11 -04:00
Andrew Kelley
06d2f53ece
windows: detect HANDLE_EOF in ReadFile
2020-03-11 17:39:53 -04:00