Commit Graph

20024 Commits

Author SHA1 Message Date
Loris Cro
0b11d8ec4d codeowners: mark myself as the codeowner of /src/autodoc/ 2022-09-02 17:35:41 +02:00
Loris Cro
081d5a9690 autodoc: correct line number implementation
we also correctly take advantage of the starting byte offset of the
parent decl when calling `tree.tokenLocation()`!
2022-09-02 17:28:12 +02:00
Loris Cro
5581b60393
Merge pull request #12724 from alichraghi/patch-2
autodoc: highlight target line
2022-09-02 16:49:56 +02:00
Ali Chraghi
30e85c9c80
autodoc: highlight target line 2022-09-02 19:11:34 +04:30
riChar
f7784a081f
stage2: fix panic when the dependency is missing 2022-09-02 12:53:48 +03:00
riChar
0d96f1f4fb
zig fmt: remove trailing comma at the end of assembly clobber 2022-09-02 12:52:33 +03:00
John Schmidt
36f4f32fad
Add AFNOSUPPORT error to bind (#12560) 2022-09-01 15:13:07 -05:00
Andrew Kelley
7c91a6fe48 CI: fix CLI usage of s3cmd regarding mime types for autodocs 2022-09-01 12:57:06 -07:00
Jason Ho
2b92c5a23e
langref: tweak description of []T (#12319)
saying []T is a pointer is confusing because zig docs say there are two types of pointers (*T and [*]T). It is more clear to say that []T is a slice type which contains a [*]T pointer and a length.

Co-authored-by: Philipp Lühmann <47984692+luehmann@users.noreply.github.com>
2022-08-31 21:53:00 -04:00
Andrew Kelley
7a733b9385 CI: macos: skip non native
We already test cross compiling on x86_64-linux; no need to additionally
test it in the macOS script.
2022-08-31 16:07:08 -07:00
Andrew Kelley
77f31ebbbe CI: fix content type of autodocs source listings 2022-08-31 15:27:09 -07:00
Andrew Kelley
368a20a051 CI: include source listings for autodocs 2022-08-31 14:22:01 -07:00
Andrew Kelley
c5f1b3224f CI: update_download_page: change docs deployment
The original impetus for making a change here was a typo in --add-header
causing the script to fail. However, upon inspection, I was alarmed that
we were making a --recursive upload to the *root directory* of
ziglang.org. This could result in garbage files being uploaded to the
website, or important files being overwritten. As I addressed this concern,
I decided to take on file compression as well.

Removed compression prior to sending to S3. I am vetoing pre-compressing
objects for the following reasons:
 * It prevents clients from working which do not support gzip encoding.
 * It breaks a premise that objects on S3 are stored 1-to-1 with what is
   on disk.
 * It prevents Cloudflare from using a more efficient encoding, such as
   brotli, which they have started doing recently.

These systems such as Cloudflare or Fastly already do compression on
the fly, and we should interop with these systems instead of fighting them.

Cloudfront has an arbitrary limit of 9.5 MiB for auto-compression. I looked
and did not see a way to increase this limit. The data.js file is currently
16 MiB. In order to fix this problem, we need to do one of the following things:

 * Reduce the size of data.js to less than 9.5 MiB.
 * Figure out how to adjust the Cloudfront settings to increase the max size
   for auto-compressed objects.
 * Migrate to Fastly. Fastly appears to not have this limitation. Note
   that we already plan to migrate to Fastly for the website.
2022-08-31 13:15:42 -07:00
Andrew Kelley
9a0cb34c73 CI: namespace manifest json files to avoid clobbering 2022-08-31 13:15:21 -07:00
Andrew Kelley
36ad0abd7a CI: drone: avoid notify_lavahut task for PRs 2022-08-31 13:14:51 -07:00
Jakub Konka
540d8cd809 coff: add import table definitions 2022-08-31 19:30:51 +02:00
Veikka Tuominen
26e9839132 disable test for non-llvm backends
Follow up to fdb8870852
2022-08-31 16:46:51 +03:00
Hashi364
973b440561 Using comptime level.asText() in log example
Some recent change makes slice concatenation runtime (merge #12368), so the example needs to be explicitly made comptime.
2022-08-31 16:01:35 +03:00
Evan Haas
fdb8870852 translate-c: promote large integer macros to unsigned long long if necessary
Closes #10793

Co-authored-by: Veikka Tuominen <git@vexu.eu>
2022-08-31 15:52:53 +03:00
Jakub Konka
b45387f20e coff: write base relocations for the dynamic linker
This means we can request ASLR on by default as other COFF linkers
do. Currently, we write the base relocations in bulk, however,
given that there is a mechanism for padding in place in PE/COFF
I believe there might be room for making it an incremental operation
(write base relocation whenever we add/update a pointer that would
require it).
2022-08-31 14:39:35 +02:00
Luuk de Gram
4ba0ad295f
Merge pull request #12687 from Luukdegram/wasm-extern-globals
wasm-linker: implement non-function extern variables
2022-08-31 13:44:06 +02:00
Andrew Kelley
9f9e51eb11 CI: drone: disable failing tests
See tracking issue #12689
2022-08-30 22:55:30 -07:00
biexelar
59e33b447b
std.Thread: fix freeAndExit on x86_64-linux (#12693)
Previously, this function used incorrect registers for the munmap syscall, leading to detached threads not cleaning up.

closes #12690

Co-authored-by: bxlr <biexelar@diroot.org>
2022-08-30 22:31:47 -04:00
Andrew Kelley
56cfa8f22f Sema: prevent access of undefined fields
When instantiating a generic function, there is a period of time where
the function is inserted into monomorphed_funcs map, but is not yet
initialized. Despite semantic analysis being single-threaded, generic
function instantiation can happen recursively, meaning that the hash
and equality functions for monomorphed_funcs entries are potentially
invoked for an uninitialized function.

This problem was mitigated by pre-setting the hash field on the newly
allocated function, however it did not solve the problem for hash
collisions in which case the equality function would be invoked. That it
was solved for hash() but not eql() explains why the problem was
difficult to observe. I tested this patch by temporarily sabotaging the
hash and making it always return 0.

This fix is centered on adding a new field to Module.Fn which is the one
checked by eql() and is populated pre-initialization.

closes #12643
2022-08-30 18:34:08 -07:00
Andrew Kelley
35e0ff7c36 CI: drone: disable failing tests
See tracking issue #12689
2022-08-30 15:01:05 -07:00
Jakub Konka
d3eaabd285 coff: add base relocation related types 2022-08-30 23:07:28 +02:00
Andrew Kelley
f559ea95b1
Merge pull request #12686 from Vexu/stage2-fixes
Stage2 fixes
2022-08-30 15:55:05 -04:00
Andrew Kelley
7377dce368 avoid exposing supportsTailCall in the standard library
This is problematic because in practice it depends on whether the
compiler backend supports it too, as evidenced by the TODO comment about
LLVM not supporting some architectures that in fact do support tail
calls.

Instead this logic is organized strategically in src/target.zig, part of
the internal compiler source code, and the behavior tests in question
duplicate some logic for deciding whether to proceed with the test.

The proper place to expose this flag is in `@import("builtin")` - the
generated source file - so that third party compilers can advertise
whether they support tail calls.
2022-08-30 12:50:15 -07:00
Veikka Tuominen
65d3723968 Sema: check that target supports tail calls 2022-08-30 12:22:07 -07:00
Veikka Tuominen
c558de6655 stage2 llvm: use tag value instead of field index in airUnionInit
Closes #12656
2022-08-30 12:22:07 -07:00
Veikka Tuominen
d3b4b2edf1 Sema: shift of comptime int with runtime value
Closes #12290
2022-08-30 12:22:07 -07:00
Veikka Tuominen
01d19a8d3c Sema: do not emit generic poison for non generic parameters
Closes #12679
2022-08-30 12:22:07 -07:00
Veikka Tuominen
67a44211f7 Sema: improve handling of always_tail call modifier
Closes #4301
Closes #5692
Closes #6281
Closes #10786
Closes #11149
Closes #11776
2022-08-30 12:22:07 -07:00
Andrew Kelley
0a42602418 CI: drone: disable failing tests
See tracking issue #12689
2022-08-30 12:02:26 -07:00
Luuk de Gram
8627858bbc
test/link: add test for extern resolution
Adds a linker tests to verify extern/undefined symbols
representing non-functions are being resolved correctly.
2022-08-30 18:32:08 +02:00
Luuk de Gram
4f72ac265a
wasm: create relocations for extern decls
This also fixes performing relocations for data symbols
of which the target symbol exists in an external object file.
We do this by checking if the target symbol was discarded,
and if so: get the new location so that we can find the
corresponding atom that belongs to said new location. Previously
it would always assume the symbol would live in the same file
as the atom/symbol that is doing the relocation.
2022-08-30 16:38:55 +02:00
Luuk de Gram
414fcea162
link/Wasm: handle extern variables
Generate symbols for extern variables and try to resolve them.
Unresolved 'data' symbols generate an error as they cannot be
exported from the Wasm runtime into a Wasm module. This means,
they can only be resolved by other object files such as from other
Zig or C code compiled to Wasm.
2022-08-30 16:38:51 +02:00
Jakub Konka
aa5568beb6 coff: move Symtab and Strtab out of coff.Coff
This should ease interfacing with different std.coff functionalities.
2022-08-30 15:51:49 +02:00
Jakub Konka
7ef0c9d298
Merge pull request #12677 from ziglang/coff-linker
coff: initial rewrite of the COFF/PE linker
2022-08-30 14:29:41 +02:00
Jakub Konka
b64e4c5bf2 fix aarch64-macos CI build script 2022-08-30 14:29:06 +02:00
Jakub Konka
69d6931be7
Merge pull request #12662 from wsengir/coff-fix
coff: fix reading COFF header offset
2022-08-30 12:26:35 +02:00
Veikka Tuominen
e6be6d9768 std.rand: make weightedIndex proportions param a const slice
The function does not mutate the proportions and the signature should reflect that.
2022-08-30 13:02:17 +03:00
Jakub Konka
e57fbe8069 test-cases: fix compiler error locations for hello world with updates 2022-08-30 11:01:08 +02:00
Jakub Konka
241e1ac030 cmake: add runaway Coff/Object.zig path 2022-08-30 10:42:21 +02:00
Jakub Konka
601f2147e0 coff: cleanup relocations; remove COFF support from other backends
Given that COFF will want to support PIC from ground-up, there is no
point in leaving outdated code for COFF in other backends such as
arm or aarch64. Instead, when we are ready to look into those, we
can start figuring out what to add and where.
2022-08-30 10:42:21 +02:00
Jakub Konka
ebdb286736 coff: commit missing Object.zig placeholder 2022-08-30 10:42:21 +02:00
Jakub Konka
f0d4ce4494 coff: add basic handling of GOT PC relative indirection 2022-08-30 10:42:21 +02:00
Jakub Konka
db1a3bb0e7 coff: fallback to _start as default entry point for now
This is not technically correct, but given that we are not yet able
to link against the CRT, it's a good default until then.

Add basic logging of generated symbol table in the linker.
2022-08-30 10:42:21 +02:00
Jakub Konka
b4e3b87a52 coff: ...and lift-off! 2022-08-30 10:42:21 +02:00
Jakub Konka
30baba899c coff: add missing bits required for minimal PE example 2022-08-30 10:42:21 +02:00