Compare commits
5
Commits
26904b6852
...
v0.0.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f39ed1684b | ||
|
|
f53ec2d71d | ||
|
|
06f4e9ed11 | ||
|
|
0776e8e4b9 | ||
|
|
458f0edccb |
No files matched your search
@@ -33,8 +33,14 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
run: just release
|
run: just release
|
||||||
|
|
||||||
# Cross-compiles for Windows so link breakages show up before a release
|
# Cross-compiles for Windows so link breakages show up before a release.
|
||||||
|
# Runs after `build`: both jobs clone the same cached actions/checkout and
|
||||||
|
# actions/cache repos into one shared directory on the runner, and starting
|
||||||
|
# them at the same time can race on that clone/fetch - one job then gets a
|
||||||
|
# missing or corrupted action and fails immediately (seen on run 136, not
|
||||||
|
# related to the odin test fix above). Sequencing avoids the race.
|
||||||
windows:
|
windows:
|
||||||
|
needs: build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ Commands (see `justfile`): `just run`, `just check`, `just test`, `just package
|
|||||||
6. **Windows builds are cross-compiled**: Odin can't link Windows binaries on Linux, so `just windows` builds objects with `-build-mode:obj` and links with `lld-link` against an xwin SDK. The VC runtime is linked statically; only Windows system DLLs are needed. New Odin core usage can need new import libs (e.g. `ole32.lib` for `os.user_data_dir`); the CI `windows` job catches this. Not yet tested on a real Windows machine.
|
6. **Windows builds are cross-compiled**: Odin can't link Windows binaries on Linux, so `just windows` builds objects with `-build-mode:obj` and links with `lld-link` against an xwin SDK. The VC runtime is linked statically; only Windows system DLLs are needed. New Odin core usage can need new import libs (e.g. `ole32.lib` for `os.user_data_dir`); the CI `windows` job catches this. Not yet tested on a real Windows machine.
|
||||||
7. **Odin constant arrays can't be indexed at runtime**: lookup tables (`DECKS`, `LAYOUTS`, …) are `@(rodata)` globals instead of `::` constants.
|
7. **Odin constant arrays can't be indexed at runtime**: lookup tables (`DECKS`, `LAYOUTS`, …) are `@(rodata)` globals instead of `::` constants.
|
||||||
8. **Profile memory**: `profile` always allocates from the heap allocator, because the test runner frees each test's allocator afterwards.
|
8. **Profile memory**: `profile` always allocates from the heap allocator, because the test runner frees each test's allocator afterwards.
|
||||||
|
9. **`odin test` segfaults if the stack rlimit is "unlimited"**: the CI runner's container sets `ulimit -s unlimited`, which makes `getrlimit(RLIMIT_STACK).rlim_cur` come back as `RLIM_INFINITY` (a huge unsigned value). Odin's `core:thread` passes that straight to `pthread_attr_setstacksize`, `pthread_create` then fails, and `thread.create()` returns `nil` - which `core:testing`'s `pool_init` dereferences unconditionally, segfaulting the whole test binary (exit 139) before it prints anything. `just test` works around it with `ulimit -s 8192` before running `odin test`. Upstream Odin bug (core:thread/core:testing don't handle a failed thread creation); not our code.
|
||||||
|
|
||||||
## File Structure
|
## File Structure
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -28,7 +28,13 @@ check:
|
|||||||
# Run the test suite (single-threaded: the tests share the memory game's global state)
|
# Run the test suite (single-threaded: the tests share the memory game's global state)
|
||||||
test:
|
test:
|
||||||
mkdir -p {{build_dir}}
|
mkdir -p {{build_dir}}
|
||||||
odin test tests -vet -define:ODIN_TEST_THREADS=1 -out:{{build_dir}}/tests
|
# If the stack rlimit is "unlimited" (RLIM_INFINITY, as some CI/container hosts set it),
|
||||||
|
# Odin's core:thread passes that straight to pthread_attr_setstacksize, pthread_create
|
||||||
|
# then fails, and thread.create() returns nil - which core:testing's pool_init
|
||||||
|
# dereferences unconditionally, segfaulting the whole test binary. Clamp it.
|
||||||
|
# (One line: just runs each recipe line in its own shell, so a separate
|
||||||
|
# `ulimit` line wouldn't carry over to the `odin test` line.)
|
||||||
|
ulimit -s 8192 && odin test tests -vet -define:ODIN_TEST_THREADS=1 -out:{{build_dir}}/tests
|
||||||
|
|
||||||
# Optimized native build into build/<os>/, with the assets it needs at runtime
|
# Optimized native build into build/<os>/, with the assets it needs at runtime
|
||||||
release:
|
release:
|
||||||
|
|||||||
Reference in new issue
Block a user