-
Notifications
You must be signed in to change notification settings - Fork 82
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
segfault caused by os.execvpe in windows #84
Comments
Hello @matthewdeanmartin, I, too, utilize LocalStack on the Windows OS. I do not use gitbash and pipx, but in a normal powershell terminal or cmd terminal all works as expected. Could you clarify why installing Python is discouraged? The AWS CLI tool is also offered as a Python pip package, and awslocal serves as a thin wrapper around it. I recommend upgrading your WSL version to the latest version and using the endpoint URL http://localhost.localstack.cloud:4566 to potentially enhance connection speed. Alternatively, you could use AWS CLI version 2 and configure a profile in your ~/.aws/credentials and ~/.aws/config files. I hope this helps with your setup. |
Well I'm glad to hear it works on your machine. I see you all have a merge request to add github Actions to test on other operating systems & shells, you might want to merge that and include windows in the build matrix, who knows, you might see a break since os.execvpe isn't expected to behave the same on windows as linux: ref: https://stackoverflow.com/questions/67371606/how-to-replace-os-execvpe-on-windows-efficiently-if-the-child-process-is
I mean people shouldn't be installing all sorts of things into your system python, the python that exists before the first venv is created. I have dozens of cli commands installed on my machine, if they all install to the same site-packages, then each succeeding app will uninstall the preferred versions of the previous. This is why virtual environments exist. Pipx exists to keep cli tools out of the current venv and in their own isolated venv & also out of the system python. |
@matthewdeanmartin We actually do have a few windows machine, and haven't seen this report before, which makes it hard for us to act on it. |
I'm using windows 11 and os.execvpe will cause a segfault. I happen to be using gitbash and pipx, but I get the same behavior if I don't use pipx.
After a bit of hacking, I got this to work, but with 2 second additional time cost over using
aws
directly. I see that 9 month ago execvpe was introduced probably to make things better for linux or mac usersI'm guessing you don't have access to a windows machine, you might want to consider a github action on a windows image to check to see if
awslocal --help
can run without segfault.Another possibility is to use something like shellingham to detect the shell before doing things that the OS isn't expected to be able to do.
When I use powershell or cmd, I get "ModuleNotFoundError: No module named 'boto3'", probably because the .bat file gets launched and doesn't actual activate the right environment, but I also got that even when installing to the system python (which is a no-no). I didn't pursue why the entry point scripts fail to get an activated environment, since I never use powershell or cmd.exe.
The text was updated successfully, but these errors were encountered: