emacs-twist / twist.nix

Build an entire Emacs configuration as a Nix package in a pure, reproducible way
GNU General Public License v3.0
66 stars 6 forks source link

Fix handling of :renames from elpa-packages when the destination is empty #149

Open brsvh opened 5 months ago

brsvh commented 5 months ago

Upon updating magit-section to my lockDir, I have captured its build failure error.

log:

``` sandbox setup: bind mounting '/nix/store/zzx3hx8awlz31spdj8ms14wd98v1yfpb-db-5.3.28' to '/nix/store/rlfar4f97kg5f5674rfk6cbl8zcjpdg3-emacs-git-20231211-0-magit-section-3.3.0.50-git.drv.chroot/nix/store/zzx3hx8awlz31spdj8ms14wd98v1yfpb-db-5.3.28' sandbox setup: closing leaked FD 3 sandbox setup: closing leaked FD 4 sandbox setup: closing leaked FD 5 sandbox setup: closing leaked FD 6 sandbox setup: closing leaked FD 7 sandbox setup: closing leaked FD 8 sandbox setup: closing leaked FD 9 sandbox setup: closing leaked FD 10 sandbox setup: closing leaked FD 11 sandbox setup: closing leaked FD 12 sandbox setup: closing leaked FD 13 sandbox setup: closing leaked FD 14 sandbox setup: closing leaked FD 15 sandbox setup: closing leaked FD 16 sandbox setup: closing leaked FD 17 sandbox setup: closing leaked FD 20 building '/nix/store/rlfar4f97kg5f5674rfk6cbl8zcjpdg3-emacs-git-20231211-0-magit-section-3.3.0.50-git.drv'... building of '/nix/store/rlfar4f97kg5f5674rfk6cbl8zcjpdg3-emacs-git-20231211-0-magit-section-3.3.0.50-git.drv^out' from .drv file: got EOF building of '/nix/store/rlfar4f97kg5f5674rfk6cbl8zcjpdg3-emacs-git-20231211-0-magit-section-3.3.0.50-git.drv^out' from .drv file: woken up building of '/nix/store/rlfar4f97kg5f5674rfk6cbl8zcjpdg3-emacs-git-20231211-0-magit-section-3.3.0.50-git.drv^out' from .drv file: build done killing process 658448 builder process for '/nix/store/rlfar4f97kg5f5674rfk6cbl8zcjpdg3-emacs-git-20231211-0-magit-section-3.3.0.50-git.drv' finished killing all processes running under uid '30001' lock released on '/nix/store/531l4la167vn9zql2qsc4zimssw0ld17-emacs-git-20231211-0-magit-section-3.3.0.50-git.lock' lock released on '/nix/store/l7kfqgmni29g9l1flrzrg9vzhdlxccdl-emacs-git-20231211-0-magit-section-3.3.0.50-git-info.lock' building of '/nix/store/rlfar4f97kg5f5674rfk6cbl8zcjpdg3-emacs-git-20231211-0-magit-section-3.3.0.50-git.drv^out' from .drv file: done error: builder for '/nix/store/rlfar4f97kg5f5674rfk6cbl8zcjpdg3-emacs-git-20231211-0-magit-section-3.3.0.50-git.drv' failed with exit code 1; last 8 log lines: > Running phase: unpackPhase > unpacking source archive /nix/store/bkkz28wc6ppz7dpwzxkzg9pwxxrg3xff-source > source root is /build/build > Running phase: patchPhase > Running phase: buildPhase > mv: missing destination file operand after '.' > Try 'mv --help' for more information. > /nix/store/d4jf1cbbk494zwgbqz31pxgigpsbh6w2-stdenv-linux/setup: line 131: pop_var_context: head of shell_variables not a function context For full logs, run 'nix log /nix/store/rlfar4f97kg5f5674rfk6cbl8zcjpdg3-emacs-git-20231211-0-magit-section-3.3.0.50-git.drv'. building of '/nix/store/7g5m5xnvw6rw2mcw8h0qdz5i5vbzx9k4-emacs.drv^out' from .drv file: waitee 'building of '/nix/store/rlfar4f97kg5f5674rfk6cbl8zcjpdg3-emacs-git-20231211-0-magit-section-3.3.0.50-git.drv^out' from .drv file' done; 3 left building of '/nix/store/i0g1sx3clfcrdak3bflys5dwzh2p8g2d-elisp-digest.json.drv^out' from .drv file: goal destroyed building of '/nix/store/hhzmvsganhs5ph7piir8s3va1rfmj2nj-elisp-packages.drv^out' from .drv file: goal destroyed building of '/nix/store/dayjk42pigrn6147cny98g222r8d6rr8-emacs-git-20231211-0-nix-mode-1.5.0.drv^out' from .drv file: goal destroyed building of '/nix/store/7g5m5xnvw6rw2mcw8h0qdz5i5vbzx9k4-emacs.drv^out' from .drv file: woken up building of '/nix/store/rlfar4f97kg5f5674rfk6cbl8zcjpdg3-emacs-git-20231211-0-magit-section-3.3.0.50-git.drv^out' from .drv file: goal destroyed building of '/nix/store/7g5m5xnvw6rw2mcw8h0qdz5i5vbzx9k4-emacs.drv^out' from .drv file: all inputs realised building of '/nix/store/7g5m5xnvw6rw2mcw8h0qdz5i5vbzx9k4-emacs.drv^out' from .drv file: done building of '/nix/store/7g5m5xnvw6rw2mcw8h0qdz5i5vbzx9k4-emacs.drv^out' from .drv file: goal destroyed error: 1 dependencies of derivation '/nix/store/7g5m5xnvw6rw2mcw8h0qdz5i5vbzx9k4-emacs.drv' failed to build ```

