[Buildbot-commits] [Buildbot] #2293: Simplify MSYS+buildslave integration
Buildbot trac
trac at buildbot.net
Wed Mar 20 14:36:02 UTC 2013
#2293: Simplify MSYS+buildslave integration
-----------------------------+--------------------
Reporter: LRN | Owner:
Type: enhancement | Status: new
Priority: patches-accepted | Milestone: 0.8.+
Version: 0.8.6p1 | Resolution:
Keywords: windows |
-----------------------------+--------------------
Old description:
> 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
> "~".
New description:
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 "~".
--
Comment (by dustin):
Neither - the idea is acceptable, but to my knowledge nothing is being
done.
--
Ticket URL: <http://trac.buildbot.net/ticket/2293#comment:8>
Buildbot <http://buildbot.net/>
Buildbot: build/test automation
More information about the Commits
mailing list