Skip to content

Resolve imported targets from the selected Magefile directory - #562

Open
businessdeveloper69 wants to merge 1 commit into
magefile:masterfrom
businessdeveloper69:fix/imports-in-magefile-directory
Open

businessdeveloper69 wants to merge 1 commit into
magefile:masterfrom
businessdeveloper69:fix/imports-in-magefile-directory

Conversation

@businessdeveloper69

Copy link
Copy Markdown

Fixes #364.

Running mage -d build -l from a parent module resolves imported targets against the caller’s dependencies. In the reporter’s kn-plugin-event project it fails to find a package that Mage lists correctly from inside build/. Both Go package queries now run from the selected Magefile directory. The target’s working directory still comes from -w.

I checked the original kn-plugin-event project, traefik-acme, and a case where both modules provide different versions of the same import path. The complete race-enabled CI suite and vet passed on Linux with Go 1.18 and 1.27, including the release dry run on 1.27. The project’s pinned linter passed with Go 1.18 and 1.26.

AI assisted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unexpected Behavior When Trying to Run Magefile with Import in Different Directory

1 participant