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

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

Open
brsvh opened this issue Jan 11, 2024 · 4 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@brsvh
Copy link

brsvh commented Jan 11, 2024

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

akirak commented Jan 11, 2024

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

brsvh commented Jan 11, 2024

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

Result:

{
  "author": "Jonas Bernoulli <[email protected]>",
  "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 <[email protected]>",
    "Homepage": "https://github.com/magit/magit",
    "Keywords": [
      "tools"
    ],
    "Maintainer": "Jonas Bernoulli <[email protected]>",
    "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 <[email protected]>"
    ]
  },
  "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
Copy link
Member

akirak commented Jan 11, 2024

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

brsvh commented Jan 11, 2024

I get it, thx ❤️

@akirak akirak changed the title renamePhase execute failed when build magit-section Fix handling of :renames from elpa-packages when the destination is empty Jan 13, 2024
@akirak akirak self-assigned this Jan 13, 2024
@akirak akirak added the bug Something isn't working label Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants