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

makepkg-mingw doesn't work over SSH #5020

Open
1 task done
maleadt opened this issue Nov 23, 2024 · 0 comments
Open
1 task done

makepkg-mingw doesn't work over SSH #5020

maleadt opened this issue Nov 23, 2024 · 0 comments
Labels

Comments

@maleadt
Copy link

maleadt commented Nov 23, 2024

Description / Steps to reproduce the issue

I'm starting an MSYS environment after logging in over SSH as per https://www.msys2.org/wiki/Setting-up-SSHd/, using a simple script:

@ECHO off
@C:\msys64\msys2_shell.cmd -defterm -here -no-start -msys2 -shell zsh

Within this environment, makepkg works as expected, but makepkg-mingw doesn't: It simply starts a Bash shell, without actually calling makepkg:

Administrator in 🌐 taurus in MINGW-packages\mingw-w64-ocl-icd on  ocl-icd
❯ bash -x /usr/bin/makepkg-mingw
+ set -e
+ /usr/bin/tput setaf 0
++ /usr/bin/tput sgr0
+ ALL_OFF=''
++ /usr/bin/tput bold
+ BOLD=''
++ /usr/bin/tput setaf 4
+ BLUE=''
++ /usr/bin/tput setaf 2
+ GREEN=''
++ /usr/bin/tput setaf 1
+ RED=''
++ /usr/bin/tput setaf 3
+ YELLOW=''
+ readonly ALL_OFF BOLD BLUE GREEN RED YELLOW
+ [[ -z '' ]]
+ [[ -n '' ]]
+ MINGW_ARCH_ALLOWED=('mingw32' 'mingw64' 'clang32' 'clang64' 'clangarm64' 'ucrt64')
+ MINGW_ARCH=
+ [[ -z '' ]]
+ [[  mingw32 mingw64 clang32 clang64 clangarm64 ucrt64  = *\ \m\s\y\s\ * ]]
+ print_warning 'MINGW_ARCH not set and not called from a MINGW environment, defaulting to mingw64. This will fail in the future!'
+ local 'mesg=MINGW_ARCH not set and not called from a MINGW environment, defaulting to mingw64. This will fail in the future!'
+ shift
+ printf '=> WARNING: MINGW_ARCH not set and not called from a MINGW environment, defaulting to mingw64. This will fail in the future!\n'
=> WARNING: MINGW_ARCH not set and not called from a MINGW environment, defaulting to mingw64. This will fail in the future!
+ MINGW_ARCH=mingw64
+ print_msg1 'MINGW_ARCH: mingw64'
+ local 'mesg=MINGW_ARCH: mingw64'
+ shift
+ printf '==>  MINGW_ARCH: mingw64\n'
==>  MINGW_ARCH: mingw64
+ for _mingw in ${MINGW_ARCH}
+ print_msg2 'Building mingw64...'
+ local 'mesg=Building mingw64...'
+ shift
+ printf '  -> Building mingw64...\n'
  -> Building mingw64...
+ MSYSTEM=MINGW64
+ CHERE_INVOKING=1
+ bash -leo pipefail -c '/usr/bin/makepkg --config /etc/makepkg_mingw.conf "$@"' bash

Administrator in 🌐 taurus in MINGW-packages\mingw-w64-ocl-icd on  ocl-icd
❯ # this is a new shell

Expected behavior

If I use the MSYS2 shell on the actual system, i.e., launching c:/msys64/msys2.exe in the graphical UI, the script works as intended:

❯ cat /tmp/test.log
+ set -e
+ /usr/bin/tput setaf 0
++ /usr/bin/tput sgr0
+ ALL_OFF=''
++ /usr/bin/tput bold
+ BOLD=''
++ /usr/bin/tput setaf 4
+ BLUE=''
++ /usr/bin/tput setaf 2
+ GREEN=''
++ /usr/bin/tput setaf 1
+ RED=''
++ /usr/bin/tput setaf 3
+ YELLOW=''
+ readonly ALL_OFF BOLD BLUE GREEN RED YELLOW
+ [[ -z '' ]]
+ [[ -n '' ]]
+ MINGW_ARCH_ALLOWED=('mingw32' 'mingw64' 'clang32' 'clang64' 'clangarm64' 'ucrt64')
+ MINGW_ARCH=
+ [[ -z '' ]]
+ [[  mingw32 mingw64 clang32 clang64 clangarm64 ucrt64  = *\ \m\s\y\s\ * ]]
+ print_warning 'MINGW_ARCH not set and not called from a MINGW environment, defaulting to mingw64. This will fail in the future!'
+ local 'mesg=MINGW_ARCH not set and not called from a MINGW environment, defaulting to mingw64. This will fail in the future!'
+ shift
+ printf '=> WARNING: MINGW_ARCH not set and not called from a MINGW environment, defaulting to mingw64. This will fail in the future!\n'
=> WARNING: MINGW_ARCH not set and not called from a MINGW environment, defaulting to mingw64. This will fail in the future!
+ MINGW_ARCH=mingw64
+ print_msg1 'MINGW_ARCH: mingw64'
+ local 'mesg=MINGW_ARCH: mingw64'
+ shift
+ printf '==>  MINGW_ARCH: mingw64\n'
==>  MINGW_ARCH: mingw64
+ for _mingw in ${MINGW_ARCH}
+ print_msg2 'Building mingw64...'
+ local 'mesg=Building mingw64...'
+ shift
+ printf '  -> Building mingw64...\n'
  -> Building mingw64...
+ MSYSTEM=MINGW64
+ CHERE_INVOKING=1
+ bash -leo pipefail -c '/usr/bin/makepkg --config /etc/makepkg_mingw.conf "$@"' bash
==> ERROR: A package has already been built. (use -f to overwrite)

Actual behavior

I get an interactive shell, makepkg doesn't execute.

The environment is correctly set-up though, so I can actually call makepkg in that interactive shell, but that doesn't seem like the way the script should behave.

Verification

Windows Version

MINGW64_NT-10.0-22631

Are you willing to submit a PR?

Sure, if I know what the issue is.

@maleadt maleadt added the bug label Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant