Restructure repository around a template/ directory; single CI workflow - #82
Closed
zeme-wana wants to merge 5 commits into
Closed
Restructure repository around a template/ directory; single CI workflow#82zeme-wana wants to merge 5 commits into
zeme-wana wants to merge 5 commits into
Conversation
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>
…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>
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.
Description
This PR reorganizes the repository so that everything a generated project is made of lives in one directory, simplifies how
install.shcreates 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 undertemplate/.install.shcopies a verbatim per-environment subset of it — the marked-block transforms incabal.projectandnix/project.nixare gone entirely.scripts/pkg-config, theprogram-locationsstanza, the generatedcabal.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) andsource dist-newstyle/crypto-libs/env.shbefore building.get-crypto-libs.shat the root, next toinstall.sh; GHC+Cabal projects carry it at their project root..github/ci/(fromdev/ci/), and the four build workflows are merged into a singleci.yamlthat rebuilds and retests everything on every pull request (no path filters), all jobs in parallel:install.shend-to-end tests (ubuntu/macos)plutus-tx-plugindeclaresbuildable: Falseon Windows (os-supportstanza, 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 (whichinstall.shenforces and the Linux jobs cover), and the GHC+Cabal README now says so explicitly.bump-plutus-versionworkflow kept as-is, but its inline bash is extracted to.github/ci/bump-plutus-version.sh(portable — python3 instead of GNUdate/tar— so it can be run and tested locally); paths updated for thetemplate/layout..github/copilot-instructions.md, the obsolete--branchflag ininstall.sh,.devcontainerat the root (it moved intotemplate/).[ x ] && cmd/[ x ] || cmdshortcut control flow replaced with explicitif/elseacross every script.Notes for reviewers
template/). If a Hydra jobset still points at this repo's root flake, it needs repointing or retiring —ci.yamlnow covers all platforms on GitHub Actions.LICENSE.md/NOTICE.mdare duplicated intotemplate/because GitHub needs root copies for the repository itself..github/ci/run-all-local.sh(orPLINTH_SKIP_HEAVY=1for the fast checks). Verified here: shellcheck over all scripts, and the fulltest-install.shsuite including the real crypto-libs download.