Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

needs is missing from main namespace #1547

Open
ferki opened this issue Sep 4, 2022 · 0 comments
Open

needs is missing from main namespace #1547

ferki opened this issue Sep 4, 2022 · 0 comments
Labels
bug Confirmed bugs

Comments

@ferki
Copy link
Member

ferki commented Sep 4, 2022

Describe the bug

As a side-effect of 3c87437 via #1414, needs is no longer registered in the main namespace, which might break some of the expected behavior. Tasks that depends on another task from the Rexfile are failing with error messages similar to:

Can't locate object method "needs" via package "main" at /loader/0x55c93d31c3b8/__Rexfile__.pm line 16, <> line 1

Expected behavior

needs should be present in the main namespace to stay backwards compatible with the established behavior.

How to reproduce it

  1. create a task two that depends on another task in the Rexfile via needs main 'one';
  2. execute two with rex two

Code example

use Rex -feature => [ '1.4' ];

task 'one', sub {
  say 'hello from one';
};

task 'two', sub {
  needs main 'one';
  say 'hello from two';
};

Additional context

Discovered while investigating #1543, so the code example is also taken from there, but fixed to show only this bug.

Rex version

1.13.4

Perl version

5.36.0

Operating system running rex

Gentoo

Operating system managed by rex

local

How rex was installed?

dzil install

@ferki ferki added triage needed A potential bug that needs to be reproduced and understood bug Confirmed bugs and removed triage needed A potential bug that needs to be reproduced and understood labels Sep 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bugs
Projects
None yet
Development

No branches or pull requests

1 participant