Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#2150 closed enhancement (fixed)

flatten nested lists in ShellCommands commands=..

Reported by: mmadia Owned by: ewong
Priority: major Milestone: 0.8.6
Version: 0.8.5 Keywords: simple
Cc:

Description

The following usage of properties={},Property() will not work as expected.

master.cfg:

BuildSlave("my-build-slave", "my-password", 
	properties={ 'configure':'--use-gcc-pipe --use-xattr' })
#....
fX86Quick.addStep(ShellCommand(
	command=[
		'../../haiku/configure',
		Property('configure'),
		'--cross-tools-prefix',
		'../../cross-tools-x86gcc2/cross-tools/bin/i586-pc-haiku-'],
	description="Configuring X86 GCC 2 normal with cross-tools-prefix",
	name="Configure cross-tools-prefix x86gcc2"))

logs/stdio

../../haiku/configure '--use-gcc-pipe --use-xattr' --cross-tools-prefix ../../cross-tools-x86gcc2/cross-tools/bin/i586-pc-haiku-
 in dir /storage/public/mmadia-buildbot-exp/sandbox/slave/x86gcc2-quick/build (timeout 1200 secs)
 watching logfiles {}
 argv: ['../../haiku/configure', '--use-gcc-pipe --use-xattr', '--cross-tools-prefix', '../../cross-tools-x86gcc2/cross-tools/bin/i586-pc-haiku-']
 environment:
<snip>
  SHELL=/usr/local/bin/bash
<snip>
 using PTY: False
Invalid argument: `--use-gcc-pipe --use-xattr'
program finished with exit code 1
elapsedTime=0.008083

Attachments (1)

patch5.txt (6.3 KB) - added by ewong 8 years ago.
Patch to fix ticket.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 8 years ago by dustin

  • Keywords simple added
  • Milestone changed from undecided to 0.8.6
  • Summary changed from Interpolate lists into lists using properties to flatten nested lists in ShellCommands commands=..
  • Type changed from undecided to enhancement

comment:2 Changed 8 years ago by dustin

I would begin testing this by using something like this in your master.cfg:

factory.addStep(ShellCommand(command=['trial', ['-d', '-B'], 'pyflakes']))

and see how it fails - in particular, it tries to pass "['-d', '-B']" as an argument, which trial doesn't recognize.

Then, look at master/buildbot/test/unit/test_steps_shell.py, and add a unit test that produces the same error.

Then, fix the problem, by flattening the nested lists -- and see both the unit test and your master.cfg start working properly.

Then, make things a little more complex - add tests with two nested lists, or lists nested two-deep, or an empty nested list, or whatever you can think of - and make sure that the step does the right thing.

Finally, add a sentence to the documentation for ShellCommand so that others expect this behavior.

comment:3 Changed 8 years ago by ewong

  • Owner set to ewong
  • Status changed from new to assigned

Changed 8 years ago by ewong

Patch to fix ticket.

comment:4 Changed 8 years ago by Dustin J. Mitchell

  • Resolution set to fixed
  • Status changed from assigned to closed

Flatten lists in shell commands, so that properties can insert multiple args

Patch by Edmund Wong <ewong@…>.

Fixes #2150.

Changeset: 726e9f81c103939d22bd18d53ca65c66cfb8aed7

comment:5 Changed 8 years ago by Dustin J. Mitchell

release notes and docs - Refs #2150.

Changeset: 745c1e528e178b3685933a7f24c4bd42792421e2

Note: See TracTickets for help on using tickets.