Simplify MSYS+buildslave integration
|Reported by:||LRN||Owned by:|
|Cc:||bdbaddog, Callek, rutsky.vladimir@…|
Description (last modified by dustin)
Right now buildslave runs ALL ShellCommand?s using COMSPEC.
This is bad, because COMSPEC is defined to Windows shell interpreter, not Bash (or any other shell). Moreover, buildslave will add "/c" to the command it gets from COMSPEC, if it isn't there already. So even if user re-defines COMSPEC to call a POSIX-compliant shell (which doesn't really work well - see below), it still gets extra "/c", which prevents it from working correctly.
Re-defining COMSPEC is a bad idea anyway, because certain programs (such as libtool) may internally rely on COMSPEC to run things. They expect COMSPEC to point to Windows shell interpreter, and when it isn't...well, you can imagine what happens.
I propose to add an environment variable that can be set for buildslave, which will point to a POSIX-compliant shell to use (i.e. x:/foo/bar/bin/sh.exe --login). It also places the command that should be run into a script file, and makes the shell run that file instead of passing the command as its argument. The reason is that it's easier to handle quoting that way ("-c" option only takes one argument, so it can be difficult to fit large commands into it), and also changes current directory as needed.
Directory change is needed because of the --login option. Using --login is necessary for shell to source the right initialization files (which, among other things, set up the PATH and several other environment variables), however it has a side-effect of setting current directory to "~".
Change History (11)
Changed 5 years ago by LRN
comment:1 Changed 5 years ago by dustin
- Keywords MSYS cmd COMSPEC libtool ShellCommand shell removed
- Milestone changed from undecided to 0.8.+