Opened 8 years ago

Last modified 6 years ago

#2293 new enhancement

Simplify MSYS+buildslave integration — at Initial Version

Reported by: LRN Owned by:
Priority: patches-accepted Milestone: 0.9.+
Version: 0.8.6p1 Keywords: windows
Cc: bdbaddog, Callek, rutsky.vladimir@…


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 (1)

Changed 8 years ago by LRN

Note: See TracTickets for help on using tickets.