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

Fix Codelite/gmake2 buildmessage escaping. #1913

Merged
merged 2 commits into from
Sep 2, 2022

Conversation

Jarod42
Copy link
Contributor

@Jarod42 Jarod42 commented Jul 17, 2022

What does this PR do?

Fix escaping for buildmessage for gmake2 and codelite

How does this PR change Premake's behavior?

Escape double quote and backslash in quoted

Anything else we should know?

Tested with https://github.com/Jarod42/premake-sample-projects/actions with branch custom_rule_check_quote_in_message

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!

Copy link
Member

@nickclark2016 nickclark2016 left a comment

Choose a reason for hiding this comment

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

LGTM

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.

gmake2 also needs a new test for the escaping.

@@ -60,7 +60,7 @@
value = 0
}

buildmessage 'Rule-ing %{file.name}'
buildmessage "Rule'ing %{file.name}"
Copy link
Member

Choose a reason for hiding this comment

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

Why did - change to '? Seems like an unintended/unnecessary change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was to show/test single quote escaping.
I can revert that part if you prefer.

Copy link
Member

Choose a reason for hiding this comment

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

That should be done in a dedicated test for escaping, as mentioned in my other comment, as this looks like a typo and will likely end up being changed back eventually.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Roll backed.

@@ -213,15 +213,15 @@ test2.obj: test2.rule
buildinputs { "toto.txt", "extra_dependency" }
buildoutputs { "toto.c" }
buildcommands { "test", "test toto.c" }
buildmessage "Some message"
buildmessage '"Some message"'
Copy link
Member

Choose a reason for hiding this comment

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

You should avoid hijacking existing tests, you should create a new test explicitly for testing the escaping.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, I will do that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Roll backed.
Dedicated test done.

@Jarod42
Copy link
Contributor Author

Jarod42 commented Aug 6, 2022

[ FAILED ] premake_http.https_get_verify_peer
HTTP response code said error
The requested URL returned error: 504 Gateway Time-out

Unrelated to my changes. :-)
Not the first time that those tests failed randomly BTW.

@nickclark2016 nickclark2016 merged commit a96fe76 into premake:master Sep 2, 2022
@Jarod42 Jarod42 deleted the fix_buildmessage_escaping branch September 2, 2022 21:39
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.

3 participants