Commit Graph

6 Commits

Author SHA1 Message Date
Dylan Baker 205cf95f99 envconfig: Add type annotations 2019-04-22 13:49:50 -07:00
Dylan Baker b8ec23b69d envconfig: simplify exception handling.
Currently this takes a return value, and in the error case sets it,
then has a separate if to hanle that. Instead just set the return
value in the error handler.
2019-04-22 13:49:50 -07:00
Ross Burton c6abca289b envconfig: remove unused parse_datafile()
The cross-file cleanup meant this function is no longer used, so remove it.
2019-03-20 20:55:32 +02:00
Dylan Baker 914056f68a envconfig: Store whether the cpu_familiy is 64 bit
We'll need this in the llvm-config logic to determine the right
llvm-config to call on Fedora 30+, but this feels like the sort of
information that might be useful elsewhere. This does not expose this
information as part of the public API, it's only accessible at the
python layer.
2019-03-14 23:35:26 +02:00
John Ericson c2db7a9cee Sync up initialization logic with Properties and BinaryTable
1. They (and the others) all use PerMachineDefaultable. It's not the
    best class, but consistency come first. (It and all of them can be
    improved accross the board later.)

 2. They use `None` as the default argument so as not to mutate what's
    effectively a global variables. (Thanks @dcbaker!)

 3. They have a `fallback` field to centralize authority on when
    environment variables should be consulted.
2019-02-27 13:10:16 -08:00
John Ericson 2622e9ec32 Move some configuration classes out of environment.py
First of all, I'd like compilers and other modules that environment.py
currently imports to be able to take these without creating
hard-to-follow module cycles.

Second of all, environment.py's exact purpose seems a bit obscured.
Splitting the data types (and basic pure functions) from the more
complex logic that infers that data seems like a good way to separate
concerns.
2019-02-27 13:10:16 -08:00