ATF-devel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: ATF arch/machine vs. OS arch/machine

On Sat, Jul 10, 2010 at 09:42:14AM +0100, Julio M. Merino Vidal wrote:
> On Fri, Jul 9, 2010 at 6:01 PM, Nicolas Joly <> 
> wrote:
> >
> > While looking into ATF meta-data properties, especially require.arch
> > and require.machine, i noticed that atf-config(1) and uname(1) show
> > inverted values for arch and machine on my NetBSD/amd64 workstation.
> Did you install from the atf distfile or are you running atf-config
> from NetBSD?  If the latter, the values do not come from configure.
> Take a look at src/external/bsd/atf/lib/libatf-c/Makefile -- I believe
> the values passed to ATF_{ARCH,MACHINE} are flipped.



And this is consistent with configure output:

configure: Machine type: x86_64, architecture: amd64

> > I fear there is no good solution for this problem, as it may vary for
> > about every OS (example below); but i find this particular case very
> > confusing.
> [...]
> Yeah... indeed.  Antti and I recently had a similar discussion
> regarding these variables and how confusing they are.  First of all,
> the names they have are probably not representative enough (they match
> NetBSD's naming, but not uname's for example).  Given that atf
> attempts to be platform independent, that's an issue.

I concur that ATF should be platform independent as much as possible;
but IMO tests cannot. Unless you do really basic stuff, you quickly
depends on OS/platform specifics.

> And second, as you mention, it's hard to come up with a naming scheme
> that works across systems.  I guess atf could try to forcibly convert
> some foreign names into "known" ones and we just pick, e.g. NetBSD's
> platform naming scheme as the canonical one.  (This is what the
> incomplete snippet in was about.)
> Any ideas on how to improve this will be appreciated!

Unless you have tests to be shared across different OSes, following
the host values should be enough ... Otherwise, machine and arch are
OS specific, and one possibility could be to prepend the OS name:
NetBSD.amd64, Linux.x86_64, ... And matching could later use jokers
such as 'Linux.*' or '*.x86_64'.

Just a quick thought.

Nicolas Joly

Biological Software and Databanks.
Institut Pasteur, Paris.

Home | Main Index | Thread Index | Old Index