Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 3 additions & 39 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,56 +6,20 @@ on:
pull_request:
branches: [ main ]

# Local snapshot versions used across the publishLocal dev loop.
# Keep these in sync with the `using dep` lines in project.scala.
env:
MADE_VERSION: 0.1.3-done-SNAPSHOT
MCODEC_VERSION: 0.0.0-done-SNAPSHOT

jobs:
build:
name: Build and test
runs-on: ubuntu-latest
steps:
- name: Checkout mrpc
uses: actions/checkout@v6
with:
path: mrpc

# Pinned upstream commits. made is consumed from a feature branch until
# its PR merges; bump these SHAs to the merged refs afterwards.
- name: Checkout made
uses: actions/checkout@v6
with:
repository: halotukozak/made
ref: 16bfbdbd7022e644e8f803be864c0c98ef53ac15
path: made

- name: Checkout mcodec
uses: actions/checkout@v6
with:
repository: halotukozak/mcodec
ref: 4f4ece438b766f18558cb42ccaf5df894bfed4ff
path: mcodec
- uses: actions/checkout@v6

- name: Setup coursier cache
uses: coursier/cache-action@v8.1

- uses: VirtusLab/scala-cli-setup@v1

- name: Publish made locally
run: scala-cli --power publish local made --project-version "$MADE_VERSION"

# mcodec must resolve the same made artifact so there is exactly one
# made typeclass set on the classpath.
- name: Repoint mcodec onto the local made
run: sed -i -E 's#(io\.github\.halotukozak::made:)[^[:space:]]+#\1'"$MADE_VERSION"'#' mcodec/project.scala

- name: Publish mcodec locally
run: scala-cli --power publish local mcodec --project-version "$MCODEC_VERSION"

- name: Check formatting
run: scala-cli --power fmt --check mrpc
run: scala-cli --power fmt --check .

- name: Run tests
run: scala-cli --power test mrpc
run: scala-cli --power test .
13 changes: 8 additions & 5 deletions project.scala
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
//> using scala 3.8.4

// mcodec is resolved from a local publishLocal SNAPSHOT.
//> using dep io.github.halotukozak::made:0.2.1-SNAPSHOT
//> using dep io.github.halotukozak::mcodec:0.0.0-done-SNAPSHOT
//> using dep io.github.halotukozak::made:0.3.0
//> using dep io.github.halotukozak::mcodec:0.1.0

//> using test.dep org.scalameta::munit:1.3.3
//> using test.dep org.scalameta::munit-scalacheck:1.3.0
Expand All @@ -17,12 +16,16 @@
//> using options -Ycheck:all
//> using options -Yexplain-lowlevel -Yexplicit-nulls
//> using options -Yshow-suppressed-errors -Yshow-var-bounds
//> using options -Wsafe-init -Werror -Wunused:all
// -Wsafe-init is disabled: the checker never terminates on this codebase's
// inline-derivation-heavy code (confirmed via thread dump stuck for 10+ min
// recursing through dotty.tools.dotc.transform.init.Semantic$$anon$1.traverse
// on TypeAccumulator.foldOver). Re-enable once upstream fixes this, or once
// derivation is scoped down enough for the checker to terminate.
//> using options -Werror -Wunused:all

//> using options -Xmax-inlines 100
////> using options -Xprint-suspension


//> using options -Yprofile-enabled -Yprofile-trace:debug.json
//> using publish.organization io.github.halotukozak
//> using publish.name mrpc
Expand Down
4 changes: 2 additions & 2 deletions src/mrpc/derive/MetadataDerivation.scala
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ private[mrpc] object MetadataDerivation:
* been widened to the bare `Context` supertype.
*/
inline private def allTerms[A](using Context): List[A] = inline ctx match
case ctx: Context.Method => getAllAnnotations(ctx.op)(using containsOnly.refl)[A & Annotation]
case ctx: Context.Param => getAllAnnotations(ctx.underlying)(using containsOnly.refl)[A & Annotation]
case ctx: Context.Method => ctx.op.getAllAnnotations[A & Annotation]
case ctx: Context.Param => ctx.underlying.getAllAnnotations[A & Annotation]
case _: Context.Trait => compiletime.error("@reifyAnnot is not valid at the trait level")

inline private def reifyAnnot[Param](arity: SlotArity)(using Context): Any =
Expand Down