Virtual-environments: Windows x64 Image broken when attempting to use commands provided by git bash

Created on 13 Jan 2020  路  11Comments  路  Source: actions/virtual-environments

Describe the bug
If an agent is attempting to run a bash script, and that script tries to run 'find', it attempts to run the Windows version of 'find' instead of that bash version of 'find'. This fails since those two commands take very different parameters. It results in the following output:

FIND: Parameter format not correct

I believe this a result of this PR #211

This started happening on Jan 10, 2020 after 5:45p EST

I was able to add a step to add those paths back to the PATH and my pipeline works again.

Git Scripting and command line bug

Most helpful comment

apologies for the delay on this, the fix is in but the rollouts have been delays for multiple unrelated reasons. We're pushing to get the latest updates out there as soon as possible!

All 11 comments

As could be expected, there's already lots of scripts that depend on the unix tools being available from the PATH without running in the git bash shell so #211 is a breaking change (I wasn't really expecting it to get merged without some discussion to be honest especially since I explicitly asked for pointers on how to actually test the changes in the pull request).

The tools really should really never have been added to the PATH when running cmd or powershell in the first place but they were so now we're stuck in a mess where having them in the PATH breaks some workflows (My use case works perfectly since #211 was deployed) but removing them breaks other existing workflows.

If #211 is reverted since it's a breaking change, the documentation should be updated to clearly mention that MinGW won't work by default since it's own libstdc++ will be overriden by the one put in the PATH by the Git installation and manual intervention is required to make sure the correct libstdc++ is found first.

It might also be possible that chocolatey is simply not adding the git tools to the PATH correctly. However, I'm not sure if it's possible to fix that without adding libstdc++ to the PATH again which breaks chocolatey MinGW for everyone else.

so #211 is a breaking change (I wasn't really expecting it to get merged without some discussion to be honest especially since I explicitly asked for pointers on how to actually test the changes in the pull request).

@DaanDeMeyer yeah, that's on me for trying to multi-task and not looking carefully enough. Removing Mingw paths seemed clear enough but I didn't think it through as I should have. Lesson learned :-)

There's currently no simple way to test other than building the machine on your own but that's quite a bit of effort. We're working on adding some CI and checks within the PRs in the coming months.

This also broke our runner builds.

I think the fix is as simple as adding a path to PATH

apologies for the delay on this, the fix is in but the rollouts have been delays for multiple unrelated reasons. We're pushing to get the latest updates out there as soon as possible!

@alepauly Is it necessary to add the directories to the PATH outside of git-bash as well? It seems my pull request has been reverted which will break chocolatey MinGW builds again. Can we solve this by adding the paths only when in git bash or do the tools have to be available outside of git-bash as well?

@DaanDeMeyer I'm guessing you're referring to #304? We kept the other cleanup you added (thanks) but adding the Git folder back addresses the issue of using the proper tools in the proper context. See @al-cheb's comment here: https://github.com/actions/virtual-environments/pull/304#issuecomment-577259228
Do you think that will still break those builds?

My bad, I must have been looking at an old version of the file. #304 seems like the perfect solution that allows both git-bash and MinGW builds to work.

Hello, @jtpetty
Could you check that the issue's been fixed?

@al-cheb - It does appear to have been resolved. Thanks!

Thanks for the helpful report and the information on this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jneira picture jneira  路  44Comments

benoittgt picture benoittgt  路  34Comments

BrightRan picture BrightRan  路  32Comments

kcgen picture kcgen  路  33Comments

kaylangan picture kaylangan  路  56Comments