Commit graph

776 commits

Author SHA1 Message Date
Wrench[bot]
b63001eb4c all: update Zig to version 0.11.0-dev.2160+49d37e2d1
Signed-off-by: Wrench[bot] <wrench@hexops.com>
2023-03-24 23:23:10 -07:00
Wrench[bot]
d3d18b3b08 all: update Zig to version 0.11.0-dev.1987+a2c6ecd6d
Signed-off-by: Wrench[bot] <wrench@hexops.com>
2023-03-16 09:47:25 -07:00
Stephen Gutekanst
1ad2210ab9 all: cache module() returns to avoid duplicate modules
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-03-15 21:20:28 -07:00
Wrench[bot]
eea7f245e1 all: update Zig to version 0.11.0-dev.1824+a7a709aaa (#709)
Signed-off-by: Wrench[bot] <wrench@hexops.com>
2023-03-05 12:15:06 -07:00
Aksel Hjerpbakk
61477e10e8 all: fix issue with glfw vulkan createWindowSurface; update to new for loop syntax (#713) 2023-03-01 18:33:17 -07:00
Casey Banner
5020979355 glfw: update to new for loop syntax (#711) 2023-03-01 18:32:21 -07:00
thedoctorquantum
5ed584a481 Fixed type error in vulkan.createWindowSurface 2023-02-17 11:10:52 -07:00
Stephen Gutekanst
74b0c807b8 officially deprecate Matrix chat in favor of Discord
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-02-13 06:46:23 -07:00
Stephen Gutekanst
4ec414e419 glfw: system_sdk: update Linux SDKs (Vulkan headers)
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-02-12 22:07:01 -07:00
avokadoen
14790d5b1e glfw: update to latest Zig build API
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-02-12 10:05:03 -07:00
Wrench[bot]
f88f26f663 all: update Zig to version 0.11.0-dev.1605+abc9530a8
Signed-off-by: Wrench[bot] <wrench@hexops.com>
2023-02-12 10:05:03 -07:00
Wrench[bot]
dc76504a57 all: update Zig to version 0.11.0-dev.1479+97b1a9bb6
Signed-off-by: Wrench[bot] <wrench@hexops.com>
2023-01-28 17:07:04 -07:00
Ali Chraghi
c41258ec6b system_sdk: update to latest revision 2023-01-20 14:53:22 -07:00
Ali Chraghi
6d7a7db0e9 glfw: ci: don't run tests when cross-compiling 2023-01-20 14:53:22 -07:00
Wrench[bot]
f3e9d7bd71 all: update Zig to version 0.11.0-dev.1350+bbab4beda
Signed-off-by: Wrench[bot] <wrench@hexops.com>
2023-01-18 10:34:40 -07:00
Ali Chraghi
f214c28f44 {glfw,mach}: remove dead code 2023-01-15 08:31:26 -07:00
Ali Chraghi
d7a16e5078 system_sdk: update to latest revision 2023-01-14 12:12:00 -07:00
Ali Chraghi
4605cc733e ci: remove git install step 2023-01-12 10:51:16 -07:00
Wrench[bot]
1edaed63dc all: update Zig to version 0.11.0-dev.1268+0e66df209
Signed-off-by: Wrench[bot] <wrench@hexops.com>
2023-01-12 02:05:33 -07:00
Lue
097bea84ab glfw: refactor getError and related functions
`getError()` now returns a struct `Error` containing `error_code` and
`description`. Rationale: retrieving the error code with the previous
implementation of `getError()` caused `getErrorString()` to return
null (the reverse is also true). The new implementation allows both
values to be retrieved at once.

The previous `getError()` function has been renamed to
`getErrorCode()` to reflect the fact that it returns a simple Zig
error rather than the `Error` struct. The error set returned by
`getErrorCode()` is now named `ErrorCode` rather than `Error`.

The behavior of the `getError()` family of functions clearing the
stored error is unchanged. However, since all code that used
`defer glfw.getError() catch {}` to explicitly clear errors had to be
refactored, a new `glfw.clearError()` function that returns void is
now available to make this operation more explicit.

Additionally, `mustGetError()` is now `mustGetErrorCode()`, and new
functions `mustGetError()` and `mustGetErrorString()` have been added
which wrap `getError()` and `getErrorString()` but panic if no error
is actually available.

Tests and API documentation had to be refactored across all of
`mach/glfw`. This commit also takes the opportunity to skip tests
involving window creation on CI so that other tests may still execute
normally.
2023-01-10 20:52:41 -07:00
Stephen Gutekanst
20fc0272f0 Revert "all: build: fix sdkPath for relative @src.file / fix autocompletion with ZLS / IDEs (#661)"
This reverts commit 711e644a061cf8e21c35308873fe0f0e698ac490.

Lue suggested reverting #661 because ZLS worked around the issue of @src
being relative in that environment: https://github.com/zigtools/zls/pull/898

This is not a perfect solution (what zls did seems to be a workaround), but
is good enough for us until Zig gets an official package manager.
2023-01-10 01:57:52 -07:00
Wrench[bot]
c1b4a83c0f all: update Zig to version 0.11.0-dev.1247+87b223428
Signed-off-by: Wrench[bot] <wrench@hexops.com>
2023-01-08 18:21:50 -07:00
Stephen Gutekanst
c244a7b72e glfw: README: update usage example
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-01-08 18:21:11 -07:00
Stephen Gutekanst
e9ba368443 glfw: rework error handling system to prevent footguns
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-01-08 18:21:11 -07:00
Lue
a9e9ac0955 all: build: fix sdkPath for relative @src.file / fix autocompletion with ZLS / IDEs (#661)
* all: build: fix sdkPath for relative @src.file

Prior to this commit, the build system heavily assumed that the result
`@src.file` would always be absolute, but this is no longer
guaranteed, likely due to there being no such thing as an "absolute
path" in WASI.

It appears that for normal invocations of `zig build`, it is safe to
assume that `@src.file` is absolute. However, when ZLS uses a custom
`build_runner.zig` to collect build configuration, `@src.file` is
actually relative to the current working directory, at least on my
system. For a while, this led to ZLS completions breaking entirely,
but presently it actually causes ZLS to crash!

The solution is not as simple as using relative `sdkPath` results
as-is, because the build system may attempt to resolve these paths
relative to build root, when the paths are actually relative to the
current working directory.

This leads to a sticky situation: the current working directory is a
runtime concept, but `@src.file` is resolved at compile time. However,
it appears that the build runner does not change current working
directory in between compilation and execution, so it is probably safe
to calculate `sdkPath` using runtime current working directory.

Still, this requires major changes with how `sdkPath` works, since
runtime computation and allocations are required. So pretty much
anything that relied on `sdkPath` being comptime-known has been
refactored in this commit.

The most severe result of this is that, for example, `gpu.pkg` can no
longer be a comptime-known constant: it has to be a runtime function
that takes a `*Builder` and returns a `Pkg`.

This commit deals with usages of `*.pkg` and `sdkPath` within Mach
itself, but projects that depend on Mach such as `mach-examples` will
almost certainly require changes as well.

* all: update README to reflect change in pkg usage

For details on updating your code to use this version, see: 88b1106953

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
Co-authored-by: Stephen Gutekanst <stephen@hexops.com>
2023-01-02 01:23:46 -07:00
Wrench[bot]
59aaaf677f all: update Zig to version 0.11.0-dev.1023+1c711b0a6
Signed-off-by: Wrench[bot] <wrench@hexops.com>
2023-01-01 02:40:57 -07:00
Wrench[bot]
a4f91a9962 all: update Zig to version 0.11.0-dev.1000+94780f7cd
Signed-off-by: Wrench[bot] <wrench@hexops.com>
2022-12-30 12:52:31 -07:00
Stephen Gutekanst
73969b6c30 CI: do not install Zig on self-hosted runners (now managed by Wrench)
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-12-29 03:19:15 -07:00
Ali Chraghi
fd3aeebdf7 glfw: undo setSizeLimits workaround 2022-12-28 11:47:51 -07:00
Ali Chraghi
5e2abcbe22 glfw: accept null cursor in Window.setCursor 2022-12-28 11:47:51 -07:00
Ali Chraghi
6cd186fcab all: update zig version 2022-12-25 13:36:03 -07:00
Ali Chraghi
ce396a5e8c system_sdk: update to latest commits 2022-12-18 18:02:31 -07:00
Ali Chraghi
0569494982 all: update zig version 2022-12-18 18:02:31 -07:00
Keith Chambers
357d3247e6 glfw: update to zig 0.11.0-dev.811 (#640) 2022-12-15 16:47:19 -07:00
Eric Joldasov
47a50164c9 glfw: use null in enums
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2022-12-14 02:18:21 -07:00
Stephen Gutekanst
d59cc605e8 system-sdk: use macOS 12 SDK for macOS 13 for now
Fixes hexops/mach#606

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-11-25 10:31:04 -07:00
Stephen Gutekanst
f43018e6c2 glfw: zig fmt (true and false no longer reserved names)
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-11-24 09:55:07 -07:00
Stephen Gutekanst
25464e74ca glfw: ensure Window.from handle is untyped
Since users of the library do not have access to the `@cImport` struct (and we
do not want to expose that), the user may pass only an untyped `*anyopaque` pointer
which we'll internally cast to `*c.GLFWwindow`.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-11-06 15:02:57 -07:00
Cameron Murtagh
d2358e8edf glfw: system_sdk: bump max major linux version (#602) 2022-10-29 10:50:13 -07:00
BratishkaErik
b19ef0319a all: README: fix links to main repository (#600) 2022-10-28 10:22:23 -07:00
Ali Chraghi
c20d377711 system_sdk: better target check 2022-10-27 16:50:30 -07:00
Stephen Gutekanst
4fa5a3699d all: CI: update to latest Zig master version
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-10-22 09:11:16 -07:00
Stephen Gutekanst
aa911cfd78 glfw: expose error handling functions for rare usages
Fixes hexops/mach#586

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-10-17 05:10:52 -07:00
Dominic
b803782349 glfw: fix native import (#583)
Co-authored-by: Ali Chraghi <63465728+alichraghi@users.noreply.github.com>
Co-authored-by: dweiller <4678790+dweiller@users.noreplay.github.com>
Co-authored-by: Stephen Gutekanst <stephen.gutekanst@gmail.com>
2022-10-16 01:19:12 -07:00
Stephen Gutekanst
099506b8c1 glfw: remove self-hosted compiler workaround
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-10-15 07:56:18 -07:00
Stephen Gutekanst
e8c171f8ab glfw: remove self-hosted compiler workaround
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-10-15 07:51:52 -07:00
Stephen Gutekanst
70b8d52c77 glfw: workaround self-hosted compiler bug
Helps hexops/mach#581

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-10-15 00:57:35 -07:00
Stephen Gutekanst
6583f6b879 all: CI: update to latest Zig 0.10.0-dev.4333+f5f28e0d2
Produced via:

```
ZIG_VERSION=0.10.0-dev.4333+f5f28e0d2 ./dev/update-zig.sh
```

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-10-14 09:00:45 -07:00
Kami Development
ef5d8b12e7 glfw: fix compilation with latest zig master (#574)
See 0b1dd845d9
2022-10-14 08:55:15 -07:00
Ali Chraghi
b4799cfd5a all: prefix environment variables with MACH_ 2022-10-11 00:59:23 +02:00