Skip to content

feat: Support '"' quoting for custom signing tool#10589

Closed
anatawa12 wants to merge 2 commits intotauri-apps:devfrom
anatawa12:feat-quoted-command-line-for-signtool
Closed

feat: Support '"' quoting for custom signing tool#10589
anatawa12 wants to merge 2 commits intotauri-apps:devfrom
anatawa12:feat-quoted-command-line-for-signtool

Conversation

@anatawa12
Copy link
Contributor

Add support for '"' quoting in custom signing tool

#10583 (comment)

@anatawa12 anatawa12 requested a review from a team as a code owner August 13, 2024 04:17
}
(State::Idle, '"') => {
state = State::Quoted;
}
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 might be good to reserve some symbols for future extension

@lucasfernog lucasfernog requested a review from amrbashir August 13, 2024 10:33
@github-actions
Copy link
Contributor

github-actions bot commented Aug 13, 2024

Package Changes Through fad62e7

There are 7 changes which include tauri-build with prepatch, tauri-codegen with prerelease, tauri-utils with prerelease, tauri-bundler with prerelease, tauri-cli with prerelease, @tauri-apps/cli with prerelease, tauri with prerelease

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
tauri-utils 2.0.0-rc.2 2.0.0-rc.3
tauri-bundler 2.0.1-rc.1 2.0.1-rc.2
tauri-runtime 2.0.0-rc.2 2.0.0-rc.3
tauri-runtime-wry 2.0.0-rc.2 2.0.0-rc.3
tauri-codegen 2.0.0-rc.2 2.0.0-rc.3
tauri-macros 2.0.0-rc.2 2.0.0-rc.3
tauri-plugin 2.0.0-rc.2 2.0.0-rc.3
tauri-build 2.0.0-rc.2 2.0.1-rc.0
tauri 2.0.0-rc.2 2.0.0-rc.3
@tauri-apps/cli 2.0.0-rc.3 2.0.0-rc.4
tauri-cli 2.0.0-rc.3 2.0.0-rc.4

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@anatawa12
Copy link
Contributor Author

I've fixed format error. sorry

Copy link
Member

@lucasfernog lucasfernog left a comment

Choose a reason for hiding this comment

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

looks good to me, anything against this change @amrbashir ?

Comment on lines +174 to +175
(State::Unquoted, '"') => {
return Err(anyhow::anyhow!("custom signing command contains an unclosed quote").into());
Copy link
Member

Choose a reason for hiding this comment

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

We shouldn't error here imo, and just continue parsing

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 think it's a little unclear that foo"bar baz should be treated as foo bar baz, foo"bar baz, or foo"bar baz so I made this error. Which should I choose?

Copy link
Member

Choose a reason for hiding this comment

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

it should be foo"bar baz

Copy link
Member

Choose a reason for hiding this comment

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

but if we go with the object solution (which we should), this doesn't matter

Copy link
Contributor Author

@anatawa12 anatawa12 Aug 15, 2024

Choose a reason for hiding this comment

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

I mean your decision is not clear and reasonable enough I think.
For example, with command prompt (cmd.exe), foo"bar baz become foobar baz.

(Sorry I forget to list this up in the previous example list. foo"bar baz is mistake of foobar baz)

Anyway I made PR for object solution so this discussion might be useless.

#10634

Copy link
Member

Choose a reason for hiding this comment

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

thanks, will close this PR then and move discussion there

state = State::Idle;
}
(State::QuotedJustAfterQuote, _) => {
return Err(anyhow::anyhow!("custom signing command contains an unclosed quote").into());
Copy link
Member

Choose a reason for hiding this comment

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

same here

result.push(buffer);
}
State::Quoted => {
return Err(anyhow::anyhow!("custom signing command contains an unclosed quote").into());
Copy link
Member

Choose a reason for hiding this comment

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

and here

@amrbashir
Copy link
Member

amrbashir commented Aug 14, 2024

I wonder if it is better to change the command into an object rather than introduce custom parsing logic

{
	"customSignCommand": {
		"cmd": "program with space.exe",
		"args": ["list", "of", "args"],
	}
}

@anatawa12
Copy link
Contributor Author

I think it's better to use object form but I have no Idea how should I implement that since crate for bundler and config is diffdrent crate Shuld I create struct on both config and bundler?

@amrbashir
Copy link
Member

I think it's better to use object form but I have no Idea how should I implement that since crate for bundler and config is diffdrent crate Shuld I create struct on both config and bundler?

yup, two configs, there is similar objects you can take inspiration from like NsisConfig in config and NsisSettings in bundler.

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