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

Delay hook absolute path cannot be created error MSB3191: Unable to create directory: The given path's format is not supported #732

Closed
saper opened this issue Sep 15, 2015 · 7 comments
Labels

Comments

@saper
Copy link
Contributor

saper commented Sep 15, 2015

Full log: https://gist.github.com/saper/08ce8416f944a7fed3dc
addon.gypi used
generated libgit2.vcxproj
Source being built: https://github.com/saper/nodegit/tree/41c9e13f25441726a2493fd9279fc00db0087da9
Environment: @appveyor full log

node-gyp is installed globally before just npm install on the package (nodegit).

Error message:

error MSB3191: Unable to create directory 
"C:\projects\nodegit\vendor\Release\obj\libgit2\C:\projects\nodegit\node_modules\node-gyp\src". 
The given path's format is not supported.

It looks like the '<(node_gyp_dir)/src/win_delay_load_hook.c' formula doesn't mix here well...

Btw. is it normal that .vcxproj files are created in the source tree and not in the build directory? relative paths fixed

Related: #636 #637 #708

@saper
Copy link
Contributor Author

saper commented Sep 15, 2015

Some investigation:

  1. Does not matter if using MSBuild 12.0 (from VS2013) or MSBuild 14.0 (from VS2015).
  2. win_delay_hook seems to be added to all targets by default (in all projects I have seen)
  3. Out of few attempts to compile win_delay_hook in the nodegit project, only one fails.
  4. This errors occurs in the Visual C++-specific MakeDirsForCl target.

For nodegit it creates directories only for one of the targets (https://github.com/saper/nodegit/blob/7b30e1d3a6180db36a13503be525252435bbb85e/vendor/libgit2.gyp#L14) out of few in the project.

For node-sass this target is not needed.

@saper
Copy link
Contributor Author

saper commented Sep 15, 2015

MakeDirForCl uses several properties to create directories and activates only if one of those are present. ObjectFileName is one of such properties and this one is set in https://gist.github.com/saper/1f9e9a7c68bfff6c1fe5#file-libgit2-vcxproj-L53 to $(IntDir)%(RelativeDir)/

saper added a commit to saper/nodegit that referenced this issue Sep 16, 2015
- gyp generates full paths where necessary
- keep generated .vcxproj files in the build directory
- don't set ObjectFile path to "$(IntDir)/%(RelativeDir)/",
  because win_delay_hook has an absolute path in %(RelativeDir)%
  which causes

     MSB3191 Unable to create directory: The given path's format is not supported

  (nodejs/node-gyp#732)
@saper
Copy link
Contributor Author

saper commented Sep 16, 2015

So it seems to me the only issue left to clarify is why %(RelativeDir)% is absolute:)

saper added a commit to saper/node-sass that referenced this issue Sep 16, 2015
Windows delay hook feature is only needed
on the main module, linked into the shared
library. Don't compile and include
it second time in the bundled libsass.

Related: nodejs/node-gyp#732
saper added a commit to saper/node-sass that referenced this issue Sep 16, 2015
Windows delay hook feature is only needed
on the main module, linked into the shared
library. Don't compile and include
it second time in the bundled libsass.

Related: nodejs/node-gyp#732
@panuhorsmalahti
Copy link

I'm also getting ths.

@saper
Copy link
Contributor Author

saper commented Sep 29, 2015

So the absolute %(RelativeDir) for the Windows delay hook is caused by #637. I have worked around this in the node-git project by not using %(RelativeDir) at all, but this is broken for projects that need it.

@ThePhD
Copy link

ThePhD commented Apr 8, 2018

This bug has negatively affected me twice and has cost me a serious amount of time: I use %(RelativeDir) to help differentiate my OBJ file builds in my C++ projects. You can imagine my surprise when I finally figured out Node.js was hooking into, using, and turning %(RelativeDir) into an absolute dir.

I am new to the Node community, but if anyone has any ideas for how I can fix this, I would not mind hacking on node-gyp to help fix this. This is the second time it's come out of nowhere and really negatively affected me, wasting quite a few hours peeling through npm logs and trying all sorts of native installs before pinning this down.

@rvagg
Copy link
Member

rvagg commented Jun 20, 2019

I think this might be something to take up at https://github.com/refack/GYP

@rvagg rvagg closed this as completed Jun 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants