-
Notifications
You must be signed in to change notification settings - Fork 26
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
Fixes #1631: Moved make shell commands into scripts for Windows #1636
Conversation
afa3448
to
08108bf
Compare
I reviewed the code with no issues. However, trying to test in a windows system that has a make I hit several issues immediatly:
|
Accidently hit the close and comment button and then reopened. This could all be my environment problems since trying just to get gnu make enabled on windows is a task but that is what I found on first tests. |
Hi karl. I have updated this branch by calling external commands from pywbem_os_setup.bat with "call", just in case someone has a curl.bat or curl.cmd. Also, I have added support for installing curl using Chocolatey if "where curl" fails. The "where" command is the built-in "which" of native Windows. Please try again with this branch. Please try this on half-way set up environments as well as on environments that are reasonably fresh (e.g. freshly created virtual python env, run |
7312952
to
c6ca8e5
Compare
Started testing on windows. Testing with existing virtual env first. Note that this make I am using is the old gnumake but that there is also a bash but VERY old in the same directory.
DISCUSSION: How far do we want to go with making the development environment work under window??? What all should be in the develop environment in order to do a make with pure windows? |
lets try: bash invocation in make that shows path. Looks like we are getting the windows bash now and for some reason, the path is not correct. |
c597dfd
to
c46fc2c
Compare
eb155b1
to
ecff41e
Compare
The latest update also bringsthe Installation section of the documentation in sync with the code. |
Please test the installation and the setup of the development environment on Windows. |
ecff41e
to
cf9bae8
Compare
I added retry support for choco installations, by using the "appveyor-retry" command. It retries 3 times (including the original attempt), and has no sleep time between retries. In the Appveyor run for this latest update to the PR we had 3/3 successes without retries. I rebased the "manual-ci-run" on this PR, and the Appveyor run there now has 32 jobs, and I already left out some combinations. In the recent run based on the latest update to this PR, its 32 jobs succeed or failed as follows:
So this got better than without the retries (I saw 5 jobs failing out of the 32, before the last update), but it is not yet safe enough for automatic runs. Of course, if it happens rarely enough, we can rerun the failing jobs (Appveyor offers that button once the whole build is finished). Discussion point: I added a tools/retry.bat script in the latest update that replaces the use of the appveyor-retry command. It has several advantages:
The discussion point is whether we should keep that script around or fall back to using the appveyor-retry command? |
67d477f
to
981fbcf
Compare
06937ba
to
230199d
Compare
In our call today, Karl and I agreed to merge this one ot make progress. We would keep the retry.bat script. |
Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
Details: - Some GNU make versions on native Windows have an issue with double quotes in make $(shell ..) commands; removed the use of double quotes. As a result, most inline python commands have been moved into new small scripts in the tools directory. Also, several make targets that used to produce log files, no longer can do that and the user needs to redirect the make invocation in order to get a log file. - Removed dependencies on most UNIX-like commands (touch, tee, bash, rm, find, xargs) when using make on native Windows. - Encapsulated file removal and copy commands to be compatible between native Windows and other platforms. - Updated the appveyor.yml file to check only the new, smaller, list of commands. - Improved dependencies in makefile - Fixed list of prerequisite commands in makefile - Added list of prereq commands to pywbem_os_setup.sh - Suppressed more builtin rules by adding -p to MAKEFLAGS - Fixed use of too new option for pylint - GNU make uses as a default shell bash or sh when it is in the PATH. For this reason, the internal commands in case of native Windows were invoked using "cmd /c". On Windows 10, there is a strange behavior with that, whereby the command processor is invoked in interactive mode whenever: - the command contains an asterisk - the command is put into double quotes Example: cmd /c del /s *.pyc invokes the command processor in interactive mode To avoid this problem, the "cmd /c" is removed. To avoid that bash or sh is used, the SHELL variable is set to cmd when running on native Windows. - Eliminated dependency on xargs by using for loop when on Windows. - Added automatic install of xmllint on Windows - Removed PYTHONPATH=. from sphinx command. It fails on Windows and does not seem to be needed. - Used $(error ...) when failing due to package version. - Changed platform names to Windows_UNIX and Windows_native, to avoid the CygWin name which is too specific. - Added a 'platform' target to the makefile that displays information about the OS platform detected by make and about the shell used by make to execute commands. - Added an 'env' target to the makefile that displays the environment as seen by make. - Added support to the Appveyor CI control file to allow specifying whether and which UNIX-like environment should be used, by adding a UNIX_PATH variable. - The required OS commands are now installed by invoking pywbem_os_setup.bat with args install and develop. this became necessary in order to dynamically set the UNIX-like environment. Commands are installed only if not yet in the PATH, i.e. if not provided by the UNIX-like environment. - The Python virtualenv in Appveyor is no longer created by tox, but by virtualenv. Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
Details: * Added a tools/retry.bat script that attempts a Windows command for a certain number of times (currently 3), with a certain sleep time in between attempts (currently 30 seconds). * Used the retry.bat script whenever choco is used to install packages: * 'make' in appveyor.yml * some OS level packages in pywbem_os_setup.bat In pywbem_os_setup.bat, the retry.bat script is only used after testing that it exists. That ensures that the pywbem_os_setup.bat script can still be downloaded and run standalone, as described in the documentation. Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
230199d
to
2e5b90f
Compare
For details, see the commit message.
Test: Raamesh wantes to test this on native Windows, see issue #1631.