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

wolfSSL GitHooks spawn .git/hooks/pre-push: incompatible on Visual Studio Windows WSL #6779

Closed
gojimmypi opened this issue Sep 16, 2023 · 1 comment
Assignees

Comments

@gojimmypi
Copy link
Contributor

gojimmypi commented Sep 16, 2023

Version

latest master

Description

Error message: Failed to push to the remote repository. See the Output window for more details.

This has been an easily-resolved, but repeating annoyance for quite some time. I'll submit a PR with a proposed fix.

In all fairness, it is probably more of a Visual Studio and/or WSL and/or Windows problem.

The error occurs in Visual Studio when pushing updates to a fork of wolfssl. This error is encountered:

image

The output window contents from Show output from: Source control - git:

Pushing ED25519_SHA2_fix
Error: cannot spawn .git/hooks/pre-push: No such file or directory
Error: waitpid for (NULL) failed: No child processes
Error: failed to push some refs to 'https://github.com/gojimmypi/wolfssl.git'
Error encountered while pushing to the remote repository: PushCommand.ExecutePushCommand
Failed to push to the remote repository. See the Output window for more details.

Although not very intuitive, the root cause is failure of Visual Studio to properly process a zero-length pre-commit and pre-push files in .git\hooks directory:

image

The problem is easily resolved by simply deleting the files.

I'm fairly certain at this point the problem is caused by autogen.sh when running on WSL using a shared filesystem with Windows, specifically the symbolic links:

ln -s ../../pre-commit.sh .git/hooks/pre-commit
ln -s ../../pre-push.sh .git/hooks/pre-push

Now, there's probably also a question if the pre-commit and pre-push files should have a Windows & Visual Studio compatible version, or if the symbolic link should simply not occur when detecting WSL shared file system.

  • edit: I have a change in place to detect WSL and properly process the files, however Windows of course does not like the pre-commit.sh and pre-push.sh files. So the PR will contain just a TODO for WSL on a Windows File system to perhaps created a DOS batch file at some point in the future. Otherwise Visual Studio fails to commit with an error like this:

image

As a side note: all git commit operations fail on Linux platforms upon fresh git clone if ./configure has never been run, due to the operations of the above-mentioned hooks. In particular this message from ./commit-tests.sh.

Saving current config
Stashing modified files not part of commit
Running commit tests...
Testing current config...
Makefile:717: *** missing separator.  Stop.
Makefile:717: *** missing separator.  Stop.
Current config make test failed
Popping stashed modified files not part of commit
Restoring current config
Oops, your commit failed

See also:

microsoft/WSL#4868
microsoft/WSL#2144
microsoft/WSL#353

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

No branches or pull requests

1 participant