Forbid configuration names ending in -reconfig

Create issue
Issue #428 closed
Erik Schnetter created an issue

I accidentally created a Cactus configuration with a name like "sim-reconfig". This confuses Cactus, because the command "make sim-reconfig" can then mean either to build the "sim-reconfig" configuration, or to reconfigure the "sim" configuration.

Cactus should catch and forbid these cases.

This is probably most cleanly handled by using a script instead of a Makefile to interpret the user commands.

Keyword:

Comments (13)

  1. Frank Löffler

    The only possibility I could create such a configuration is using 'make sim-(re)?config-config'. The attached patch catches this. Please review. Also, please try to remember if this was the way you could create such a configuration, or if there is another way not covered by this patch.

  2. Ian Hinder
    • removed comment

    Since the cactus make system uses '-' as a separator, I propose that configuration names should not contain '-' at all. We can introduce a warning saying that such names are deprecated.

  3. Frank Löffler
    • removed comment

    I agree with Ian, and changed the patch. However, in contrast to Ians suggestion creating a configuration containing a dash is now not introducing a warning, but a fatal error. A warning that early in the configuration process will most likely go unnoticed anyway.

    The patch changes the Makefile to produce an error as early as possible, but also checks the configuration name in the actual setup. The second test should not be triggered if everything was caught on the makefile level already, but you never know...

  4. Erik Schnetter reporter
    • removed comment

    Simfactory generates names containing dashes by default, e.g. "sim-debug" or "sim-profile".

  5. Frank Löffler
    • removed comment

    Then we need to decide: forbid '-' entirely, or blacklist only '-' followed by any valid Cactus option (about 17, but frankly we should remove some of them anyway). I don't like either option very much.

    Dashes are a popular delimited that, if possible, we should make available to the users. A blacklist might be the best option, even it it means to have some ugly long regex twice in the Makefile plus in the setup perl script - which is a nuisance to maintain. Opinions?

  6. Erik Schnetter reporter
    • removed comment

    My suggestion: Live with the ugliness until we replace the "make -command" with something that has a better syntax, e.g. "cactus command ". There exist several attempts at rewriting the top-level makefile in Python, and there's no reason not to do so (except time).

  7. Roland Haas
    • removed comment

    I'd rather take the minimally invasive solution and only forbid the configuration names that have Cactus commands in their name.

  8. Log in to comment