Southclaws / sampctl

The Swiss Army Knife of SA:MP - vital tools for any server owner or library maintainer.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

failed to ensure dependency from cache: exec

NebulaGB opened this issue · comments

WARN: failed to ensure package github.com/pawn-lang/samp-stdlib: failed to ensure dependency from cache: exec: "C:\\Users\\Pavel\\scoop\\apps\\git\\2.40.0.windows.1\\mingw64\\libexec\\git-core\\git-upload-pack": file does not exist

WARN: failed to ensure package github.com/pawn-lang/samp-stdlib after 2 attempts, skipping

WARN: failed to ensure package github.com/pawn-lang/pawn-stdlib: failed to ensure dependency from cache: exec: "C:\\Users\\Pavel\\scoop\\apps\\git\\2.40.0.windows.1\\mingw64\\libexec\\git-core\\git-upload-pack": file does not exist

I've checked in users/x/.samp but that folder is not generating and when I create it manually the folder is deleted after running sampctl ensure

I've also checked into directory " 2.40.0.windows.1\mingw64\libexec\git-core " and the " git-upload-pack " is also not generating any thoughts on fixes?

The latest version of sampctl moved the cache folder from C:\Users\<User>\.samp to %appdata%\sampctl.

You need to have git installed and it needs to be in your environment path so that it can be picked up. We use git-go which is a go implementation of git, however there is one very specific part of the library that relies on git being installed which is the git-upload-pack, so yes git still has to be installed for that.

My mistake with the cache folder location.

image

As for the git issue I do have git installed, I have installed both via scoop and https://gitforwindows.org/ but the git-upload-pack continues to remains an issue.

image

Unfortunately that error has been a very common issue people using git seem to have experienced and is not related to sampctl. I would recommend not using it via mingw and instead use the terminal built into windows (or cmd) and try that to see if that works. I haven't tested sampctl running under mingw so no idea what stuff it does for emulation.

I did this on PowerShell.

PS C:\Users\Pavel\Documents\SAMP\workpls> sampctl init

Found 0 pwn files and 0 inc files.
? Preferred package format json
? Your Name - If you plan to release, must be your GitHub username. NebulaGB
? Package Name - If you plan to release, must be the GitHub project name. workpls
? Package Type - Are you writing a gamemode or a reusable library? gamemode
? Add a .gitignore and .gitattributes files? Yes
? Add a README.md file? Yes
? Select your text editor vscode
? Add standard library dependency? Yes
? Scan for dependencies? Yes
? No .pwn or .inc files - enter name for new script gamemode.pwn
WARN: failed to ensure package github.com/pawn-lang/samp-stdlib: failed to ensure dependency from cache: exec: "C:\\Users\\Pavel\\scoop\\apps\\git\\2.40.0.windows.1\\mingw64\\libexec\\git-core\\git-upload-pack": file does not exist                                                                                                                                     \\git-core\\git
WARN: failed to ensure package github.com/pawn-lang/samp-stdlib: failed to ensure dependency from cache: exec: "C:\\Users\\Pavel\\scoop\\apps\\git\\2.40.0.windows.1\\mingw64\\libexec\\git-core\\git-upload-pack": file does not exist                                                                                                                                     \\git-core\\git
WARN: failed to ensure package github.com/pawn-lang/samp-stdlib after 2 attempts, skipping
WARN: failed to ensure package github.com/pawn-lang/pawn-stdlib: failed to ensure dependency from cache: exec: "C:\\Users\\Pavel\\scoop\\apps\\git\\2.40.0.windows.1\\mingw64\\libexec\\git-core\\git-upload-pack": file does not exist                                                                                                                                     \\git-core\\git
WARN: failed to ensure package github.com/pawn-lang/pawn-stdlib: failed to ensure dependency from cache: exec: "C:\\Users\\Pavel\\scoop\\apps\\git\\2.40.0.windows.1\\mingw64\\libexecWARN: failed to ensure package github.com/pawn-lang/pawn-stdlib after 2 attempts, skipping                                                                                            \\git-core\\git

after uninstalling everything git related.
PS C:\Users\Pavel\Documents\SAMP\workpls> git

