extension-chrome icon indicating copy to clipboard operation
extension-chrome copied to clipboard

Setup instructions for Windows

Open DanAtkinson opened this issue 6 years ago • 16 comments

The setup instructions provided in the readme appear to be for non-Windows machines.

There is no ability to execute ./script/setup on Windows, and looking at the script itself, it appears to be Perl.

Is there a Windows alternative for setup instructions? I otherwise have all other stated requirements.

DanAtkinson avatar Mar 19 '18 15:03 DanAtkinson

If the file is Perl, just add Perl to your system path, open CMD, and type Perl + execution block.

perl setup

Frontear avatar Mar 19 '18 18:03 Frontear

It is not a perl file, it's just a regular shell file so this works best on linux/macos environments. @DanAtkinson What version of windows are you running? I know that Win10 has a linux subsystem you could utilize to run this file. If not, we'll need to write a .bat file that could be run in older windows environments.

taesup avatar Mar 19 '18 23:03 taesup

@taesup I know what you're getting at, but sadly my version of Windows is too low. It's Windows 10 but it's stuck at v1511 due to some critical software installed which is not yet compatible with 1607.

If you do not support outdated versions of Windows, I can accept it, but as this is just a step in order to get the extension set up then I would ask for consideration to be made to make a batch file to support earlier environments.

Thanks, Dan

DanAtkinson avatar Mar 20 '18 10:03 DanAtkinson

Okay... So after a lot of playing around, I could run the setup script but no builds folder was created.

First, I had to run the following command: gem install bundler

Without this, I got an error when running perl script\setup - "ERROR: 'bundle' was not found in $PATH. Install bundle v and then rerun this script."

Then I ran perl script\setup. Output is as follows:

/c/tools/ruby25/bin/ruby
/c/Program Files/nodejs/node
/c/tools/ruby25/bin/bundle
/c/Program Files/nodejs/npm
script\setup: line 12: warning: command substitution: ignored null byte in input
OK: bundle install
OK: npm install -g yarn
warning " > [email protected]" has incorrect peer dependency "react@^15.0.0".
OK: yarn install
DONE!

Perhaps it's worth noting the react-timeago dependency warning.

In any case, as I mentioned, there is no builds folder once the setup script has run. It's also unclear how I can run browser=chrome build=debug grunt from the Windows command line, or whether this again needs to be prefixed with something else.

DanAtkinson avatar Mar 20 '18 20:03 DanAtkinson

@DanAtkinson so the script/setup shell script only installs the dependencies for the project. It does not build the project. To build the project, you will need to run the browser=chrome build=debug grunt command from the command line while you are in the root for the project. This could be done via the cmd.exe executable that should already be pre-installed with your windows installation.

With regard to the script/setup file, how did you manage to run that file? Just so others who are in the same situation as you have an answer.

taesup avatar Mar 21 '18 06:03 taesup

Executing the command from cmd does not work as browser is not recognised. See screengrab below. This was done in Cmder, but it's just a command line wrapper.

image

Regarding getting the install working, I laid out the steps above. Firstly, I needed to install bundler (via gem install bundler) and then I ran perl script\setup which would be the equivalent of ./script/setup on Windows.

DanAtkinson avatar Mar 21 '18 09:03 DanAtkinson

@DanAtkinson Sidenote: In the spirit of open source and sharing of information we'd be very happy if you are willing to add a section to the README with Windows build instructions once you get it up and running. Feel free to submit a Pull Request if you get around to do it!

tommienu avatar Mar 21 '18 12:03 tommienu

I will, although I think it's probably best to spin up a VM and go through the steps. I already had several components installed such as Ruby and Node (but I also use NVM, albeit the Windows variant).

DanAtkinson avatar Mar 21 '18 12:03 DanAtkinson

There's no movement on this. I'm still unable to execute browser=chrome in the browser. Any help would be great.

DanAtkinson avatar Apr 04 '18 17:04 DanAtkinson

