Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jan 17, 2021. It is now read-only.
/sshcodePublic archive

MSYS/MINGW Client Support (FINNALLY Working)#127

Closed
Merith-TK wants to merge13 commits intocoder:masterfromMerith-TK:msys-support
Closed

MSYS/MINGW Client Support (FINNALLY Working)#127

Merith-TK wants to merge13 commits intocoder:masterfromMerith-TK:msys-support

Conversation

Merith-TK
Copy link
Contributor

@Merith-TKMerith-TK commentedJul 24, 2019
edited
Loading

EDIT: OLD IMAGES HAVE BEEN REDUCED TO LINKS TO SAVE POST SPACE

Basically, I have madesshcode run properly onmsys/mingw enviroments,

TL;DR

  • Chrome only works when usingmsys/cygwin based enviroments
  • sshcode only works inmsys/cygwin based enviroments
  • sshcode incmd.exe does not work yet due to how sshcode callsssh

Summary of my edits

  • main.go > Added filepath conversion, (thanks@eargollo )
  • settings.go > added default paths for VSCode data on windows
  • sshcode.go > copied and slightly tweaked thewslPath to match awindows enviroment for accessing theC:\ drive.

TODO

  • 100% windows support: NOTE, I do not plan on implementing this for the time being, i feel like i have dont enought to make a great step towards windows support, this todo will be a log of the errors in windows
    • Some odd bug where it returns this when running withcmd.exe
    • The error appears to be sshcode not actually executingssh on windows even if it is in%path%
      • This appears to be because of howsshcode calls thessh command
C:\Misc\MegaSync\Code\Workspace\sshcode>go buildC:\Misc\MegaSync\Code\Workspace\sshcode>sshcode.exe --skipsync merith@192.168.0.1012019-07-29 20:58:13 �[94mINFO�[0m       failed to stat ~/.ssh directory, disabling connection reuse feature: CreateFile ~\.ssh: The system cannot find the path specified.2019-07-29 20:58:13 �[94mINFO�[0m       ensuring code-server is updated...2019-07-29 20:58:13 �[31mFATAL�[0m      error: failed to update code-server:---ssh cmd---ssh  merith@192.168.0.101 '/usr/bin/env bash -l'---download script---set -euxo pipefail || exit 1[ "$(uname -m)" != "x86_64" ] && echo "Unsupported server architecture $(uname -m). code-server only has releases for x86_64 systems." && exit 1pkill -f ~/.cache/sshcode/sshcode-server || truemkdir -p ~/.local/share/code-server ~\.cache\sshcodecd ~\.cache\sshcodecurlflags="-o latest-linux"if [ -f latest-linux ]; then        curlflags="$curlflags -z latest-linux"ficurl $curlflags https://codesrv-ci.cdr.sh/latest-linux[ -f ~/.cache/sshcode/sshcode-server ] && rm ~/.cache/sshcode/sshcode-serverln latest-linux ~/.cache/sshcode/sshcode-serverchmod +x ~/.cache/sshcode/sshcode-server: exec: "sh": executable file not found in %PATH%

attached image is of it building and running (first working release,)
https://user-images.githubusercontent.com/10422110/61765201-ef1c0e80-ad90-11e9-87cb-b46e6dc2a909.gif

This image is of the second build working just fine, Note, yes i did have to drag the window over from the side, that is because i have two monitors, and for some reason my mouse wasnt recorded so... thats a thing
https://user-images.githubusercontent.com/10422110/62153007-8533c580-b2b8-11e9-9d2b-03e25af9bbd0.gif

8-9-2019, 1211-7PST
This build has the sshMaster fix (i didnt bother building it again just for the example as it would take FOREVER as seen in previous pictures, and sorry for horrible quality,)
https://user-images.githubusercontent.com/10422110/62803352-094b3180-ba9f-11e9-818f-4c4b93fb60ed.gif

8-9-2019, 1308-7PST
this build is a work in progress, some users may have to modifymain.go to match their setups. otherwisesshcode --skipsync user@server /<choosen filepath> works. In the example i open/opt on the server
https://user-images.githubusercontent.com/10422110/62806173-f50b3280-baa6-11e9-8438-71a5aa6d7104.gif

8-9-2019, 1358-7PST
Not going to upload gif, would take to long, but rsync now works provided its installed and in path
UPDATE: DESPITE WHAT TRAVIS SAYS, IT WORKS, AND BUILDS JUST FINE

xparq reacted with thumbs up emoji
@Merith-TKMerith-TK changed the titleMsys supportMSYS/MINGW Client SupportJul 24, 2019
@Merith-TKMerith-TK mentioned this pull requestJul 24, 2019
Copy link
Member

@deansheatherdeansheather left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

If this was compiled on regular Windows, do paths like/c/.../ even work?

Chrome support needs to be tested before this can be merged.

xparq reacted with thumbs up emoji
@Merith-TK
Copy link
ContributorAuthor

Merith-TK commentedJul 30, 2019
edited
Loading

If this was compiled on regular Windows, do paths like/c/.../ even work?

You were correct in questioning this,
paths like/c/Program Files (x86)/Google/Chrome/Application/chrome.exethe correct path for this wouldve been/Program Files (x86)/Google/Chrome/Application/chrome.exe

@deansheather

@Merith-TKMerith-TK changed the titleMSYS/MINGW Client SupportMSYS/MINGW Client Support (Working Properly)Aug 2, 2019
@Merith-TK
Copy link
ContributorAuthor

Merith-TK commentedAug 6, 2019
edited
Loading

@deansheather

If this was compiled on regular Windows, do paths like/c/.../ even work?

Chrome support needs to be tested before this can be merged.

Can you please close this edit? i am unable to since i had to roll back a little bit and its missing. so it just bugs our and gives a error that the commit does not exist
image

Copy link
Member

@deansheatherdeansheather left a comment
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This needs the relative path stuff from eargollo's PR so~/file on windows corresponds to~/file on the server instead ofC:\Users\dean\file. I understand you two wanted to combine your PRs into one.

The README's "OS support" section should be updated saying how to get it working on Windows.

@Merith-TK
Copy link
ContributorAuthor

Merith-TK commentedAug 6, 2019
edited
Loading

@deansheather The issue i am seeing with his code, is that there is ATLEAST 100+ lines of code MISSING from his fork and the Mainstream Repo. Which means (to me atleast) i dont know if i can SAFELY add his code into mine and have it be update, which i have informed him of this and he is confused about it

Also he has yet to get back to me on that

EDIT: On local build, adding his code into mine manually does seem to work, but if i were to, for examplesshcode --skipsync developer@archlinux /home, in the command status output, it gives thisbash: line 0: cd: /home/developer/../../msys: No such file or directory which means its treating the root folder as its own file path arg, which i have no clue how to fix.
Another example. is persay i want to edit~/.bashrc, it tries to open/home/developer/../../msys/home/merith/.bashrc instead of/home/developer/.bashrc
bash: line 0: cd: /home/developer/../../msys/home/merith/.bashrc

@Merith-TKMerith-TK changed the titleMSYS/MINGW Client Support (Working Properly)MSYS/MINGW Client Support (Mostly Working)Aug 7, 2019
@deansheather
Copy link
Member

That needs to be fixed then, should be as simple as stripping the msys paths.

@Merith-TK
Copy link
ContributorAuthor

Merith-TK commentedAug 7, 2019 via email

Yep, I just need to figure out how to do that... And rsync still isn'tworking. At all.
On Tue, Aug 6, 2019, 7:09 PM Dean Sheather ***@***.***> wrote: That needs to be fixed then, should be as simple as stripping the msys paths. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#127>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ACPQOXUPELOUL7NFSBZJDR3QDIVEHANCNFSM4IGL5L3Q> .

@teddy-codes
Copy link
Contributor

You should probably usedeltacopy instead ofrsync on windows.

@Merith-TK
Copy link
ContributorAuthor

@roberthmiller

You should probably usedeltacopy instead ofrsync on windows.

Welp this is actually my first time even touchinggo code and judging from the progress, im actually doing pretty okay. I dont know how to do that yet so if you want, feel free to fork and help me out!

Copy link
Member

@deansheatherdeansheather left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Tested this with Merith today on Windows 10 in a VM, using MINGW64 (from Git Bash):

  • Syncing doesn't work, even with rsync installed:
    2019-08-08 12:59:14 FATAL       error: failed to sync settings: CreateFile //Users/dean/AppData/Roaming/Code/User: The network name cannot be found.
  • SSH master connections don't work:
    2019-08-08 12:52:25 INFO        failed to stat ~/.ssh directory, disabling connection reuse feature: CreateFile ~\.ssh: The system cannot find the path specified.
  • Slash paths (i.e./home/dean/folder) don't work, but tilde/dot paths work (i.e.~/folder,./folder):
    bash: line 0: cd: too many arguments

@deansheather
Copy link
Member

My bad, forgot Windows doesn't have sockets. SSH master connections aren't really possible on Windows except in WSL. If the OS is Windows, we should skip the SSH directory check and not attempt to open a master socket.

@teddy-codes
Copy link
Contributor

I am pretty sure that is what he was attempting to do with--skip-sync, but we would have to apply that by default on windows... Not sure if that is a good idea or not (seems fine for me).

@Merith-TK
Copy link
ContributorAuthor

Merith-TK commentedAug 8, 2019 via email
edited
Loading

All skip sync does is make it not sync with `rsync`? Right? Or am I wrong?Couldn't we use `scp`? I think it might have a sync directive. I may be wrong.
On Wed, Aug 7, 2019, 8:33 PM Robert M ***@***.***> wrote: I am pretty sure that is what he was attempting to do with --skip-sync, but we would have to apply that by default on windows... Not sure if that is a good idea or not (seems fine for me). — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#127>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ACPQOXWXFSF52B7QJESTH5LQDOHX7ANCNFSM4IGL5L3Q> .

@deansheather
Copy link
Member

@roberthmiller I wasn't referring to sync when I said master connections don't work on Windows. Sync is definitely possible on Windows, and should work with rsync once the code that determines which directory to use locally is fixed.

@Merith-TK
Copy link
ContributorAuthor

Updated withmaster ssh connection fixed, AND the

2019-08-08 12:59:14 FATAL error: failed to sync settings: CreateFile //Users/user/AppData/Roaming/Code/User: The network name cannot be found.

issue, the code that converted the windows filepath to a linux compatable format was adding a extra/ where it wasnt needed

in reference to@eargollo 's

// gitbashWindowsDir translates a directory similar to `C:\Users\username\path` to `~/path` for compatibility with Git bash.funcgitbashWindowsDir(dirstring) (resstring) {res=filepath.ToSlash(dir)res="/"+strings.Replace(res,":","",-1)returnres}

Specificallyres = "/" + strings.Replace(res, ":", "", -1)

Copy link
ContributorAuthor

@Merith-TKMerith-TK left a comment
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I looked, specifically to remove the annoying "requested changes" that left basically nothing

@Merith-TK
Copy link
ContributorAuthor

Tested this with Merith today on Windows 10 in a VM, using MINGW64 (from Git Bash):

  • Syncing doesn't work, even with rsync installed:
    2019-08-08 12:59:14 FATAL       error: failed to sync settings: CreateFile //Users/dean/AppData/Roaming/Code/User: The network name cannot be found.
  • SSH master connections don't work:
    2019-08-08 12:52:25 INFO        failed to stat ~/.ssh directory, disabling connection reuse feature: CreateFile ~\.ssh: The system cannot find the path specified.
  • Slash paths (i.e./home/dean/folder) don't work, but tilde/dot paths work (i.e.~/folder,./folder):
    bash: line 0: cd: too many arguments

*Fixed Master SSH connection issue (Flat out Disabled if on windows)

*~/ seem to go to WINDOWS ~ for some odd reason...

*rsync is now the issue.error 11, testing possible fixes

@teddy-codes
Copy link
Contributor

teddy-codes commentedAug 9, 2019
edited
Loading

It looks like the~ is a problem. Is the issue here?https://github.com/cdr/sshcode/pull/127/files#diff-7ddfb3e035b42cd70649cc33393fe32cR134

Why not exclusively useuser. HomeDir?

@Merith-TK
Copy link
ContributorAuthor

Merith-TK commentedAug 9, 2019
edited
Loading

It looks like the~ is a problem. Is the issue here?https://github.com/cdr/sshcode/pull/127/files#diff-7ddfb3e035b42cd70649cc33393fe32cR134

Quite possibly. Im testing to see if that entire code block, "relativeWindowsPath" is actually needed. when i disabled it. it seems to simplfy the issue from/home/user/../../<path to mingw isntall directory on windows>/<path you told it to go to> not existing,
to/<path to mingw install directory>/<path you told it to go to> not existing

My mingw install dir isC:\msys\

examplesshcode developer@archlinux used to give the error (for me)
bash: line 0: cd: /home/developer/../../msys/opt/ No such file or directory

now its
bash: line 0: cd: /msys/opt: No such file or directory

EDIT for your comment @roberthmiller : I dont know yet, Im still learning this programming language, but i am working on~/ paths, if you have a replacement for that, i would be happy to hear it (along with a gobyexample link so i can look at its reference if possible?)

@Merith-TK
Copy link
ContributorAuthor

rsync still does not work due to how its requesting the server's directory

2019-08-09 13:40:22 INFO       syncing settingssending incremental file listrsync: change_dir "/Users/zachd/AppData/Roaming/Code/User" failed: No such file or directory (2)rsync: mkdir "/home/developer/~/.local/share/code-server/User" failed: No such file or directory (2)rsync error: error in file IO (code 11) at main.c(664) [Receiver=3.1.3]2019-08-09 13:40:23 FATAL      error: failed to sync settings: failed to rsync '/Users/zachd/AppData/Roaming/Code/User/' to 'developer@archlinux:~/.local/share/code-server/User/': exit status 11

@Merith-TK
Copy link
ContributorAuthor

I MADE IT WORK!!! So rsync was trying to use/Users inside a mingw enviroment, which flat out doesnt work, so i tried slapping a/c to the beginning AND IT WORKS

zachd@DESKTOP-BQUQ80R MINGW64 /c/Users/zachd/Documents/Workspace2/sshcode-msys$ ./sshcode.exe developer@archlinux workspace2019-08-09 13:49:46 INFO        OS is windows, disabling connection reuse feature2019-08-09 13:49:46 INFO        ensuring code-server is updated...++ uname -m+ '[' x86_64 '!=' x86_64 ']'+ pkill -f /home/developer/.cache/sshcode/sshcode-server+ true+ mkdir -p /home/developer/.local/share/code-server /home/developer/.cache/sshcode+ cd /home/developer/.cache/sshcode+ curlflags='-o latest-linux'+ '[' -f latest-linux ']'+ curlflags='-o latest-linux -z latest-linux'+ curl -o latest-linux -z latest-linux https://codesrv-ci.cdr.sh/latest-linux  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                 Dload  Upload   Total   Spent    Left  Speed  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0+ '[' -f /home/developer/.cache/sshcode/sshcode-server ']'+ rm /home/developer/.cache/sshcode/sshcode-server+ ln latest-linux /home/developer/.cache/sshcode/sshcode-server+ chmod +x /home/developer/.cache/sshcode/sshcode-server2019-08-09 13:49:48 INFO        syncing settingssending incremental file listsent 226 bytes  received 14 bytes  480.00 bytes/sectotal size is 1,131,117  speedup is 4,712.992019-08-09 13:49:49 INFO        synced settings in 414.7449ms2019-08-09 13:49:49 INFO        syncing extensionssending incremental file list./13xforever.language-x86-64-assembly-2.2.11/13xforever.language-x86-64-assembly-2.2.11/.vsixmanifest13xforever.language-x86-64-assembly-2.2.11/CHANGELOG.md13xforever.language-x86-64-assembly-2.2.11/LICENSE.txt13xforever.language-x86-64-assembly-2.2.11/README.md13xforever.language-x86-64-assembly-2.2.11/language-configuration.json13xforever.language-x86-64-assembly-2.2.11/logo.png13xforever.language-x86-64-assembly-2.2.11/package.json13xforever.language-x86-64-assembly-2.2.11/.vscode/13xforever.language-x86-64-assembly-2.2.11/.vscode/launch.json

I cut off there becayse it was going to take FOREVER with all my extensions

@Merith-TKMerith-TK changed the titleMSYS/MINGW Client Support (Mostly Working)MSYS/MINGW Client Support (FINNALLY Working)Aug 9, 2019
@Merith-TK
Copy link
ContributorAuthor

Merith-TK commentedAug 9, 2019
edited
Loading

When i ran travis personally on this, i get this

 go test -v ./...=== RUN   TestSSHCode2019-08-09 21:07:59 INFOensuring code-server is updated...sh: 25: [[: not foundWarning: Permanently added '[127.0.0.1]:9360' (RSA) to the list of known hosts.sh: 25: [[: not foundgo version go1.12.7 linux/amd64++uname -m+'[' x86_64 '!=' x86_64 ']'+pkill -f /home/travis/.cache/sshcode/sshcode-server+true+mkdir -p /home/travis/.local/share/code-server /home/travis/.cache/sshcode+cd /home/travis/.cache/sshcode+curlflags='-o latest-linux'+'[' -f latest-linux ']'+curl -o latest-linux https://codesrv-ci.cdr.sh/latest-linux  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                 Dload  Upload   Total   Spent    Left  Speed100 90.1M  100 90.1M    0     0  82.3M      0  0:00:01  0:00:01 --:--:-- 82.4M+'[' -f /home/travis/.cache/sshcode/sshcode-server ']'+ln latest-linux /home/travis/.cache/sshcode/sshcode-server+chmod +x /home/travis/.cache/sshcode/sshcode-server2019-08-09 21:08:01 INFOsyncing settingssh: 25: [[: not foundsending incremental file listrsync: mkdir "/home/travis/gopath/src/go.coder.com/retry/.local/share/code-server/User" failed: No such file or directory (2)rsync error: error in file IO (code 11) at main.c(674) [Receiver=3.1.1]

@Merith-TK
Copy link
ContributorAuthor

But when i actually BUILD it. it has no issue? i built it and ran it myself. (Archlinux, windows10-mingw64) it didnt have any issues...

Copy link
ContributorAuthor

@Merith-TKMerith-TK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

how do i make this "requested changes" GO AWAY!? IVE MADE THE CHANGES!

@Merith-TK
Copy link
ContributorAuthor

Merith-TK commentedAug 10, 2019
edited
Loading

@roberthmiller I looked into your suggestion, that would work for git4windows as your home directory isC:\Users\user, but it wouldnt exactly play NICE with mingw enviroments, since mingw uses/home/user instead,

Although i think i could implement theos/user import to help determine user, only issue with that is on windows it flat out gives your user in this formatPACNAME\username

@deansheather
Copy link
Member

If you just need the home directory path, useos.UserHomeDir().

@Merith-TK
Copy link
ContributorAuthor

That's fine for git4win (uses yourc:\users\Username as home) , but it still reads Mingw as windows when Mingw uses/home/username

GOOS on git4win and Mingw, are detected as WINDOWS,

But I shall check further, I still and trying to figure out just WHY Travis is failing despite the program compiling and running without any issue on actual systems (hell, it still works on my android phone. Chrome doesn't work but every thing else does as expected)

@Merith-TK
Copy link
ContributorAuthor

Merith-TK commentedAug 14, 2019
edited
Loading

FROM THIS POINT ON, THE PUSHES ARE JUST GOING TO BE SHILLED TO TRY AND GET IT TROUGH THE BLOODY PIPELINE WHILE ALSO NOT BREAKING SUPPORT FOR SYSTEMS

@Merith-TK
Copy link
ContributorAuthor

closing this to make a CLEANER PR

Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

1 more reviewer

@deansheatherdeansheatherdeansheather requested changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@Merith-TK@deansheather@teddy-codes

[8]ページ先頭

©2009-2025 Movatter.jp