Open sganis opened 6 years ago
On 28 Jul 2018 14:13, "Santiago Ganis" notifications@github.com wrote:
@billziss-gh https://github.com/billziss-gh I was wondering if you could include some documentation to build sshfs in windows, similar to the passthrough tutorial in winfsp, which is excellent. Thank you.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/billziss-gh/sshfs-win/issues/41, or mute the thread https://github.com/notifications/unsubscribe-auth/AEE6AyWQlhWVvEoVo10IIoK_qD7Dsg-dks5uLFVsgaJpZM4VlBZu .
Thanks @4O4 . Fair enough. It didn't work for me as easy as you mention, there was something wrong in my setup, but I understand the process a little more now. I just needed to debug something in the sshfs-win.exe and it builds with a simple "gcc sshfs-win.c" invocation.
Here is my building experience, just for documentation purposes:
Install SSHFS-Win, WinFsp, and WIX Toolset. Versions that I used in this test: SSHFS-Win 3.2 BETA, WinFsp 2018.2 B2, WIX Toolset 3.11.
Install cygwin Download from https://www.cygwin.com/setup-x86_64.exe Run installer and follow default settings
Install development tools, minimum packages: gcc-g++,make,automake,patch,vim,git,libglib2.0-devel,cygport,meson. An simple way to do it is this: Copy setup-x86_64.exe to c:\cygwin64, then from a cygwin terminal run: $ /setup-x86_64.exe -q -B -P gcc-g++,make,automake,patch,vim,git,libglib2.0-devel,cygport,meson
Install cygfuse by running: $ /cygdrive/c/Program\ Files\ (x86)/WinFsp/opt/cygfuse/install.sh
Clone the sshfs-win repository $ git clone https://github.com/billziss-gh/sshfs-win.git
Update the sshfs submodule Go to the sshfs-win project directory, then run: $ git submodule init $ git submodule update
Run make in parallel mode $ make -j8
An msi file installer will be saved in .build/x64/dist folder. It builds with some warnings that I coundn't get rid of, such as missing rst2man package.
Thanks to @billziss-gh for the latest release.
@sganis thank you for the instructions. I will adapt them and add them to the README.
Does anyone know how to make a proper debug build? Seems that the problem lays within the 'ninja' config but it's impossible to edit it since it's pretty much 'make clean & make' to build the stuff. And 'clean' erases the ninja config so therefore you cannot edit it when it's building the application immediately after downloading the code (again?) from git. I used the instructions from @sganis to perform the compilation.
I need to debug the sshfs process itself and the default config doesn't generate the symbols. It would also be really nice to get this whole thing working on Visual Studio because debugging (and compiling + starting the app) via GDB is painful.
I think @sganis had a Visual Studio build at some point.
To produce debug builds with meson
I think you need to use --buildtype=debug
. See here.
After messing around I got it to work, I will post here what I did:
So that's what I did, and it works somewhat since sshfs.exe now contains debug symbols. (I did not attempt actual debugging itself since I've spent a lot of time on this and it's night time already!) It is extremely painful to do this: I can't really believe that it's supposed to be done this way so I am probably doing something wrong. The real problem is I think that 'make' is cloning this git repo with it's own config file which makes you lose your changes when you execute 'make clean'. Are there simple commands to do this for me? Compiling + debugging is pretty awkward like this. I also would like to know whether I am indeed supposed to edit the .c files in the cloned git repo, or in the main folder.
@darkcharmander if you need to debug sshfs the best approach is to work against the upstream sshfs project directly. I use the SSHFS-Win Makefile only when I want to package it for distribution.
This project's goal was to provide patches for sshfs to build on Cygwin, and a Makefile/script to package all necessary files for deployment and easy use on Windows. It was never meant to facilitate debugging or development of sshfs.
Most sshfs-win patches have been upstreamed to the sshfs project, which should now build against a Cygwin with FUSE installed (available from the WinFsp installer).
Thanks for clearing that up, I see that it is indeed a separate project. I will take a look at that one.
@billziss-gh I was wondering if you could include some documentation to build sshfs in windows, similar to the passthrough tutorial in winfsp, which is excellent. Thank you.