Skip to content

fix: point pslua at github, move to a current set + nix CI (#60)#2

Merged
Unisay merged 2 commits into
masterfrom
fix/safe-coerce-flake-overlay
Jun 14, 2026
Merged

fix: point pslua at github, move to a current set + nix CI (#60)#2
Unisay merged 2 commits into
masterfrom
fix/safe-coerce-flake-overlay

Conversation

@Unisay

@Unisay Unisay commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

Fixes purescript-lua/purescript-lua#60.

The pslua flake input was a dead local path (/home/yura/...), so nix develop could not even build the dev shell. This points it at github:Unisay/purescript-lua and moves the dev shell onto the purescript-overlay setup the rest of the forks share, replacing an off-target easy-purescript-nix shell that was still pinned to Lua 5.3. The fork now lines up with the others: purs 0.15.16, spago 0.21.0, and a Lua 5.1 toolchain.

The fork was also stuck on the ancient psc-0.15.8 draft package set. Its unsafe-coerce (v6.0.0) ships an FFI value that is not wrapped in parentheses, which trips pslua's foreign-file parser (the format requires identifier = (<value>)). Bumping to the current set picks up unsafe-coerce v6.1.0, whose FFI is parenthesised, so the fork compiles again.

CI moves off the dead npm/bower/setup-purescript flow onto the nix + overlay canon the other forks use: scripts/build under set -euo pipefail, and luacheck --std lua51 --no-unused-args. This fork has no hand-written Lua FFI of its own (Safe.Coerce is pure PureScript over unsafeCoerce), so luacheck runs over the generated dist/ to confirm the output is valid Lua 5.1.

Verification

nix develop -c ./scripts/build compiles the fork from a clean checkout (dist/ is created by the build, unsafe-coerce v6.1.0 is fetched and parses), and luacheck is clean on dist/Safe_Coerce.lua.

The pslua flake input was a dead local path (`/home/yura/...`), so the
dev shell could not be entered at all. Point it at
`github:Unisay/purescript-lua`, switch the dev shell to Lua 5.1 (it was
pinned to 5.3) and pin purs, matching the other package-set forks.

`packages.dhall` was on the ancient `psc-0.15.8` draft set, whose
`unsafe-coerce` (v6.0.0) ships an FFI value that is not parenthesised and
so trips pslua's foreign-file parser. Bump to the current set, which
carries `unsafe-coerce` v6.1.0, so the fork builds again.

CI moves onto the nix + overlay canon: build under `set -euo pipefail`,
luacheck `--std lua51 --no-unused-args` over the generated `dist/` (this
fork has no hand-written FFI of its own).

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the project’s Nix-based development and CI setup so the repo builds reliably again: it replaces a dead local pslua flake input with the upstream GitHub source, refreshes the PureScript/Lua package-set inputs to a current set, and modernizes CI to build via nix develop and validate generated Lua (Lua 5.1).

Changes:

  • Harden scripts/build with set -euo pipefail and rely on spago build under the Nix dev shell.
  • Update packages.dhall to merge a current upstream PureScript package set with the Lua-specific overlay set.
  • Rework Nix flake devShell inputs (Lua 5.1, pinned purs) and migrate GitHub Actions CI from Node/bower to Nix + luacheck.

Reviewed changes

Copilot reviewed 4 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
scripts/build Enables strict bash mode for more reliable build failures in CI/dev.
packages.dhall Switches to newer package sets and merges PureScript upstream with Lua overlay.
flake.nix Fixes pslua to a GitHub flake input; updates devShell tooling (Lua 5.1, pinned purs).
flake.lock Updates locked inputs to match the new flake configuration and dependencies.
.gitignore Ignores .spago/ working directory artifacts.
.github/workflows/ci.yml Migrates CI to Nix (nix develop) and adds Lua output linting via luacheck.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci.yml
Align the flake with the other forks: purescript-overlay
(purs-bin.purs-0_15_16, spago-bin.spago-0_21_0, lua51Packages,
nixfmt-rfc-style, luaformatter, treefmt) instead of easy-purescript-nix,
and lock pslua to the current HEAD so dist/ is created on a clean build.
@Unisay Unisay requested a review from Copilot June 14, 2026 15:58
@Unisay Unisay self-assigned this Jun 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 6 changed files in this pull request and generated no new comments.

@Unisay Unisay merged commit 235dc83 into master Jun 14, 2026
2 checks passed
@Unisay Unisay deleted the fix/safe-coerce-flake-overlay branch June 14, 2026 16:05
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.

[fork-flake] purescript-lua-safe-coerce: pslua flake input is a dead local path

2 participants