Merged
Conversation
We want to get back into developing in this repository. The issue is that things are so out of date that it's hard to do anything. We do what we should've done years ago, and setup `nix` and `direnv` here so that we can at least build stuff. This is mostly temporary until we get up to date on versions of things. So even if this doesn't work too well as-is, it hopefully won't be around for long.
Times have moved on, and devices are using ARM more and more these days. In order to support that in this repository with the version of things we're using, we have to do a bit of work. The version of `purescript` we were using–0.14.0–does not have a pre-built ARM version. The `npm` package for `purescript` will fallback to building from source, but we have to make sure certain dependencies are available in order to do that. Since those dependencies are only necessary if we have to build from source, we make them conditional on the host platform of the system. Unfortunately even with those dependencies, we still cannot build things from source. The version of GHC that `purescript` 0.14.0 wants is 8.10.4, which is not available in the version of `stack`? we're using. We could go down to an older version of `nixpkgs`, but the alternative we decide on is to update the version of `purescript` to 0.14.9. This version of `purescript` requires a newer version of GHC that actually is available in the `stack`? we're using. All this stuff means we can now develop again in the year 2025!
There's two things we fix in this change: - Ignore third-party dependency warnings. - Remove erroneous `compile` flag. We cannot do anything about what some third-party dependency is doing in this repository. There's no need to surface their warnings to us, so we ignore them. We also were erroneously passing `compile` to `psa`. That isn't how that command works. So we remove `compile`.
We move over to using `nix` for formatting and linting. We also setup some pre-commit and pre-push hooks to validate this stuff. We only add the formatters and linters that pass without requiring a change. We'll add more stuff in separate changes, so we can have a smaller, more manageable diff. Unfortunately (or maybe fortunately?) we cannot use `purty` anymore. The developer *cough* hasn't made ARM binaries available, and we're not going to try to figure out how to build it. More than that, it doesn't support 0.15.x syntax. We're going to move on to the currently maintained PureScript formatter in a future change. For now, we remove it from the `Makefile`. We also add a `lint` recipe in the `Makefile`. This gets added as a dependency to `test`, since we generally want to make sure that the lints pass when testing as well.
We've got a couple of typos in some comments. We enable the `typos` linter to catch this stuff so it doesn't linger for years (like the current typos).
We want to catch any issues with Shell code. `shellcheck` tends to be way more useful than some other linters, given just how easy it is to do the wrong with with Bash. Hopefully it will also pay off if we write more Shell code.
We've got quite a bit of Markdown in this repo. We want to make sure we're linting it properly, so we enable the `markdownlint` linter. It catches a few violations, so we fix those.
To make dealing with `markdownlint` a little easier, and to have consistent formatting for Markdown, we enable `mdformat` as a formatter. We also update the Markdown files to use this new formatting.
Since `purty` is deprecated it in favor of `purs-tidy` (I did mention this in like the old PS Slack or something at some point, but should probably make it explicit in the repository) we migrate over to `purs-tidy`. There are some minor differences in formatting, but that doesn't really matter. Formatting has never been about doing things "my way." But about having _something_ format the code so we Humans don't have to think about it.
We want YAML to be formatted consistently just like all the other stuff. We enable `yamlfmt` in `treefmt` so we get that with `make format` as well.
We want our GitHub Actions to do the right thing. There's a linter that checks we're not doing something wrong: `actionlint`. So we enable it. It already caught that the old `ubuntu-18.04` is no longer suported. So it's paying for itself.
Addressing some CVEs in `npm`, even though this isn't really how things work for this package. Still good to have some of this stuff not blasting warnings. We cannot update all `npm` dependencies just yet, since that requires bumping `purescript` and friends, and that's too big a change to make right now.
We update things to be a bit more modern:
- We rename the file to not be about `nodejs` (because it never really
was, that was an implementation detail).
- We trigger on all `pull_request_target` events.
- We trigger on pushes to the `main` or `joneshf/<something>` branches.
- We rename the job from `build` to `test` (because that's what we're
actually doing: testing).
- We bump the version of `actions/checkout`.
- We switch to using `cachix/install-nix-action`.
It would be nice to have this stuff cached somewhere, but caching with
GitHub Actions plus Nix plus Node.js takes more than a modicum of
effort, so we're not going to deal with it.
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.
It's been a few years, and many things have changed (in my development style, in the ecosystem, in the world at large). We modernize some stuff, and get CI working again. We're also switching over to
nixas the thing to get this stuff working (since it didn't work as-is out of the box after all these years). Also adding some more formatting/linting (because it's super easy to do these days).In any case, the individual commits tell the story of what we're doing and why we're doing it.