Skip to content

Pass more options from package:find_tool to lib.detect.find_tool#6172

Merged
waruqi merged 1 commit intoxmake-io:devfrom
Doekin:package-find_tool
Feb 26, 2025
Merged

Pass more options from package:find_tool to lib.detect.find_tool#6172
waruqi merged 1 commit intoxmake-io:devfrom
Doekin:package-find_tool

Conversation

@Doekin
Copy link
Contributor

@Doekin Doekin commented Feb 26, 2025

This update ensures that all options options check, command and parse are passed from package:find_tool to lib.detect.find_tool, allowing for customizable check methods in packages.

require_version = opt.require_version,
norun = opt.norun,
system = opt.system,
force = opt.force})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

? why remove these args?

                              require_version = opt.require_version,
                              norun = opt.norun,
                              system = opt.system,
                              force = opt.force

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought those arguments were already included in the opt table and passed directly to self._find_tool. Since opt is being passed as an entire table, I assumed we didn't need to explicitly pass each of these individual arguments again.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not use opt parameter directly, it will modify the state of opt object outside the function.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, not all opt parameters should be passed in. They are not all the same. Some parameters are only used by packages and should not be passed to lib.detect.find_tool

@Doekin Doekin changed the title Pass all options from package:find_tool to lib.detect.find_tool Pass more options from package:find_tool to lib.detect.find_tool Feb 26, 2025
@waruqi waruqi added this to the v2.9.9 milestone Feb 26, 2025
@waruqi waruqi merged commit 3513afc into xmake-io:dev Feb 26, 2025
22 checks passed
@Doekin Doekin deleted the package-find_tool branch February 26, 2025 11:01
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.

2 participants