Fix System.cmd/3 unit test that fails on Ubuntu 26.04 - #15646
Merged
Conversation
This test runs `System.cmd/3` against a symlink to the `echo` command.
This works when `echo` is its own binary and when it's in a multicall
binary that's dispatched using `argv[0]`. It doesn't work for the new
Rust/uutils coreutils which doesn't dispatch via `argv[0]`. In this
case, intended call to echo produces no output:
```
1) test Unix cmd/3 with absolute and relative paths (SystemTest)
test/elixir/system_test.exs:210
match (=) failed
code: assert {"hello\n", 0} = System.cmd(Path.join(File.cwd!(), @echo), ["hello"], arg0: "echo")
left: {"hello\n", 0}
right: {"", 0}
stacktrace:
test/elixir/system_test.exs:223: anonymous fn/0 in SystemTest."test Unix cmd/3 with absolute and relative paths"/1
(elixir 1.21.0-dev) lib/file.ex:2100: File.cd!/2
test/elixir/system_test.exs:215: (test)
```
This fix switches the binary used for the test over to `sh` which fixes
the issue on Ubuntu 26.04. This was also verified on Ubuntu 24.04,
Ubuntu 22.04, Alpine Linux 3.24, macOS Tahoe (26.5.1) and MacOS Sequoia
(15.3.2).
Member
|
💚 💙 💜 💛 ❤️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This test runs
System.cmd/3against a symlink to theechocommand. This works whenechois its own binary and when it's in a multicall binary that's dispatched usingargv[0]. It doesn't work for the new Rust/uutils coreutils which doesn't dispatch viaargv[0]. In this case, intended call to echo produces no output:This fix switches the binary used for the test over to
shwhich fixes the issue on Ubuntu 26.04. This was also verified on Ubuntu 24.04, Ubuntu 22.04, Alpine Linux 3.24, macOS Tahoe (26.5.1) and MacOS Sequoia (15.3.2).