When installing rustup with Git Bash the persist directories are not in the correct place
Bug Report
Package Name: rustup
Current Behaviour
When you run scoop install rustup using cygwin the .cargo and .rustup directories end up under ~/scoop/apps/rustup/current/.
Expected Behaviour
Persisted directories should be under ~/scoop/persist/.
Additional context/output
I'm using Bash that comes installed with Git (GNU bash, version 4.4.23(1)-release (x86_64-pc-msys)).
System details
Windows version: 10.0.22000.778 (Windows 11)
OS architecture: 64bit
PowerShell version: N/A
Scoop Configuration
{
"lastupdate": "2022-06-29T19:48:15.7782399-03:00",
"SCOOP_REPO": "https://github.com/lukesampson/scoop",
"SCOOP_BRANCH": "master"
}
Some notes here:
- Git Bash is not Cygwin. Git Bash is based on MSYS2, which is a fork of Cygwin but has diverged quite a bit from Cygwin.
- The shell where Scoop commands are used does not matter. Scoop uses pwsh.exe or powershell.exe, irrespective of where you run the commands from.
- The observed behavior is correct. The
.cargoand.rustupdirectories in~/scoop/apps/rustup/current/are hard links, which point to their real locations in~/scoop/persist/rustup/
The directories under ~/scoop/persist/ are empty. They are not hard links when installed with git bash. Scoop is broken with git bash.
As the issue was already closed, can I assume git bash is not a supported environment for Scoop?
The environment used does not matter for Scoop. Can you try installing both from Git bash and PowerShell and then compare?
I did. The behavior is different. This is why I opened this issue. It works as expected in PowerShell, and it breaks in Git Bash.
Just tried scoop install rustup from Git Bash on a fresh Windows 10 install (with new PowerShell installed), and it works as expected.
Have you installed the new PowerShell or are you using Windows PowerShell (the built in one)?
What is the output of gci env: in PowerShell?
I have both Windows PowerShell and PowerShell Core installed.
Here is a slightly redacted output of "gci env:"
ALLUSERSPROFILE C:\ProgramData
APPDATA C:\Users\myuser\AppData\Roaming
BAT_PAGER less -RF
CARGO_HOME C:\Users\myuser\scoop\persist\rustup\.cargo
ChocolateyBinRoot c:\tools\
ChocolateyInstall C:\ProgramData\chocolatey
ChocolateyLastPathUpdate 132979656993500515
ChocolateyToolsLocation C:\tools
ChocolateyToolsRoot c:\tools\
CLINK_DIR C:\Program Files (x86)\clink
CommonProgramFiles C:\Program Files\Common Files
CommonProgramFiles(x86) C:\Program Files (x86)\Common Files
CommonProgramW6432 C:\Program Files\Common Files
COMPUTERNAME ComputarName
ComSpec C:\WINDOWS\system32\cmd.exe
DOCKER_BUILDKIT 1
DOTNET_SUGGEST_SCRIPT_VERSION 1.0.2
DriverData C:\Windows\System32\Drivers\DriverData
FPS_BROWSER_APP_PROFILE_STRING Internet Explorer
FPS_BROWSER_USER_PROFILE_STRI… Default
GIT_EDITOR 'C:\Users\myuser\scoop\shims\vim.exe'
GOROOT C:\Users\myuser\scoop\apps\go\current
HOME C:\Users\myuser
HOMEDRIVE C:
HOMEPATH \Users\myuser
JAVA_HOME C:\Program Files\OpenJDK\jdk-18.0.1.1
KUBECONFIG C:\Users\myuser\.kube\config;
LOCALAPPDATA C:\Users\myuser\AppData\Local
LOGONSERVER \\LOGONSERVER
LUA_CPATH C:\Users\myuser\scoop\apps\lua\current
LUA_PATH C:\Users\myuser\scoop\apps\lua\current
NUMBER_OF_PROCESSORS 8
NVM_HOME C:\Users\myuser\AppData\Roaming\nvm
NVM_SYMLINK C:\Program Files\nodejs
OneDrive C:\Users\myuser\OneDrive - Company
OneDriveCommercial C:\Users\myuser\OneDrive - Company
OneDriveConsumer C:\Users\myuser\OneDrive
OS Windows_NT
Path C:\Program Files\PowerShell\7;C:\Windows\System32;C:\Windows;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Prog…
PATHEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL
POWERSHELL_DISTRIBUTION_CHANN… MSI:Windows 10 Pro
PROCESSOR_ARCHITECTURE AMD64
PROCESSOR_IDENTIFIER Intel64 Family 6 Model 140 Stepping 1, GenuineIntel
PROCESSOR_LEVEL 6
PROCESSOR_REVISION 8c01
ProgramData C:\ProgramData
ProgramFiles C:\Program Files
ProgramFiles(x86) C:\Program Files (x86)
ProgramW6432 C:\Program Files
PSAdditionalModulePath C:\p\poshfiles\AdditionalModules
PSModulePath C:\p\poshfiles\Modules;C:\Users\myuser\OneDrive\Documents\PowerShell\Modules;C:\Program Files\PowerShell\Modules;c:\program…
PUBLIC C:\Users\Public
RUSTUP_HOME C:\Users\myuser\scoop\persist\rustup\.rustup
STARSHIP_CONFIG C:\p\poshfiles\starship.toml
STARSHIP_SESSION_KEY foo
STARSHIP_SHELL pwsh
SystemDrive C:
SystemRoot C:\WINDOWS
TEMP C:\Users\myuser\AppData\Local\Temp
TMP C:\Users\myuser\AppData\Local\Temp
USERDNSDOMAIN DOMAIN.COM.BR
USERDOMAIN DOMAIN
USERDOMAIN_ROAMINGPROFILE DOMAIN
USERNAME myuser
USERPROFILE C:\Users\myuser
VIRTUAL_ENV_DISABLE_PROMPT 1
VISUAL vim
windir C:\WINDOWS
WSLENV WT_SESSION::WT_PROFILE_ID
WT_PROFILE_ID REDACTED
WT_SESSION REDACTED
ZES_ENABLE_SYSMAN 1
The environment seems fine to me.
Do you have any antivirus or scanning apps? It seems like Git Bash parent process is being prevented from creating hard links.
Yes, but I am able to create symlinks with git bash. I can run a command to test it out, if you'd like.
I just learned that to create native symlinks with msys/git bash, I need to export MSYS=winsymlinks:nativestrict. But I'm not sure this applies to Scoop, as it uses pwsh, right?
Yes, but I am able to create symlinks with git bash. I can run a command to test it out, if you'd like.
I just learned that to create native symlinks with msys/git bash, I need to
export MSYS=winsymlinks:nativestrict.
This is true for symlinks. But Scoop does not create/use symlinks. Scoop creates hard links and junctions. You'd need to test that.
@giggio any updates on this?
Closing as stale