Skip to content

Restructure repository around a template/ directory; single CI workflow - #82

Closed
zeme-wana wants to merge 5 commits into
mainfrom
claude/crypto-libs-build-nix-free-c9ec98
Closed

Restructure repository around a template/ directory; single CI workflow#82
zeme-wana wants to merge 5 commits into
mainfrom
claude/crypto-libs-build-nix-free-c9ec98

Conversation

@zeme-wana

@zeme-wana zeme-wana commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR reorganizes the repository so that everything a generated project is made of lives in one directory, simplifies how install.sh creates projects, and consolidates CI.

What changed

  • template/ directory: all files that get copied into a user's project (Haskell sources, cabal files, nix files, .devcontainer, configs, licenses, per-environment readmes) now live under template/. install.sh copies a verbatim per-environment subset of it — the marked-block transforms in cabal.project and nix/project.nix are gone entirely.
  • pkg-config shim removed: scripts/pkg-config, the program-locations stanza, the generated cabal.project.local, and the documented "first build stops once" quirk are all gone. GHC+Cabal projects now run ./get-crypto-libs.sh (the installer does it for you) and source dist-newstyle/crypto-libs/env.sh before building.
  • get-crypto-libs.sh at the root, next to install.sh; GHC+Cabal projects carry it at their project root.
  • CI scripts moved to .github/ci/ (from dev/ci/), and the four build workflows are merged into a single ci.yaml that rebuilds and retests everything on every pull request (no path filters), all jobs in parallel:
    • shell lint, install.sh end-to-end tests (ubuntu/macos)
    • GHC+Cabal project builds (ubuntu/macos × GHC 9.6.7/9.12.2)
    • nix shell builds (ghc96/ghc912) and the devx docker build
  • No native-Windows job — verified impossible: plutus-tx-plugin declares buildable: False on Windows (os-support stanza, introduced by Move cross-compiling logic from project.nix to cabal plutus#6299; the plugin is a GHC compiler plugin that upstream only ever supported on Windows as a cross-compiled stub). A Windows job was attempted on this branch and cabal rejects the plugin at solve time; the crypto-libs MSYS2 machinery itself worked. Windows users go through WSL2 (which install.sh enforces and the Linux jobs cover), and the GHC+Cabal README now says so explicitly.
  • bump-plutus-version workflow kept as-is, but its inline bash is extracted to .github/ci/bump-plutus-version.sh (portable — python3 instead of GNU date/tar — so it can be run and tested locally); paths updated for the template/ layout.
  • Removed: .github/copilot-instructions.md, the obsolete --branch flag in install.sh, .devcontainer at the root (it moved into template/).
  • Shell style: all statement-level [ x ] && cmd / [ x ] || cmd shortcut control flow replaced with explicit if/else across every script.

Notes for reviewers

  • There is no flake at the repository root anymore (it lives in template/). If a Hydra jobset still points at this repo's root flake, it needs repointing or retiring — ci.yaml now covers all platforms on GitHub Actions.
  • LICENSE.md/NOTICE.md are duplicated into template/ because GitHub needs root copies for the repository itself.
  • Everything runs locally: .github/ci/run-all-local.sh (or PLINTH_SKIP_HEAVY=1 for the fast checks). Verified here: shellcheck over all scripts, and the full test-install.sh suite including the real crypto-libs download.

zeme-wana and others added 2 commits July 24, 2026 14:33
Reorganize the repository so that everything a generated project is made
of lives in one place, and simplify how projects are created:

* template/ now carries the union of every environment's project files
  (sources, cabal files, nix files, .devcontainer, configs, licenses,
  per-environment readmes). install.sh copies a verbatim per-environment
  subset of it — no marked blocks, no file transforms.
* Remove the pkg-config shim (scripts/pkg-config) and its whole feature:
  the program-locations stanza in cabal.project, the generated
  cabal.project.local, and the cold-start build interruption. GHC+Cabal
  projects now run ./get-crypto-libs.sh (done by the installer) and
  source dist-newstyle/crypto-libs/env.sh instead.
* Move get-crypto-libs.sh to the repository root, next to install.sh;
  GHC+Cabal projects carry it at their project root.
* Move the CI scripts from dev/ci/ to .github/ci/ and merge all build
  workflows into a single ci.yaml running every job on every pull
  request (no path filters): lint, install.sh end-to-end tests
  (ubuntu/macos), GHC+Cabal builds (ubuntu/macos × GHC 9.6.7/9.12.2),
  native Windows builds (MSYS2 crypto libs, GHC 9.6.7/9.12.2), nix
  builds (ghc96/ghc912) and the devx docker build.
* Extract the bump-plutus-version workflow logic into
  .github/ci/bump-plutus-version.sh so it can be run and tested locally
  (portable: python3 instead of GNU date/tar).
* Remove .github/copilot-instructions.md and the obsolete --branch flag
  from install.sh.
* Shell style: replace all statement-level `[ x ] && cmd` / `[ x ] || cmd`
  shortcut control flow with explicit if/else.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment thread .github/workflows/ci.yaml Fixed
Comment thread .github/workflows/ci.yaml Fixed
Comment thread .github/workflows/ci.yaml Fixed
Comment thread .github/workflows/ci.yaml Fixed
Comment thread .github/workflows/ci.yaml Fixed
Comment thread .github/workflows/ci.yaml Fixed
zeme-wana and others added 3 commits July 28, 2026 14:31
…PATH

bash.exe invoked directly runs no login profile, so MSYSTEM is never
processed and /usr/bin (pacman, cygpath, sha256sum) is not on PATH — and
the bare `bash` in the run line resolved to Git Bash (which has uname but
no pacman), producing "pacman not found". Invoke the script with
/usr/bin/bash (absolute) and have it prepend /usr/bin itself; drop the
MSYS2_PATH_TYPE env, which only login shells read.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The Windows jobs can never work: plutus-tx-plugin.cabal carries an
os-support stanza (if (impl(ghcjs) || os(windows)) buildable: False)
imported by its library, so cabal rejects the plugin — and with it any
Plinth project — on native Windows at solve time. The stanza was
introduced by IntersectMBO/plutus#6299, which moved the long-standing
"not buildable on Windows" marking out of their haskell.nix
cross-compilation config: the plugin is a GHC compiler plugin (it links
the ghc package and runs inside the compiler), which upstream only ever
supported on Windows as a non-functional cross-compiled stub
(plutus-ghc-stub).

Windows users go through WSL2 — which install.sh already enforces and
the Linux jobs already cover. The crypto-libs pacman machinery itself
worked (the job failed at dependency resolution, after the libraries
installed and verified), so this removes build-windows.sh, the ci.yaml
job, and the msys2 instructions in the GHC+Cabal README in favor of a
clear "use WSL2" note.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…sions

Three CI failures, three distinct causes:

* env.sh now also exports LD_LIBRARY_PATH. The .pc files carry no -rpath,
  so on Linux an executable linked against the downloaded crypto libs
  records a bare "libblst.so" and ld.so cannot find it in the per-user
  cache: running the generated blueprint died with "libblst.so: cannot
  open shared object file". macOS was unaffected because the install
  names rewritten by get-crypto-libs.sh are absolute. This is a
  user-facing bug, not just a CI one — the GHC+Cabal README now explains
  what env.sh sets and why.

* build-docker.sh no longer fails after a successful build. The devx
  container builds as root, leaving root-owned dist-newstyle files on the
  host, so the EXIT trap's rm failed and turned a green build red
  ("build-docker: SUCCESS" is in the log, followed by rm: Permission
  denied). Cleanup now hands the files back through a throwaway container
  and warns instead of failing if it still cannot remove them.

* ci.yaml declares `permissions: contents: read` (CodeQL: workflow does
  not limit GITHUB_TOKEN). No job in it writes to the repository.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@zeme-wana zeme-wana changed the title Restructure repository around a template/ directory; single CI workflow with Windows coverage Restructure repository around a template/ directory; single CI workflow Jul 28, 2026
@zeme-wana zeme-wana closed this Jul 30, 2026
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.

2 participants