It seems that renamePhase failed during the execution of mv docs/*.* ..

I am at a loss regarding this, how should I resolve it?

As additional info, the flake of magit-section:

    "magit-section": {
      "flake": false,
      "locked": {
        "lastModified": 1704784205,
        "narHash": "sha256-qiQQ1nKm+f1Hx9cipHSmxP6ED2SntnWx/qm1erUS1t4=",
        "owner": "magit",
        "repo": "magit",
        "rev": "c3b7fd7dc43dd87468a86aef3d59576ad79fbc16",
        "type": "github"
      },
      "original": {
        "owner": "magit",
        "repo": "magit",
        "type": "github"
      }
    },
akirak commented 5 months ago

The culprit might be Documentation/magit-section.texi in the recipe. It's strange because I don't encounter the issue in my config.

Could you run the following command to check what's going on?

nix eval .#emacsEnv.packageInputs.magit-section --json | jq

Also, I'm on travel, so I can't look into the details until Saturday.

brsvh commented 5 months ago

nix eval .#emacsEnv.packageInputs.magit-section --json | jq

Result:

``` { "author": "Jonas Bernoulli ", "doTangle": true, "ename": "magit-section", "files": { ".gitignore": ".gitignore", "docs/magit-section.texi": "magit-section.texi", "lisp": "lisp", "lisp/magit-base.el": "magit-base.el", "lisp/magit-section.el": "magit-section.el", "lisp/magit-sparse-checkout.el": "magit-sparse-checkout.el" }, "headers": { "Author": "Jonas Bernoulli ", "Homepage": "https://github.com/magit/magit", "Keywords": [ "tools" ], "Maintainer": "Jonas Bernoulli ", "Package-Requires": [ "(", "(emacs \"25.1\")", "(compat \"29.1.4.4\")", "(dash \"2.19.1\")", "(seq \"2.24\"))" ], "Package-Version": "3.3.0.50-git", "SPDX-License-Identifier": "GPL-3.0-or-later", "summary": "Sections for read-only buffers" }, "inventory": { "auto-sync-only": true, "core-src": "/nix/store/ykv46izbd15l0m7yk181786kx1fmj0ac-source", "entry": { "doc": "docs/magit-section.texi", "ignored-files": [ "LICENSE", ".github", ".mailmap", "docs", "Makefile", "default.mk", "lisp/Makefile", "lisp/*-pkg.el", "test", "README.md", "RelNotes.org", "lisp/git-commit.el", "lisp/git-rebase.el", "lisp/magit-apply.el", "lisp/magit-autoloads.el", "lisp/magit-autorevert.el", "lisp/magit-bisect.el", "lisp/magit-blame.el", "lisp/magit-bookmark.el", "lisp/magit-branch.el", "lisp/magit-bundle.el", "lisp/magit-clone.el", "lisp/magit-commit.el", "lisp/magit-core.el", "lisp/magit-diff.el", "lisp/magit-ediff.el", "lisp/magit.el", "lisp/magit-extras.el", "lisp/magit-fetch.el", "lisp/magit-files.el", "lisp/magit-git.el", "lisp/magit-gitignore.el", "lisp/magit-imenu.el", "lisp/magit-libgit.el", "lisp/magit-log.el", "lisp/magit-margin.el", "lisp/magit-merge.el", "lisp/magit-mode.el", "lisp/magit-notes.el", "lisp/magit-obsolete.el", "lisp/magit-patch.el", "lisp/magit-process.el", "lisp/magit-pull.el", "lisp/magit-push.el", "lisp/magit-reflog.el", "lisp/magit-refs.el", "lisp/magit-remote.el", "lisp/magit-repos.el", "lisp/magit-reset.el", "lisp/magit-sequence.el", "lisp/magit-stash.el", "lisp/magit-status.el", "lisp/magit-submodule.el", "lisp/magit-subtree.el", "lisp/magit-tag.el", "lisp/magit-transient.el", "lisp/magit-utils.el", "lisp/magit-wip.el", "lisp/magit-worktree.el" ], "lisp-dir": "lisp", "renames": [ [ "docs/", "" ] ], "url": "https://github.com/magit/magit" }, "path": "/nix/store/fcyfj4vi8iksa5xi528igqykqpscfrc3-source/elpa-packages", "type": "elpa" }, "lispFiles": [ "lisp/magit-base.el", "lisp/magit-section.el", "lisp/magit-sparse-checkout.el" ], "mainFile": "lisp/magit-section.el", "meta": { "description": "Sections for read-only buffers", "license": { "deprecated": false, "free": true, "fullName": "GNU General Public License v3.0 or later", "redistributable": true, "shortName": "gpl3Plus", "spdxId": "GPL-3.0-or-later", "url": "https://spdx.org/licenses/GPL-3.0-or-later.html" }, "maintainers": [ "Jonas Bernoulli " ] }, "origin": { "owner": "magit", "repo": "magit", "type": "github" }, "packageRequires": { "compat": "29.1.4.4", "dash": "2.19.1", "emacs": "25.1", "seq": "2.24" }, "preBuild": "", "renames": { "docs/": "" }, "sourceInfo": { "lastModified": 1704784205, "lastModifiedDate": "20240109071005", "narHash": "sha256-qiQQ1nKm+f1Hx9cipHSmxP6ED2SntnWx/qm1erUS1t4=", "rev": "c3b7fd7dc43dd87468a86aef3d59576ad79fbc16", "shortRev": "c3b7fd7" }, "src": "/nix/store/bkkz28wc6ppz7dpwzxkzg9pwxxrg3xff-source", "version": "3.3.0.50-git" } ```

Also, I'm on travel, so I can't look into the details until Saturday.

No worries, enjoy your trip.

akirak commented 5 months ago

It must be a bug with how twist handles :renames in elpa-packages. I'll fix that later, but you can build magit-section right now using the melpa recipe instead of elpa. Actually, twist has a better support for melpa than elpa, so melpa should take precedence in registries.

brsvh commented 5 months ago

I get it, thx :heart: