Skip to content

Require iyi 0.21.0: spawn(unit: :new) and the III.13 unsafe marks - #3

Merged
sdogruyol merged 1 commit into
masterfrom
iyi-0.21
Nov 10, 2026
Merged

sdogruyol merged 1 commit into
masterfrom
iyi-0.21

Conversation

@sdogruyol

Copy link
Copy Markdown
Contributor

What

iyi 0.21.0 changes two things iyi-db depends on:

  • spawn_parallel is gone. A parallel task is g.spawn(unit: :new) (SPEC.md III.4.16/18), which 0.20.x refuses.
  • A module that handles raw memory, or takes a type as Share on trust (@[Share], @[Share(owns: true)], uninitialized), must say so with one @[Unsafe("why")] above its module header (SPEC.md III.13). 0.20.x refuses that mark. 0.21.0 also adds the safe calls Bytes.of, String#byte_at and String.new(Array(UInt8)).

On 0.21.0, master is refused in db.iyi (@[Share] on SharedBuilder), db/core.iyi (uninitialized Pool(Connection)), db/pooling.iyi (Pool, PoolSlot), db/testing/dummy_driver.iyi (Made), and in db/mapping_test.iyi and db/serializable_test.iyi (text.to_unsafe). db/parallel_test.iyi and manual/pool_concurrency.iyi don't build (spawn_parallel).

This PR:

  • Marks db, db/core, db/pooling and db/testing/dummy_driver, each with its reason: the builder, pool and slot, and test double held Share on trust, and the pool a Database leaves uninitialized while it builds it. No code changes in them.
  • Safe calls: the two tests read a string's bytes with Bytes.of, so they stay checked.
  • Spawns: the 7 spawn_parallel calls in db/parallel_test.iyi and manual/pool_concurrency.iyi become spawn(unit: :new) (what iyi fix writes). The prose in the README, db/core, db/pooling, the dummy driver and the manual program uses the new spelling too.
  • Minimum iyi 0.21.0: CI's IYI_VERSION, README Requirements, and a CHANGELOG Unreleased entry.

Since 0.20.x can't build this, the release that carries it is a minor bump. iyilang/pg's 0.21.0 update requires it as v0.5.0. Tagging is up to you.

Tests (iyi 0.21.0 release binary, Linux x86_64, 12 vCPU)

The iyi-0.21.0-linux-x86_64.tar.gz from the v0.21.0 release, checked against SHA256SUMS. The steps are CI's:

  • iyi test db: 16 passed, 0 failed.
  • From artifacts: each of the 16 db/*_test.iyi built with --emit-iyimod, rebuilt with --use-iyimod, and the rebuilt binary run. All 16 pass.
  • manual/load.iyi and manual/pool_concurrency.iyi build.
  • iyi fmt --check db.iyi db manual passes.

The macOS leg of the matrix wasn't run locally.

iyi 0.21.0 spells a parallel task spawn(unit: :new) and removed
spawn_parallel, and it refuses raw memory and trust marks in a module
not marked @[Unsafe("why")] above its module header, which 0.20.x
refuses. db, db/pooling and db/testing/dummy_driver are marked for the
types they hold Share on trust, db/core for the pool a Database leaves
uninitialized while it builds it. The tests read a string's bytes with
Bytes.of.
@sdogruyol
sdogruyol merged commit 39c00d8 into master Nov 10, 2026
2 checks passed
@sdogruyol
sdogruyol deleted the iyi-0.21 branch November 10, 2026 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant