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

Add validation for toolset. #1997

Merged
merged 1 commit into from
Apr 16, 2023
Merged

Conversation

Jarod42
Copy link
Contributor

@Jarod42 Jarod42 commented Nov 11, 2022

What does this PR do?

Add validation for toolset.
So valid_tools is now useful.

How does this PR change Premake's behavior?

Add a message for invalid configuration for toolset

Anything else we should know?

No.

Did you check all the boxes?

  • Focus on a single fix or feature; remove any unrelated formatting or code changes
  • Add unit tests showing fix or feature works; all tests pass
  • Mention any related issues (put closes #XXXX in comment to auto-close issue when PR is merged)
  • Follow our coding conventions
  • Minimize the number of commits
  • Align documentation to your changes

You can now support Premake on our OpenCollective. Your contributions help us spend more time responding to requests like these!

@@ -174,6 +175,13 @@
end


function m.actionSupportsToolset(prj)
if not p.action.supportsToolset(prj.language, prj.toolset) then
p.warn("Unsupported toolset '%s' used for language '%s' for project '%s'", prj.toolset, prj.language, prj.name)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Most other validations use warn and not error...
So I stay coherent with above checks. (but I think all should be error).

---

function action.supportsToolset(language, toolset)
local function buildLanguageKeysMap()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure how it should be done with extern registered languages. Apply to valid_tools entry or registered action anyway...

Copy link
Member

@samsinsane samsinsane left a comment

Choose a reason for hiding this comment

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

Overall, this looks good. I'm a bit concerned that it might be emitting the warning on valid uses since we probably haven't been updating the valid_tools along the way, but we can just make sure they're all fixed up before the next release.

src/base/action.lua Outdated Show resolved Hide resolved
src/base/action.lua Show resolved Hide resolved
src/base/action.lua Outdated Show resolved Hide resolved
@Jarod42
Copy link
Contributor Author

Jarod42 commented Apr 16, 2023

Tests actually fail as master fails.

@samsinsane samsinsane merged commit 168988a into premake:master Apr 16, 2023
@Jarod42 Jarod42 deleted the toolset_validation branch April 16, 2023 10:03
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