Main icon indicating copy to clipboard operation
Main copied to clipboard

When installing rustup with Git Bash the persist directories are not in the correct place

Open giggio opened this issue 3 years ago • 10 comments

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"
}

giggio avatar Jun 29 '22 23:06 giggio

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 .cargo and .rustup directories in ~/scoop/apps/rustup/current/ are hard links, which point to their real locations in ~/scoop/persist/rustup/

rashil2000 avatar Jul 01 '22 05:07 rashil2000

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?

giggio avatar Jul 01 '22 13:07 giggio

The environment used does not matter for Scoop. Can you try installing both from Git bash and PowerShell and then compare?

rashil2000 avatar Jul 01 '22 13:07 rashil2000

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.

giggio avatar Jul 01 '22 14:07 giggio

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?

rashil2000 avatar Jul 02 '22 07:07 rashil2000

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

giggio avatar Jul 04 '22 00:07 giggio

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.

rashil2000 avatar Jul 04 '22 18:07 rashil2000

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?

giggio avatar Jul 06 '22 00:07 giggio

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.

rashil2000 avatar Jul 06 '22 04:07 rashil2000

@giggio any updates on this?

rashil2000 avatar Jul 28 '22 09:07 rashil2000

Closing as stale

rashil2000 avatar Sep 05 '22 06:09 rashil2000