Skip to content

Use System.cmd rather than System.shell for Rebar3 to avoid escaping #13751

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

Merged
merged 1 commit into from
Jul 31, 2024

Conversation

josevalim
Copy link
Member

Closes #13750.

@josevalim josevalim merged commit cb5e812 into main Jul 31, 2024
18 checks passed
@josevalim josevalim deleted the jv-rebar3-system-cmd branch July 31, 2024 19:45
@josevalim
Copy link
Member Author

💚 💙 💜 💛 ❤️

@@ -207,8 +207,15 @@ defmodule Mix.Tasks.Deps.Compile do
{"TERM", "dumb"}
]

cmd = "#{rebar_cmd(dep)} bare compile --paths #{escape_path(lib_path)}"
do_command(dep, config, cmd, false, env)
rebar = Mix.Rebar.local_rebar_path(:rebar3) || handle_rebar_not_found(dep)
Copy link
Contributor

@michallepicki michallepicki Aug 1, 2024

Choose a reason for hiding this comment

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

Dialyzer points out that Mix.Rebar.local_rebar_path(:rebar3) always returns a binary so it's truthy, so || handle_rebar_not_found(dep) and the whole def handle_rebar_not_found function are unreachable

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you, I will push a fix soon. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Path escaping for rebar shell command in deps.compile.ex
3 participants