Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tripplilley opened this issue May 15, 2024 · 5 comments
Open

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

tripplilley opened this issue May 15, 2024 · 5 comments

Comments

@tripplilley
Copy link

$ 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
Copy link
Contributor

yannham commented May 21, 2024

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
Copy link
Author

$ 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
Copy link
Contributor

yannham commented Jul 1, 2024

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
Copy link
Author

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

$ nix --version
nix (Nix) 2.18.4

@tripplilley
Copy link
Author

(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)

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

No branches or pull requests

2 participants