Skip to content

Fix linter not work on Windows/MinGW-x64 #118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 17, 2019
Merged

Fix linter not work on Windows/MinGW-x64 #118

merged 2 commits into from
Mar 17, 2019

Conversation

machsix
Copy link
Contributor

@machsix machsix commented Mar 11, 2019

In previous version, to make linter works on Windows, there are the following three requirements:

  1. Install MinGW-x64 version gfortran compiler. NOT MSYS2, NOT Cygwin. Only MinGW-x64 can run natively on windows. You can install it by first install mysys2 and then run pacman -Syu and pacman -S mingw-w64-x86_64-toolchain.
  2. Add the bin directory to the PATH environment variable, for my case, it's C:\msys64\mingw64\bin
  3. Add the path of gfortran to the Gfortran Excutable, for my case, it's C:\msys64\mingw64\bin\gfortran.exe

This PR removes the second requirement since editing PATH globally can ruin other program. The fix extracts the path of bin directory of gfortran and adds it to the PATH of child_process

Fix #116

@pedro-ricardo
Copy link
Collaborator

Looks good to me!

@pedro-ricardo pedro-ricardo mentioned this pull request Mar 16, 2019
7 tasks
@pedro-ricardo pedro-ricardo changed the base branch from master to release/2.1.0 March 16, 2019 13:46
@pedro-ricardo pedro-ricardo requested a review from krvajal March 16, 2019 16:01
Co-Authored-By: machsix <28209092+machsix@users.noreply.github.com>
@machsix
Copy link
Contributor Author

machsix commented Mar 16, 2019

travis shows the following error because linux has env.PATH instead of env.Path. I tried to add // @ts-ignore ahead of the lines but prettier seems to strip that out.

> tsc -p ./
src/features/linter-provider.ts:42:16 - error TS2339: Property 'Path' does not exist on type '{ LC_ALL: string; }'.
42       if (!env.Path.includes(path.dirname(command))) {
                  ~~~~
src/features/linter-provider.ts:43:13 - error TS2339: Property 'Path' does not exist on type '{ LC_ALL: string; }'.
43         env.Path = `${path.dirname(command)}${path.delimiter}${env.Path}`;
               ~~~~
src/features/linter-provider.ts:43:68 - error TS2339: Property 'Path' does not exist on type '{ LC_ALL: string; }'.
43         env.Path = `${path.dirname(command)}${path.delimiter}${env.Path}`;
                                                                      ~~~~

@krvajal krvajal merged commit b0c27ce into fortran-lang:release/2.1.0 Mar 17, 2019
krvajal pushed a commit that referenced this pull request Mar 26, 2019
### Check List
- [x] Merge #120 suggestion of #105
- [x] Merge #112 for fix on issue #110
- [x] Merge #117 for fix on issue #115
- [x] Merge #118 for fix on issue #116
- [x] Merge #122 for fix on issue #113
- [x] Update CHANGELOG.md
- [x] Update Package.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants