Skip to content

fix: run share provider scripts via bash, fixes Windows ddev share - #8157

Merged
stasadev merged 2 commits into
mainfrom
20260218_rfay_windows_share
Feb 19, 2026
Merged

stasadev merged 2 commits into
mainfrom
20260218_rfay_windows_share

Conversation

@rfay

@rfay rfay commented Feb 19, 2026 •

Copy link
Copy Markdown
Member

The Issue

Related: #8156

I was testing that and found that ddev share did not work at all on WIndows.

On Windows, ddev share fails with:

Failed to find share provider 'ngrok': share provider 'ngrok' is not executable (chmod +x C:\Users\..\.ddev\share-providers\ngrok.sh)

Even though the .sh files have execute bits set (visible via ls -l), Go's os.Stat() on Windows/NTFS does not report Unix-style execute bits, so the check always fails. And even if the check passed, .sh files cannot be executed directly on Windows — they require bash.

How This PR Solves The Issue

  • Removes the executable bit check from GetShareProviderScript entirely — it is unnecessary when scripts are always run via bash
  • Changes ddev share to always invoke the provider script via bash (using the existing util.FindBashPath(), which finds Git Bash on Windows and returns "bash" on Linux/macOS), mirroring the same pattern used for custom host commands
  • This changes the behavior for all share providers on all OS, but it seems more sensible anyway.

Manual Testing Instructions

On Windows (Git Bash):

  1. Build with make (or on another platform, make windows_amd64 or make windows_arm64 or use from the PR's artifacts
  2. Run ddev share in a running project — should no longer fail with the "not executable" error

On Linux/macOS:

  1. Run ddev share — should work as before

Automated Testing Overview

  • We currently don't test ddev share on Windows, it's skipped explicitly.

Release/Deployment Notes

No breaking changes. The provider scripts are unchanged. Users with custom share providers in .ddev/share-providers/ are unaffected — they will now be run via bash rather than directly, which is what they already require.

On Windows, Go's os.Stat() does not report Unix execute bits for files
on NTFS, so the executable check always failed for .sh provider scripts.
Running the scripts via bash (using util.FindBashPath()) fixes Windows
and is more explicit on all platforms, removing the need for the
executable bit check entirely.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@rfay
rfay requested a review from a team as a code owner February 19, 2026 00:05
@github-actions

github-actions Bot commented Feb 19, 2026 •

Copy link
Copy Markdown

@stasadev stasadev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, I tested it in a Windows VM.

@stasadev
stasadev merged commit 68c413c into main Feb 19, 2026
30 checks passed
@stasadev
stasadev deleted the 20260218_rfay_windows_share branch February 19, 2026 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants