A robot must not miss the bits in the corners unless it conflicts with the first or second law

April 6th, 2010

I got to watch one of the iRobot cleaning robots do it’s thing, they’re pretty amazing little (for pizza-box sized values of “little”) gadgets. This was the “Scooba“, rather than the Roomba (the difference, as best as I know, is that the Roomba vacuums, whereas the Scooba does hard surfaces, linoleum say).

I imagine in the long run they’re probably time saving, you can get stuff done while it cleans, but I could have watched the thing for hours, days even. “Turn left! No, your other left!”.

The women-folk named it Ziggy, though they refer to it in the masculine, I guess after a while all Ziggy’s get crosswired with “…and the spiders from mars”.

It got lost quite a bit, the table legs confused the hell out of it for 5 or 10 minutes, though it made it out of there eventually. I was convinced, for the longest time, it wasn’t actually cleaning; The floor was getting wet, the stink of whatever OEM cleaner wafted through the room (apparently you can use vinegar, if you want to smell like a fish and chip shop) but the floor was as far from clean as ever, then without any noticeable shift, long familiar grime was vanishing! Even the bits I’d somewhat privately bet myself it would never be able to shift (“…it’d take me 20 minutes and a chisel to shift that”) it eventually got through. Colour me impressed.

Building fat debug/non-debug ON packages

December 7th, 2009

As bug #10997 says, pkg change-variant debug would be really cool.

All the bits required to do this are present already, because it’s conceptually the same as the x86/sparc fat packages, and you could just as easily (if time-consumingly) build x86/sparc/debug/non-debug fatter packages by adding another level of indirection.

As a fairly hacky way to attempt this, clone a copy of the on_ips (/hg/pkg/on_ips) and pkg (/hg/pkg/gate) gates. You’ll need the pkg gate, because the scripts to do the merging and publishing conveniently aren’t delivered to the system.

Run a complete build of on_ips, including packages. (that is with p and D in NIGHTLY_OPTIONS and F not).

Start depots for the debug and non-debug bits:

  /usr/lib/pkg.depotd -d $CODEMGR_WS/packages/${MACH}/nightly \
    -p 13000 --add-content
  /usr/lib/pkg.depotd -d $CODEMGR_WS/packages/${MACH}/nightly-nd \
    -p 13001 --add-content

Merge the manifests from the two repos:

  python2.6 path/to/pkg/gate/src/util/publish/merge.py -r \
    -d repo_merge \
    -v true,http://localhost:13000 \
    -v false,http://localhost:13001 \
    debug consolidation/osnet/osnet-incorporation

Publish the resulting fat packages to yet-another repository:

  pkgsend -s file://$CODEMGR_WS/packages/${MACH}/nightly-fat \
    create-repository --set-property publisher.prefix=on-nightly
  for pkg in repo_merge/*; do
    ksh path/to/pkg/gate/src/util/publish/pkg_publish $pkg \
      file://$CODEMGR_WS/packages/${MACH}/nightly-fat
  done

On x86 (the only arch I’ve tried), a handful of packages will fail here complaining that renamed packages must have at least one depend action, which, most confusingly, they do; I haven’t looked into why this is yet.

This is also, probably, going to take a considerable amount of time, so instead you may want to copy pkg_publisher to a temporary directory, and add the --no-index and --no-catalog flags to the last line:

pkgsend -s $repo close --no-index --no-catalog

And when the loop is complete run:

pkgsend -s file://$CODEMGR_WS/packages/${MACH}/nightly-fat refresh-index

Fire up a depotd to serve your new fat packages to clients (using the --add-content flag, if you altered pkg_publish above):

/usr/lib/pkg.depotd -d $CODEMGR_WS/packages/${MACH}/nightly-fat \
    -p 13002 --add-content

On the test machine you wish to use this bits, add your on-nightly publisher as normal for on_ips. Then add a debug=false entry to the [variants] section of /var/pkg/cfg_cache (I have no idea what the correct way to introduce a new variant is, but this ain’t it.)

image-update to your own, non-debug bits, as normal.

Take a look at what will be done, the important will be at the end, when it displays the change in the set of variants and facets and their values:

  pkg change-variant -nv debug=true

Finally, switch to your new bits:

  pkg change-variant --be-name my-debug-bits debug=true

(Though the --be-name argument may not be honoured, see bug #13305, which I just filed about this)