Jakub Konka
99f0e64fa0
Draft out dir symlinks branch
2020-07-22 08:51:23 +02:00
Jakub Konka
c53bcd027f
Start drafting CreateSymbolicLink using ntdll syscalls
2020-07-22 08:51:23 +02:00
Jakub Konka
2c9c13f624
Add various build fixes
...
Fix WASI build, fix atomicSymlink by using `cwd().symLink`, add
`Dir.symLink` on supported targets.
2020-07-22 08:51:22 +02:00
Jakub Konka
e0b77a6b77
Ensure Dir.deleteTree does not dereference symlinks
...
Otherwise, the behaviour can lead to unexpected results, resulting
in removing an entire tree that's not necessarily under the root.
Furthermore, this change is needed if are to properly handle dir
symlinks on Windows. Without explicitly requiring that a directory
or file is opened with `FILE_OPEN_REPARSE_POINT`, Windows automatically
dereferences all symlinks along the way. This commit adds another
option to `OpenDirOptions`, namely `.no_follow`, which defaults to
`false` and can be used to specifically open a directory symlink on
Windows or call `openat` with `O_NOFOLLOW` flag in POSIX.
2020-07-22 08:51:22 +02:00
Jakub Konka
3c8ceb674e
Fix Windows build
2020-07-22 08:51:22 +02:00
Jakub Konka
fc7d87fef1
Move symlink to fs.symlinkAbsolute with SymlinkFlags
...
This way `std.fs.symlinkAbsolute` becomes cross-platform and we can
legally include `SymlinkFlags` as an argument that's only used on
Windows. Also, now `std.os.symlink` generates a compile error on
Windows with a message to instead use `std.os.windows.CreateSymbolicLink`.
Finally, this PR also reshuffles the tests between `std.os.test` and
`std.fs.test`.
2020-07-22 08:51:22 +02:00
Jakub Konka
dd366d316d
Fix more compilation errors on other hosts
2020-07-22 08:51:22 +02:00
Jakub Konka
08e7ac3028
Fix compilation on other hosts
2020-07-22 08:51:22 +02:00
Jakub Konka
22362568cf
Refactor
2020-07-22 08:51:22 +02:00
Jakub Konka
3ab5e6b1a9
Ensure we use Win32 prefix in Win32 calls
2020-07-22 08:51:22 +02:00
Jakub Konka
cc9c5c5b0e
Handle relative/absolute symlinks; add more tests
2020-07-22 08:51:22 +02:00
Jakub Konka
a8a02dfbfa
Add smoke test for dir symlinks
2020-07-22 08:51:22 +02:00
Jakub Konka
30f1176a54
Add SymlinkFlags needed to create symlinks to dirs on Win
2020-07-22 08:51:22 +02:00
Jakub Konka
4894de2b32
Fix readlink smoke test
2020-07-22 08:51:22 +02:00
Jakub Konka
99e3e29e2e
Refactor
2020-07-22 08:51:22 +02:00
Jakub Konka
c47cb8d09f
Fix unlinkatW to allow file symlink deletion on Windows
2020-07-22 08:51:22 +02:00
Jakub Konka
ae8abedbed
Use NtCreateFile to get handle to reparse point
2020-07-22 08:51:22 +02:00
Jakub Konka
d17c9b3591
Fix incorrect byte format of REPARSE_DATA_BUFFER struct
2020-07-22 08:51:22 +02:00
Jakub Konka
9b00dc941b
Use windows.CreateFileW to open the reparse point
2020-07-22 08:51:22 +02:00
Jakub Konka
49b5815364
Add windows.ReadLink similar to OpenFile but for reparse points only
2020-07-22 08:51:22 +02:00
Jakub Konka
92d11fd4e9
Debug readlinkW using OpenFile
2020-07-22 08:51:22 +02:00
Jakub Konka
791795a63a
Finish symlink implementation on Windows
2020-07-22 08:51:22 +02:00
Jakub Konka
515c663cd6
Add readlink smoke test
2020-07-22 08:51:22 +02:00
Jakub Konka
cc83d92b0b
Start drafting out os.readlink on Windows
2020-07-22 08:51:22 +02:00
Jakub Konka
9225763f8b
Add temporary fix to the CI on Win
...
Here's the [thread](https://github.com/msys2/MSYS2-packages/issues/2050 )
for reference.
2020-07-22 06:49:24 +00:00
Andrew Kelley
25a01a16e0
Merge pull request #5905 from Vexu/stage2-float
...
Stage2: floats
2020-07-21 22:35:05 +00:00
Hiroki Noda
68e0632aa5
Use function attribute "frame-pointer"
2020-07-21 21:03:02 +00:00
Vexu
dd89297388
stage2: actually implement float casting
2020-07-21 22:34:14 +03:00
Vexu
c29c79b17a
stage2: remove some dead code, fix build on aarch64
2020-07-21 22:34:14 +03:00
Vexu
7e7d1df4da
stage2: add floatCast to zir and ir
2020-07-21 22:34:12 +03:00
Vexu
7b52dbbf83
stage2: implement some casts for numbers
2020-07-21 22:29:29 +03:00
Vexu
da217fadeb
stage2: astgen for floats and other primitive literals
2020-07-21 22:29:28 +03:00
Vexu
e77ca6af70
stage2: add float values
2020-07-21 22:29:28 +03:00
Vexu
fd2f034e31
fix comptime comparisons of different sized floats
2020-07-21 22:29:15 +03:00
Andrew Kelley
8ee629aa4c
stage2: ability for ZIR to map multiple tags to the same type
2020-07-21 12:13:15 -07:00
Andrew Kelley
7a1a924788
stage2: AST: (breaking) flatten out suffix operations
2020-07-21 10:52:24 -07:00
Andrew Kelley
1ac28eed83
stage2 AST: rename OptionalUnwrap to OrElse
...
preparing to flatten suffix operations AST
2020-07-21 10:46:47 -07:00
Andrew Kelley
1cfe43d563
Merge pull request #5888 from pfgithub/stage-2-testing-Copy
...
stage2: period and suffixop
2020-07-21 17:42:46 +00:00
purringChaos
094223d634
Fix log.zig example.
2020-07-21 18:53:30 +03:00
Andrew Kelley
4abf119d95
Merge branch 'register-allocation'
2020-07-20 13:12:25 -07:00
Andrew Kelley
ef91b11295
stage2: register allocator processes operand deaths
...
also rework the IR data structures
2020-07-20 13:12:20 -07:00
Andrew Kelley
a8065a05a5
stage2: fix implementation of liveness operandDies()
2020-07-20 13:12:20 -07:00
Andrew Kelley
896472c20e
stage2: implement register copying
2020-07-20 13:12:20 -07:00
Andrew Kelley
ef9aeb6ac4
stage2: codegen: refactor to always have comptime arch
2020-07-20 13:12:20 -07:00
Vexu
596ca6cf70
allow non-pointer extern opaque variables
2020-07-18 16:45:07 +03:00
Vexu
78962eeeda
fix floatCast type check regression
...
Closes #5900
2020-07-18 10:22:15 +03:00
data-man
39915ae086
Add trait.isTuple
2020-07-17 17:55:55 +03:00
Vexu
a1e78d0b06
add is_tuple field to struct typeinfo
...
part of #4335
2020-07-17 00:15:34 +03:00
pfg
86922b8d08
stage2: support @"identifier" syntax
2020-07-16 14:08:36 -07:00
Andrew Kelley
cc3bceea3d
Merge pull request #5889 from Vexu/translate-c
...
Translate-c support initializer lists in macros
2020-07-16 19:03:03 +00:00