https://bugs.winehq.org/show_bug.cgi?id=46751
Bug ID: 46751 Summary: Allow starting native binaries Product: Wine Version: unspecified Hardware: x86 OS: other Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: kolan_n@mail.ru
Sometimes apps use CLI apps, and these CLI apps have a version native for the OS and a compatible command line interface. It would be nice to allow Windows apps to call them.
An example of such an app is git.
Of course paths in arguments and env variables should be rewritten automatically.
https://bugs.winehq.org/show_bug.cgi?id=46751
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |z.figura12@gmail.com
--- Comment #1 from Zebediah Figura z.figura12@gmail.com --- (In reply to KOLANICH from comment #0)
Of course paths in arguments and env variables should be rewritten automatically.
That's harder than you think. How do you know what's a path?
https://bugs.winehq.org/show_bug.cgi?id=46751
--- Comment #2 from KOLANICH kolan_n@mail.ru --- OK. Another idea: [intercept syscalls](https://github.com/pmem/syscall_intercept), making the called process understand Windows paths with respect to the prefix.
https://bugs.winehq.org/show_bug.cgi?id=46751
--- Comment #3 from KOLANICH kolan_n@mail.ru --- Both methods are incomplete. 1. detecting path will fail on something like -m.\a\b 2. intercepting syscalls will fail if the binary checks path syntax
https://bugs.winehq.org/show_bug.cgi?id=46751
--- Comment #4 from KOLANICH kolan_n@mail.ru --- 3. Manually writing a spec of program CLI is an option too, but not a good one: it have to be updated.
The solution may be creating a geteric spec: specifying common conventions in the CLI like (-a a and --arg=a) vs -arg a vs -arga for most args, using arg-specific ones only if strictly necessary.
A spec may be a JSON file like
{ "binary":"/usr/bin/git", "import":["./common.json"], "types":{ "gitArgType": here is a (G)LR grammar for an arg with something marking which piece is path }, "spec": here is a (G)LR grammar for args, using the types from types and imported specs }
The rewriter processes imports and constructs the spec, then it finds the positions of the stuff which is a path and replaces them with the rewritten paths
All the three methods should he used in combination.
https://bugs.winehq.org/show_bug.cgi?id=46751
Fabian Maurer dark.shadow4@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dark.shadow4@web.de
--- Comment #5 from Fabian Maurer dark.shadow4@web.de --- Windows programs under wine can already call linux programs, you just need to give them the right path. What exactly is thew problem here?
https://bugs.winehq.org/show_bug.cgi?id=46751
joaopa jeremielapuree@yahoo.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jeremielapuree@yahoo.fr
--- Comment #6 from joaopa jeremielapuree@yahoo.fr ---
Windows programs under wine can already call linux programs, you just need to give them the right path
How do you do that? I did not find any wiki in winehq site explaining the way to achieve this.
https://bugs.winehq.org/show_bug.cgi?id=46751
--- Comment #7 from Fabian Maurer dark.shadow4@web.de --- Just execute them like normal binaries, e.g.
start z:\bin\bash -c "echo hello > x.txt"
https://bugs.winehq.org/show_bug.cgi?id=46751
--- Comment #8 from KOLANICH kolan_n@mail.ru ---
Just execute them like normal binaries,
We still need the rewriting engine allowing applications to call native binaries with arbitrary parameters.
https://bugs.winehq.org/show_bug.cgi?id=46751
--- Comment #9 from Fabian Maurer dark.shadow4@web.de --- Applications can already call native binaries with arbitrary parameters. And what is a "rewriting engine"?
https://bugs.winehq.org/show_bug.cgi?id=46751
--- Comment #10 from Ken Thomases ken@codeweavers.com --- If you want arguments rewritten, write a native wrapper script to invoke the native app and arrange for Wine to invoke that wrapper script. Writing the wrapper script is an exercise for the reader and outside of the scope of Wine.
https://bugs.winehq.org/show_bug.cgi?id=46751
--- Comment #11 from KOLANICH kolan_n@mail.ru ---
And what is a "rewriting engine"?
Mostly the ones transforming paths passed via cli arguments and env variables.
If you want arguments rewritten, write a native wrapper script to invoke the native app and arrange for Wine to invoke that wrapper script.
Wrapper scripts is not an universal approch. They require user actions. The proposed approach requires to write several generic profiles (can be shipped with wine), and most of apps should work out of the box without any actions done by users. No wrapper scripts, just wine itself.