nickel-lang / organist

Control all your tooling from a single console
MIT License
421 stars 21 forks source link

`nix run .#regenerate-files` fails (missing `.attrs.sh`) #200

Open tripplilley opened 6 months ago

tripplilley commented 6 months ago
$ nix run .#regenerate-files
error: builder for '/nix/store/0gh34k924ii1n986w0m5sacq9430i7yv-regenerate-files.drv' failed with exit code 1;
       last 1 log lines:
       > bash: line 1: /tmp/nix-build-regenerate-files.drv-0/.attrs.sh: No such file or directory
       For full logs, run 'nix log /nix/store/0gh34k924ii1n986w0m5sacq9430i7yv-regenerate-files.drv'.

I'm still relatively new to Nix, Nickel, and Organist, so I fully allow this might be operator error.

My project.ncl is bone stock output from nix flake init -t github:nickel-lang/organist and I have done nix run .#regenerate-lockfile. I've tried this both from within and without a nix develop shell.

let inputs = import "./nickel.lock.ncl" in
let organist = inputs.organist in

{
  shells = organist.shells.Bash,

  shells.build = {
    packages = {},
  },

  shells.dev = {
    packages.hello = organist.import_nix "nixpkgs#hello",
  },
}
  | organist.OrganistExpression
yannham commented 6 months ago

Hi,

Thanks for the report. I just tried to copy the template from the repo and I can regenerate-lockfile and regenerate-files both several times, from inside and outside the developer environment.

I think .attrs.sh should be provisioned by Nix automatically in our case (when using __structuredAttrs). I haven't seen this error before, personally.

Could you please let us know:

  1. Your nix version (nix --version)
  2. The organist version (e.g. the rev written in the flake.lock file)
  3. Your platform
tripplilley commented 4 months ago
$ nix --version
nix (Nix) 2.13.3
$ jq .nodes.organist flake.lock
{
  "inputs": {
    "flake-compat": "flake-compat",
    "flake-utils": "flake-utils",
    "nixpkgs": "nixpkgs_3"
  },
  "locked": {
    "lastModified": 1719421167,
    "narHash": "sha256-zLLUxIAoUxjKFvYPlJVyB9vOxNqb5R4eBfr02MP4jUI=",
    "owner": "nickel-lang",
    "repo": "organist",
    "rev": "7f83a26e56111a63449b1f9aeebe5e1a34f74bdd",
    "type": "github"
  },
  "original": {
    "owner": "nickel-lang",
    "repo": "organist",
    "type": "github"
  }
}

Platform is x86-64 Linux /Ubuntu (-ish):

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=23.10
DISTRIB_CODENAME=mantic
DISTRIB_DESCRIPTION="Ubuntu 23.10"
$ uname -a
Linux zed 6.5.0-42-generic #42-Ubuntu SMP PREEMPT_DYNAMIC Mon Jun 10 09:28:55 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
yannham commented 4 months ago

After a quick search, it seems that organist is making use of __structuredAttrs, which only appears in the documentation from version 2.14 of Nix and onward (it's absent from the 2.13 reference, but in the 2.14 reference).

It should be clearly documented in the README though, so keeping this issue open until then. Is updating an option for you?

tripplilley commented 4 months ago

Yes, I just (finally) updated and it works fine now :sweat_smile: . Thanks!

$ nix --version
nix (Nix) 2.18.4
tripplilley commented 3 months ago

(oops, sorry - I closed it because it's "fixed", but then I saw the "keeping this issue open until then" note and re-opened it)