Repository navigation
Conversation
iyi 0.21.0 refuses an operation on raw memory in a module that is not
marked @[Unsafe("why")] above its module header (SPEC.md III.13), and
0.20.x refuses the mark. pg/pq/stream, pg/pq/scram, pg/pq/connection and
pg/copy_result are marked, each saying what it does with the memory.
pg/core, pg/pq/frame, pg/pq/param, pg/replication/messages,
examples/simple_query and four tests use String.new(bytes), Bytes.of
and byte_at instead, so the compiler checks them.
iyi-db 0.4.0 is refused by 0.21.0 too, so iyi.mod requires the iyi-db
release that carries its marks, 0.5.0. iyi.sum gets its line from
`iyi get github.com/iyilang/db@v0.5.0` once that tag exists.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
iyi 0.21.0 refuses an operation on raw memory in a module that doesn't say it handles some (SPEC.md III.13). That covers a
Pointerfromto_unsafe, the buffer ofString.new(n) { |buffer| }and aPointerparameter. A module says so with one@[Unsafe("why")]above itsmoduleheader, a mark 0.20.x refuses. 0.21.0 also adds safe calls for the common cases:String#byte_at,Bytes.ofandString.new(Array(UInt8)).On 0.21.0, master is refused in 13 of its own modules. It is also refused in iyi-db v0.4.0's
db,db/coreanddb/pooling, which only an iyi-db release with marks clears. The spawn changes in 0.21.0 break nothing here.This PR:
pg/pq/stream(the socket's read and write buffers),pg/pq/connection(read_direct's pointer into the caller's buffer),pg/copy_result(a copy read straight into the caller's slice) andpg/pq/scram(the HMAC pads and client proof written into new strings).pg/core,pg/pq/frame,pg/pq/param,pg/replication/messages,examples/simple_queryand the testsescape_test,pq/param_test,pq/stream_testandreplication_testuseString.new(bytes),Bytes.ofandbyte_at. The compiler checks them.IYI_VERSIONand README Requirements, plus a CHANGELOGUnreleasedentry.iyi.modrequiresgithub.com/iyilang/db v0.5.0, the release that Require iyi 0.21.0: spawn(unit: :new) and the III.13 unsafe marks db#3 would become. 0.21.0 refuses every earlier iyi-db.Depends on iyilang/db#3 being released as v0.5.0
That tag doesn't exist yet, so CI on this PR fails at fetch until it does:
cannot fetch github.com/iyilang/db v0.5.0 ... Remote branch v0.5.0 not found. After db#3 is merged and tagged v0.5.0:iyi get github.com/iyilang/db@v0.5.0on this branch, which writes theiyi.sumline (it still lists v0.4.0);requireline to match.No pin that is on GitHub today passes. v0.4.0 is refused by 0.21.0, and the only alternative is a pseudo-version of an unmerged branch.
Tests (iyi 0.21.0 release binary, Linux x86_64, 12 vCPU)
The
iyi-0.21.0-linux-x86_64.tar.gzfrom the v0.21.0 release, checked againstSHA256SUMS. Against a local PostgreSQL 18.6 withDATABASE_URL=postgres://postgres:postgres@127.0.0.1/iyi_pg_test, the steps are CI's, except the TLS step, which wasn't run:require ... v0.5.0):iyi test pg0 passed, 21 failed, and the 4 examples fail, all at the fetch error above.iyi fmt --check pg.iyi pg examplespasses. This is what CI shows until the tag exists.replace github.com/iyilang/db => ../iyi-dbpointing at db#3's branch (15ed9dd):iyi test pg21 passed, 0 failed;command,listen_notify,shoddy_psqlandsimple_querybuild;fmt --checkpasses.