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

Add wslbridge-backend path from command #25

Closed
wants to merge 2 commits into from
Closed

Add wslbridge-backend path from command #25

wants to merge 2 commits into from

Conversation

Biswa96
Copy link

@Biswa96 Biswa96 commented Apr 7, 2018

I've added the -p option to add wslbridge-backend path. With that option, the backend find can be put in anywhere.

@rprichard
Copy link
Owner

You already closed #23?

I don't think I understand why this option is needed. You've run into a situation where the two files can't be in the same directory, I guess?

I'd prefer something more descriptive than -p. Maybe --backend <PATH>.

It looks like your -p option accepts a Windows-style path rather than a WSL-style path. The Windows-to-WSL path conversion has had some issues, so if there's an option to specify the backend path, maybe it ought to be a WSL-style path to sidestep those issues.

@rprichard
Copy link
Owner

Even with your change, wslbridge will abort if it can't find the backend executable in the expected location. It's still calling findBackendProgram() even when -p is passed.

Are you trying to package multiple backends to accommodate different distributions, maybe? I've been thinking lately that maybe the backend should be statically linked so it works with non-glibc distributions...

replace `-p` option with `-b` or `--backend` option in `getopt_long()`. And add the path in findBackendProgram() function.
@Biswa96
Copy link
Author

Biswa96 commented Apr 17, 2018

May you please accept these changes? This helps in wsltty.appx project.

@rprichard
Copy link
Owner

Why does the wsltty.appx project need the flag?

@Biswa96
Copy link
Author

Biswa96 commented Apr 17, 2018

Because in UWP environment the backend cannot be executed. So it need to copied in LocalAppData. And with that option I can execute backend from that path.

Also with this option users have no restriction to put both files in same directory.

@rprichard
Copy link
Owner

Ok, that makes sense. I'll try to look at the change soon. Maybe I'll just add a --backend option.

@rprichard
Copy link
Owner

Not necessary. I already have this behavior written. I'll push it within a day:

  --backend BACKEND
                Overrides the default path to wslbridge-backend. BACKEND is a
                Cygwin-style path (not a WSL path).

It takes a path to the file rather than a path to a directory containing the file. I assume that's not an issue.

@rprichard
Copy link
Owner

It's just the normal Cygwin rules. /cygdrive/c/foo is OK, as is C:\foo. /foo and \foo, however, will refer to C:\path\to\cygwin\foo, whereas the ordinary Windows rules would interpret it as drive-relative, e.g. C:\foo.

rprichard added a commit that referenced this pull request Apr 22, 2018
Apparently this is useful for the appx bundling of wsltty. That project
copies wslbridge.exe and wslbridge-backend to a separate directory to get
around a permissions issue, and it'd be better if only the backend were
copied.

Fixes #23
See #25
See mintty/wsltty#63
@Biswa96
Copy link
Author

Biswa96 commented Apr 22, 2018

Should I close this PR?

@rprichard
Copy link
Owner

Yes, please close it.

@Biswa96 Biswa96 closed this Apr 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants