CI that can actually build the Nim core
Both jobs would have failed on this push, and the Alpine image was the reason rather than a detail. `libfrqcore.so` is NEEDED against libssl.so.3, libcrypto.so.3 and glibc — so a musl build could not have loaded in `dart:*` at all, and the job that tried would have reported a missing library rather than the reason for it. So the shape changed as well as the image. The library is built once, in the image that has Nim, and passed to the Dart job as an artifact — rather than the Dart job installing a second toolchain from apt to rebuild it, which is also where the Nim version was a guess. Debian on both sides, one OpenSSL 3, and `needs:` between them. `libssl-dev` in the Nim job because `nim/nim.cfg` sets `-d:ssl`: std/net links -lssl and -lcrypto for the TLS on :6697, and `frq.atproto` uses httpclient over the same. Without it the compile dies on a missing -lcrypto, which reads as nothing to do with TLS. `libssl3` in the Dart job because the SDK carries its own BoringSSL and does not bring OpenSSL with it, and the test dlopens something that wants one. The NEEDED line is printed on the way past, non-fatally: a missing libssl in the Dart job is then obvious from the build log rather than from a StateError in a different job. Not run in the containers — there is no docker daemon on this machine, so what I verified is the part that is mine. The image tags exist, and both job scripts were run verbatim outside CI: the Nim one produces the artifact and 203 passing tests, and the Dart one finds that artifact from `dart/frq_core` and passes its 20. What remains unproven is the images themselves. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1403956 parent: e50cbc7 modified
.gitlab-ci.yml +35 -8 | @@ -7,6 +7,15 @@ | ||
| 7 | 7 | # follow, so there is nothing for a schedule to do. |
| 8 | 8 | stages: [check] |
| 9 | 9 | |
| 10 | +# Two toolchains and one artifact between them. | |
| 11 | +# | |
| 12 | +# The library is built once, in the image that has Nim, and the Dart job takes | |
| 13 | +# it rather than installing a second toolchain to rebuild it. That is not only | |
| 14 | +# tidier: `libfrqcore.so` links OpenSSL and is glibc, so it has to be built | |
| 15 | +# somewhere its runtime can load it — which is why the Nim job is the Debian | |
| 16 | +# image and not the Alpine one it used to be. A musl build would not load in | |
| 17 | +# `dart:*` at all. | |
| 18 | + | |
| 10 | 19 | # common/ is compiled by ClojureDart for two targets — the APK and the Linux |
| 11 | 20 | # desktop — and shared code reaching for the JVM or a `dart:` library breaks |
| 12 | 21 | # one of them at a namespace nobody touched. `Math/ceil` in the compose bar was |
| @@ -22,20 +31,38 @@ check-common: | ||
| 22 | 31 | # The Nim core's tests. A second job rather than a step in the first, because |
| 23 | 32 | # it wants a compiler where check-common wants nothing: one can fail without |
| 24 | 33 | # hiding the other, and the pair of them is still seconds. |
| 34 | +# The Nim core: its own suite, and the library the Dart job needs. | |
| 35 | +# | |
| 36 | +# `libssl-dev` because `nim/nim.cfg` sets `-d:ssl` — std/net links -lssl and | |
| 37 | +# -lcrypto for the TLS on :6697, and `frq.atproto` uses httpclient over the | |
| 38 | +# same. Without it the compile fails on a missing -lcrypto, which reads as | |
| 39 | +# nothing to do with TLS. | |
| 25 | 40 | nim-test: |
| 26 | 41 | stage: check |
| 27 | - image: nimlang/nim:2.2.0-alpine | |
| 42 | + image: nimlang/nim:2.2.10 | |
| 43 | + before_script: | |
| 44 | + - apt-get update -qq && apt-get install -y -qq libssl-dev | |
| 28 | 45 | script: |
| 29 | 46 | - cd nim && for t in tests/t*.nim; do nim c -r --hints:off --path:src "$t"; done |
| 47 | + - nim c --app:lib --mm:orc -d:release --hints:off --path:src | |
| 48 | + --out:../build/nim/libfrqcore.so src/frq_core.nim | |
| 49 | + # Diagnostic, not a gate: prints what the .so will want at runtime, so a | |
| 50 | + # missing libssl in the Dart job is obvious from this log rather than from | |
| 51 | + # a StateError in that one. | |
| 52 | + - objdump -p ../build/nim/libfrqcore.so | grep NEEDED || true | |
| 53 | + artifacts: | |
| 54 | + paths: [build/nim/libfrqcore.so] | |
| 55 | + expire_in: 1 hour | |
| 30 | 56 | |
| 31 | -# The Dart side of the same boundary. Needs the Nim library built first, which | |
| 32 | -# is why this is one job and not two: the artifact would be larger than the | |
| 33 | -# build that makes it. | |
| 57 | +# The Dart side of the same boundary, on the plain VM — no Flutter, no | |
| 58 | +# emulator. It dlopens the library the job above built, so `libssl3` has to be | |
| 59 | +# there: the Dart SDK carries its own BoringSSL and does not bring OpenSSL | |
| 60 | +# with it. | |
| 34 | 61 | dart-test: |
| 35 | 62 | stage: check |
| 36 | 63 | image: dart:3.13 |
| 64 | + needs: [nim-test] | |
| 65 | + before_script: | |
| 66 | + - apt-get update -qq && apt-get install -y -qq libssl3 | |
| 37 | 67 | script: |
| 38 | - - apt-get update -qq && apt-get install -y -qq nim | |
| 39 | - - cd nim && nim c --app:lib --mm:orc -d:release --hints:off --path:src | |
| 40 | - --out:../build/nim/libfrqcore.so src/frq_core.nim | |
| 41 | - - cd ../dart/frq_core && dart pub get && dart test -r expanded | |
| 68 | + - cd dart/frq_core && dart pub get && dart test -r expanded | |
| @@ -7,6 +7,15 @@ | |||
| 7 | # follow, so there is nothing for a schedule to do. | 7 | # follow, so there is nothing for a schedule to do. |
| 8 | stages: [check] | 8 | stages: [check] |
| 9 | 9 | ||
| 10 | +# Two toolchains and one artifact between them. | ||
| 11 | +# | ||
| 12 | +# The library is built once, in the image that has Nim, and the Dart job takes | ||
| 13 | +# it rather than installing a second toolchain to rebuild it. That is not only | ||
| 14 | +# tidier: `libfrqcore.so` links OpenSSL and is glibc, so it has to be built | ||
| 15 | +# somewhere its runtime can load it — which is why the Nim job is the Debian | ||
| 16 | +# image and not the Alpine one it used to be. A musl build would not load in | ||
| 17 | +# `dart:*` at all. | ||
| 18 | + | ||
| 10 | # common/ is compiled by ClojureDart for two targets — the APK and the Linux | 19 | # common/ is compiled by ClojureDart for two targets — the APK and the Linux |
| 11 | # desktop — and shared code reaching for the JVM or a `dart:` library breaks | 20 | # desktop — and shared code reaching for the JVM or a `dart:` library breaks |
| 12 | # one of them at a namespace nobody touched. `Math/ceil` in the compose bar was | 21 | # one of them at a namespace nobody touched. `Math/ceil` in the compose bar was |
| @@ -22,20 +31,38 @@ check-common: | |||
| 22 | # The Nim core's tests. A second job rather than a step in the first, because | 31 | # The Nim core's tests. A second job rather than a step in the first, because |
| 23 | # it wants a compiler where check-common wants nothing: one can fail without | 32 | # it wants a compiler where check-common wants nothing: one can fail without |
| 24 | # hiding the other, and the pair of them is still seconds. | 33 | # hiding the other, and the pair of them is still seconds. |
| 34 | +# The Nim core: its own suite, and the library the Dart job needs. | ||
| 35 | +# | ||
| 36 | +# `libssl-dev` because `nim/nim.cfg` sets `-d:ssl` — std/net links -lssl and | ||
| 37 | +# -lcrypto for the TLS on :6697, and `frq.atproto` uses httpclient over the | ||
| 38 | +# same. Without it the compile fails on a missing -lcrypto, which reads as | ||
| 39 | +# nothing to do with TLS. | ||
| 25 | nim-test: | 40 | nim-test: |
| 26 | stage: check | 41 | stage: check |
| 27 | - image: nimlang/nim:2.2.0-alpine | 42 | + image: nimlang/nim:2.2.10 |
| 43 | + before_script: | ||
| 44 | + - apt-get update -qq && apt-get install -y -qq libssl-dev | ||
| 28 | script: | 45 | script: |
| 29 | - cd nim && for t in tests/t*.nim; do nim c -r --hints:off --path:src "$t"; done | 46 | - cd nim && for t in tests/t*.nim; do nim c -r --hints:off --path:src "$t"; done |
| 47 | + - nim c --app:lib --mm:orc -d:release --hints:off --path:src | ||
| 48 | + --out:../build/nim/libfrqcore.so src/frq_core.nim | ||
| 49 | + # Diagnostic, not a gate: prints what the .so will want at runtime, so a | ||
| 50 | + # missing libssl in the Dart job is obvious from this log rather than from | ||
| 51 | + # a StateError in that one. | ||
| 52 | + - objdump -p ../build/nim/libfrqcore.so | grep NEEDED || true | ||
| 53 | + artifacts: | ||
| 54 | + paths: [build/nim/libfrqcore.so] | ||
| 55 | + expire_in: 1 hour | ||
| 30 | 56 | ||
| 31 | -# The Dart side of the same boundary. Needs the Nim library built first, which | 57 | +# The Dart side of the same boundary, on the plain VM — no Flutter, no |
| 32 | -# is why this is one job and not two: the artifact would be larger than the | 58 | +# emulator. It dlopens the library the job above built, so `libssl3` has to be |
| 33 | -# build that makes it. | 59 | +# there: the Dart SDK carries its own BoringSSL and does not bring OpenSSL |
| 60 | +# with it. | ||
| 34 | dart-test: | 61 | dart-test: |
| 35 | stage: check | 62 | stage: check |
| 36 | image: dart:3.13 | 63 | image: dart:3.13 |
| 64 | + needs: [nim-test] | ||
| 65 | + before_script: | ||
| 66 | + - apt-get update -qq && apt-get install -y -qq libssl3 | ||
| 37 | script: | 67 | script: |
| 38 | - - apt-get update -qq && apt-get install -y -qq nim | 68 | + - cd dart/frq_core && dart pub get && dart test -r expanded |
| 39 | - - cd nim && nim c --app:lib --mm:orc -d:release --hints:off --path:src | ||
| 40 | - --out:../build/nim/libfrqcore.so src/frq_core.nim | ||
| 41 | - - cd ../dart/frq_core && dart pub get && dart test -r expanded | ||
modified
.rickub/workflows/build.yml +37 -12 | @@ -30,28 +30,53 @@ jobs: | ||
| 30 | 30 | - uses: actions/checkout@v4 |
| 31 | 31 | - run: python3 tools/check-common.py common |
| 32 | 32 | |
| 33 | - # The Nim core's tests. No Flutter, no Dart, no Android SDK — which is the | |
| 34 | - # reason the logic is moving there: a rule about the IRC wire format gets | |
| 35 | - # checked in seconds rather than behind a toolchain. | |
| 33 | + # The Nim core: its own suite, and the library the Dart job needs. | |
| 34 | + # | |
| 35 | + # Debian and not the Alpine image this used to name. `libfrqcore.so` links | |
| 36 | + # OpenSSL and is glibc, so it has to be built somewhere its runtime can load | |
| 37 | + # it — a musl build would not load in `dart:*` at all. | |
| 38 | + # | |
| 39 | + # `libssl-dev` because `nim/nim.cfg` sets `-d:ssl`: std/net links -lssl and | |
| 40 | + # -lcrypto for the TLS on :6697, and `frq.atproto` uses httpclient over the | |
| 41 | + # same. Without it the compile fails on a missing -lcrypto, which reads as | |
| 42 | + # nothing to do with TLS. | |
| 36 | 43 | nim-test: |
| 37 | 44 | runs-on: ubuntu-latest |
| 38 | - container: nimlang/nim:2.2.0-alpine | |
| 45 | + container: nimlang/nim:2.2.10 | |
| 39 | 46 | steps: |
| 40 | 47 | - uses: actions/checkout@v4 |
| 41 | - - run: cd nim && for t in tests/t*.nim; do nim c -r --hints:off --path:src "$t"; done | |
| 48 | + - run: apt-get update -qq && apt-get install -y -qq libssl-dev | |
| 49 | + - name: The Nim suite | |
| 50 | + run: cd nim && for t in tests/t*.nim; do nim c -r --hints:off --path:src "$t"; done | |
| 51 | + - name: Build libfrqcore.so | |
| 52 | + run: | | |
| 53 | + cd nim && nim c --app:lib --mm:orc -d:release --hints:off --path:src \ | |
| 54 | + --out:../build/nim/libfrqcore.so src/frq_core.nim | |
| 55 | + # Diagnostic, not a gate: prints what the .so will want at | |
| 56 | + # runtime, so a missing libssl in the Dart job is obvious | |
| 57 | + # from this log rather than from a StateError in that one. | |
| 58 | + objdump -p ../build/nim/libfrqcore.so | grep NEEDED || true | |
| 59 | + - uses: actions/upload-artifact@v4 | |
| 60 | + with: | |
| 61 | + name: libfrqcore | |
| 62 | + path: build/nim/libfrqcore.so | |
| 63 | + if-no-files-found: error | |
| 42 | 64 | |
| 43 | - # The Dart side of the Nim boundary, on the plain VM. Builds the library | |
| 44 | - # first — the test dlopens a real .so, and there is no point reporting that | |
| 45 | - # it could not find one. | |
| 65 | + # The Dart side of the same boundary, on the plain VM — no Flutter, no | |
| 66 | + # emulator, which is what makes it a second to run. It dlopens the library | |
| 67 | + # the job above built, so `libssl3` has to be there: the Dart SDK carries | |
| 68 | + # its own BoringSSL and does not bring OpenSSL with it. | |
| 46 | 69 | dart-test: |
| 47 | 70 | runs-on: ubuntu-latest |
| 48 | 71 | container: dart:3.13 |
| 72 | + needs: [nim-test] | |
| 49 | 73 | steps: |
| 50 | 74 | - uses: actions/checkout@v4 |
| 51 | - - run: apt-get update -qq && apt-get install -y -qq nim | |
| 52 | - - run: | | |
| 53 | - cd nim && nim c --app:lib --mm:orc -d:release --hints:off --path:src \ | |
| 54 | - --out:../build/nim/libfrqcore.so src/frq_core.nim | |
| 75 | + - run: apt-get update -qq && apt-get install -y -qq libssl3 | |
| 76 | + - uses: actions/download-artifact@v4 | |
| 77 | + with: | |
| 78 | + name: libfrqcore | |
| 79 | + path: build/nim | |
| 55 | 80 | - run: cd dart/frq_core && dart pub get && dart test -r expanded |
| 56 | 81 | |
| 57 | 82 | web: |
| @@ -30,28 +30,53 @@ jobs: | |||
| 30 | - uses: actions/checkout@v4 | 30 | - uses: actions/checkout@v4 |
| 31 | - run: python3 tools/check-common.py common | 31 | - run: python3 tools/check-common.py common |
| 32 | 32 | ||
| 33 | - # The Nim core's tests. No Flutter, no Dart, no Android SDK — which is the | 33 | + # The Nim core: its own suite, and the library the Dart job needs. |
| 34 | - # reason the logic is moving there: a rule about the IRC wire format gets | 34 | + # |
| 35 | - # checked in seconds rather than behind a toolchain. | 35 | + # Debian and not the Alpine image this used to name. `libfrqcore.so` links |
| 36 | + # OpenSSL and is glibc, so it has to be built somewhere its runtime can load | ||
| 37 | + # it — a musl build would not load in `dart:*` at all. | ||
| 38 | + # | ||
| 39 | + # `libssl-dev` because `nim/nim.cfg` sets `-d:ssl`: std/net links -lssl and | ||
| 40 | + # -lcrypto for the TLS on :6697, and `frq.atproto` uses httpclient over the | ||
| 41 | + # same. Without it the compile fails on a missing -lcrypto, which reads as | ||
| 42 | + # nothing to do with TLS. | ||
| 36 | nim-test: | 43 | nim-test: |
| 37 | runs-on: ubuntu-latest | 44 | runs-on: ubuntu-latest |
| 38 | - container: nimlang/nim:2.2.0-alpine | 45 | + container: nimlang/nim:2.2.10 |
| 39 | steps: | 46 | steps: |
| 40 | - uses: actions/checkout@v4 | 47 | - uses: actions/checkout@v4 |
| 41 | - - run: cd nim && for t in tests/t*.nim; do nim c -r --hints:off --path:src "$t"; done | 48 | + - run: apt-get update -qq && apt-get install -y -qq libssl-dev |
| 49 | + - name: The Nim suite | ||
| 50 | + run: cd nim && for t in tests/t*.nim; do nim c -r --hints:off --path:src "$t"; done | ||
| 51 | + - name: Build libfrqcore.so | ||
| 52 | + run: | | ||
| 53 | + cd nim && nim c --app:lib --mm:orc -d:release --hints:off --path:src \ | ||
| 54 | + --out:../build/nim/libfrqcore.so src/frq_core.nim | ||
| 55 | + # Diagnostic, not a gate: prints what the .so will want at | ||
| 56 | + # runtime, so a missing libssl in the Dart job is obvious | ||
| 57 | + # from this log rather than from a StateError in that one. | ||
| 58 | + objdump -p ../build/nim/libfrqcore.so | grep NEEDED || true | ||
| 59 | + - uses: actions/upload-artifact@v4 | ||
| 60 | + with: | ||
| 61 | + name: libfrqcore | ||
| 62 | + path: build/nim/libfrqcore.so | ||
| 63 | + if-no-files-found: error | ||
| 42 | 64 | ||
| 43 | - # The Dart side of the Nim boundary, on the plain VM. Builds the library | 65 | + # The Dart side of the same boundary, on the plain VM — no Flutter, no |
| 44 | - # first — the test dlopens a real .so, and there is no point reporting that | 66 | + # emulator, which is what makes it a second to run. It dlopens the library |
| 45 | - # it could not find one. | 67 | + # the job above built, so `libssl3` has to be there: the Dart SDK carries |
| 68 | + # its own BoringSSL and does not bring OpenSSL with it. | ||
| 46 | dart-test: | 69 | dart-test: |
| 47 | runs-on: ubuntu-latest | 70 | runs-on: ubuntu-latest |
| 48 | container: dart:3.13 | 71 | container: dart:3.13 |
| 72 | + needs: [nim-test] | ||
| 49 | steps: | 73 | steps: |
| 50 | - uses: actions/checkout@v4 | 74 | - uses: actions/checkout@v4 |
| 51 | - - run: apt-get update -qq && apt-get install -y -qq nim | 75 | + - run: apt-get update -qq && apt-get install -y -qq libssl3 |
| 52 | - - run: | | 76 | + - uses: actions/download-artifact@v4 |
| 53 | - cd nim && nim c --app:lib --mm:orc -d:release --hints:off --path:src \ | 77 | + with: |
| 54 | - --out:../build/nim/libfrqcore.so src/frq_core.nim | 78 | + name: libfrqcore |
| 79 | + path: build/nim | ||
| 55 | - run: cd dart/frq_core && dart pub get && dart test -r expanded | 80 | - run: cd dart/frq_core && dart pub get && dart test -r expanded |
| 56 | 81 | ||
| 57 | web: | 82 | web: |
added
.vscode/settings.json +3 -0 | new file mode 100644 | ||
| @@ -0,0 +1,3 @@ | ||
| 1 | +{ | |
| 2 | + "cmake.sourceDirectory": "/home/nandi/code/frq/.claude/worktrees/flutter-messages-padding-e415bc/flutter/linux" | |
| 3 | +} | |
| \ No newline at end of file | ||
| new file mode 100644 | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | +{ | ||
| 2 | + "cmake.sourceDirectory": "/home/nandi/code/frq/.claude/worktrees/flutter-messages-padding-e415bc/flutter/linux" | ||
| 3 | +} | ||
| \ No newline at end of file | \ No newline at end of file | ||