Lue
a1fe671db8
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]
d5f37257c5
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]
a3a0417c21
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
90bca96627
dev: remove update-zig script (Wrench now does this)
...
Wrench now automatically sends PRs to update Zig:
* https://github.com/hexops/mach/pull/655
* https://github.com/hexops/mach-examples/pull/23
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-12-30 12:51:18 -07:00
Ali Chraghi
5849304fba
all: update zig version
2022-12-25 13:36:03 -07:00
Ali Chraghi
3b162fdd7c
all: update zig version
2022-12-18 18:02:31 -07:00
Stephen Gutekanst
6a45971c6f
trimesh2d: remove in favor of mach/earcut library
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-10-31 12:12:01 -07:00
Stephen Gutekanst
96c2e35ab3
all: integrate earcut library
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-10-31 12:12:01 -07:00
Stephen Gutekanst
628387764c
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
db4743b2ed
dev: also update mach-examples zig version
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-10-22 09:11:16 -07:00
Stephen Gutekanst
7beb89fac6
{dev,model3d}: ensure model3d has standard project files
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-10-22 07:45:50 -07:00
Stephen Gutekanst
fbdabee863
{dev,libs}: update linter for standard project files generation
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-10-22 07:44:31 -07:00
Stephen Gutekanst
6ee405e7c7
dev: add trimesh2d to linter
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-10-18 13:42:38 -07:00
Stephen Gutekanst
1f777759b3
dev: correct freetype .gitignore generation
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-10-16 08:30:19 -07:00
Stephen Gutekanst
373c55894f
{dev,gpu-dawn}: add yamlfmt to ci-lint.sh
...
Fixes hexops/mach#430
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-10-15 04:04:57 -07:00
Stephen Gutekanst
2c65845aed
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
Ali Chraghi
62e00bfbd0
dev: fix zig version update script
2022-09-20 02:30:45 -07:00
Ali Chraghi
f3109b365c
all: update zig version
2022-09-19 20:11:55 -07:00
Stephen Gutekanst
b0ea3b9e44
dev: add mach-gpu to push_subrepos.sh
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-09-11 09:46:25 -07:00
Stephen Gutekanst
b282641300
all: update to latest Zig nightly version
...
Performed via:
```sh
VERSION=0.10.0-dev.3952+9e070b653 ./dev/update-zig.sh
```
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-09-10 02:16:05 +00:00
Ali Chraghi
21a0edca03
all: update zig version
2022-09-02 09:42:48 -07:00
Stephen Gutekanst
bf096e2a0c
dev: update ensure-standard-files for new libs/ directory
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-26 15:12:04 -07:00
Stephen Gutekanst
79ec61396f
dev: update scripts to push subrepos
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-26 15:12:04 -07:00
Stephen Gutekanst
b6a512ebac
dev: update subproject paths to have libs/ prefix
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-26 15:12:04 -07:00
Stephen Gutekanst
60220cbe4f
dev: ensure .git* files are standardized across subprojects
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-23 08:36:22 -07:00
Stephen Gutekanst
1c4f4e4c90
ev: add script ensuring standard files across subprojects
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-23 08:16:17 -07:00
Stephen Gutekanst
f0d483507b
dev/template: make LICENSE year consistent
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-23 08:13:54 -07:00
Stephen Gutekanst
19fa5cee8c
dev/template: add template for creating new sub-projects
...
Fixes hexops/mach#473
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-22 20:49:44 -07:00
Ali Chraghi
eecbad403c
dev: add other workflows to ci-lint.sh
...
Co-authored-by: Stephen Gutekanst <stephen@hexops.com>
2022-07-27 10:25:59 -07:00
Ali Chraghi
1b9607be3f
dev: add ci-lint.sh script
2022-07-24 09:28:56 -07:00
alichraghi
a825965208
dev: make update-zig work on linux
2022-07-17 09:26:29 -07:00
Stephen Gutekanst
1af3ae02bf
dev: CI: keep string terminator when updating Zig version for Windows
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-05-31 05:01:34 -07:00
Stephen Gutekanst
7fb3e071d4
dev: CI: correct automated Zig version updates for Windows
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-05-31 03:39:26 -07:00
Stephen Gutekanst
2de8918e9a
dev: make update-zig.sh update README version
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-05-31 03:24:34 -07:00
Stephen Gutekanst
59e82a6c5c
dev: add a script to update Zig version used by CI
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-05-31 03:24:34 -07:00
Stephen Gutekanst
fb95a5ae95
dev: add mach-freetype subrepo
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-05-24 11:55:07 -07:00
Stephen Gutekanst
bc4f6f36c5
dev: dont complain about unbound GITHUB_ACTIONS env var when pushing subrepos
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-04 17:45:32 -07:00
Stephen Gutekanst
bd220b275c
dev: correct bash conditional for CI auth
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-02-12 18:16:00 -07:00
Stephen Gutekanst
6e5b3e393c
CI: authenticate pushes to subrepositories properly
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-02-12 18:07:27 -07:00
Stephen Gutekanst
e276648c3f
dev: use HTTPS subrepo remotes in CI
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-02-12 17:24:48 -07:00
Stephen Gutekanst
882e876666
dev: cleanup push-subrepos.sh
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-02-12 15:21:16 -07:00
Stephen Gutekanst
ec1a332853
dev: add gpu-dawn subrepository
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-02-12 15:21:16 -07:00
Stephen Gutekanst
02654a51c7
move GLFW into sub-repository, use git subtree to sync ( #42 )
...
* README: move GLFW into sub-repository, describe git subtree usage
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
* dev: add subrepo sync scripts
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-10-24 07:19:38 -07:00