Make config.status use EnumString subclasses




Build Config
a year ago
a year ago


(Reporter: glandium, Unassigned)


(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)




a year ago
Currently, we get some EnumString subclass instances out of python configure, and while we could get to use them while running config status as part of (per bug 1296503), we don't because
  a) some moz.builds do some checks that fail because of the EnumString checks (legitimately)
  b) some others fail because they use things like OS_TARGET, which map to a different EnumString subclass depending on the platform, thus failing checks in some cases
  c) for consistency between running config.status standalone (or it being included from python code) and through

a) needs fixing. b) variables like OS_TARGET, OS_ARCH and CPU_ARCH probably need to be stringified at the python configure level (definitely the first two, not sure about the latter). c) needs EnumString subclasses's repr to print out an expression that can create the same EnumString subclass instance.
When you say "at the python configure level" where are you thinking? It would be pretty nice if we could persist EnumString all the way into the context so that testing against invalid values in would fail.

Comment 2

a year ago
The three variables I mentioned are special, in that their value alternate between different EnumString subclasses depending on the platform. So propagating them as-is to is bound to fail. So the easy way out is, for those (and only those) to not propagate them as EnumStrings.

And yes, this bug is about propagating the EnumStrings to (otherwise a) wouldn't need fixing ;) ).

On the long run, we need to get rid of OS_TARGET, OS_ARCH and CPU_ARCH in, and use the equivalent of target.os, target.kernel and target.cpu (and same with host). Maybe we should even propagate the namespaces to, so that we get something like CONFIG['TARGET'].os, CONFIG['TARGET'].kernel, etc. But that's a discussion for another day.
You need to log in before you can comment on or make changes to this bug.