Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Windows support TODOs #88

Closed
11 tasks done
angrybrad opened this issue Apr 24, 2020 · 18 comments
Closed
11 tasks done

Windows support TODOs #88

angrybrad opened this issue Apr 24, 2020 · 18 comments
Milestone

Comments

@angrybrad
Copy link
Member

angrybrad commented Apr 24, 2020

  • need native windows installer/updater (installer now works on git bash)

  • add/host command is broken because of sudo and different hosts path
    The current solution works find in Cmder and Goland console, but cmd.exe is giving this:

    C:\Users\taco\temp>nitro apply
    Applied changes from C:\Users\taco\.nitro\nitro-dev.yaml
    Editing your hosts file
    Error: exec: "sudo": executable file not found in %PATH%
    
  • interactive commands require j k l h keys to navigate instead of arrows (fixed by new prompt library)

  • redis command "Error: not supported by windows"

  • ssh command "Error: not supported by windows"

  • Figure out what to do with prompt library (make fork an official go module)? Because of Windows bugs among other issues.

  • Test our prompt library.

  • self-update currently broken, but investigating fix

  • ssh and redis commands kind of work. You get a prompt, but no keyboard input is allowed.
    multipass shell works fine from cmd.exe, but nitro ssh has this behavior (regardless of if nitro ssh uses c := exec.Command(mp, "shell", machine) or not)

  • Uninstall instructions in readme

  • nitro remove is broken on Windows.

D:\dev\nitro>nitro add
What should the hostname be? [nitro]
Where is the webroot? [www]
Added nitro to config file
Apply changes from config? [yes]
Mounting D:\dev\nitro to nitro-dev
Adding site nitro to nitro-dev
Applied changes from C:\Users\taco\.nitro\nitro-dev.yaml
Editing your hosts file

D:\dev\nitro>nitro remove
  1 - nitro
Select a site to remove? [1] 1
Error: unable to find an associated mount

nitro-dev.yaml

php: "7.4"
mounts:
  - source: D:\dev\nitro
    dest: /nitro/sites/nitro
databases:
  - engine: mysql
    version: "5.7"
    port: "3306"
sites:
  - hostname: nitro
    webroot: /nitro/sites/nitro/www
$ nitro ssh
Welcome to Ubuntu 18.04.4 LTS (GNU/Linux 4.15.0-96-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Thu Apr 30 19:06:02 PDT 2020

  System load:  0.0               Processes:              120
  Usage of /:   7.0% of 38.60GB   Users logged in:        0
  Memory usage: 52%               IP address for eth0:    172.18.8.166
  Swap usage:   0%                IP address for docker0: 172.17.0.1

0 packages can be updated.
0 updates are security updates.

Last login: Thu Apr 30 19:14:48 2020 from 172.18.8.161
ubuntu@nitro-dev:~$
@jasonmccallister
Copy link
Contributor

jasonmccallister commented Apr 29, 2020

I just pushed code that will be in the next release to correct redis and ssh errors on Windows. The interactive prompt is now removed.

@angrybrad angrybrad changed the title Native Windows support TODOs Windows support TODOs May 1, 2020
@brandonkelly brandonkelly added this to the v1.0.0 milestone May 5, 2020
@clarknelson
Copy link

When I run bash <(curl -sLS http://installer.getnitro.sh) on windows powershell I get this error:

At line:1 char:6
+ bash <(curl -sLS http://installer.getnitro.sh)
+      ~
The '<' operator is reserved for future use.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : RedirectionNotSupported

Hope this helps!

@clarknelson
Copy link

I believe my issue is multipass is installed on windows (PS) and not WSL or bash

@angrybrad
Copy link
Member Author

@jasonmccallister
Copy link
Contributor

jasonmccallister commented May 9, 2020

I need to work on the paths for the apply command, path destinations are coming out strange on Windows:

Removing mount C:/Users/Jason from nitro-dev
Mounting ~\go\src\github.com\craftcms\nitro\demo-site to nitro-dev
umount failed: The following errors occurred:
"=>" is not mounted
"=>" not found in database

Note: probably because I have a space in my username

@clarknelson
Copy link

Thanks, I suppose that makes sense I am new to windows development.

Here is what I have now. The command runs but it wont let me input a command before it terminates:

nitro-install-windows

@angrybrad
Copy link
Member Author

@clarknelson yup resolved here and will be in the next beta release, early next week. #115

@angrybrad
Copy link
Member Author

@jasonmccallister I'm sure you already know, but gotta "" those Windows paths take into account spaces.

@clarknelson
Copy link

Great! I will start with Homestead and come back to Nitro when the new release is out :)

@jasonmccallister
Copy link
Contributor

I just pushed a fix for the windows redis and ssh commands. I also resolved the issue with spaces in mount paths.

@delixyr
Copy link

delixyr commented May 16, 2020

powershell_76ESsqndk2
I get this

@clarknelson
Copy link

clarknelson commented May 21, 2020

Now I have this error when trying to install:

image

I may be missing software as it's a pretty new machine.

@sa3dany
Copy link
Contributor

sa3dany commented May 21, 2020

I think the install script should ask you to add the nitro dir /c/users/clark/Nitro to your path since it can't do that on Windows easily.

What the installer script does is essentially grab the nitro.exe from the latest release tag an put it in /c/Users/clark/Nitro then it tries to run nitro init.

Windows support is still WIP since many commands don't run in Windows yet.

@clarknelson
Copy link

clarknelson commented May 21, 2020

thanks for the heads up on the path so I can keep going, devs say they will focus on windows support soon

@delixyr
Copy link

delixyr commented May 21, 2020

@jasonmccallister

@clarknelson
I believe my issue is multipass is installed on windows (PS) and not WSL or bash

@clarknelson Yup... Git Bash is required https://github.com/craftcms/nitro/blob/windows/README.md#installation

Install Multipass (requires 1.2.0+).
Download nitro_windows_x86_64.zip from the latest release
Create a Nitro folder in your home folder. i.e. C:\Users<username>\Nitro
Extract the zip file and copy nitro.exe into the Nitro folder you just created in your home folder.
Run this from the command line to add nitro to your global path: setx path "%PATH%;%USERPROFILE%\Nitro"
Run nitro init to create your first machine.

Where does it say it requires wsl to be enabled or gitbash as a pre-requisite? The commands runs only on cmd or powershell.
bash comes to play after you run an instance within powershell?

@delixyr
Copy link

delixyr commented May 24, 2020

@brandonkelly @jasonmccallister

For windows there is still the need of php and composer installed as native for composer to work?
Can we cd to path/to/project and run composer of the nitro-dev to be folder to install craft?
Also we do still need to edit hosts file manually to resolve a site host name?
Can you shed light on exact steps for windows in the documentation.

@angrybrad
Copy link
Member Author

@delixyr

For windows there is still the need of php and composer installed as native for composer to work?

Not really related to Windows, but no for PHP and the next beta release will have Composer installed in the Nitro machine by default (see #149).

Can we cd to path/to/project and run composer of the nitro-dev to be folder to install craft?

Yes.

Also we do still need to edit hosts file manually to resolve a site host name?

Yes, because of this:

CleanShot 2020-05-23 at 22 13 19@2x

Can you shed light on exact steps for windows in the documentation.

We will update the docs on the windows branch as progress is made. Please note that Windows is still a WIP so there are issues we are working through in the beta. We plan to have official Windows support before 1.0 launches.

@angrybrad
Copy link
Member Author

We just released Nitro 1.0.0-beta.6 which greatly improves Windows support. Works with regular old cmd.exe, but the biggest caveats are 1) cmd.exe needs to be run with Administrator permissions and 2) installing/updating is a manual process. Be sure and check out the README for Windows-specific instructions.

Going to go ahead and close this one out and we can keep track of Windows tickets separately in their own issues now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants