Skip to content
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

Sudden Windows build failures #30

Closed
jviotti opened this issue Mar 16, 2017 · 5 comments · Fixed by balena-io/etcher#1191
Closed

Sudden Windows build failures #30

jviotti opened this issue Mar 16, 2017 · 5 comments · Fixed by balena-io/etcher#1191
Labels

Comments

@jviotti
Copy link
Contributor

jviotti commented Mar 16, 2017

lzma-native is suddenly failing to build in all Etcher pull requests on Windows for no apparent reason. See the following build logs for an example: https://ci.appveyor.com/project/resin-io/etcher/build/job/2cfvk4dpnder5c62

These are the errors we're seeing:

[00:04:07] > [email protected] install C:\projects\etcher\node_modules\lzma-native
[00:04:07] > node-pre-gyp install --fallback-to-build
[00:04:07] 
[00:04:13] Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
[00:04:15]   build
[00:04:15]   The input line is too long.
[00:04:15] C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 1. [C:\projects\etcher\node_modules\lzma-native\build\liblzma.vcxproj]
[00:04:15] gyp ERR! build error 
[00:04:15] gyp ERR! stack Error: `msbuild` failed with exit code: 1
[00:04:15] gyp ERR! stack     at ChildProcess.onExit (C:\projects\etcher\node_modules\node-gyp\lib\build.js:285:23)
[00:04:15] gyp ERR! stack     at emitTwo (events.js:106:13)
[00:04:15] gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
[00:04:15] gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
[00:04:15] gyp ERR! System Windows_NT 6.3.9600
[00:04:15] gyp ERR! command "c:\\Program Files\\nodejs\\node.exe" "C:\\projects\\etcher\\node_modules\\node-gyp\\bin\\node-gyp.js" "build" "--fallback-to-build" "--module=C:\\projects\\etcher\\node_modules\\lzma-native\\binding\\lzma_native.node" "--module_name=lzma_native" "--module_path=C:\\projects\\etcher\\node_modules\\lzma-native\\binding"
[00:04:15] gyp ERR! cwd C:\projects\etcher\node_modules\lzma-native
[00:04:15] gyp ERR! node -v v6.1.0
[00:04:15] gyp ERR! node-gyp -v v3.6.0
[00:04:15] gyp ERR! not ok 
[00:04:15] node-pre-gyp ERR! build error 
[00:04:15] node-pre-gyp ERR! stack Error: Failed to execute 'c:\Program Files\nodejs\node.exe C:\projects\etcher\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\projects\etcher\node_modules\lzma-native\binding\lzma_native.node --module_name=lzma_native --module_path=C:\projects\etcher\node_modules\lzma-native\binding' (1)
[00:04:15] node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\projects\etcher\node_modules\lzma-native\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
[00:04:15] node-pre-gyp ERR! stack     at emitTwo (events.js:106:13)
[00:04:15] node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
[00:04:15] node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:850:16)
[00:04:15] node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
[00:04:15] node-pre-gyp ERR! System Windows_NT 6.3.9600
[00:04:15] node-pre-gyp ERR! command "c:\\Program Files\\nodejs\\node.exe" "C:\\projects\\etcher\\node_modules\\lzma-native\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
[00:04:15] node-pre-gyp ERR! cwd C:\projects\etcher\node_modules\lzma-native
[00:04:15] node-pre-gyp ERR! node -v v6.1.0
[00:04:15] node-pre-gyp ERR! node-pre-gyp -v v0.6.29
[00:04:15] node-pre-gyp ERR! not ok 
[00:04:15] Failed to execute 'c:\Program Files\nodejs\node.exe C:\projects\etcher\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\projects\etcher\node_modules\lzma-native\binding\lzma_native.node --module_name=lzma_native --module_path=C:\projects\etcher\node_modules\lzma-native\binding' (1)

The above errors during npm install finally result in:

