Skip to content

node-gyp build on Windows always rebuilds the final binary even if no files were changed #1115

@DuBistKomisch

Description

@DuBistKomisch

Cloned bufferutil, ran npm install and node-gyp rebuild, then running node-gyp build:

PS C:\Users\jake\src\bufferutil> node-gyp build
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | ia32
gyp info spawn C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=Win32' ]
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
     Creating library C:\Users\jake\src\bufferutil\build\Release\bufferutil.lib and object C:\Users\jake\src\bufferutil\build\Release\bufferutil.exp
  Generating code
  Finished generating code
  bufferutil.vcxproj -> C:\Users\jake\src\bufferutil\build\Release\\bufferutil.node
  bufferutil.vcxproj -> C:\Users\jake\src\bufferutil\build\Release\bufferutil.pdb (Full PDB)
gyp info ok

No source files were modified, but it still rebuilds the binaries. On Linux and Mac this would be a no-op as it recognises nothing has changed.

Is this a limitation of gyp itself? Surely msbuild is capable of this. Is there some setting I can put in binding.gyp to override this?

This is an issue because it slows down build scripts with unnecessary rebuilds. We have a fairly big native addon so it adds about 20 seconds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions