Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Update Documentation for BLT under WSL #509

Closed
geerlingguy opened this issue Oct 6, 2016 · 13 comments
Closed

Update Documentation for BLT under WSL #509

geerlingguy opened this issue Oct 6, 2016 · 13 comments
Labels
Enhancement A feature or feature request

Comments

@geerlingguy
Copy link
Contributor

Running BLT under the Windows Subsystem for Linux (Ubuntu Bash) is a little more complicated than is currently stated in the documentation—though there are some parts that I think we can consolidate and make simpler.

I'm working on rebuilding BLT + Drupal VM a few times on my old Lenovo running Windows 10, and I found a few extra tips and tricks to help get everything working correctly.

I'll submit a PR with proposed changes/additions, and I'll also add a few notes to this issue for posterity/background.

@geerlingguy
Copy link
Contributor Author

Eh... one weird thing—I'm getting the following error message whenever Drupal VM hits the Run drush to finish setting it up task:

Drush was not found in this project's vendor/bin directory.

And it tries to install all the project dependencies (including phantomjs-installer and a zillion other things) instead of just... running /usr/local/bin/drush.

The only place on the internet I've seen that message is in here: https://github.com/mariagwyn/mariagwynBLT/blob/master/drush.wrapper — what's this used for?

Also, how is it that if I vagrant ssh into the VM and literally run /usr/local/bin/drush, Drush seems to work just fine, printing out it's built-in help?

@geerlingguy
Copy link
Contributor Author

Ah, that's just a fork... it's in https://github.com/acquia/blt/blob/8.x/template/drush.wrapper

@geerlingguy
Copy link
Contributor Author

geerlingguy commented Oct 6, 2016

So I guess @grasmash how is this thing supposed to work, and how is it possible that running the command /usr/local/bin/drush during Vagrant provisioning is getting wrapped by this wrapper?

(And on another level, why would installing drush, even with this wrapper, require installing phantomjs-installer?)

The default from geerlingguy.drush is drush_path: /usr/local/bin/drush, and that's the command that's called in the VM. How is it that the drush.wrapper script is overriding that? Scratching my head... (If I run drush by itself inside the project synced directory at /var/www/blted8, I can reproduce the error above).

@grasmash
Copy link
Contributor

grasmash commented Oct 7, 2016

@geerlingguy When the drush command is run from within the repository, it looks for and runs drush.wrapper. The wrapper script tells the global install of drush to use the repo's vendor/bin/drush as its binary. It essentially overrides global drush. However, we need to make sure that composer dependencies have actually been built before attempting to execute vendor/bin/drush, hence the call to composer install. We might be able to change this tocomposer install drush/drush.

@geerlingguy
Copy link
Contributor Author

geerlingguy commented Oct 7, 2016

To pull down the latest dev version:

composer create-project acquia/blt-project=8.x-dev test --no-interaction

Much easier than having to do all of this, thanks to @grasmash adding a dev branch — thanks!

@geerlingguy
Copy link
Contributor Author

@grasmash - I'm going to putz around with it on the windows environment/VM today and see if I can get it working.

Note that if we are able to get rid of the dependency on phantomjs, this problem (like many others) would go away :)

@geerlingguy
Copy link
Contributor Author

geerlingguy commented Oct 7, 2016

On latest master the build fails with:

"PhantomJS v1.9.8 is already installed. Skipping the installation."

Also got an error "file_put_contents(/vagrant/vendor/bin/drupal): failed to open stream: No such file or directory"

@geerlingguy
Copy link
Contributor Author

Testing with composer require drush/drush inside the drush wrapper...

@geerlingguy
Copy link
Contributor Author

geerlingguy commented Oct 7, 2016

Ah, so the reason why drush.wrapper seems to be failing is that the symbolic link—which is created during BLT setup in the Ubuntu Bash environment—is not working inside the VM.

If I ssh into the VM, then run ls -lah /vagrant/vendor/bin/drush, I get:

ls: cannot read symbolic link drush: Protocol error
lrwxrwxrwx 1 vagrant vagrant   20 Oct  7 16:06 drush

Within the host (Windows 10 under Ubuntu Bash), I see the symlink like:

lrwxrwxrwx 1 root root  20 Oct  7 11:06 drush -> ../drush/drush/drush

@geerlingguy
Copy link
Contributor Author

Fun times...

Symlinks are supported within the Linux filesystem, but not on `/mnt/`…

We’re looking into fixing this in the future.

Found here: https://blogs.windows.com/buildingapps/2016/03/30/run-bash-on-ubuntu-on-windows/#yhiOMwz0h3iI2FQt.97

@geerlingguy
Copy link
Contributor Author

#515 to fix the above issue.

@geerlingguy
Copy link
Contributor Author

geerlingguy commented Oct 7, 2016

So a few more notes (just to keep myself up to date):

@grasmash
Copy link
Contributor

All relevant pull requests merged.

@grasmash grasmash added the Enhancement A feature or feature request label Oct 12, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Enhancement A feature or feature request
Projects
None yet
Development

No branches or pull requests

2 participants