git : The term 'git' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that    
the path is correct and try again.
At line:1 char:1
+ git
+ ~~~
    + CategoryInfo          : ObjectNotFound: (git:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS C:\Users\Pavel\Documents\SAMP\workpls> scoop install git

Scoop uses Git to update itself. Run 'scoop install git' and try again.
Installing 'git' (2.40.0.windows.1) [64bit] from main bucket
PortableGit-2.40.0-64-bit.7z.exe (46.8 MB) [================================================================================================================================] 100%
Checking hash of PortableGit-2.40.0-64-bit.7z.exe ... ok.
Extracting dl.7z ... done.
Linking ~\scoop\apps\git\current => ~\scoop\apps\git\2.40.0.windows.1
Creating shim for 'sh'.
Creating shim for 'bash'.
Creating shim for 'git'.
Creating shim for 'gitk'.
Creating shim for 'git-gui'.
Creating shim for 'scalar'.
Creating shim for 'tig'.
Creating shim for 'git-bash'.
Creating shortcut for Git GUI (git-gui.exe)
Running post_install script...
'git' (2.40.0.windows.1) was installed successfully!
Notes
-----
Set Git Credential Manager Core by running: "git config --global credential.helper manager"

To add context menu entries, run 'C:\Users\Pavel\scoop\apps\git\current\install-context.reg'

To create file-associations for .git* and .sh files, run 'C:\Users\Pavel\scoop\apps\git\current\install-file-associations.reg'

PS C:\Users\Pavel\Documents\SAMP\workpls> git

usage: git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           [--config-env=<name>=<envvar>] <command> [<args>]

These are common Git commands used in various situations:

start a working area (see also: git help tutorial)
   clone     Clone a repository into a new directory
   init      Create an empty Git repository or reinitialize an existing one

work on the current change (see also: git help everyday)
   add       Add file contents to the index
   mv        Move or rename a file, a directory, or a symlink
   restore   Restore working tree files
   rm        Remove files from the working tree and from the index

examine the history and state (see also: git help revisions)
   bisect    Use binary search to find the commit that introduced a bug
   diff      Show changes between commits, commit and working tree, etc
   grep      Print lines matching a pattern
   log       Show commit logs
   show      Show various types of objects
   status    Show the working tree status

grow, mark and tweak your common history
   branch    List, create, or delete branches
   commit    Record changes to the repository
   merge     Join two or more development histories together
   rebase    Reapply commits on top of another base tip
   reset     Reset current HEAD to the specified state
   switch    Switch branches

collaborate (see also: git help workflows)
   fetch     Download objects and refs from another repository
   pull      Fetch from and integrate with another repository or a local branch
   push      Update remote refs along with associated objects

'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.
See 'git help git' for an overview of the system.

PS C:\Users\Pavel\Documents\SAMP\workpls> sampctl ensure

INFO: Package does not have any tags, consider versioning your code with: `sampctl package release`
WARN: failed to ensure package github.com/pawn-lang/samp-stdlib: failed to ensure dependency from cache: exec: "C:\\Users\\Pavel\\scoop\\apps\\git\\2.40.0.windows.1\\mingw64\\libexec\\git-core\\git-upload-pack": file does not exist
WARN: failed to ensure package github.com/pawn-lang/samp-stdlib: failed to ensure dependency from cache: exec: "C:\\Users\\Pavel\\scoop\\apps\\git\\2.40.0.windows.1\\mingw64\\libexec\\git-core\\git-upload-pack": file does not exist
WARN: failed to ensure package github.com/pawn-lang/samp-stdlib after 2 attempts, skipping
WARN: failed to ensure package github.com/pawn-lang/pawn-stdlib: failed to ensure dependency from cache: exec: "C:\\Users\\Pavel\\scoop\\apps\\git\\2.40.0.windows.1\\mingw64\\libexec\\git-core\\git-upload-pack": file does not exist
WARN: failed to ensure package github.com/pawn-lang/pawn-stdlib: failed to ensure dependency from cache: exec: "C:\\Users\\Pavel\\scoop\\apps\\git\\2.40.0.windows.1\\mingw64\\libexec\\git-core\\git-upload-pack": file does not exist
WARN: failed to ensure package github.com/pawn-lang/pawn-stdlib after 2 attempts, skipping
INFO: ensured dependencies for package
PS C:\Users\Pavel\Documents\SAMP\workpls> 

I've not seen many posts about this, I think one or two on github and only a handful on the samp discord but for the few that have had answers its been just " re-install " but I have tried several times and still have the same end result.

I could use VS extension and manually set the compiler but sampctl is my preference as it's just easier to manage everything if you don't know what's causing this issue then it's no big deal I'm sure it will be fixed / solution found at some point so I will just have to be patient but thank you for answering :)

I don't get this issue, and I have git installed via scoop too. Did you make sure to delete the sampctl folder from the %appdata% directory?

Yes I deleted both directories and re-installed sampctl to just to make sure, I've just had a browse of your closed tickets and noticed the last one, installing an earlier version of git seems to have fixed the issue

scoop install git@2.26.2.windows.1

PS C:\Users\Pavel\Documents\SAMP\workpls> sampctl ensure
INFO: Package does not have any tags, consider versioning your code with: `sampctl package release`
INFO: NebulaGB/workpls successfully ensured dependency files for github.com/pawn-lang/samp-stdlib
INFO: NebulaGB/workpls successfully ensured dependency files for github.com/pawn-lang/pawn-stdlib

I wonder if git changed how the git-upload-pack works then. Well if that works then we have a workaround and I hope that go-git supports the new changes so I can make them available in the newer versions of sampctl

Fingers crossed, thank you 👍