Build fails on Windows due to git-utils.
Opened this issue · 7 comments
Upstream issue for us on https://github.com/ensime/ensime-atom:
ensime-atom -> scandal -> git-utils fails with node-gyp errors on Windows:
https://github.com/ensime/ensime-atom/issues/112#issuecomment-174500613
Sorry if this is a known issue and not a bug. Is Python on PATH a requirement for Windows? A bit hard for me to find info, but since this is a project under atom org I thought it probably was safe to use as a dependency without risking platform issues.
@hedefalk I don't have a Windows build environment to verify this on, but I'm pretty sure that Python v2.7 on the PATH is a requirement (along with the other requirements listed in the Atom Windows build requirements).
@lee-dohm Ok, cool!
But what does this mean for me as a package developer? That I can't depend on scandal at all or that I have to do some kind of pre-cross-build thing first? I mean, this breaks for users of my package on Windows. But scandal is used by atom's internal file search features too, right? So there has to be some kind of pre-building going on then? Is it possible for me to achieve the same with apm as a package author?
Up until now I have just added any kind of npm dependency I needed and everything just works… Have I missed something in the docs?
@hedefalk Yeah, a python interpreter is required for installing most node modules that use C or C++ code, because node uses gyp
as part of its build system. For users that don't have python
, a decent number of packages will fail to install.
That said, it is possible to publish node modules with their native components pre-compiled for all platforms. In Atom, we are currently switching to a different git module, nodegit
, which does this. So pretty soon, we will update scandal
to use nodegit
, and if you upgrade to the latest version of scandal
, the user who reported the issue will be able to install your package.
@maxbrunsfeld Cool! Is there a known timeframe for that? Depending on days vs weeks I might just need to remove the dependency on scandal and use something else in the meantime. I just used it for some super simple file searching task that I could probably do with just fs in the meantime…
@maxbrunsfeld Just one more question though so I understand: scandal IS used internally by the pre-packagade modules of atom, right? Is this solved there in another way? Not something I could mimic easily myself in the meantime?
Yeah, scandal
is used by Atom, but when a user downloads Atom they get a binary that is pre-compiled for their platform. It is possible to do this for any node module, but it requires some work, and it would mean changing git-utils
to use node-pre-gyp. Soon, this particular problem will be addressed by our switching to nodegit
, which already does this.