Skip to content

Change in KTX-Software overlay prevents finding bash when git-for-windows is installed in a non-default path #1656

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

Open
GhisBntly opened this issue Apr 14, 2025 · 0 comments · May be fixed by #1657

Comments

@GhisBntly
Copy link

Symptom is a build error when ezvcpkg tries to install KTX-Software using the overlay port:

*** Content of log file: C:\(...)\.ezvcpkg\2024.11.16\buildtrees\ktx\config-x64-windows-unreal-dbg-err.log:
CMake Error at C:/Dev/CMake/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
  Could NOT find Bash (missing: BASH_EXECUTABLE)

  Hint: The project() command has not yet been called.  It sets up
  system-specific search paths.
Call Stack (most recent call first):
  C:/Dev/CMake/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
  cmake/modules/FindBash.cmake:96 (find_package_handle_standard_args)
  CMakeLists.txt:11 (find_package)

I do have git/bash installed (from gitforwindows.org) but in C:\Dev\Git instead of the default C:\Program Files\Git path. And indeed KTX's FindBash.cmake looks for the bash executable like this:

# First, look if GIT bash is installed
find_program (
    BASH_EXECUTABLE
    bash
PATHS
    # Additional paths for Windows
    "C:\\Program Files\\Git\\bin"
NO_SYSTEM_ENVIRONMENT_PATH
)

if(NOT BASH_EXECUTABLE)
  # Fallback search in default locations
  find_program (
      BASH_EXECUTABLE
      bash
  )
endif()

The first find_program fails because of Git's non-default installation path, the second because the default and recommended option when installing git-for-windows is not to put bash and other executables in the PATH as that would override Windows executables in a Command prompt (only a minimal set of git wrappers from your_install_dir\Git\cmd is added).

I guess this is why the vcpkg port's maintainer chose to fetch msys2's bash in the portfile, which @kring removed in 4c5c548 because the links were broken at the time.

Even though it is ultimately a bug in FindBash.cmake IMO, for more robustness and developer-friendliness I would like to revert the commit (and updating the links), even though I agree it is annoying to have to maintain hardcoded tool versions and SHA's in portfile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant