Skip to content
This repository was archived by the owner on Aug 19, 2024. It is now read-only.
This repository was archived by the owner on Aug 19, 2024. It is now read-only.

warn_illegal_args fix #45

@lauracaulfield

Description

@lauracaulfield

Hey Mark -- I have a question about the code in lib\Recipe.pm. I'd like to add a warning based on properties of a test. I believe "warn_illegal_args" is the right place to do that. It should be called when StorScore processes the recipe ("Phase 1" in the BUILD sub), but it isn't. I've traced it down to the anonymous function on line 375. The foreach loop runs for each kind of step, but a print statement inside the anonymous function doesn't run. Can you help me understand why? I suspect the anonymous function needs to be called, but it's not clear to me where that should happen, or why it's happening for phase 2 but not for phase 1.

For example, this code:

    # Install our handler for each kind of step 
    print("warn? $recipe_warnings\n");
    foreach my $kind ( @step_kinds )
    {
        my $sym = "${package}::$kind";
        print("in foreach loop $kind\n");
        *$sym = sub
        {
            print("here\n");
            return $self->handle_step(
                $callback,
                $recipe_warnings,
                $kind,
                @_
            )
        };
    }
    print("done\n");

prints the following:
warn? 1
in foreach loop test
in foreach loop purge
in foreach loop initialize
in foreach loop precondition
in foreach loop bg_exec
in foreach loop fg_exec
in foreach loop bg_killall
in foreach loop idle
done

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions