kiviktnm / decman

Declarative package & configuration manager for Arch Linux.
GNU General Public License v3.0
66 stars 3 forks source link

This must be run in a directory containing a PKGBUILD #5

Closed tex closed 3 months ago

tex commented 3 months ago

Hello,

I updated my source.py from previous version of decman to newest as is shown in Readme as example and now I am getting this error:

[DECMAN] SUMMARY: The following foreign packages will be installed explicitly:
[DECMAN]     
[DECMAN]     decman-git
[DECMAN]     
[DECMAN] PROMPT (Y/n): Proceed? 
[DECMAN] SUMMARY: Installing foreign package dependencies from pacman.
warning: pacman-6.1.0-3 is up to date -- skipping
warning: python-requests-2.32.3-1 is up to date -- skipping
warning: devtools-1:1.2.1-1 is up to date -- skipping
warning: git-2.45.2-1 is up to date -- skipping
warning: python-3.12.4-1 is up to date -- skipping
warning: systemd-256.4-1 is up to date -- skipping
 there is nothing to do
[DECMAN] INFO: Creating a build environment..
[DECMAN] INFO: Getting all PKGBUILDS.
[DECMAN] PROMPT (Y/n): Review PKGBUILD or show diff for decman-git? 
[DECMAN] PROMPT (Y/n): Build this package? 
[DECMAN] INFO: Creating a new chroot.
[DECMAN] INFO: Building 'decman-git'.
[DECMAN] INFO: Installing build dependencies to chroot.
[DECMAN] INFO: Making package.
==> ERROR: This must be run in a directory containing a PKGBUILD.
[DECMAN] ERROR: Command '['makechrootpkg', '-c', '-r', '/tmp/decman/build/chroot', '-U', 'nobody']' returned non-zero exit status 255.
[DECMAN] ERROR: Failed to build packages.
tex commented 3 months ago

I see, something changed, I had to update git_url="https://github.com/kiviktnm/decman-pkgbuild.git",

But after this change it shows

[DECMAN]     
[DECMAN]     decman-git
[DECMAN]     
[DECMAN] PROMPT (Y/n): Proceed? 
[DECMAN] SUMMARY: Installing foreign package dependencies from pacman.
warning: git-2.45.2-1 is up to date -- skipping
warning: devtools-1:1.2.1-1 is up to date -- skipping
warning: systemd-256.4-1 is up to date -- skipping
warning: python-3.12.4-1 is up to date -- skipping
warning: pacman-6.1.0-3 is up to date -- skipping
warning: python-requests-2.32.3-1 is up to date -- skipping
 there is nothing to do
[DECMAN] INFO: Creating a build environment..
[DECMAN] INFO: Removing previous build directory.
[DECMAN] INFO: Getting all PKGBUILDS.
[DECMAN] PROMPT (Y/n): Review PKGBUILD or show diff for decman-git? 
fatal: bad object 483bf0d6761c9ee991deef2c51bd798f484db126
[DECMAN] ERROR: Output:
[DECMAN]     None
[DECMAN] ERROR: Failed to clone and review PKGBUILD from https://github.com/kiviktnm/decman-pkgbuild.git
tex commented 3 months ago

I build it externally and ignoring it in source.py. Anyway it would be nice to have ability to just point to PKGBUILD file or repository holding it from source.py without replicating all that stuff about dependencies, build dependencies in both places and let it build / manage with it.

kiviktnm commented 3 months ago

I think I know what the issue is. You probably had a different git_url in the beginning, which didn't have a PKGBUILD. However, decman stored the latest commit id of that repository as the latest reviewed version. Now that the git_url has changed, when decman tries to use git diff to show changes, it fails because the commit id doesn't exist in the new repository. The fix is to reset the stored commit id when git_url changes.

I'll implement the fix for this as soon as I can. My current life situation doesn't leave me with a ton of time, so it may take a while.

I'll provide instructions to reset the stored commit id manually tomorrow or during the weekend since I'll have time then.

As for the feature request, to just point to a PKGBUILD file, I'll look into that, since it will improve the user experience.

tex commented 3 months ago

Exactly as you deducted! Thank you, no rush, take your time, life is more important! I am grateful for your tool because it allowed me to leave Guix (because of GNU only approach and lots of old packages, problems with rust, npm, ...) and NixOS (because of NIX DSL which I wasn't able to understand). Arch + Decman is ideal setup for me.

kiviktnm commented 3 months ago

If the issue is the one I suggested, this should be a manual way to resolve it.

You'll have to edit the file /var/lib/decman/store.json. In that file, there is a dictionary pkgbuild_git_commits. Remove the entry "decman-git": "<some hash>".

Before:

{
  <snip>

  "pkgbuild_git_commits": {
    <possibly other entries>
    "decman-git": "10d10e816b474404545905e4cef894775acc2a0f"
  }
}

After:

{
  <snip>

  "pkgbuild_git_commits": {
    <possibly other entries>
  }
}