Sorry about the lack of movement. We've just finished a major milestone and this got pushed to the back burner. So as far as the browser=chrome is related, that whole section before the grunt command is just setting some environment variables before running the grunt command (which also needs to be installed globally using npm npm i -g grunt).

So I'm not too familiar with setting the environment variables inline with a command in windows, but I believe this should work:

set browser=chrome
set build=debug
grunt

Please give that a try and let me know how it goes.

taesup avatar Apr 06 '18 06:04 taesup

Thank you. This has led me further down the track but ultimately it's failed again.

Running "deletebuild" task
'rm' is not recognized as an internal or external command,
operable program or batch file.
Warning: Command failed: rm -rf ./builds/debug
'rm' is not recognized as an internal or external command,
operable program or batch file.
 Use --force to continue.

Aborted due to warnings.

Having looked at the gruntfile, I can see that it's littered with bash commands which are just not executing in a Windows terminal (Windows 10 - v1511).

Thanks, Dan

DanAtkinson avatar Apr 06 '18 11:04 DanAtkinson

I've looked into this issue and since it affects our build process, I'll have to rewrite that section so that it's compatible with windows machines. The best approach is to probably use OS agnostic tools to replicate the shell commands being used. Rimraf and mkdirp come to mind for the directory deletion and creation. Unfortunately, I'm blocked by a few other tasks right now. But I wanted to at least reply and let you know that this is on my plate, there is a way forward, and that we acknowledge and appreciate your feedback.

I'm hoping that I can get to this by the end of the week or at least the beginning of the next week. Thank you for your patience.

taesup avatar Apr 10 '18 06:04 taesup

I was playing with the extension last night and thought that, perhaps you could split the gruntfile and the system commands. For example, you could create an isWindows check with typeof process.env.windir !== 'undefined' which should return true for Windows boxes, or false for other.

In my local version, I needed to perform this check on the deletebuild, createbuild, copyfiles, and removeartifacts builds, mainly because of the direction of the slashes. I also needed to modify buildconfig.json file so that the buildpath property used Windows-style directory separation.

From there, I got through some of the tasks until it crashed out at sass:dist with the following error:

Running "sass:dist" (sass) task
Could not find public_suffix-3.0.1 in any of the sources
Run `bundle install` to install missing gems.
Could not find public_suffix-3.0.1 in any of the sources
Run `bundle install` to install missing gems.
Warning: Exited with error code 7 Use --force to continue.

I ran bundle install as suggested but sadly got the following error:

Gem::RuntimeRequirementNotMetError: nokogiri requires Ruby version < 2.5, >=
2.2. The current ruby version is 2.5.0.
An error occurred while installing nokogiri (1.8.1), and Bundler cannot continue.
Make sure that `gem install nokogiri -v 1.8.1` succeeds before bundling.

DanAtkinson avatar Apr 10 '18 10:04 DanAtkinson

@DanAtkinson Just wanted to let you know that I updated the repo with a new gruntfile that should be windows compatible. Please give it a try and offer any feedback.

taesup avatar May 28 '18 17:05 taesup

Unfortunately my previous computer broke and I've had to buy a new one. It's taken me until today to get anywhere near a semblance of normality.

I did try out the changes and I was able to build the extension but was not able to actually run it. Unfortunately I don't recall the reasons why but will have to look again once I've reinstalled Ruby.

As a happy result of my old machine's premature expiry, my new Windows 10 build is now 1709, so running Linux commands using the subsystem should now be possible.

Thanks, Dan

DanAtkinson avatar Jun 26 '18 16:06 DanAtkinson

Sorry to hear about your computer. With the newest code base, you shouldn't need Ruby at all. I've also updated the README to be more specific about the commands to run if the user is on windows. Although with the new linux subsystem, you may not need those commands anymore and can rely purely on the linux commands.

taesup avatar Jun 28 '18 01:06 taesup