Skip to content

Conversation

@robinheghan
Copy link
Contributor

@robinheghan robinheghan commented Apr 25, 2025

Context: I'm the lead developer of Gren. This is also my first contribution to nixpkgs, I apologize if I've missed something obvious.

This PR updates the Gren programming language to the latest released version.

Gren has become a little tricky to release since 0.5.0. The Gren compiler now consists of a (Haskell-based) backend and a (Gren/Node-based) frontend.

The frontend is bootstrapped, meaning it's written in Gren.

A release build of the frontend is commited to the official git repository, which makes things rather easy.

For the frontend to use the nix-built backend, a GREN_BIN environment variable must be set that points to this binary. If not set, the frontend will download a pre-built backend from github and install in XDG_CACHE. To set GREN_BIN, I've opted to use the wrapProgram utility function.

I've also added git to PATH using wrapProgram --suffix, as Gren's package manager relies on git being installed.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added the 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` label Apr 25, 2025
@NixOSInfra NixOSInfra added the 12.first-time contribution This PR is the author's first one; please be gentle! label Apr 25, 2025
@github-actions github-actions bot added 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Apr 25, 2025
@0xda157 0xda157 added the 11.by: upstream-developer This issue or PR was created by the developer of packaged software. label Apr 25, 2025
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/5512

@nix-owners nix-owners bot requested a review from TomaSajt June 2, 2025 13:33
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jun 9, 2025
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jun 11, 2025
@nixpkgs-ci nixpkgs-ci bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jul 21, 2025
@robinheghan robinheghan changed the title Update Gren from 0.4.5 to 0.5.4 Update Gren from 0.4.5 to 0.6.0 Jul 25, 2025
@nixpkgs-ci nixpkgs-ci bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jul 25, 2025
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/5703

@TomaSajt
Copy link
Contributor

I'll try to review this.

@robinheghan
Copy link
Contributor Author

I'll try to review this.

Thank you!

I couldn't decide if I should've left your name in the maintainer list or not 🤷‍♂️

@TomaSajt
Copy link
Contributor

I added a commit that cleans up the package:

It uses buildNpmPackage to not have to generate node_modules inside of the nixpkgs tree (which is not allowed).

buildNpmPackage correctly installs the binary as written inside package.json, though the wrapping still needed to be done with makeWrapper in postInstall.

I added extra meta fields.

I moved the backend package into passthru.backend so that it can be build separately if we want to.

Also, I improved the update.sh script.

Could you tell me how the versioning / tagging scheme works for gren? There's blob-{version} and there's ${version}.
Which one should we be using?

@TomaSajt
Copy link
Contributor

TomaSajt commented Jul 25, 2025

If you've reviewed my changes, please, squash all of the commits in the PR.

The commit message should be gren: 0.4.5 -> 0.6.0 (maybe also update the PR title)

@robinheghan
Copy link
Contributor Author

robinheghan commented Jul 25, 2025

It uses buildNpmPackage to not have to generate node_modules inside of the nixpkgs tree (which is not allowed).

The frontend doesn't have any dependencies, and can run without node_modules. There should be no reason to use buildNpmPackage.

Could you tell me how the versioning / tagging scheme works for gren? There's blob-{version} and there's ${version}.
Which one should we be using?

{version} is the frontend
blob-{version} is the backend

The other changes looks like good improvements :)

@TomaSajt
Copy link
Contributor

Alright I'll push another commit

@TomaSajt
Copy link
Contributor

Alright, I pushed it.

@robinheghan robinheghan changed the title Update Gren from 0.4.5 to 0.6.0 gren: 0.4.5 -> 0.6.0 Jul 25, 2025
@robinheghan
Copy link
Contributor Author

I've squashed all the commits

@TomaSajt
Copy link
Contributor

Oh, sorry, I forgot this PR also adds to you the maintainer list.

In that case, please create two commits instead:

  • the first should be maintainers: add robinheghan which contains only the change to maintainer-list.nix
  • the second one should be gren: 0.4.5 -> 0.6.0 with all other changes.

After that I think we're good to go.

@TomaSajt
Copy link
Contributor

Good catch with the shebang of the script!

@robinheghan
Copy link
Contributor Author

Are we just waiting for all the checks to complete, or are there other things that needs to be done before this can be merged?

@robinheghan robinheghan changed the title gren: 0.4.5 -> 0.6.0 gren: 0.4.5 -> 0.6.1 Jul 31, 2025
@robinheghan
Copy link
Contributor Author

@TomaSajt Updated to Gren 0.6.1 which was released today.

I couldn't get the nix-update command of update.hs to work, so I removed it, and updated the version and github hash in package.nix manually.

Is there anything else that needs to be done before this can be merged?

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/is-it-normal-for-ofborg-github-actions-to-stay-pending-forever/67505/1

@Lassulus Lassulus merged commit 258f6ee into NixOS:master Aug 2, 2025
25 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 11.by: upstream-developer This issue or PR was created by the developer of packaged software. 12.first-time contribution This PR is the author's first one; please be gentle!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants