Commit Graph

650 Commits

Author SHA1 Message Date
Andrew Kelley
28e95b3240 CI: drone: simplify
Instead of a switch in a bash file we just properly name
the pipeline steps.

Also use zig build to produce the release artifact.
2022-08-19 16:45:15 -07:00
Andrew Kelley
5b486b1851 CI: use zig build to produce release artifact
For both macOS and FreeBSD.
2022-08-19 16:45:15 -07:00
Andrew Kelley
a8f86291d2 CI: update freebsd tarball
This updates to a stage3 freebsd tarball.
2022-08-19 16:45:15 -07:00
Andrew Kelley
7cf6930e24 CI: macos: set release mode for zig and simplify 2022-08-19 16:45:15 -07:00
Andrew Kelley
9f43ebd6ef CI: windows: build stage3 directly from dev kit 2022-08-19 16:45:15 -07:00
Andrew Kelley
d75d40dfdf build: make docs a separate step than test 2022-08-19 16:45:15 -07:00
Andrew Kelley
7346600517 CI: avoid concurrent jobs tripping over each other 2022-08-19 16:45:15 -07:00
Andrew Kelley
e3ccea70dd CI: isolate zig-cache for parallel debug/release builds 2022-08-19 16:45:15 -07:00
Andrew Kelley
a73b3a0d70 CI: simplify x86 linux test instructions 2022-08-19 16:45:15 -07:00
Andrew Kelley
06c42a0c68 CI: test both stage3-debug and stage3-release on x86-linux 2022-08-19 16:45:15 -07:00
Andrew Kelley
507aae4a1a make self-hosted the default compiler
stage1 is available behind the -fstage1 flag.

closes #89
2022-08-19 16:45:15 -07:00
Andrew Kelley
73bbd1069a build: remove the option to omit stage2 2022-08-19 16:45:15 -07:00
Jakub Konka
b6ce0cce69 windows-ci: pass -Domit-stage2 to test-toolchain 2022-08-17 23:13:58 +02:00
Loris Cro
95573dbeeb ci: add gzip compression to stdlib docs & langref 2022-08-15 20:44:30 +02:00
Andrew Kelley
64307c2821 CI: update windows tarball 2022-08-11 12:48:11 -07:00
Hadrien Dorio
bcc6cdc4fb ci: azure: stop when exe exits with an error 2022-08-11 12:48:11 -07:00
Loris Cro
94662591d6 ci: upload langref and stdlib docs directly to s3
previously we were delegating that job to the website CI but it caused
the website repo to bloat, so now we only commit releases.json
2022-08-06 18:12:21 +02:00
Andrew Kelley
932d1f785e CI: -Denable-llvm for test-cases
This requires using -Dstatic-llvm and setting the search prefix and the
target, just like it is required for building stage2 and stage3. This
prevents Zig from trying to integrate with the system, which would
trigger an error due to the `cc` command not being installed.

closes #12144
2022-07-29 11:03:12 -07:00
Andrew Kelley
3ccb6a0cd4 CI: run test-run-translated-c tests with stage3 2022-07-27 17:56:59 -07:00
Andrew Kelley
ffac6a1b9f CI: run test-link with stage3 2022-07-26 20:23:33 -07:00
Andrew Kelley
3de9ffa84d CI: run test-cases with stage3
See #12144 for why I did not `-Denable-llvm` yet.
2022-07-26 20:15:57 -07:00
Andrew Kelley
0d120fcb89
Merge pull request #12225 from ziglang/ci-stage3-standalone
CI stage3 test coverage for test-standalone and test-cli
2022-07-25 00:46:56 -07:00
Andrew Kelley
93ae386f56 stage2: don't skip liveness or codegen if -femit-asm is supplied
Fixes Godbolt's CLI usage of Zig.
2022-07-24 15:02:05 -07:00
Andrew Kelley
be294e3744 CI stage3 test coverage for test-standalone 2022-07-24 15:02:05 -07:00
Luuk de Gram
34b786fb0f
enable link-test on linux CI 2022-07-23 10:08:51 +02:00
Andrew Kelley
7502e490cb
Merge pull request #12173 from ziglang/autodocs-rebased
New Autodocs!
2022-07-22 20:56:59 -07:00
Andrew Kelley
5cd1ccf4b9 CI: stage3 coverage for test-translate-c 2022-07-21 22:52:08 -07:00
zc
460211431f complete the drone pipeline runner type and platform os 2022-07-21 11:17:35 -07:00
Andrew Kelley
e054877466 CI: stage3 covers test-universal-libc and builds stage1 2022-07-20 23:28:30 -07:00
Andrew Kelley
1ec50613bf CI: increase stage3 test coverage
* Use a debug build of stage3 instead of a debug build of stage2 for
   our self-hosted compiler test coverage.
 * Move coverage from stage1 to stage3 for:
   - building self-hosted without LLVM
   - building self-hosted for 32-bit arm
   - test-compiler-rt
   - test-behavior
   - test-std
   - test-compare-output
   - test-asm-link
   - test-fmt
2022-07-20 12:27:03 -07:00
Andrew Kelley
08f3c7960a build.zig: remove deleted .cpp file 2022-07-20 11:10:46 -07:00
Jakub Konka
e3c8ba2dc5 ci: bump macOS image on Github Actions to macos-11
The currently used image is getting deprecated and every user is advised
to switch to either macos-11 or macos-12. The link to upstream
issue/notification:

