diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 4dc2dd62..5af82d0f 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -21,24 +21,18 @@ jobs: java-version: "21" cache: maven - - name: Resolve the MEOS source commit - id: meos - # The catalog (tools/meos-idl.json) and JMEOS jar are derived from one upstream - # MobilityDB commit, recorded once in tools/meos-source-commit.txt. CI reads it so - # the derived catalog and the libmeos build stay in lockstep with the pinned - # surface — bumping the surface is a single edit there, with no SHA duplicated. - run: echo "sha=$(tr -d '[:space:]' < tools/meos-source-commit.txt)" >> "$GITHUB_OUTPUT" - # Derive the MEOS catalog (meos-idl.json via run.py) and build+install the - # all-families libmeos.so from the pinned MobilityDB commit, through the shared + # all-families libmeos.so from upstream MobilityDB master, through the shared # composite action. It does the full libmeos provisioning itself (PostgreSQL # purge, PGDG, PG17, build deps, cmake, install under /usr/local), so no inline - # apt/PG/cmake steps are needed here. + # apt/PG/cmake steps are needed here. Tracking master (not a pinned commit) keeps + # the source and the @master derivation toolchain moving together, so the catalog + # can never drift from the run.py that derives it. - name: Provision MEOS catalog + libmeos id: provision uses: MobilityDB/MEOS-API/.github/actions/provision-meos@master with: - mobilitydb-ref: ${{ steps.meos.outputs.sha }} + mobilitydb-ref: master build-libmeos: "true" - name: Stage the derived catalog for the generator @@ -49,12 +43,35 @@ jobs: cp "${{ steps.provision.outputs.catalog-path }}" tools/meos-idl.json echo "LD_LIBRARY_PATH=/usr/local/lib" >> "$GITHUB_ENV" - - name: Install the bundled JMEOS jar into the local repo - # The generator reads this jar's symbols at build time and the UDFs call it at - # runtime (org.jmeos:meos:1.0); it is not on Maven Central. + - name: Check out JMEOS at master + # The JMEOS jar (org.jmeos:meos:1.0) is built from JMEOS main against the SAME + # master-derived catalog and libmeos as above — so the jar's FFI surface can never + # drift from the catalog the generator reads, and JMEOS tracks master in lockstep + # with this binding. + uses: actions/checkout@v4 + with: + repository: MobilityDB/JMEOS + ref: main + path: jmeos + + - name: Build + install the JMEOS jar as org.jmeos:meos:1.0 + # Mirror JMEOS's own CI: stage the already-derived catalog + libmeos into the JMEOS + # checkout and build it (jmeos-core's generate-sources emits GeneratedFunctions from + # the catalog). Building from the same commit that produced the catalog keeps the jar's + # GeneratedFunctions signatures in lockstep with it. The jar plugin writes the plain + # jar/JMEOS.jar (finalName JMEOS) — jnr-ffi is supplied by this project's own pom, so + # the plain jar, not the shaded jar/JMEOS-fat.jar, is what the committed libs/JMEOS.jar + # was; libmeos is loaded from LD_LIBRARY_PATH, never from the jar. It is installed under + # the org.jmeos:meos:1.0 coordinates the generator and UDF runtime consume (not on + # Maven Central, so built here rather than pulled). Tests are skipped — only the jar is + # needed; JMEOS's own CI exercises its FFI suite. run: | + mkdir -p jmeos/codegen/input + cp "${{ steps.provision.outputs.catalog-path }}" jmeos/codegen/input/meos-idl.json + cp /usr/local/lib/libmeos.so jmeos/jmeos-core/src/ + mvn -B -f jmeos/pom.xml clean install -Dmaven.test.skip=true mvn -B install:install-file \ - -Dfile=libs/JMEOS.jar \ + -Dfile=jmeos/jar/JMEOS.jar \ -DgroupId=org.jmeos -DartifactId=meos -Dversion=1.0 -Dpackaging=jar - name: Build + generate + unit tests diff --git a/GENERATION.md b/GENERATION.md index 0dc12639..e29e04ed 100644 --- a/GENERATION.md +++ b/GENERATION.md @@ -19,9 +19,14 @@ MEOS-init guard, enforced at build time. ## Inputs -The generator reads two vendored inputs, both tracked to MobilityDB master: +The generator reads two inputs, both derived in CI from upstream MobilityDB master: -- the MEOS-API catalog `tools/meos-idl.json`, and -- the JMEOS jar `libs/JMEOS.jar` (its `javap` surface). +- the MEOS-API catalog `tools/meos-idl.json`, derived by the shared `provision-meos` + action (`mobilitydb-ref: master`), and +- the JMEOS jar `org.jmeos:meos` (its `javap` surface), built from JMEOS `main` against + that same master catalog and libmeos. + +Tracking master keeps the source and the `@master` derivation toolchain moving together, +so the catalog and jar never drift from the `run.py` that derives them. The UDF layer is the generated `registerAll()` — zero hand-written registrations. diff --git a/libs/JMEOS.jar b/libs/JMEOS.jar deleted file mode 100644 index a87509d8..00000000 Binary files a/libs/JMEOS.jar and /dev/null differ diff --git a/libs/MobilityDB-JMEOS-Linux.jar b/libs/MobilityDB-JMEOS-Linux.jar deleted file mode 100644 index b19aa037..00000000 Binary files a/libs/MobilityDB-JMEOS-Linux.jar and /dev/null differ diff --git a/libs/MobilityDB-JMEOS.jar b/libs/MobilityDB-JMEOS.jar deleted file mode 100644 index a2488c2c..00000000 Binary files a/libs/MobilityDB-JMEOS.jar and /dev/null differ diff --git a/tools/meos-source-commit.txt b/tools/meos-source-commit.txt deleted file mode 100644 index d7c4d060..00000000 --- a/tools/meos-source-commit.txt +++ /dev/null @@ -1 +0,0 @@ -0b8a63b227037fb51767488286834e02410bb3c2