{"action":"created","issue":{"url":"https://api.github.com/repos/Gabriel439/bench/issues/38","repository_url":"https://api.github.com/repos/Gabriel439/bench","labels_url":"https://api.github.com/repos/Gabriel439/bench/issues/38/labels{/name}","comments_url":"https://api.github.com/repos/Gabriel439/bench/issues/38/comments","events_url":"https://api.github.com/repos/Gabriel439/bench/issues/38/events","html_url":"https://github.com/Gabriel439/bench/issues/38","id":366999341,"node_id":"MDU6SXNzdWUzNjY5OTkzNDE=","number":38,"title":"Bench on Cygwin - supported?","user":{"login":"Kaos-Industries","id":16962031,"node_id":"MDQ6VXNlcjE2OTYyMDMx","avatar_url":"https://avatars3.githubusercontent.com/u/16962031?v=4","gravatar_id":"","url":"https://api.github.com/users/Kaos-Industries","html_url":"https://github.com/Kaos-Industries","followers_url":"https://api.github.com/users/Kaos-Industries/followers","following_url":"https://api.github.com/users/Kaos-Industries/following{/other_user}","gists_url":"https://api.github.com/users/Kaos-Industries/gists{/gist_id}","starred_url":"https://api.github.com/users/Kaos-Industries/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kaos-Industries/subscriptions","organizations_url":"https://api.github.com/users/Kaos-Industries/orgs","repos_url":"https://api.github.com/users/Kaos-Industries/repos","events_url":"https://api.github.com/users/Kaos-Industries/events{/privacy}","received_events_url":"https://api.github.com/users/Kaos-Industries/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-10-04T22:51:35Z","updated_at":"2018-10-09T21:37:55Z","closed_at":null,"author_association":"NONE","body":"I'm sorry if I'm raising too many issues in such a short space of time, but this one is by far the most important for me since I first started looking at `bench`, as it stops me in my tracks from running it. \r\n\r\nI'm trying to use `bench` to benchmark the speeds of different grep-like programs (GNU grep, GNU grep with `-F`, and ripgrep), using some relatively complicated for loops. For reference, I'm planning to do something like this:\r\n\r\nfor i in {1..15}; \\\r\ndo \\\r\n(bench 'rg -i \"ajndoandajskaskaksnaodnasnakdnaosnaond\" \"5GB_file.txt\"') 2>&1 |\r\ntee -a \"/cygdrive/b/users/user/Tests/ripgrep (bench 5.2GB Ramdisked with Cache Flush, position 1).txt\"; \\\r\n(bench 'LC_ALL=C grep -i \"ajndoandajskaskaksnaodnasnakdnaosnaond\" \"5GB_file.txt\"') 2>&1 |\r\ntee -a \"/cygdrive/b/users/user/Tests/grep (bench 5.2GB Ramdisked with Cache Flush, position 1).txt\"; \\\r\n(bench 'LC_ALL=C grep -Fi \"ajndoandajskaskaksnaodnasnakdnaosnaond\" \"losers_5GB.txt\"') 2>&1 |\r\ntee -a \"/cygdrive/b/users/hashim/desktop/Tests/grep -F (bench 5.2GB Ramdisked with Cache Flush, position 1).txt\"; \\\r\ndone;\r\n\r\nBefore I go about trying to get that to work, I was trying to test with the most minimal form that I can run in a single command, which is this: \r\n\r\n`\"bench LC_ALL=C grep -i 'ajndoandajskaskaksnaodnasnakdnaosnaond' '5GB_file.txt'\"`\r\n\r\n...but even that fails. When I try to run it, I get the following output:\r\n\r\n`benchmarking LC_ALL=C grep -i \"ajndoandajskaskaksnaodnasnakdnaosnaond\" \"losers_sorted.txt\"\r\nbench.exe: ShellFailed {shellCommandLine = \"LC_ALL=C grep -i 'ajndoandajskaskaksnaodnasnakdnaosnaond' 'losers_sorted.txt'\", shellExitCode = ExitFailure 1}`\r\n\r\nAs far as I can tell, the syntax is correct as per the documentation, and works fine in similar applications like `hyperfine`. Any idea what's going on here? Is this possibly a problem with the shell that `bench` uses on a Windows system, or is something else at work here?\r\n\r\nThanks for the help, I'd appreciate it a lot."},"comment":{"url":"https://api.github.com/repos/Gabriel439/bench/issues/comments/428361841","html_url":"https://github.com/Gabriel439/bench/issues/38#issuecomment-428361841","issue_url":"https://api.github.com/repos/Gabriel439/bench/issues/38","id":428361841,"node_id":"MDEyOklzc3VlQ29tbWVudDQyODM2MTg0MQ==","user":{"login":"Kaos-Industries","id":16962031,"node_id":"MDQ6VXNlcjE2OTYyMDMx","avatar_url":"https://avatars3.githubusercontent.com/u/16962031?v=4","gravatar_id":"","url":"https://api.github.com/users/Kaos-Industries","html_url":"https://github.com/Kaos-Industries","followers_url":"https://api.github.com/users/Kaos-Industries/followers","following_url":"https://api.github.com/users/Kaos-Industries/following{/other_user}","gists_url":"https://api.github.com/users/Kaos-Industries/gists{/gist_id}","starred_url":"https://api.github.com/users/Kaos-Industries/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kaos-Industries/subscriptions","organizations_url":"https://api.github.com/users/Kaos-Industries/orgs","repos_url":"https://api.github.com/users/Kaos-Industries/repos","events_url":"https://api.github.com/users/Kaos-Industries/events{/privacy}","received_events_url":"https://api.github.com/users/Kaos-Industries/received_events","type":"User","site_admin":false},"created_at":"2018-10-09T21:37:55Z","updated_at":"2018-10-09T21:37:55Z","author_association":"NONE","body":"> \r\n> \r\n> @Kaos-Industries: What exit code does the `grep` command return when run outside of `bench`? `grep` can return a non-zero exit code it finds no matches\r\n\r\n`grep` does return an exit code of 1 as it should, due to the fact that the string I'm testing with is a dummy string with no matches. Surely `bench` is able to benchmark programs even if they return a non-zero exit code?\r\n\r\n> \r\n> \r\n> Just to save everyone some time here: We have been going through the exact same thing on the Hyperfine bug tracker: [sharkdp/hyperfine#90](https://github.com/sharkdp/hyperfine/issues/90)\r\n> \r\n> My guess would be that `bench` also uses `cmd.exe` to run shell commands on Windows. And `LC_ALL=C grep..` isn't valid syntax in `cmd.exe`.\r\n> \r\n> > As far as I can tell, the syntax is correct as per the documentation, and works fine in similar applications like `hyperfine`.\r\n> \r\n> @Kaos-Industries Why would you claim that? It doesn't work in hyperfine as well, and there is a detailed analysis in the ticket above.\r\n\r\nYou're right of course, when writing that I was juggling so many different tests and tools that I was struggling to keep track of what was going on. The idea that the cause of these `bench` errors would be the same as that of the one I came across a week or so ago in `hyperfine` did occur to me, but I figured the fact that there was no sign of CMD's `'x is not recognized as an internal or external command,\r\noperable program or batch file` that it would have a separate cause. If it as you say and the problem here is that, like `hyperfine`, `bench` can only use CMD as its shell on a Windows environment, it's unfortunate that neither of the benchmarking tools that I've so far come across, apart from `time`, works successfully in a Cygwin environment.\r\n\r\n"}}
{"actor":{"display_login":"Kaos-Industries"}}