https://github.com/actions/virtual-environments/issues/5583
2022-07-15 07:56:21 -07:00
Luuk de Gram
8033767082
wasm-linker: Implement linker tests (#12006)
* test/link: initial wasm support

This adds basic parsing and dumping of wasm section so they
can be tested using the new linker-test infrastructure.

* test/link: all wasm sections parsing and dumping

We now parse and dump all sections for the wasm binary format.
Currently, this only dumps the name of a custom section.
Later this should also dump symbol table, name, linking metadata and relocations.
All of those live within the custom sections.

* Add wasm linker test

This also fixes a parser mistake in reading the flags.

* test/link: implement linker tests wasm & fixes

Adds several test cases to test the wasm self-hosted linker.
This also introduces fixes that were caught during the implementation
of those tests.

* test-runner: obey omit_stage2 for standalone

When a standalone test requires stage2, but stage2 is omit
from the compiler, such test case will not be included as part
of the test suite that is being ran. This is to support CI's
where we omit stage2 to lower the memory usage.
2022-07-12 14:36:33 +02:00
Andrew Kelley
3e864c86da CI: azure: update build.zig for LLVM 14 2022-07-08 23:02:38 -07:00
Andrew Kelley
aade8856ee CI: update scripts to stage1 LLVM 14 tarballs
The previous tarballs were stage3 which is not quite ready for primetime
yet.
2022-07-08 21:28:06 -07:00
Andrew Kelley
bdf3fa12fa CI: update scripts to new LLVM 14 tarballs 2022-07-07 20:47:58 -07:00
Andrew Kelley
927e59d053 CI: fix wrong macos tarball 2022-07-05 15:20:12 -07:00
Andrew Kelley
bcfc4f0ceb CI: update tarballs to LLVM 14 2022-07-04 20:12:44 -07:00
Andrew Kelley
902dc8c721 CI: update freebsd pkg install command 2022-06-30 17:57:00 -07:00
Jakub Konka
ab8a670a57 link-tests: enable on macos CI host only for now 2022-06-22 23:04:47 +02:00
Jakub Konka
1d4dbf8d3c macos: run test-cases single threaded in the CI 2022-06-19 21:08:53 +02:00
Veikka Tuominen
6b36774adc std: disable failing tests, add zig2 build test-std to CI 2022-06-12 10:43:28 +03:00
Andrew Kelley
2bf532fc23 stage2: use std.debug.Trace only when explicitly enabled
Because it bumps up the stack space requirements, which is making a test
case fail on aarch64 drone CI.
2022-06-09 20:00:59 -07:00
Andrew Kelley
b095aa6986 CI: skip single-threaded tests on Drone
sure would be nice if they would just give us another hour of CI run time.
2022-06-01 14:05:58 -07:00
Andrew Kelley
69323fc143 CI: skip non native ReleaseFast and ReleaseSafe tests on drone
Because we're hitting the 2 hour time limit.
2022-06-01 11:19:19 -07:00
Jakub Konka
5b813f1a2a Set macOS/iPhoneOS/tvOS/watchOS ABI to none (unspecified) by default
Prior to this change we would assume the ABI for Apple targets to
be GNU which could result in subtle errors in LLVM emitting calls
to non-existent system libc provided functions such as `_sincosf`
which is a GNU extension and as such is not provided by macOS for example.
This would result in linker errors where the linker would not be
able to find the said symbol in `libSystem.tbd`.

With this change, we now correctly identify macOS (and other Apple
platforms) as having ABI `unknown` which translates to unspecified
in LLVM under-the-hood:

```
// main.ll
target triple = "aarch64-unknown-macos-unknown"
```

Note however that we never suffix the target OS with target version
such as `macos11` or `macos12` which means we fail to instruct LLVM
of potential optimisations provided by the OS such as the availability
of function `___sincosf_stret`. I suggest we investigate that in a
follow-up commit.
2022-05-22 17:45:02 +02:00
Andrew Kelley
66f3efb63b migrate runtime safety tests to the new test harness
* migrate runtime safety tests to the new test harness
   - this required adding compare output / execution support for stage1
     to the test harness.
 * rename `zig build test-stage2` to `zig build test-cases` since it now
   does quite a bit of stage1 testing actually. I named it this way
   since the main directory in the source tree associated with these
   tests is "test/cases/".
 * add some documentation for the test manifest format.
2022-05-13 14:03:20 -07:00
Andrew Kelley
aa05cd4809 CI: fix universal libc step name
This was a merge conflict that went undetected.
2022-05-07 17:44:37 -07:00
Andrew Kelley
e8c85450fe
Merge pull request #11592 from ziglang/stage3-macos-linker
Sema: solve a false positive "depends on itself"
2022-05-07 04:38:19 -04:00
Andrew Kelley
ec95e00e28 flatten lib/std/special and improve "pkg inside another" logic
stage2: change logic for detecting whether the main package is inside
the std package. Previously it relied on realpath() which is not portable.
This uses resolve() which is how imports already work.

 * stage2: fix cleanup bug when creating Module
 * flatten lib/std/special/* to lib/*
   - this was motivated by making main_pkg_is_inside_std false for
     compiler_rt & friends.
 * rename "mini libc" to "universal libc"
2022-05-06 22:41:00 -07:00
Jakub Konka
a2dbe6589e macho: share traditional codepaths with stage2+llvm backend 2022-05-07 01:44:26 +02:00
Andrew Kelley
a2b8a9756f CI: macos: disable stage2 test-behavior
stage2 on macOS is not yet capable of passing these tests. Such
improvements will be done in a follow-up change.
2022-05-06 16:26:04 -07:00
Andrew Kelley
6d605ca690 CI: macos: stage2 zig build test-behavior 2022-05-06 15:42:52 -07:00
Andrew Kelley
496eb69273 CI: add non-LLVM backends to the test matrix
We can't yet run the behavior tests with stage3, but at least we can run
them with stage2, and we can use the proper test matrix.

This commit also adds use_llvm and ofmt to the zig build system.
2022-05-05 22:29:25 -07:00
Jakub Konka
3624e1ef48 test: move compile errors and incremental tests into common dir 2022-05-04 23:51:16 +02:00
Jakub Konka
c8a0d8ff2b ci: ignore fmt errors in test/incremental/ 2022-04-28 18:35:01 +02:00
Andrew Kelley
ebfddbaf00 CI: additionally test building stage3 2022-04-21 11:20:26 -07:00
Andrew Kelley
ecd756834b CI: update CLI invokation
243afdcdf5 removed `-Dskip-compile-errors`
and added `-Dskip-stage`.
2022-03-31 16:06:50 -07:00
Cody Tapscott
1de63ad793 zig fmt: Add --exclude argument to skip dir/file
This change adds a "--exclude" parameter to zig format, which can be
used to make sure that it does not process certain files or folders
when recursively walking a directory.

To do this, we simply piggy-back on the existing "seen" logic in zig
fmt and mark these files/folders as seen before processing begins.
2022-03-25 12:27:46 -07:00
Andrew Kelley
46ba24010a CI: explicitly pass -fno-LLVM
Needed because of previous commit.
2022-03-17 19:12:27 -07:00
Andrew Kelley
e74382b602 ci: azure: update to newest LTS ubuntu 2022-03-06 20:03:57 -07:00
Andrew Kelley
e535521619 CI: additionally test wasm32-wasi with LLVM backend 2022-03-06 12:25:33 -07:00
Carlos Zúñiga
d8da9a01fc Use lowercase in shasum for windows builds 2022-02-21 00:40:46 -05:00
Andrew Kelley
dd12a7b1e5 ci: linux: re-use cmake config for finding LLVM 2022-02-17 23:42:48 -07:00
Andrew Kelley
6f42876e74 CLI: resolve system libs into static libraries
using the provided -L directories before checking if we need to integrate
with system library paths. This prevents false positive of invoking
system cc to find native paths when in fact all dependencies are
satisfied by -L (or --search-prefix to zig build).
2022-02-17 23:42:48 -07:00
Andrew Kelley
419074a81b CI: simplify linux script
* build.zig: remove detour through zig0. I'll add it back as an option
   later. This means you can build stage1 with a freshly built zig
   without detouring through zig0 again.
 * remove unused file windows_script.bat
 * drone.yml: remove unnecessary steps
 * ninja doesn't need a jobs parameter
 * build the release version of zig with zig build instead of cmake.
 * build stage2 with -Dstatic-llvm -Duse-zig-libcxx
2022-02-17 23:42:46 -07:00
Andrew Kelley
2f42a2617b CI: more stage2 test coverage
* Test everything on the Linux CI even if we can't run it, because it's
   our fastest machine.
 * Test stage2 using a build of stage2 (instead of using `-fno-stage1`)
   so that compiler-rt is also built with stage2.
 * Additionally test running x86_64-macos on the macOS CI, both the LLVM
   backend and x86_64 backend.
2022-02-17 23:41:58 -07:00
Hadrien Dorio
02902cc099
ci: azure: split build-and-test step (#10853)
replace the .bat script by a pwsh script
2022-02-16 22:33:08 -05:00
Andrew Kelley
25a7025613 ci: use zig-bootstrap for windows 2022-02-16 18:43:45 -07:00
Andrew Kelley
0b22b6b70e ci: update x86_64-linux tarballs
The updated docker images has LLVM, LLD, Clang updated to 13.0.1 and Zig
updated to 0.9.1.
2022-02-15 20:12:10 -07:00
Andrew Kelley
65cb8a03ee CI: update macos and freebsd tarballs 2022-02-15 19:50:38 -07:00
Jakub Konka
be98f30a2d
Merge pull request #10893 from joachimschmidt557/stage2-aarch64
stage2 AArch64: get zig test working; enable behavior tests
2022-02-15 07:05:24 +01:00
Andrew Kelley
dc6553d93e CI: update download page and langref for 0.9.1 2022-02-14 20:08:04 -07:00
joachimschmidt557
6c195db03a
ci: add aarch64-linux behavior tests 2022-02-14 22:36:13 +01:00
Andrew Kelley
1a8987fe7c CI: additionally test stage2 LLVM backend targeting aarch64-linux 2022-02-12 11:18:23 +01:00
Jakub Konka
beb275b371 Revert "CI: upgrade both host and target tarballs to llvm 13.0.1 x86_64-macos"
This reverts commit 1072d8a065.
2022-02-12 11:17:41 +01:00
Jakub Konka
1072d8a065 CI: upgrade both host and target tarballs to llvm 13.0.1 x86_64-macos 2022-02-12 11:01:10 +01:00
Andrew Kelley
3fdbc3bba8 CI: upgrade x86_64-macos tarball to llvm 13.0.1 2022-02-12 01:09:13 -07:00
Andrew Kelley
a5a7f0ff00 CI: upgrade x86_64-macos tarball to llvm 13.0.1 2022-02-11 15:57:44 -07:00
Andrew Kelley
44b5fdf326 Revert "ci: azure: split build-and-test step"
This reverts commit 846eb70182.

This did not properly translate the upload portion of the CI script to
powershell which broke our CI pipeline.
2022-02-09 18:26:56 -07:00
Andrew Kelley
274b9d5c1d ci: work around azure networking issue 2022-02-09 16:42:15 -07:00
Andrew Kelley
92cb17a331 CI: windows: update env var names 2022-02-09 10:41:12 -07:00
Hadrien Dorio
846eb70182 ci: azure: split build-and-test step
replace the .bat script by a pwsh script
2022-02-08 19:47:46 -05:00
Andrew Kelley
aa902c7042 ci: azure: update to newer msys2 release 2022-01-29 11:28:57 -07:00
Andrew Kelley
59315463f2 ci: add test coverage for self-hosted arm and x86_64 backends 2022-01-06 22:57:29 -05:00
Andrew Kelley
ea913846c2 ci: add 0.9.0 to downloads json 2021-12-20 15:18:25 -07:00
Michael Dusan
a711fcbbfa ci: linux: supply on_master_sucess with VERSION
- move on_master_success to the package step
- add required secret availability for packaging

This replaces a1b79ea585 .
2021-12-06 23:13:06 -08:00
Luuk de Gram
9e03cf9489 wasm: Initial behavior tests succeeding
- Correctly load slice value on stack
- Implement WrapErrorUnionErr and payload
- Implement trunc, fix sliceLen and write undefined
- Implement slice as return type and argument

Note: This also fixes a memory leak for inferred error sets, and for usingnamespace
2021-12-05 12:19:01 -08:00
Michael Dusan
a1b79ea585 ci: linux: pass VERSION on_master_success
Cache the VERSION value for use with linux_on_mster_success.
This replaces 117c0460d3 .
2021-12-05 00:31:59 -08:00
Andrew Kelley
f7cbd92e6c Revert "Merge pull request #10270 from Luukdegram/behaviour-tests"
This reverts commit 725267f7c2, reversing
changes made to 2dae860de3.

This test is failing:

```zig
pub fn main() u8 {
    var e = foo();
    const i = e catch 69;
    return i;
}

fn foo() anyerror!u8 {
    return 5;
}
```

It's returning 69 instead of the expected value 5.
2021-12-04 21:55:50 -07:00
Michael Dusan
117c0460d3 ci: linux: pass VERSION on_master_success 2021-12-04 20:28:26 -08:00
Andrew Kelley
725267f7c2
Merge pull request #10270 from Luukdegram/behaviour-tests
Stage2: Initial behavior tests succeeding
2021-12-04 18:16:05 -08:00
Andrew Kelley
daa3e0bbb4 ci: fix update-download-page and remove bashism 2021-12-04 14:20:46 -07:00
Luuk de Gram
74a5f4d848
wasm: Initial behavior tests succeeding
Note: This also fixes a memory leak for inferred error sets, and for usingnamespace
2021-12-04 21:17:17 +01:00
Andrew Kelley
e81fda9823 ci: make the on_master_success script fail on missing args 2021-12-03 20:34:54 -07:00
Andrew Kelley
b24cbecdb2 zig build: promote qemu, wine, wasmtime, darling, and rosetta
from zig-specific options to generally recognized zig build options that
any project can take advantage of. See the updated usage text for more
details.
2021-12-02 15:46:22 -07:00
Lee Cannon
1093b09a98
allocgate: renamed getAllocator function to allocator 2021-11-30 23:32:47 +00:00
Lee Cannon
75548b50ff
allocgate: stage 1 and 2 building 2021-11-30 23:32:47 +00:00
Lee Cannon
85de022c56
allocgate: std Allocator interface refactor 2021-11-30 23:32:47 +00:00
Jakub Konka
2ca5a859e9 Force static libncurses in CMakeLists when static zig on macos
Add additional search paths pointing at homebrew prefixes as Apple
doesn't ship a static libncurses for linking - only a stub for dynamic
linking `libncurses.tbd`.
2021-11-28 21:10:33 -08:00
Andrew Kelley
2991e3f66b ci: add coverage for building stage2 for arm-linux-musleabihf 2021-11-21 19:50:20 -07:00
Andrew Kelley
c715d512cb CI: additionally run stage2 behavior tests with -ofmt=c 2021-11-09 16:12:57 -07:00
Michael Dusan
a7d215759e ci: fully activate ci.ziglang.org linux
- disable azure/linux
- split probe/build/test steps for log clarity
- add package step; enabled only when master/pull
- add on-master-success pipeline; enabled only when master/pull
2021-11-08 13:45:03 -05:00
Andrew Kelley
4acd8920d8 ci: don't print env because there will be secrets there 2021-11-08 11:27:02 -07:00
Michael Dusan
325bae7fc0
ci: add new linux pipeline
A new zsf-hosted server is being brought online.
This should be enough for linux build, test and packaging pipeline.

Currently this pipeline does not not post artifacts.
2021-11-02 10:44:01 -04:00
Robin Voetter
15a0b30d8e ci: disable macos stage 2 tests 2021-10-17 22:46:36 +02:00
Andrew Kelley
7f006287ae
Merge pull request #9878 from pfgithub/patch-4
Add line numbers to langref
2021-10-12 14:21:28 -04:00
pfg
2e244c90b3 update ci script to not error for empty elements 2021-10-11 23:15:03 -04:00
Michael Dusan
4e590fadb5 ci drone: enable more testsuite
Upstream LLVM fixes #8597, no longer need `-Dskip-debug` and others.

Additionally, due to the nature of drone.io server pool, it is
beneficial to know which aarch64 CPU brand is in use.

- drop `-Dskip-debug` and others
- invoke `lscpu` prior to build
- enable more testsuite consistent with ci azure
- remove workaround for (already closed) #6830

closes #8597
2021-10-04 19:18:19 -04:00
Andrew Kelley
c7b32eb99a ci: windows: update tar command line parameter order
you have got to be kidding me
2021-10-01 22:27:16 -07:00
Andrew Kelley
86bb09a0ff ci: update macos tarballs
These bring in a bug fix to libcxx.zig that is currently causing the CI
to fail.
2021-10-01 18:32:19 -07:00
Andrew Kelley
210ef5af8e ci: windows: adjust tar workaround
tar does not properly implement the -k feature, so don't use it.
It incorrectly reports "file exists" when the expected behavior is to
leave the existing file alone.
2021-10-01 18:07:50 -07:00
Andrew Kelley
acb0a87158 ci: windows: workaround for tar symlink behavior 2021-10-01 17:18:32 -07:00
Andrew Kelley
43e3734d3b ci: macos arm64 script uses release build of zig
even for the host. This prevents a dependency on "dump" functions of
LLVM, which are not included in the tarballs used for the CI.
2021-10-01 16:53:42 -07:00
Andrew Kelley
9bf10b1018 ci: update windows tarballs to llvm 13 2021-10-01 16:53:33 -07:00
Andrew Kelley
7350cb2fc7 ci: update tarballs for LLVM 13
NetBSD CI is disabled because it is not yet supported in
zig-bootstrap. Once NetBSD has proper zig-bootstrap support, it can be
re-enabled.

Windows is not solved here yet; will be pushing a separate commit for
that.
2021-10-01 16:07:42 -07:00
Andrew Kelley
3eb729b442 Merge remote-tracking branch 'origin/master' into llvm13 2021-09-30 21:38:04 -07:00
Andrew Kelley
60b6e74468 ci: fix typo introduced in earlier commit
c2a7542df5 introduced a typo in the linux
CI script.
2021-09-28 09:50:25 -07:00
Andrew Kelley
c2a7542df5 ci: azure: run build steps independently to save ram
Azure is hitting OOM on test-toolchain. This commit is trying to
coast for another week until we switch to Drone CI for this job.
2021-09-27 21:39:27 -07:00
Josh Soref
664941bf14
Spelling corrections (#9833)
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2021-09-24 13:39:20 -04:00
Michael Dusan
cc4d38ed57 ci linux: bump qemu-6.1.0.1
closes #8653
2021-09-23 21:22:53 -04:00
Andrew Kelley
dc9d76b630 ci: go back to passing state for linux
This commit reverts 6d37ae95ed and
8f8294a809. I don't know why they caused a
failure but that investigation can happen while the CI is green.
2021-09-16 16:40:06 -07:00
Andrew Kelley
6d37ae95ed build.zig: support -Duse-zig-libcxx
This supports the case when it is known that LLVM, Clang, LLD were built
with Clang (or `zig c++`). This commit updates the Linux CI script to
pass this since we build using a zig tarball.
2021-09-16 13:09:32 -07:00
Andrew Kelley
8f8294a809 ci: linux: enable LLVM stage2 tests 2021-09-16 11:21:56 -07:00
Andrew Kelley
f3ebfcae38 Merge remote-tracking branch 'origin/master' into llvm13
Conflicts:

 * cmake/Findclang.cmake
 * cmake/Findlld.cmake
 * cmake/Findllvm.cmake

In master branch, more search paths were added to these files with "12"
in the path. In this commit I updated them to "13".

 * src/stage1/codegen.cpp
 * src/zig_llvm.cpp
 * src/zig_llvm.h

In master branch, ZigLLVMBuildCmpXchg is improved to add
`is_single_threaded`. However, the LLVM 13 C API has this already, and
in the llvm13 branch, ZigLLVMBuildCmpXchg is deleted in favor of the C
API. In this commit I updated stage2 to use the LLVM 13 C API rather
than depending on an improved ZigLLVMBuildCmpXchg.

Additionally, src/target.zig largestAtomicBits needed to be updated to
include the new m68k ISA.
2021-09-15 14:51:08 -07:00
Jonathan Marler
e5fd45003e azure pipeline fix removal of recently run exe
The following is an azure failure that occured Sep 13:

del : Cannot remove item D:\a\1\s\sfx.exe: The process cannot access the file 'D:\a\1\s\sfx.exe' because it is being used by another process.

Windows will keep a hold of recently run exeutables even after their process has exited.  To avoid this I've just removed the deletion of the exe file.  It's about 70 MB so it's probably OK.
2021-09-15 13:47:09 -04:00
Andrew Kelley
2b90e2c284 ci: azure: update to newer msys2 release 2021-09-15 10:32:33 -07:00
Andrew Kelley
501e6cf2f3 ci: add 0.8.1 release to download page 2021-09-07 14:36:08 -07:00
Andrew Kelley
7efca2e6f5 Merge remote-tracking branch 'origin/master' into llvm13 2021-08-31 18:44:15 -07:00
Andrew Kelley
75263e160e CI: update Linux and macOS tarballs to LLVM 12.0.1 2021-08-31 16:39:25 -07:00
Andrew Kelley
a69b86003c update CI scripts to llvm 13 rc1 2021-08-15 23:11:01 -07:00
Carlos Zúñiga
aad4598367 ci: remove extra zig directory in windows builds
From $prefix/lib/zig/std/std.zig to $prefix/lib/std/std.zig
2021-08-03 08:49:18 +03:00
Jakub Konka
159cd528b1 Add -Denable-macos-sdk explicit flag to build.zig
This way, we can explicitly signal if a test requires the presence
of macOS SDK to build. For instance, when testing our in-house
MachO linker for correctly linking Objective-C, we require the
presence of the SDK on the host system, and we can enforce this
with `-Denable-macos-sdk` flag to `zig build test-standalone`.
2021-08-02 13:41:58 -04:00
Andrew Kelley
c47b46fc8d CI: enable stage2 behavior test coverage 2021-07-28 16:00:49 -04:00
Luna
3e8394776a ci: enable netbsd tarballs
This reverts commit 3063f0a5ed.
2021-07-12 21:44:38 -04:00
Andrew Kelley
3063f0a5ed ci: disable netbsd tarballs until the false positives stop 2021-07-11 22:28:03 -07:00
Andrew Kelley
a886374df4 ci: netbsd fixups and general cleanup
* remove unused download page html. It's now handled in the
   www.ziglang.org website repo.
 * add netbsd to the downloads index.json file that we send to
   the www.ziglang.org website repo.
 * shallow clone the website repo to avoid downloading old copies of
   data.js unnecessarily.
2021-07-11 22:13:26 -07:00
Luna
c28b227d0b ci: add scripts for netbsd 2021-07-11 22:09:12 -07:00
Andrew Kelley
96ebf9396f ci: no need for --ast-check
since zig will now run AstGen even when using the stage1 backend.
2021-06-23 10:44:46 -07:00
Andrew Kelley
e125ead2b1 ci: remove confusing message now that --ast-check is added
This extra message was intended to help contributors by clarifying
what to do when they hit a `zig fmt` failure, but now AST errors are
also emitted here and the message may actually introduce confusion.

Remove it for now.
2021-06-15 14:27:56 -07:00
Andrew Kelley
408d8df86c ci: azure: update to newer msys2 release 2021-06-14 12:03:10 -07:00
Andrew Kelley
193c529b8c CLI: rename --override-lib-dir to --zig-lib-dir
This breaking change disambiguates between overriding the lib dir when
performing an installation with the Zig Build System, and overriding the
lib dir that the Zig installation itself uses.
2021-06-14 11:33:27 -07:00
Veikka Tuominen
e63ff4f1c1 add ast-check flag to zig fmt, fix found bugs 2021-06-14 00:16:40 +03:00
jacob gw
b9f07b7ac2 format zig files and add formatting check to ci 2021-06-13 22:33:39 +03:00
Jakub Konka
b0ee911c23 wasi: always grant fd_readdir right
Since v0.23 release of Wasmtime, if we want to iterate a directory
Y then directory Y needed to have been granted `fd_readdir` right.
However, it is now also required for directory X to carry `fd_readdir`
right, and so on, up-chain all the way until we reach the preopen
(which possesses all rights by default).

This caused problems for us since our libstd implementation is more
fine-grained and allowed for parent dirs not to carry the right while
allow for iterating on its children. My proposal here is to always
grant `fd_readdir` right as part of
`std.fs.Dir.OpenDirOptions.access_sub_paths`. This seems to be the
approach taken by Rust also, plus we should be justified to take this
approach since WASI is experimental and snapshot1 will be discontinued
eventually and replaced with a new approach to access management
that will require a complete rewrite of our libstd anyhow.
2021-06-08 05:48:33 +02:00
Andrew Kelley
ddf9c40bc1 ci: fix 0.8.0 release date 2021-06-04 16:33:50 -07:00
Andrew Kelley
c7b68ce0f8 ci: fix aarch64-macos download tarball filename 2021-06-04 16:21:01 -07:00
Andrew Kelley
555805e0d5 ci: update download page releases 2021-06-04 15:33:18 -07:00
Andrew Kelley
05cd8936c8 ci: drone: use zig-bootstrap tarball instead of system toolchain 2021-06-02 17:03:11 -07:00
Andrew Kelley
16c5cbab0c ci: update x86_64-freebsd tarball
to llvm 12.0.1-rc1, and -DLLVM_ENABLE_ZLIB=FORCE_ON
2021-06-01 23:26:53 -07:00
Jakub Konka
0ad534b392 ci: update x86_64-macos and aarch64-macos tarballs
to llvm 12.0.1-rc1, and -DLLVM_ENABLE_ZLIB=FORCE_ON
2021-05-30 08:46:35 +02:00
Andrew Kelley
e46c55edbd ci: update x86_64-linux, aarch64-linux, and windows tarballs
to llvm 12.0.1-rc1, and -DLLVM_ENABLE_ZLIB=FORCE_ON
2021-05-29 20:18:02 -07:00
Andrew Kelley
9910bfa6d8 ci: use a different ssh private key to deploy the website
This changes the deploy key to a different one on www.ziglang.org so
that we can test notifications.
2021-05-19 21:36:48 -07:00
Andrew Kelley
d228d86059 ci: drone: refresh docker image with latest alpine
hopefully resolves the failures we've been seeing recently
2021-05-18 11:29:14 -07:00
Michael Dusan
04d95ea419 ci linux: bump qemu-5.2.0.1
- apply patch for qemu-user syscall do_sendrecvmsg_locked
- see #8750
2021-05-17 12:06:25 -04:00
Michael Dusan
fb8527b289 azure: bump timeout for macos-arm64 2021-05-12 06:38:01 -04:00
Jakub Konka
53acb54fad
Bump zig-bootstrap and wasmtime versions in linux CI (#8738)
* Bump zig-bootstrap and wasmtime versions in linux CI

* Revert wasm stage2 test fixup; point to issue
2021-05-12 09:56:55 +02:00
Isaac Freund
f8cf106fc9
ci: unset CC/CXX before make install on macos arm64
Having these set causes zig's native libc detection code to fail.
2021-05-11 21:30:13 +02:00
Jakub Konka
b7a6a251a0 Tweak macos_arm64_script to use bootstrapped zig 2021-05-10 18:42:01 +02:00
Jakub Konka
603242fa86 Use zig-bootstrapped x86_64 macos compiler in CI 2021-05-10 13:55:48 +02:00
Andrew Kelley
5622f9382c
Merge pull request #8657 from jedisct1/ci-split
Azure CI: Test std.* and the rest separately
2021-05-03 17:36:51 -04:00
Luna
c47028cd02 ci: freebsd: use py38-s3cmd 2021-05-02 17:24:17 -04:00
Frank Denis
9a637f81e0 Restore the CI logging as before 2021-05-02 02:07:59 +02:00
Frank Denis
3e389d01ed CI: no need to try qemu and wasmtime on macOS builds 2021-05-01 00:38:54 +02:00
Frank Denis
b49d99b246 Azure CI: Test std.* and the rest separately
On CI, we have been running into OOM issues when running the test
suite on Windows for quite some time.

Unfortunately, we are very close to having the same issues on Linux
as well. Some additional comptime work immediately makes these builds
fail as well.

Add a new `test-toolchain` step, that tests everything except `std.*`
and documentation.

On CI, call `test-toolchain`, `test-std` and `docs` separately
instead of the `test` big hammer that emcompasses all of them.

Change the special case we made for Windows to the same code as other
platforms.

This is a stopgap measure that stage2 will eventually make useless.

Until then, it gives us some headroom.

Change `linux_script` by the way to only output the log of failing
steps. This shrinks the Linux CI log from a bazilion lines down to
something more humanely manageable.
2021-04-30 23:41:28 +02:00
LemonBoy
0340ed3a9e build: Re-add test-translate-c and test-run-translated-c 2021-04-25 17:02:48 +02:00
Michael Dusan
37b05742ff ci: drone disable debug test suite for aarch64
Temporary workaround for #8597 until upstream fix lands.

- add `zig build -Dskip-debug` option
- build a release-fast build.exe
- disable test suite build modes { debug, release-small, release-safe }
- enable passing test-* components
- use parallel pipeline steps for tests
2021-04-25 00:02:36 -04:00
Andrew Kelley
235aa8c078 ci: drone: don't skip stage2 tests
the stalls seem to be happening for a different reason
2021-04-16 09:57:31 -07:00
Andrew Kelley
2b2920f599 ci: drone: disable stage2 tests
See #8545
2021-04-15 16:20:43 -07:00
Andrew Kelley
c795e82cbc ci: windows: update to llvm 12 msvc tarball 2021-04-15 12:40:22 -07:00
Andrew Kelley
c49fe52cb1 ci: update macos tarball to llvm 12 2021-04-15 11:27:02 -07:00
Andrew Kelley
a38042e3ac ci: windows: proper flags to zig build 2021-04-15 02:02:36 -07:00
Andrew Kelley
fa633a658f ci: windows: try the dev kit strategy 2021-04-15 01:44:17 -07:00
Andrew Kelley
4a1d3465cc ci: windows: ranlib take 2 2021-04-15 01:22:42 -07:00
Andrew Kelley
3266f326de ci: windows: better -DCMAKE_RANLIB option 2021-04-15 01:14:33 -07:00
Andrew Kelley
996193c228 ci: freebsd: don't try to compile with zig cc 2021-04-15 00:51:26 -07:00
Andrew Kelley
a680c7ba98 ci: windows: use llvm-ar.exe from the tarball 2021-04-15 00:41:30 -07:00
Andrew Kelley
c59241bda0 ci: better handle of -mcpu 2021-04-15 00:18:21 -07:00
Andrew Kelley
553fbeba82 ci: better target triple and mcpu cmake args 2021-04-14 23:49:16 -07:00
Andrew Kelley
85755c51d5 ci: freebsd: set the target triple 2021-04-14 23:35:51 -07:00
Andrew Kelley
df319db058 ci: windows: install git 2021-04-14 23:18:03 -07:00
Andrew Kelley
3967823f3a ci: freebsd: pass -DZIG_USE_LLVM_CONFIG=OFF 2021-04-14 23:17:08 -07:00
Andrew Kelley
ee42178b43 ci: aarch64-linux: disable run-translated-c tests
See #8537
2021-04-14 23:10:51 -07:00
Andrew Kelley
45eb9554c4 ci: windows: try using zig-bootstrap to build zig 2021-04-14 23:03:16 -07:00
Andrew Kelley
406353103a ci: freebsd: update to llvm 12 2021-04-14 22:59:34 -07:00
Andrew Kelley
1438c324a4 ci: update drone CI to llvm 12 2021-04-14 21:18:23 -07:00
Andrew Kelley
391a40d601 ci: update linux to llvm12 tarball 2021-04-14 20:35:33 -07:00
Michael Dusan
6a7f21d1b8 ci: macos-aarch64 update dep tarballs for llvm12 2021-04-14 19:43:17 -07:00
Jakub Konka
d6d27d51ef CI: update brew before installing pkgs 2021-04-12 18:42:51 +02:00
Michael Dusan
cab1d5c1a3
azure: OnMasterSuccess dependsOn BuildMacOS_arm64 2021-04-11 05:17:18 -04:00
Michael Dusan
c676c21824
ci: remove superfluous linefeed from macos arm64 2021-04-11 01:33:17 -04:00
Michael Dusan
75f86dab3f macos: add aarch64 (arm64) to downloads page 2021-04-10 19:33:17 -07:00
Andrew Kelley
175adc0bd7 ci: update msys2 installer 2021-03-28 17:49:28 -07:00
Jakub Konka
54b42a7596 azure: run pacman with -Sy 2021-03-28 11:01:57 +02:00
Michael Dusan
e35f325dd1 azure: produce macos arm64 binaries
new pipeline `BuildMacOS_arm64`
  - `vmImage: 'macOS-10.15' `

new `macos_arm64_script`
  - switch from using `make` to `ninja`
  - select xcode 12.4
  - set zig-cache env variables
  - build host-zig binary with xcode, link against llvm for x86_64 (target macos 10.15)
  - build arm64-zig binary with xcode and host-zig, link against llvm for arm64 (target macos 11.0)
  - ad-hoc codesign arm64 binary with linker
  - use host-zig for docgen
  - use host-zig for experimental std lib docs
  - sync final `release/` hierarchy with `linux_script`
  - use gnu-tar for good-practices (set owner, set sort)

enhance `CMakeLists.txt`
  - do not build `zig0` when cross-compiling
  - disable `BYPRODUCTS` directive `zig1.o` to avoid `ninja` error

see #8265
2021-03-20 22:50:51 +01:00
LemonBoy
72664df491 std: Deprecate the B and Bi format specifiers
Following #8007 and #8137 let's get rid of the last weird format.
2021-03-07 14:58:45 +02:00
Andrew Kelley
ffc8a43dfb ci: stop directly pushing web page stuff to s3
This is now handled by the www.ziglang.org repo deploy script.
2021-01-12 17:27:36 -07:00
Andrew Kelley
23c6cca24d ci: give the updated website content to the website repo
and use master branch not hugo-redesign branch
2021-01-12 13:26:52 -07:00
Andrew Kelley
166e9ea689 ci: add stdDocs to downloads/index.json for master branch 2021-01-12 12:52:59 -07:00
Andrew Kelley
c7666ff885 ci: import the update-download-page from www repo 2021-01-07 16:49:13 -07:00
Andrew Kelley
d8eba037a4 ci: fix path to update-download-page.zig script 2021-01-07 15:49:43 -07:00
Andrew Kelley
aa2422e830 ci: add github.com's public key for the ssh clone 2021-01-07 12:28:55 -07:00
Andrew Kelley
87aa052e23 ci: pass --override-lib-dir to emit std lib docs
Otherwise we get errors from conflicting std libs.
2021-01-07 02:58:27 -07:00
Andrew Kelley
ee1b370404 ci: don't use ninja on linux
I got this error when re-running the cmake line setting
-DZIG_EXECUTABLE:

```
ninja: warning: multiple rules generate zig1.o. builds involving
this target will not be correct; continuing anyway
[-w dupbuild=warn]
```

But it works fine with make.
2021-01-07 00:38:48 -07:00
Andrew Kelley
a279cf81b2 ci: add missing target/mcpu args to zig cc
In the previous commit, I forgot to add these.
2021-01-07 00:18:28 -07:00
Andrew Kelley
ce5222d945 ci: rework linux script
* no longer depend on apt.llvm.org, instead we rely on a zig-bootstrap
   tarball with pre-built Zig, LLVM, LLD, and Clang. Similar to the
   Windows Dev Kit but for Linux. This also makes the script no longer
   depend on Docker, libxml2, or GCC.
 * remove bash retry logic; it was only needed for flaky apt.llvm.org
   and isn't needed for the other resources we download.
 * build and upload the experimental std lib automatically generated
   docs. langref.html is moved to docs/langref.html because the std lib
   docs are in docs/std/.
 * the superfluous "zig" directory in $prefix/lib/zig/std/std.zig is
   removed from the tarball.
 * update_download_page makes a commit in the www.ziglang.org repository
   updating data/releases.json so that repository can manage deploys.
2021-01-06 23:40:17 -07:00
Frank Denis
5afd6204e8 Azure CI: update MSYS version 2021-01-06 15:52:34 -08:00
Andrew Kelley
2fe8a48215 ci: omit stage2 backend from stage1 on Windows
to avoid out-of-memory on the CI runs.
2021-01-04 14:59:18 -07:00
Andrew Kelley
5c92e24a29 drone ci: skip compile error tests to save time
These are covered by other CI scripts and we're up against Drone CI time
limits.
2021-01-03 20:10:07 -07:00
Jay Petacat
993f4b5a06 ci: fix git describe
git describe is used for version string creation, but it had to be
reverted in commit 69da6ba because it was broken in CI builds.
Azure Pipelines and Drone perform shallow clones by default.
This change reconfigures them to fetch history and tags. It adds tens of
seconds, which is negligible compared to overall build and test time.

Related: #6466, #6509, #7601
2021-01-01 20:41:39 -07:00
Luna
7550af0d4c ci: freebsd: use py37-s3cmd 2020-12-31 08:18:06 +01:00
Andrew Kelley
3366e4caf3 ci: put Drone CI back to normal
Surely this time all the problems have been fixed
2020-12-26 13:55:38 -07:00
Andrew Kelley
c452bb1322 ci: build in Debug mode to help find the deadlock 2020-12-25 18:39:13 -07:00
Andrew Kelley
1d94a68936 add an option to compile zig in single-threaded mode
And enable it for Drone CI. I hate to do this, but I need to make
progress on other fronts.
2020-12-20 15:37:58 -07:00
Michael Dusan
ae0af5e5a6
ci linux: bump qemu-5.2.0 2020-12-09 21:31:31 -05:00
LemonBoy
55838bc291 ci: Use eval to make retry() work for pipelines too 2020-12-04 17:31:27 +01:00
LemonBoy
2282eb1be1 ci: Use -nv flag for wget
-nv, --no-verbose   turn off verboseness, without being quiet
2020-12-04 13:11:45 +01:00
LemonBoy
77031baf98 ci: Prevent some more CI failures
Many times the CI pipeline fails in the early stages because the APT
repo for LLVM is being updated.
Add a retry mechanism for some more APT commands.
2020-12-04 13:11:45 +01:00
LemonBoy
471e26425a ci: Retry apt-get install at most three times
Try harder instead of failing after the first invocation fails.
2020-12-02 12:14:11 +01:00
Frank Denis
7b9af0592d Azure Pipelines CI: update msys2 to the current version 2020-11-15 00:27:18 +01:00
Frank Denis
bb14bd35bd Update wasmtime to version 0.20
The version we were using in CI is now getting quite old, and we
want to make sure that the code we produce is compatible with
current versions of Wasmtime.
2020-11-04 20:28:54 +01:00
Andrew Kelley
81f5e1e667 ci: freebsd: skip non-native tests to save time 2020-10-28 22:59:23 -07:00
Andrew Kelley
fd3da3348c ci: macos: rebuild zig1.o with stage1
see #6830 for details.
2020-10-28 16:31:59 -07:00
Andrew Kelley
a0f4606f32 ci: still build zig even though we are using (older) zig cc 2020-10-26 10:50:43 -07:00
Andrew Kelley
bbd1e122d4 ci: skip compile error tests on freebsd to save time 2020-10-25 17:29:10 -07:00
Andrew Kelley
198d1438ea ci: fix regression from not building docs
0e4f7a8e3f forgot to build the docs,
causing CI failures
2020-10-22 01:18:55 -07:00
Frank Denis
0e4f7a8e3f
MSVC CI: run tests individually (#6751)
This slightly reduces the amount of peak RSS needed, buying us more time until stage2 is shipping.
2020-10-21 22:40:41 -04:00
Andrew Kelley
477798b37e ci: macos: unset ZIG_LIBC before testing
otherwise cross compiling gets incorrectly affected by the environment
variable.
2020-10-14 17:59:29 -07:00
Andrew Kelley
540364e6c1 ci: macos: update to new cache tarball
This tarball contains LLVM, Clang, LLD, Zig, and libz.a for macOS. This
is everything we need for the CI to produce a working Zig executable.
2020-10-14 17:36:43 -07:00
Andrew Kelley
bf8cc73cf3 ci: macos: take advantage of zig-bootstrap 2020-10-14 02:25:51 -07:00
Andrew Kelley
9e05f42fee ci: macos: set the cross compile cmake option
This should avoid invoking llvm-config to work around a symbol
not found inside libstdc++, and plus it's technically more correct
anyway.
2020-10-12 22:32:14 -07:00
Andrew Kelley
92926c4331 ci: no space in vmImage I guess 2020-10-12 21:58:46 -07:00
Andrew Kelley
461792f9de ci: update to macos 10.15 image 2020-10-12 21:53:13 -07:00
Andrew Kelley
68e6da7c00 CI: enable all the freebsd tests 2020-10-12 20:51:16 -07:00
Andrew Kelley
27b04d5905 disable the failing std lib freebsd tests
enable std lib freebsd tests on the CI

See #1759
2020-10-12 20:08:23 -07:00
Andrew Kelley
74e3ffa9b4 ci: update llvm 10 => 11 2020-10-12 18:38:28 -07:00
Andrew Kelley
682a29aefd ci: stop testing mingw builds
Zig supports both Linux and Windows natively. Those are the main use
cases we are focusing on. Happy to accept mingw patches if they are
non-invasive, but we will not be hampering progress on the main use
cases with failing mingw CI builds.
2020-10-04 21:51:41 -07:00
Jakub Konka
0e2d858d69 Revert back to original Win CI install script
Since msys2/MSYS2-packages#2050 was fixed, we can now revert back to the
original install script.

Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
2020-10-04 11:53:07 +02:00
Andrew Kelley
d1e779cea8 ci: update azure msys base installer
hopefully resolves the CI failures
2020-10-03 17:33:51 -07:00
Andrew Kelley
7c0ee42385 CI: TERM=dumb to source hut 2020-09-29 12:10:38 -07:00
Andrew Kelley
561ed38f12 ci: drop the cmake patch for linux
hopefully they've solved the polly plugin thing by now on apt.llvm.org.
2020-09-21 12:40:19 -07:00
Andrew Kelley
a863d899e1 ci: undo mangled autocrlf files before building 2020-09-16 11:58:26 -07:00
Andrew Kelley
80d8515e3a ci: disable git autocrlf
See also commit
2c8495b4bb
2020-09-16 10:49:43 -07:00
Andrew Kelley
95941c4e70 stage2: building glibc shared objects
* caching system: use 16 bytes siphash final(), there was a bug in the
   std lib that wasn't catching undefined values for 18 bytes. fixed in
   master branch.
 * fix caching system unit test logic to not cause error.TextBusy on windows
 * port the logic from stage1 for building glibc shared objects
 * add is_native_os to the base cache hash
 * fix incorrectly freeing crt_files key (which is always a reference to
   global static constant data)
 * fix 2 use-after-free in loading glibc metadata
 * fix memory leak in buildCRTFile (errdefer instead of defer on arena)
2020-09-16 03:02:46 -07:00
Andrew Kelley
7ccfb08a93 ci: update the on_master_success secret to lavatech 2020-09-15 15:08:35 -07:00
Andrew Kelley
5e39ab4600 ci: disable some freebsd tests to save time 2020-09-14 21:11:34 -07:00
Andrew Kelley
44ef270de1 ci: use hut.lavatech.top for updating the download page 2020-09-14 19:37:59 -07:00
Andrew Kelley
01c24c4509 ci: enable std lib tests for freebsd 2020-09-14 18:22:16 -07:00
Andrew Kelley
8716fde7bc ci: skip non native builds on windows to save time 2020-09-08 09:53:41 -07:00
Andrew Kelley
26140678a5 ci: skip compile error tests on Windows
We're up against the 6 hour limit so this is a time-saving workaround.
Compile error tests are generally not OS-specific so the coverage from
the other platforms should be sufficient.
2020-08-31 14:54:05 -07:00