[00:04:18] npm ERR! Windows_NT 6.3.9600
[00:04:18] npm ERR! argv "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
[00:04:18] npm ERR! node v6.1.0
[00:04:18] npm ERR! npm  v3.8.6
[00:04:18] npm ERR! code ELIFECYCLE
[00:04:18] 
[00:04:18] npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
[00:04:18] npm ERR! Exit status 1
[00:04:18] npm ERR! 
[00:04:18] npm ERR! Failed at the [email protected] install script 'node-pre-gyp install --fallback-to-build'.
[00:04:18] npm ERR! Make sure you have the latest version of node.js and npm installed.
[00:04:18] npm ERR! If you do, this is most likely a problem with the lzma-native package,
[00:04:18] npm ERR! not with npm itself.
[00:04:18] npm ERR! Tell the author that this fails on your system:
[00:04:18] npm ERR!     node-pre-gyp install --fallback-to-build
[00:04:18] npm ERR! You can get information on how to open an issue for this project with:
[00:04:18] npm ERR!     npm bugs lzma-native
[00:04:18] npm ERR! Or if that isn't available, you can get their info via:
[00:04:18] npm ERR!     npm owner ls lzma-native
[00:04:18] npm ERR! There is likely additional logging output above.
[00:04:18] 
[00:04:18] npm ERR! Please include the following file with any support request:
[00:04:18] npm ERR!     C:\projects\etcher\npm-debug.log

We're shrinkwrapping our dependencies, so we're guessing the problem is caused by either a development dependency or node/npm.

