Summary: | misc/mc 4.8.14 fails with "Cannot create pipe streams" when running shell commands using the Filtered View menu item on the File menu | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | Trond Endrestøl <Trond.Endrestol> | ||||||
Component: | Individual Port(s) | Assignee: | Adam Weinberger <adamw> | ||||||
Status: | Closed FIXED | ||||||||
Severity: | Affects Many People | CC: | adamw, woodsb02 | ||||||
Priority: | --- | Flags: | woodsb02:
maintainer-feedback+
|
||||||
Version: | Latest | ||||||||
Hardware: | Any | ||||||||
OS: | Any | ||||||||
Attachments: |
|
Description
Trond Endrestøl
2015-04-11 07:37:57 UTC
I can confirm I am seeing the same error on my system (built with the default port options). I'll look into it. (In reply to Ben Woods from comment #1) Using absolute paths, such as /usr/local/sbin/lsof, produces the desired outcome. Maybe MC doesn't properly locate the executable when we only provide the name of the executable, lsof, similar to the example above. Created attachment 155497 [details]
Patch to misc/mc to use the PATH environment variable to search for the executable when running Filtered View
You are correct that mc does not use the PATH environment variable to search for the executable when performing a Filtered View command. The filtered view command is run with the mc_popen function in lib/utilunix.c. This function runs the process with the glib function g_spawn_async_with_pipes, which by default requires the full path of the executable. Details defined here: https://developer.gnome.org/glib/stable/glib-Spawning-Processes.html#g-spawn-async-with-pipes The attached patch adds the G_SPAWN_SEARCH_PATH to the g_spawn_async_with_pipes function call, which causes mc to use the PATH environment variable to search for the executable. This fixes/improves this behaviour. Created attachment 155498 [details]
Successful poudriere testport logs on FreeBSD 10.1 amd64
I have also submitted this patch upstream: https://github.com/MidnightCommander/mc/pull/59 (In reply to Ben Woods from comment #6) Goodie. I can confirm the patch works on stable/10 r281411. Thanks. This patch has just been accepted upstream, however it looks like their next release is still some time away. Suggest we go ahead and add this patch to the port in the mean time. A commit references this bug: Author: adamw Date: Mon Apr 27 12:19:47 UTC 2015 New revision: 384828 URL: https://svnweb.freebsd.org/changeset/ports/384828 Log: Fix "Cannot create pipe streams" when running shell commands using the Filtered View menu item on the File menu. PR: 199366 Reported by: Trond.Endrestol@ximalas.info Patch by: Ben Woods (maintainer) Changes: head/misc/mc/Makefile head/misc/mc/files/patch-lib_utilunix.c Committed. For the next update, Ben, can you please remove the need to include <bsd.port.options.mk>? |