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

Test "src/cmd/ksh93/tests/path.sh" has "not found" command errors #158

Closed
krader1961 opened this issue Nov 28, 2017 · 4 comments
Closed
Labels

Comments

@krader1961
Copy link
Contributor

While working on the config of the Meson based Travis tests I saw the following in the test log. The test passed but there is obviously something wrong given the "not found" errors.

86/156 path                                    OK       3.15 s
--- command ---
SHELL='/source/build/src/cmd/ksh93/ksh' LANG='' LD_LIBRARY_PATH='/source/build/src/lib/libast:/source/build/src/lib/libcmd:/source/build/src/lib/libcoshell' /source/build/src/cmd/ksh93/ksh /source/src/cmd/ksh93/tests/path.sh
--- stderr ---
builtin: chmod: not found
/source/src/cmd/ksh93/tests/path.sh[160]: chmod: not found [No such file or directory]
builtin: /bin/getconf: not found
-------
@krader1961
Copy link
Contributor Author

The PR doesn't fix the problems on my macOS server. The problem is this line in src/cmd/ksh93/tests/path.sh:

for PATH in $path :$path $path: .:$path $path: $path:. $PWD::$path $PWD:.:$path $path:$PWD $path:. :$PWD

Notice the lack of double-quotes. If the original PATH or PWD contains spaces chaos ensues. This happens to be true on my macOS server because PATH contains /Applications/VMware Fusion.app/Contents/Public.

So when I hear people say, without irony, that ksh93 is meant to be a general purpose programming language that competes with Python and the like I shake my head in disbelief. The POSIX rules for parsing statements are a disaster.

@krader1961
Copy link
Contributor Author

Another test bogosity. The path.sh script does PATH=$path just before exiting. Why? It's completely pointless.

@jelmd
Copy link

jelmd commented Nov 30, 2017

LOL - if an admin/developer here gets hit by a "whitespace in path" he gets some cleaning rags and some days to cleanup the labs - should be enough time to think over, what went wrong ... ;-)

@jelmd
Copy link

jelmd commented Nov 30, 2017

Why PATH=$path? Because the one, who wrote it, is an experienced programmer and knows, that it is important to restore state of the target under test, so that new tests can be append w/o any trouble?

siteshwar added a commit that referenced this issue Nov 30, 2017
siteshwar pushed a commit that referenced this issue Nov 30, 2017
The script doesn't work if `$PATH` contains spaces. It also assumes
`getconf` is in the `/bin` directory if it isn't a builtin.

Fixes #158
siteshwar pushed a commit that referenced this issue Nov 30, 2017
The script doesn't work if `$PATH` contains spaces. It also assumes
`getconf` is in the `/bin` directory if it isn't a builtin.

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

No branches or pull requests

2 participants