Skip to content

Feat/build arg with space#1103

Merged
phil-opp merged 2 commits intodora-rs:mainfrom
drindr:feat/build-arg-with-space
Sep 3, 2025
Merged

Feat/build arg with space#1103
phil-opp merged 2 commits intodora-rs:mainfrom
drindr:feat/build-arg-with-space

Conversation

@drindr
Copy link
Copy Markdown
Contributor

@drindr drindr commented Aug 20, 2025

Allow argument with space in build command.
This PR is compatible with the old single string command.

...
build:
    - exec: program-to-run
    - args:
        - -c
        - cargo build ...
... 

Copy link
Copy Markdown
Collaborator

@phil-opp phil-opp left a comment

Choose a reason for hiding this comment

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

Thanks for the separate PR! Am I understanding it correctly that this new version does not support any quoting in the normal build string anymore, compared to #1098? Instead, we now have the option to specify the args as list, right?

The example in the PR description seems outdated, it's a list of exec/args pairs now, right?

CommandConfig::WithArgs(configs) => {
let mut cmd_vec = vec![];
for CommandWithArgs { exec, args } in configs {
let mut cmd = Command::new(exec);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We should probably do the same pip/uv replacement here.

@phil-opp
Copy link
Copy Markdown
Collaborator

The new syntax seems quite verbose, I'm not sure if this is worth it. I think I liked the previous idea of supporting quoted substrings more.

How about we just use a crate such as splitty for splitting the build lines and the args key? I think this would be more intuitive, as quoting substrings is quite common.

@drindr
Copy link
Copy Markdown
Contributor Author

drindr commented Aug 20, 2025

Thanks for the separate PR! Am I understanding it correctly that this new version does not support any quoting in the normal build string anymore, compared to #1098? Instead, we now have the option to specify the args as list, right?

The example in the PR description seems outdated, it's a list of exec/args pairs now, right?

Yes. Because string processing is complex and some corner cases quotation marks might not be considered.😭

A list makes it easy to handle and it is also commonly used in configuarion(like some settings for the VSCode)

@haixuanTao
Copy link
Copy Markdown
Collaborator

I don't think we should use list as it would break what people know from configuration like docker / GitHub action...

@drindr
Copy link
Copy Markdown
Contributor Author

drindr commented Aug 20, 2025

The new syntax seems quite verbose, I'm not sure if this is worth it. I think I liked the previous idea of supporting quoted substrings more.

How about we just use a crate such as splitty for splitting the build lines and the args key? I think this would be more intuitive, as quoting substrings is quite common.

This crate looks good.
I will have a try.

Signed-off-by: drindr <dreamchancn@qq.com>
@drindr drindr force-pushed the feat/build-arg-with-space branch from 4a2afd1 to 7497ecb Compare August 20, 2025 09:45
@drindr
Copy link
Copy Markdown
Contributor Author

drindr commented Aug 20, 2025

Reverted to use quoted arguments

@drindr
Copy link
Copy Markdown
Contributor Author

drindr commented Aug 20, 2025

I don't think we should use list as it would break what people know from configuration like docker / GitHub action...

Docker provided the list form as well. The implementation of the GitHub action seems to depend on a specific shell and execute the command with the shell. But in current Dora's build, it is not relied on any shell, which makes the functionalities of the build command limited.

@drindr
Copy link
Copy Markdown
Contributor Author

drindr commented Sep 1, 2025

Reverted to use quoted arguments

ready to merge @haixuanTao

Copy link
Copy Markdown
Collaborator

@phil-opp phil-opp left a comment

Choose a reason for hiding this comment

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

Thank you!

@phil-opp phil-opp merged commit da31b13 into dora-rs:main Sep 3, 2025
155 of 158 checks passed
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