Skip to content

Commit

Permalink
Add a config error for invalid locale model setting (chapel-lang#26067)
Browse files Browse the repository at this point in the history
It appears that we don't check the value of `CHPL_LOCALE_MODEL` in our
environment scripts. I have no idea what we build if it was set to
something invalid, but we build _something_. That's pretty bad. This PR
adds an error message when `CHPL_LOCALE_MODEL` is set to something other
than `flat` or `gpu`.

Tested locally with different settings including leaving it unset.

[Reviewed by @stonea]
  • Loading branch information
e-kayrakli authored Oct 9, 2024
2 parents 809f6d9 + 43fb0b9 commit f8ed3bd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion util/chplenv/chpl_locale_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@
import sys

import overrides
from utils import memoize
from utils import memoize, error


@memoize
def get():
locale_model_val = overrides.get('CHPL_LOCALE_MODEL', 'flat')

if locale_model_val not in ['flat', 'gpu']:
error('{} is not a valid value for CHPL_LOCALE_MODEL. '
'It can only be "flat" or "gpu".'.format(locale_model_val))

return locale_model_val


Expand Down

0 comments on commit f8ed3bd

Please sign in to comment.