I cloned this repo and checked out the 1.5.2 tag (which is the one we're using) on a Windows 10 machine running npm 3.10.10 on node v6.9.4 and got the following errors when doing npm install ---build-from-source:

C:\Projects\lzma-native>npm install --build-from-source

> [email protected] install C:\Projects\lzma-native
> node-pre-gyp install --fallback-to-build


C:\Projects\lzma-native>if not defined npm_config_node_gyp (node "C:\Users\jviotti\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" clean )  else (node "" clean )

C:\Projects\lzma-native>if not defined npm_config_node_gyp (node "C:\Users\jviotti\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" configure --fallback-to-build --module=C:\Projects\lzma-native\binding\lzma_native.node --module_name=lzma_native --module_path=C:\Projects\lzma-native\binding )  else (node "" configure --fallback-to-build --module=C:\Projects\lzma-native\binding\lzma_native.node --module_name=lzma_native --module_path=C:\Projects\lzma-native\binding )
Warning: Missing input files:
C:\Projects\lzma-native\build\..\deps\doc\liblzma.def

C:\Projects\lzma-native>if not defined npm_config_node_gyp (node "C:\Users\jviotti\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" build --fallback-to-build --module=C:\Projects\lzma-native\binding\lzma_native.node --module_name=lzma_native --module_path=C:\Projects\lzma-native\binding )  else (node "" build --fallback-to-build --module=C:\Projects\lzma-native\binding\lzma_native.node --module_name=lzma_native --module_path=C:\Projects\lzma-native\binding )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  build
  Microsoft (R) Library Manager Version 14.00.24215.1
  Copyright (C) Microsoft Corporation.  All rights reserved.

LINK : fatal error LNK1104: cannot open file 'C:\Projects\lzma-native\deps\doc\liblzma.def' [C:
\Projects\lzma-native\build\liblzma.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `msbuild` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\jviotti\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\jviotti\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "build" "--fallback-to-build" "--module=C:\\Projects\\lzma-native\\binding\\lzma_native.node" "--module_name=lzma_native" "--module_path=C:\\Projects\\lzma-native\\binding"
gyp ERR! cwd C:\Projects\lzma-native
gyp ERR! node -v v6.9.4
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd build --fallback-to-build --module=C:\Projects\lzma-native\binding\lzma_native.node --module_name=lzma_native --module_path=C:\Projects\lzma-native\binding' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Projects\lzma-native\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:877:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System Windows_NT 10.0.14393
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Projects\\lzma-native\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Projects\lzma-native
node-pre-gyp ERR! node -v v6.9.4
node-pre-gyp ERR! node-pre-gyp -v v0.6.33
node-pre-gyp ERR! not ok
Failed to execute 'node-gyp.cmd build --fallback-to-build --module=C:\Projects\lzma-native\binding\lzma_native.node --module_name=lzma_native --module_path=C:\Projects\lzma-native\binding' (1)npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the lzma-native package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs lzma-native
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls lzma-native
npm ERR! There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\jviotti\AppData\Roaming\npm-cache\_logs\2017-03-16T16_39_42_730Z-debug.log

To summarize, the above output prints the following error:

LINK : fatal error LNK1104: cannot open file 'C:\Projects\lzma-native\deps\doc\liblzma.def' [C:
\Projects\lzma-native\build\liblzma.vcxproj]

And the referenced file does not exist:

C:\Projects\lzma-native\deps>dir
 Volume in drive C has no label.
 Volume Serial Number is 9890-734C

 Directory of C:\Projects\lzma-native\deps

03/16/17  12:31 PM    <DIR>          .
03/16/17  12:31 PM    <DIR>          ..
03/16/17  12:31 PM                36 .gitignore
03/16/17  12:31 PM                 0 .npmignore
03/16/17  12:31 PM           647,563 xz-5.2.1-windows.7z
03/16/17  12:31 PM               543 xz-5.2.1-windows.7z.sig
03/16/17  12:31 PM         1,186,051 xz-5.2.1.tar.bz2
03/16/17  12:31 PM               543 xz-5.2.1.tar.bz2.sig
               6 File(s)      1,834,736 bytes
               2 Dir(s)  98,177,015,808 bytes free

Do you have any clues about what might be going wrong?

@lurch
Copy link

lurch commented Mar 16, 2017

For comparison, this is the last Appveyor build where it did build successfully https://ci.appveyor.com/project/resin-io/etcher/build/1.0.2804/job/qf8dip3bafk0i6sj
It'd been working fine (for ages) up until recently, and it's only in the last couple of days that it's been failing (each time).

@jviotti
Copy link
Contributor Author

jviotti commented Mar 16, 2017

Looks like everything works if I run npm run prepare first, which is the npm task that creates the doc directory that the build is complaining about:

C:\Projects\lzma-native>npm install --build-from-source

> [email protected] install C:\Projects\lzma-native
> node-pre-gyp install --fallback-to-build


C:\Projects\lzma-native>if not defined npm_config_node_gyp (node "C:\Users\jviotti\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" clean )  else (node "" clean )

C:\Projects\lzma-native>if not defined npm_config_node_gyp (node "C:\Users\jviotti\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" configure --fallback-to-build --module=C:\Projects\lzma-native\binding\lzma_native.node --module_name=lzma_native --module_path=C:\Projects\lzma-native\binding )  else (node "" configure --fallback-to-build --module=C:\Projects\lzma-native\binding\lzma_native.node --module_name=lzma_native --module_path=C:\Projects\lzma-native\binding )

C:\Projects\lzma-native>if not defined npm_config_node_gyp (node "C:\Users\jviotti\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" build --fallback-to-build --module=C:\Projects\lzma-native\binding\lzma_native.node --module_name=lzma_native --module_path=C:\Projects\lzma-native\binding )  else (node "" build --fallback-to-build --module=C:\Projects\lzma-native\binding\lzma_native.node --module_name=lzma_native --module_path=C:\Projects\lzma-native\binding )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  build
  Microsoft (R) Library Manager Version 14.00.24215.1
  Copyright (C) Microsoft Corporation.  All rights reserved.

     Creating library C:\Projects\lzma-native\deps\bin_x86-64\lzma.lib and object C:\Projects\lzma-native\deps\bin_x86-64\lzma.exp
          1 file(s) copied.
  util.cpp
  liblzma-functions.cpp
..\src\liblzma-functions.cpp(52): warning C4244: 'argument': conversion from 'int64_t' to 'uint32_t', possible loss of data [C:\Projects\lzma-native\build\lzma_native.vcxproj]
..\src\liblzma-functions.cpp(58): warning C4244: 'argument': conversion from 'int64_t' to 'uint32_t', possible loss of data [C:\Projects\lzma-native\build\lzma_native.vcxproj]
..\src\liblzma-functions.cpp(75): warning C4244: 'argument': conversion from 'int64_t' to 'uint32_t', possible loss of data [C:\Projects\lzma-native\build\lzma_native.vcxproj]
..\src\util.cpp(101): warning C4244: '=': conversion from 'uint64_t' to 'uint32_t', possible loss of data [C:\Projects\lzma-native\build\lzma_native.vcxproj]
..\src\util.cpp(102): warning C4244: '=': conversion from 'uint64_t' to 'uint32_t', possible loss of data [C:\Projects\lzma-native\build\lzma_native.vcxproj]
..\src\util.cpp(103): warning C4244: '=': conversion from 'uint64_t' to 'uint32_t', possible loss of data [C:\Projects\lzma-native\build\lzma_native.vcxproj]
..\src\util.cpp(104): warning C4244: '=': conversion from 'uint64_t' to 'uint32_t', possible loss of data [C:\Projects\lzma-native\build\lzma_native.vcxproj]
..\src\util.cpp(106): warning C4244: '=': conversion from 'uint64_t' to 'uint32_t', possible loss of data [C:\Projects\lzma-native\build\lzma_native.vcxproj]
..\src\util.cpp(108): warning C4244: '=': conversion from 'uint64_t' to 'uint32_t', possible loss of data [C:\Projects\lzma-native\build\lzma_native.vcxproj]
..\src\util.cpp(114): warning C4244: 'argument': conversion from 'uint64_t' to 'uint32_t', possible loss of data [C:\Projects\lzma-native\build\lzma_native.vcxproj]
..\src\util.cpp(147): warning C4244: 'return': conversion from 'double' to 'uint64_t', possible loss of data [C:\Projects\lzma-native\build\lzma_native.vcxproj]
c:\projects\lzma-native\node_modules\nan\nan_new.h(208): warning C4244: 'argument': conversion from 'uint64_t' to 'double', possible loss of data (compiling source file ..\src\util.cpp) [C:\Pro
jects\lzma-native\build\lzma_native.vcxproj]
  ..\src\util.cpp(123): note: see reference to function template instantiation 'v8::Local<v8::Number> Nan::New<v8::Number,uint64_t>(A0)' being compiled
          with
          [
              A0=uint64_t
          ]
  filter-array.cpp
  lzma-stream.cpp
..\src\filter-array.cpp(19): warning C4267: 'argument': conversion from 'size_t' to 'uint32_t', possible loss of data [C:\Projects\lzma-native\build\lzma_native.vcxproj]
..\src\filter-array.cpp(44): warning C4244: '=': conversion from 'uint64_t' to 'uint32_t', possible loss of data [C:\Projects\lzma-native\build\lzma_native.vcxproj]
..\src\lzma-stream.cpp(99): warning C4244: 'argument': conversion from 'int64_t' to 'int', possible loss of data [C:\Projects\lzma-native\build\lzma_native.vcxproj]
..\src\lzma-stream.cpp(226): warning C4267: 'argument': conversion from 'size_t' to 'uint32_t', possible loss of data [C:\Projects\lzma-native\build\lzma_native.vcxproj]
..\src\lzma-stream.cpp(373): warning C4996: 'v8::Function::NewInstance': was declared deprecated [C:\Projects\lzma-native\build\lzma_native.vcxproj]
  c:\users\jviotti\.node-gyp\6.9.4\include\node\v8.h(3270): note: see declaration of 'v8::Function::NewInstance'
..\src\lzma-stream.cpp(444): warning C4244: 'argument': conversion from 'int64_t' to 'uint32_t', possible loss of data [C:\Projects\lzma-native\build\lzma_native.vcxproj]
..\src\lzma-stream.cpp(489): warning C4244: 'argument': conversion from 'int64_t' to 'uint32_t', possible loss of data [C:\Projects\lzma-native\build\lzma_native.vcxproj]
..\src\lzma-stream.cpp(499): warning C4244: 'argument': conversion from 'int64_t' to 'uint32_t', possible loss of data [C:\Projects\lzma-native\build\lzma_native.vcxproj]
  module.cpp
  mt-options.cpp
  index-parser.cpp
  win_delay_load_hook.cc
..\src\index-parser.cpp(459): warning C4996: 'v8::Function::NewInstance': was declared deprecated [C:\Projects\lzma-native\build\lzma_native.vcxproj]
  c:\users\jviotti\.node-gyp\6.9.4\include\node\v8.h(3270): note: see declaration of 'v8::Function::NewInstance'
..\src\index-parser.cpp(479): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data [C:\Projects\lzma-native\build\lzma_native.vcxproj]
..\src\index-parser.cpp(490): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data [C:\Projects\lzma-native\build\lzma_native.vcxproj]
     Creating library C:\Projects\lzma-native\build\Release\lzma_native.lib and object C:\Projects\lzma-native\build\Release\lzma_native.exp
  Generating code
  Finished generating code
  lzma_native.vcxproj -> C:\Projects\lzma-native\build\Release\\lzma_native.node
  lzma_native.vcxproj -> C:\Projects\lzma-native\build\Release\lzma_native.pdb (Full PDB)
  Copying C:\Projects\lzma-native\build\Release\/lzma_native.node to C:/Projects/lzma-native/binding\lzma_native.node
          1 file(s) copied.

> [email protected] prepare C:\Projects\lzma-native
> cd deps && 7z x -y xz-5.2.1-windows.7z bin_i686/liblzma.dll bin_x86-64/liblzma.dll include doc/liblzma.def


7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21

Scanning the drive for archives:
1 file, 647563 bytes (633 KiB)

Extracting archive: xz-5.2.1-windows.7z
--
Path = xz-5.2.1-windows.7z
Type = 7z
Physical Size = 647563
Headers Size = 1293
Method = LZMA:3m BCJ
Solid = +
Blocks = 2

Everything is Ok

Folders: 2
Files: 36
Size:       1891268
Compressed: 647563

Based on this output, it looks like the prepare task is running after the build, which makes no sense.

jviotti pushed a commit to balena-io/etcher that referenced this issue Mar 18, 2017
We've been recently hitting a weird `lzma-native` build error on Windows
(both locally and on Appveyor CI):

```
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  build
  The input line is too long.

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 1. [C:\projects\etcher\node_modules\lzma-native\build\liblzma.vcxproj]
```

After a lot of experimentation, we realised the issue was gone if we
removed `node-sass` from the development dependencies.

The issue is that `node-gyp` was recently upgraded to v3.6.0, which was
picked up by `node-sass`, which declares `node-gyp` as a dependency. For
some reason, if `node-sass` causes `node-gyp` to be updated, then
`lzma-native` fails with the above cryptic error.

I was able to trace down the error to the following `node-gyp` commit:

nodejs/node-gyp@ae141e1

As a solution, this commit starts to shrinkwrap development
dependencies, and locks `node-gyp` to v3.5.0 until the issue is fixed.

Fixes: addaleax/lzma-native#30
Signed-off-by: Juan Cruz Viotti <[email protected]>
jviotti pushed a commit to balena-io/etcher that referenced this issue Mar 18, 2017
We've been recently hitting a weird `lzma-native` build error on Windows
(both locally and on Appveyor CI):

```
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  build
  The input line is too long.

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 1. [C:\projects\etcher\node_modules\lzma-native\build\liblzma.vcxproj]
```

After a lot of experimentation, we realised the issue was gone if we
removed `node-sass` from the development dependencies.

The issue is that `node-gyp` was recently upgraded to v3.6.0, which was
picked up by `node-sass`, which declares `node-gyp` as a dependency. For
some reason, if `node-sass` causes `node-gyp` to be updated, then
`lzma-native` fails with the above cryptic error.

I was able to trace down the error to the following `node-gyp` commit:

nodejs/node-gyp@ae141e1

As a solution, this commit starts to shrinkwrap development
dependencies, and locks `node-gyp` to v3.5.0 until the issue is fixed.

Fixes: addaleax/lzma-native#30
Signed-off-by: Juan Cruz Viotti <[email protected]>
@jviotti
Copy link
Contributor Author

jviotti commented Mar 18, 2017

@addaleax Turns out it is an issue in node-gyp. See balena-io/etcher#1191

@jviotti jviotti closed this as completed Mar 18, 2017
@addaleax
Copy link
Owner

@jviotti Cool, thanks for letting me know. Have you opened a issued on the node-gyp repo? Could you link that somewhere (or @mention me in it)? :)

@jviotti
Copy link
Contributor Author

jviotti commented Mar 20, 2017

There you go: nodejs/node-gyp#1151, thanks a lot for the help!

jviotti pushed a commit to balena-io/etcher that referenced this issue Mar 20, 2017
We've been recently hitting a weird `lzma-native` build error on Windows
(both locally and on Appveyor CI):

```
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  build
  The input line is too long.

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 1. [C:\projects\etcher\node_modules\lzma-native\build\liblzma.vcxproj]
```

After a lot of experimentation, we realised the issue was gone if we
removed `node-sass` from the development dependencies.

The issue is that `node-gyp` was recently upgraded to v3.6.0, which was
picked up by `node-sass`, which declares `node-gyp` as a dependency. For
some reason, if `node-sass` causes `node-gyp` to be updated, then
`lzma-native` fails with the above cryptic error.

I was able to trace down the error to the following `node-gyp` commit:

nodejs/node-gyp@ae141e1

As a solution, this commit starts to shrinkwrap development
dependencies, and locks `node-gyp` to v3.5.0 until the issue is fixed.

Fixes: addaleax/lzma-native#30
See: nodejs/node-gyp#1151
Signed-off-by: Juan Cruz Viotti <[email protected]>
jviotti pushed a commit to balena-io/etcher that referenced this issue Mar 20, 2017
We've been recently hitting a weird `lzma-native` build error on Windows
(both locally and on Appveyor CI):

```
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  build
  The input line is too long.

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 1. [C:\projects\etcher\node_modules\lzma-native\build\liblzma.vcxproj]
```

After a lot of experimentation, we realised the issue was gone if we
removed `node-sass` from the development dependencies.

The issue is that `node-gyp` was recently upgraded to v3.6.0, which was
picked up by `node-sass`, which declares `node-gyp` as a dependency. For
some reason, if `node-sass` causes `node-gyp` to be updated, then
`lzma-native` fails with the above cryptic error.

I was able to trace down the error to the following `node-gyp` commit:

nodejs/node-gyp@ae141e1

As a solution, this commit starts to shrinkwrap development
dependencies, and locks `node-gyp` to v3.5.0 until the issue is fixed.

Fixes: addaleax/lzma-native#30
See: nodejs/node-gyp#1151
Signed-off-by: Juan Cruz Viotti <[email protected]>
jviotti pushed a commit to balena-io/etcher that referenced this issue Mar 20, 2017
* chore: fix `lzma-native` build issues on Windows

We've been recently hitting a weird `lzma-native` build error on Windows
(both locally and on Appveyor CI):

```
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  build
  The input line is too long.

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 1. [C:\projects\etcher\node_modules\lzma-native\build\liblzma.vcxproj]
```

After a lot of experimentation, we realised the issue was gone if we
removed `node-sass` from the development dependencies.

The issue is that `node-gyp` was recently upgraded to v3.6.0, which was
picked up by `node-sass`, which declares `node-gyp` as a dependency. For
some reason, if `node-sass` causes `node-gyp` to be updated, then
`lzma-native` fails with the above cryptic error.

I was able to trace down the error to the following `node-gyp` commit:

nodejs/node-gyp@ae141e1

As a solution, this commit starts to shrinkwrap development
dependencies, and locks `node-gyp` to v3.5.0 until the issue is fixed.

Fixes: addaleax/lzma-native#30
See: nodejs/node-gyp#1151
Signed-off-by: Juan Cruz Viotti <[email protected]>

* chore: ensure some modules in npm-shrinkwrap stay at specific versions

* Address code review comments

Signed-off-by: Juan Cruz Viotti <[email protected]>
@addaleax addaleax added the build label May 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants