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

Can't install nu-git-manager #108

Open
mrxiaozhuox opened this issue Nov 21, 2024 · 3 comments
Open

Can't install nu-git-manager #108

mrxiaozhuox opened this issue Nov 21, 2024 · 3 comments

Comments

@mrxiaozhuox
Copy link

Description

image

Steps to reproduce

> use nupm
> nupm install nu-git-manager

Version

{
  "version": "0.100.0",
  "major": 0,
  "minor": 100,
  "patch": 0,
  "branch": "",
  "commit_hash": "",
  "build_os": "macos-aarch64",
  "build_target": "aarch64-apple-darwin",
  "rust_version": "rustc 1.82.0 (f6e511eec 2024-10-15) (Homebrew)",
  "cargo_version": "cargo 1.82.0",
  "build_time": "2024-11-13 03:28:47 +00:00",
  "build_rust_channel": "release",
  "allocator": "mimalloc",
  "features": "default, sqlite, trash",
  "installed_plugins": "formats 0.100.0, gstat 0.100.0, inc 0.100.0, query 0.100.0, sled 0.1.0"
}
@a-stevan
Copy link

i can repro with the following install as well

version 0.99.1
major 0
minor 99
patch 1
branch
commit_hash
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.79.0 (129f3b996 2024-06-10)
rust_channel 1.79-x86_64-unknown-linux-gnu
cargo_version cargo 1.79.0 (ffa9cf99a 2024-06-03)
build_time 2024-10-21 09:40:37 +02:00
build_rust_channel release
allocator mimalloc
features default, sqlite, trash
installed_plugins clipboard 0.98.0, explore 0.99.1

@a-stevan
Copy link

i have applied the following "debug" patch to the main branch

diff --git a/nupm/install.nu b/nupm/install.nu
index 29c7197..effed60 100644
--- a/nupm/install.nu
+++ b/nupm/install.nu
@@ -48,6 +48,8 @@ def install-path [
 
     let package = open-package-file $pkg_dir
 
+    print "ok"
+
     log info $"installing package ($package.name)"
 
     match $package.type {
@@ -188,6 +190,7 @@ def fetch-package [
     --registry: string  # Which registry to use
     --version: string  # Package version to install (string or null)
 ]: nothing -> path {
+    print "fetch"
     let regs = search-package $package --registry $registry --exact-match
 
     if ($regs | is-empty) {
@@ -197,6 +200,8 @@ def fetch-package [
         throw-error $'Multiple registries contain package ($package)'
     }
 
+    print "ok regs"
+
     # Now, only one registry contains the package
     let reg = $regs | first
     let pkgs = $reg.pkgs | filter-by-version $version
@@ -210,6 +215,7 @@ def fetch-package [
     print $pkg
 
     if $pkg.type == 'git' {
+        print "download"
         download-pkg $pkg
     } else {
         # local package path is relative to the registry file (absolute paths
@@ -250,5 +256,6 @@ export def main [
         $package
     }
 
+    print "install"
     install-path $pkg --force=$force
 }
diff --git a/nupm/utils/package.nu b/nupm/utils/package.nu
index 8586184..01f7451 100644
--- a/nupm/utils/package.nu
+++ b/nupm/utils/package.nu
@@ -1,19 +1,25 @@
 # Open nupm.nuon
 export def open-package-file [dir: path] {
+    print "open package file"
     if not ($dir | path exists) {
         throw-error "package_dir_does_not_exist" (
             $"Package directory ($dir) does not exist"
         )
     }
+    print "dir exists"
 
     let package_file = $dir | path join "nupm.nuon"
 
+    print $package_file
+
     if not ($package_file | path exists) {
         throw-error "package_file_not_found" (
             $'Could not find "nupm.nuon" in ($dir) or any parent directory.'
         )
     }
 
+    print "package file exists"
+
     let package = open $package_file
 
     log debug "checking package file for missing required keys"

and i see the following when running locally

use ./nupm/
nupm install nu-git-manager
fetch
ok regs
───────┬───────────────────
name   │nu-git-manager
version│0.7.0
path   │pkgs/nu-git-manager
type   │git
info   │{record 2 fields}
───────┴───────────────────
download
Package nu-git-manager found in cache
install
open package file
dir exists
/home/disc/a.stevan/.cache/nupm/git/nu-git-manager-md5-af10de7daf48f81db731538797de28b6-0.7.0/pkgs/nupm.nuon
Error:   × package_file_not_found
  │ Could not find "nupm.nuon" in /home/disc/a.stevan/.cache/nupm/git/nu-git-manager-md5-af10de7daf48f81db731538797de28b6-0.7.0/pkgs or any parent directory.

so my guess is that Nupm simply does not handle repos with multiple packages even though the path of the packages are specified as reported by nupm search 🤔

@a-stevan
Copy link

@kubouch
also tagging you on this one in case you find time before i do 😉

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