Repository navigation
Doesn't work with Electron #574
Description
The installation instructions for Electron http://www.nodegit.org/guides/install/electron/ have us add to package.json:
"engines": {
"electron": "0.20.7"
}
And run npm install, which in turn runs lifecycleScripts/install.js. However, that install script is still based off the old "atom-shell" and not Electron:
https://github.com/nodegit/nodegit/blob/master/lifecycleScripts/install.js#L29
https://github.com/nodegit/nodegit/blob/master/lifecycleScripts/install.js#L106-L107
.. so when you run npm install nodegit with the package.json above it will build against the current Node version, not Electron. Unsurprisingly, Electron blows if you try to require nodegit in it.
I've tried working around this by taking the instructions from Electron's docs (https://github.com/atom/electron/blob/master/docs/tutorial/using-native-node-modules.md) and patching lifecycleScripts/install.js accordingly, e.g.:
diff --git a/lifecycleScripts/install.js b/lifecycleScripts/install.js
index 65b8031..7550fe0 100644
--- a/lifecycleScripts/install.js
+++ b/lifecycleScripts/install.js
@@ -18,7 +18,7 @@ var local = path.join.bind(path, __dirname);
return whichNativeNodish("..")
.then(function(results) {
nwVersion = results.nwVersion;
- asVersion = results.asVersion;
+ asVersion = '0.26.0';
})
.then(function() {
if (nwVersion) {
@@ -103,8 +103,7 @@ function build() {
target = "--target=" + asVersion;
- distUrl = "--dist-url=https://gh-contractor-zcbenz.s3." +
- "amazonaws.com/atom-shell/dist";
+ distUrl = "--dist-url=https://atom.io/download/atom-shell";
}
else if (nwVersion) {
builder = "nw-gyp";However, the build fails:
$ node lifecycleScripts/install
[nodegit] Must build for atom-shell
[nodegit] Making sure dependencies are available and native code is generated
[nodegit] Everything is ready to go, attempting compilation
[nodegit] Building native node module.
{ [Error: Command failed: /bin/sh -c HOME=~/.atom-shell-gyp /Users/aadib/temp/nodegit/node_modules/.bin/pangyp rebuild --target=0.26.0 --dist-url=https://atom.io/download/atom-shell
gyp info it worked if it ends with ok
gyp info using pangyp@2.2.0
gyp info using node@2.0.2 | darwin | x64
gyp info spawn python
gyp info spawn args [ '/Users/aadib/temp/nodegit/node_modules/pangyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/Users/aadib/temp/nodegit/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/aadib/temp/nodegit/node_modules/pangyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/aadib/.atom-shell-gyp/.node-gyp/0.26.0/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/Users/aadib/.atom-shell-gyp/.node-gyp/0.26.0',
gyp info spawn args '-Druntime=iojs',
gyp info spawn args '-Dmodule_root_dir=/Users/aadib/temp/nodegit',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.' ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
../vendor/libgit2/src/attr.c:10:1: warning: unused function 'kh_clear_str' [-Wunused-function]
GIT__USE_STRMAP;
^
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
__KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
^
../vendor/libgit2/src/khash.h:206:13: note: expanded from macro '__KHASH_IMPL'
SCOPE void kh_clear_##name(kh_##name##_t *h) \
^
<scratch space>:74:1: note: expanded from here
kh_clear_str
^
../vendor/libgit2/src/attr.c:10:1: warning: unused function 'kh_del_str' [-Wunused-function]
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
__KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
^
../vendor/libgit2/src/khash.h:333:13: note: expanded from macro '__KHASH_IMPL'
SCOPE void kh_del_##name(kh_##name##_t *h, khint_t x) \
^
<scratch space>:88:1: note: expanded from here
kh_del_str
^
2 warnings generated.
../vendor/libgit2/src/attrcache.c:8:1: warning: unused function 'kh_clear_str' [-Wunused-function]
GIT__USE_STRMAP;
^
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
__KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
^
../vendor/libgit2/src/khash.h:206:13: note: expanded from macro '__KHASH_IMPL'
SCOPE void kh_clear_##name(kh_##name##_t *h) \
^
<scratch space>:74:1: note: expanded from here
kh_clear_str
^
../vendor/libgit2/src/attrcache.c:8:1: warning: unused function 'kh_del_str' [-Wunused-function]
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
__KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
^
../vendor/libgit2/src/khash.h:333:13: note: expanded from macro '__KHASH_IMPL'
SCOPE void kh_del_##name(kh_##name##_t *h, khint_t x) \
^
<scratch space>:88:1: note: expanded from here
kh_del_str
^
2 warnings generated.
../vendor/libgit2/src/clone.c:479:20: warning: unused function 'repository_base' [-Wunused-function]
static const char *repository_base(git_repository *repo)
^
1 warning generated.
../vendor/libgit2/src/config_file.c:24:1: warning: unused function 'kh_clear_str' [-Wunused-function]
GIT__USE_STRMAP;
^
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
__KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
^
../vendor/libgit2/src/khash.h:206:13: note: expanded from macro '__KHASH_IMPL'
SCOPE void kh_clear_##name(kh_##name##_t *h) \
^
<scratch space>:74:1: note: expanded from here
kh_clear_str
^
../vendor/libgit2/src/config_file.c:24:1: warning: unused function 'kh_del_str' [-Wunused-function]
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
__KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
^
../vendor/libgit2/src/khash.h:333:13: note: expanded from macro '__KHASH_IMPL'
SCOPE void kh_del_##name(kh_##name##_t *h, khint_t x) \
^
<scratch space>:88:1: note: expanded from here
kh_del_str
^
2 warnings generated.
../vendor/libgit2/src/diff_driver.c:20:1: warning: unused function 'kh_clear_str' [-Wunused-function]
GIT__USE_STRMAP;
^
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
__KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
^
../vendor/libgit2/src/khash.h:206:13: note: expanded from macro '__KHASH_IMPL'
SCOPE void kh_clear_##name(kh_##name##_t *h) \
^
<scratch space>:74:1: note: expanded from here
kh_clear_str
^
../vendor/libgit2/src/diff_driver.c:20:1: warning: unused function 'kh_del_str' [-Wunused-function]
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
__KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
^
../vendor/libgit2/src/khash.h:333:13: note: expanded from macro '__KHASH_IMPL'
SCOPE void kh_del_##name(kh_##name##_t *h, khint_t x) \
^
<scratch space>:88:1: note: expanded from here
kh_del_str
^
2 warnings generated.
../vendor/libgit2/src/mwindow.c:17:1: warning: unused function 'kh_clear_str' [-Wunused-function]
GIT__USE_STRMAP;
^
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
__KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
^
../vendor/libgit2/src/khash.h:206:13: note: expanded from macro '__KHASH_IMPL'
SCOPE void kh_clear_##name(kh_##name##_t *h) \
^
<scratch space>:121:1: note: expanded from here
kh_clear_str
^
1 warning generated.
../vendor/libgit2/src/odb_mempack.c:21:1: warning: unused function 'kh_destroy_oid' [-Wunused-function]
GIT__USE_OIDMAP;
^
../vendor/libgit2/src/oidmap.h:30:2: note: expanded from macro 'GIT__USE_OIDMAP'
__KHASH_IMPL(oid, static kh_inline, const git_oid *, void *, 1, git_oidmap_hash, git_oid_equal)
^
../vendor/libgit2/src/khash.h:198:13: note: expanded from macro '__KHASH_IMPL'
SCOPE void kh_destroy_##name(kh_##name##_t *h) \
^
<scratch space>:67:1: note: expanded from here
kh_destroy_oid
^
../vendor/libgit2/src/odb_mempack.c:21:1: warning: unused function 'kh_clear_oid' [-Wunused-function]
../vendor/libgit2/src/oidmap.h:30:2: note: expanded from macro 'GIT__USE_OIDMAP'
__KHASH_IMPL(oid, static kh_inline, const git_oid *, void *, 1, git_oidmap_hash, git_oid_equal)
^
../vendor/libgit2/src/khash.h:206:13: note: expanded from macro '__KHASH_IMPL'
SCOPE void kh_clear_##name(kh_##name##_t *h) \
^
<scratch space>:70:1: note: expanded from here
kh_clear_oid
^
../vendor/libgit2/src/odb_mempack.c:21:1: warning: unused function 'kh_del_oid' [-Wunused-function]
../vendor/libgit2/src/oidmap.h:30:2: note: expanded from macro 'GIT__USE_OIDMAP'
__KHASH_IMPL(oid, static kh_inline, const git_oid *, void *, 1, git_oidmap_hash, git_oid_equal)
^
../vendor/libgit2/src/khash.h:333:13: note: expanded from macro '__KHASH_IMPL'
SCOPE void kh_del_##name(kh_##name##_t *h, khint_t x) \
^
<scratch space>:84:1: note: expanded from here
kh_del_oid
^
3 warnings generated.
../vendor/libgit2/src/refdb_fs.c:29:1: warning: unused function 'kh_init_str' [-Wunused-function]
GIT__USE_STRMAP;
^
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
__KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
^
../vendor/libgit2/src/khash.h:195:23: note: expanded from macro '__KHASH_IMPL'
SCOPE kh_##name##_t *kh_init_##name(void) { \
^
<scratch space>:124:1: note: expanded from here
kh_init_str
^
../vendor/libgit2/src/refdb_fs.c:29:1: warning: unused function 'kh_destroy_str' [-Wunused-function]
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
__KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
^
../vendor/libgit2/src/khash.h:198:13: note: expanded from macro '__KHASH_IMPL'
SCOPE void kh_destroy_##name(kh_##name##_t *h) \
^
<scratch space>:129:1: note: expanded from here
kh_destroy_str
^
../vendor/libgit2/src/refdb_fs.c:29:1: warning: unused function 'kh_clear_str' [-Wunused-function]
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
__KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
^
../vendor/libgit2/src/khash.h:206:13: note: expanded from macro '__KHASH_IMPL'
SCOPE void kh_clear_##name(kh_##name##_t *h) \
^
<scratch space>:132:1: note: expanded from here
kh_clear_str
^
../vendor/libgit2/src/refdb_fs.c:29:1: warning: unused function 'kh_get_str' [-Wunused-function]
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
__KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
^
../vendor/libgit2/src/khash.h:213:16: note: expanded from macro '__KHASH_IMPL'
SCOPE khint_t kh_get_##name(const kh_##name##_t *h, khkey_t key) \
^
<scratch space>:135:1: note: expanded from here
kh_get_str
^
../vendor/libgit2/src/refdb_fs.c:29:1: warning: unused function 'kh_put_str' [-Wunused-function]
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
__KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
^
../vendor/libgit2/src/khash.h:291:16: note: expanded from macro '__KHASH_IMPL'
SCOPE khint_t kh_put_##name(kh_##name##_t *h, khkey_t key, int *ret) \
^
<scratch space>:141:1: note: expanded from here
kh_put_str
^
../vendor/libgit2/src/refdb_fs.c:29:1: warning: unused function 'kh_del_str' [-Wunused-function]
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
__KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
^
../vendor/libgit2/src/khash.h:333:13: note: expanded from macro '__KHASH_IMPL'
SCOPE void kh_del_##name(kh_##name##_t *h, khint_t x) \
^
<scratch space>:146:1: note: expanded from here
kh_del_str
^
6 warnings generated.
../vendor/libgit2/src/refs.c:27:1: warning: unused function 'kh_init_str' [-Wunused-function]
GIT__USE_STRMAP;
^
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
__KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
^
../vendor/libgit2/src/khash.h:195:23: note: expanded from macro '__KHASH_IMPL'
SCOPE kh_##name##_t *kh_init_##name(void) { \
^
<scratch space>:124:1: note: expanded from here
kh_init_str
^
../vendor/libgit2/src/refs.c:27:1: warning: unused function 'kh_destroy_str' [-Wunused-function]
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
__KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
^
../vendor/libgit2/src/khash.h:198:13: note: expanded from macro '__KHASH_IMPL'
SCOPE void kh_destroy_##name(kh_##name##_t *h) \
^
<scratch space>:129:1: note: expanded from here
kh_destroy_str
^
../vendor/libgit2/src/refs.c:27:1: warning: unused function 'kh_clear_str' [-Wunused-function]
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
__KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
^
../vendor/libgit2/src/khash.h:206:13: note: expanded from macro '__KHASH_IMPL'
SCOPE void kh_clear_##name(kh_##name##_t *h) \
^
<scratch space>:132:1: note: expanded from here
kh_clear_str
^
../vendor/libgit2/src/refs.c:27:1: warning: unused function 'kh_get_str' [-Wunused-function]
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
__KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
^
../vendor/libgit2/src/khash.h:213:16: note: expanded from macro '__KHASH_IMPL'
SCOPE khint_t kh_get_##name(const kh_##name##_t *h, khkey_t key) \
^
<scratch space>:135:1: note: expanded from here
kh_get_str
^
../vendor/libgit2/src/refs.c:27:1: warning: unused function 'kh_put_str' [-Wunused-function]
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
__KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
^
../vendor/libgit2/src/khash.h:291:16: note: expanded from macro '__KHASH_IMPL'
SCOPE khint_t kh_put_##name(kh_##name##_t *h, khkey_t key, int *ret) \
^
<scratch space>:141:1: note: expanded from here
kh_put_str
^
../vendor/libgit2/src/refs.c:27:1: warning: unused function 'kh_del_str' [-Wunused-function]
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
__KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
^
../vendor/libgit2/src/khash.h:333:13: note: expanded from macro '__KHASH_IMPL'
SCOPE void kh_del_##name(kh_##name##_t *h, khint_t x) \
^
<scratch space>:146:1: note: expanded from here
kh_del_str
^
6 warnings generated.
../vendor/libgit2/src/submodule.c:86:1: warning: unused function 'kh_clear_str' [-Wunused-function]
__KHASH_IMPL(
^
../vendor/libgit2/src/khash.h:206:13: note: expanded from macro '__KHASH_IMPL'
SCOPE void kh_clear_##name(kh_##name##_t *h) \
^
<scratch space>:74:1: note: expanded from here
kh_clear_str
^
1 warning generated.
../vendor/libgit2/src/transaction.c:20:1: warning: unused function 'kh_clear_str' [-Wunused-function]
GIT__USE_STRMAP;
^
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
__KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
^
../vendor/libgit2/src/khash.h:206:13: note: expanded from macro '__KHASH_IMPL'
SCOPE void kh_clear_##name(kh_##name##_t *h) \
^
<scratch space>:74:1: note: expanded from here
kh_clear_str
^
../vendor/libgit2/src/transaction.c:20:1: warning: unused function 'kh_del_str' [-Wunused-function]
../vendor/libgit2/src/strmap.h:23:2: note: expanded from macro 'GIT__USE_STRMAP'
__KHASH_IMPL(str, static kh_inline, const char *, void *, 1, kh_str_hash_func, kh_str_hash_equal)
^
../vendor/libgit2/src/khash.h:333:13: note: expanded from macro '__KHASH_IMPL'
SCOPE void kh_del_##name(kh_##name##_t *h, khint_t x) \
^
<scratch space>:88:1: note: expanded from here
kh_del_str
^
2 warnings generated.
../vendor/libssh2/src/misc.c:214:19: warning: unused variable 'base64_table' [-Wunused-const-variable]
static const char base64_table[] =
^
../vendor/libssh2/src/misc.c:223:19: warning: unused variable 'base64_pad' [-Wunused-const-variable]
static const char base64_pad = '=';
^
2 warnings generated.
../vendor/openssl/openssl/ssl/d1_srtp.c:147:7: warning: missing field 'id' initializer [-Wmissing-field-initializers]
{0}
^
1 warning generated.
../vendor/openssl/openssl/crypto/asn1/x_bignum.c:85:1: warning: missing field 'prim_print' initializer [-Wmissing-field-initializers]
};
^
1 warning generated.
../vendor/openssl/openssl/crypto/cmac/cm_ameth.c:96:2: warning: missing field 'item_verify' initializer [-Wmissing-field-initializers]
};
^
1 warning generated.
../vendor/openssl/openssl/crypto/dh/dh_ameth.c:500:2: warning: missing field 'old_priv_decode' initializer [-Wmissing-field-initializers]
};
^
1 warning generated.
../vendor/openssl/openssl/crypto/dsa/dsa_ameth.c:650:3: warning: missing field 'pem_str' initializer [-Wmissing-field-initializers]
},
^
../vendor/openssl/openssl/crypto/dsa/dsa_ameth.c:656:3: warning: missing field 'pem_str' initializer [-Wmissing-field-initializers]
},
^
../vendor/openssl/openssl/crypto/dsa/dsa_ameth.c:662:3: warning: missing field 'pem_str' initializer [-Wmissing-field-initializers]
},
^
../vendor/openssl/openssl/crypto/dsa/dsa_ameth.c:668:3: warning: missing field 'pem_str' initializer [-Wmissing-field-initializers]
},
^
../vendor/openssl/openssl/crypto/dsa/dsa_ameth.c:702:3: warning: missing field 'item_verify' initializer [-Wmissing-field-initializers]
}
^
5 warnings generated.
../vendor/openssl/openssl/crypto/ec/ec_ameth.c:660:2: warning: missing field 'item_verify' initializer [-Wmissing-field-initializers]
};
^
1 warning generated.
../vendor/openssl/openssl/crypto/ec/ec_lib.c:71:19: warning: unused variable 'EC_version' [-Wunused-const-variable]
static const char EC_version[] = "EC" OPENSSL_VERSION_PTEXT;
^
1 warning generated.
../vendor/openssl/openssl/crypto/engine/eng_dyn.c:117:30: warning: unused variable 'dynamic_cmd_defns_empty' [-Wunused-const-variable]
static const ENGINE_CMD_DEFN dynamic_cmd_defns_empty[] = {
^
1 warning generated.
../vendor/openssl/openssl/crypto/engine/eng_openssl.c:344:2: warning: missing field 'md_ctrl' initializer [-Wmissing-field-initializers]
};
^
1 warning generated.
../vendor/openssl/openssl/crypto/evp/m_dss.c:94:2: warning: missing field 'md_ctrl' initializer [-Wmissing-field-initializers]
};
^
1 warning generated.
../vendor/openssl/openssl/crypto/evp/m_dss1.c:96:2: warning: missing field 'md_ctrl' initializer [-Wmissing-field-initializers]
};
^
1 warning generated.
../vendor/openssl/openssl/crypto/evp/m_ecdsa.c:144:2: warning: missing field 'md_ctrl' initializer [-Wmissing-field-initializers]
};
^
1 warning generated.
../vendor/openssl/openssl/crypto/evp/m_md4.c:97:2: warning: missing field 'md_ctrl' initializer [-Wmissing-field-initializers]
};
^
1 warning generated.
../vendor/openssl/openssl/crypto/evp/m_md5.c:96:2: warning: missing field 'md_ctrl' initializer [-Wmissing-field-initializers]
};
^
1 warning generated.
../vendor/openssl/openssl/crypto/evp/m_mdc2.c:97:2: warning: missing field 'md_ctrl' initializer [-Wmissing-field-initializers]
};
^
1 warning generated.
../vendor/openssl/openssl/crypto/evp/m_null.c:88:2: warning: missing field 'md_ctrl' initializer [-Wmissing-field-initializers]
};
^
1 warning generated.
../vendor/openssl/openssl/crypto/evp/m_ripemd.c:96:2: warning: missing field 'md_ctrl' initializer [-Wmissing-field-initializers]
};
^
1 warning generated.
../vendor/openssl/openssl/crypto/evp/m_sha.c:95:2: warning: missing field 'md_ctrl' initializer [-Wmissing-field-initializers]
};
^
1 warning generated.
../vendor/openssl/openssl/crypto/evp/m_sha1.c:97:2: warning: missing field 'md_ctrl' initializer [-Wmissing-field-initializers]
};
^
../vendor/openssl/openssl/crypto/evp/m_sha1.c:134:2: warning: missing field 'md_ctrl' initializer [-Wmissing-field-initializers]
};
^
../vendor/openssl/openssl/crypto/evp/m_sha1.c:153:2: warning: missing field 'md_ctrl' initializer [-Wmissing-field-initializers]
};
^
../vendor/openssl/openssl/crypto/evp/m_sha1.c:184:2: warning: missing field 'md_ctrl' initializer [-Wmissing-field-initializers]
};
^
../vendor/openssl/openssl/crypto/evp/m_sha1.c:203:2: warning: missing field 'md_ctrl' initializer [-Wmissing-field-initializers]
};
^
5 warnings generated.
../vendor/openssl/openssl/crypto/evp/m_wp.c:37:2: warning: missing field 'md_ctrl' initializer [-Wmissing-field-initializers]
};
^
1 warning generated.
../vendor/openssl/openssl/crypto/hmac/hm_ameth.c:166:2: warning: missing field 'item_verify' initializer [-Wmissing-field-initializers]
};
^
1 warning generated.
../vendor/openssl/openssl/crypto/pem/pem_lib.c:473:6: warning: variable 'i' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (o)
^
../vendor/openssl/openssl/crypto/pem/pem_lib.c:480:5: note: uninitialized use occurs here
j+=i;
^
../vendor/openssl/openssl/crypto/pem/pem_lib.c:473:2: note: remove the 'if' if its condition is always true
if (o)
^~~~~~
../vendor/openssl/openssl/crypto/pem/pem_lib.c:443:7: note: initialize the variable 'i' to silence this warning
int i,j,o,klen;
^
= 0
1 warning generated.
../vendor/openssl/openssl/crypto/rsa/rsa_ameth.c:697:3: warning: missing field 'pem_str' initializer [-Wmissing-field-initializers]
}
^
1 warning generated.
In file included from ../src/nodegit.cc:6:
In file included from ../src/../include/wrapper.h:11:
In file included from ../node_modules/nan/nan.h:80:
In file included from ../node_modules/nan/nan_new.h:190:
../node_modules/nan/nan_implementation_12_inl.h:181:66: error: too many arguments to function call, expected at most 2, have 4
return v8::Signature::New(v8::Isolate::GetCurrent(), receiver, argc, argv);
~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~
/Users/aadib/.atom-shell-gyp/.node-gyp/0.26.0/deps/v8/include/v8.h:4170:3: note: 'New' declared here
static Local<Signature> New(
^
1 error generated.
make: *** [Release/obj.target/nodegit/src/nodegit.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/aadib/temp/nodegit/node_modules/pangyp/lib/build.js:271:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1009:12)
gyp ERR! System Darwin 14.3.0
gyp ERR! command "/Users/aadib/.nvm/versions/io.js/v2.0.2/bin/iojs" "/Users/aadib/temp/nodegit/node_modules/.bin/pangyp" "rebuild" "--target=0.26.0" "--dist-url=https://atom.io/download/atom-shell"
gyp ERR! cwd /Users/aadib/temp/nodegit
gyp ERR! node -v v2.0.2
gyp ERR! pangyp -v v2.2.0
gyp ERR! not ok
]
killed: false,
code: 1,
signal: null,
cmd: '/bin/sh -c HOME=~/.atom-shell-gyp /Users/aadib/temp/nodegit/node_modules/.bin/pangyp rebuild --target=0.26.0 --dist-url=https://atom.io/download/atom-shell' }
undefined
Activity
[-]Doesn't work with Electron 0.26[/-][+]Doesn't work with Electron[/+]arturadib commentedon May 17, 2015
BTW, same build error with version
0.25.3instead of0.26.0maxkorp commentedon May 18, 2015
Ha, try renaming it from electron to atom-shell in the package.json. Someone renamed that, but the underlying module that does the check doesn't look for electron I think. I'll have to verify in a minute, but try renaming it to atom-shell.
arturadib commentedon May 19, 2015
same error output as above. I also tried the previous version
0.25.3(same error), as well as0.25.0and0.24.0. interestingly those gave a 403 error for the--dist-urllink:but I've checked the urls and they exist (e.g. https://gh-contractor-zcbenz.s3.amazonaws.com/atom-shell/dist/v0.25.0/node-v0.25.0.tar.gz).
to sum up, the issues are:
atom-shellinstead ofelectronatom-shell, it doesn't build with the latest versions (0.26.0, 0.25.3) because of a method mismatch, whereas for previous versions (0.25.0, 0.24.0) it can't download the tar archive for the headers (even though they apparently exist)arturadib commentedon May 19, 2015
@maxkorp I've tried bumping
nanto 1.8.4 (since the error seems to come from there) but that gave rise to other error messages.. any ideas?johnhaley81 commentedon May 19, 2015
@arturadib have you tried doing this on the
rollback-libssh2branch?arturadib commentedon May 19, 2015
@johnhaley81 almost there! the module builds fine using that branch, but I get a module version mismatch error when I run electron:
Relevant part of package.json showing we're building against 0.26.0 and running against that same version:
is it possible the downloaded headers are actually not in sync with
electron-prebuilt?johnhaley81 commentedon May 19, 2015
Oh interesting... so try to start again from a clean slate.
git clean -xdffand nuke~/.atom-shellarturadib commentedon May 19, 2015
no juice (nuked
~/.atom-shell-gypsince.atom-shelldidn't exist):maxkorp commentedon May 20, 2015
Well that's unusual. nuking ~/.atom-shell-gyp is good, but I'd also see if theres a ~/.electron (or anything else to that effect, not including
.atom) and nuke that if it's there? It seems likely that somehow the contents of the build for 25.3 got stored as 26, but I'm not sure how.arturadib commentedon May 20, 2015
Weird stuff for sure. Nuked ~/.electron, ~/.electron-gyp (both existed), built with
atom-shellset to 0.26.0, tried also 0.25.3, same problem (Module version mismatch. Expected 43, got 44).Can one of you repro the issue? I just have a barebones Electron project with two files in it:
package.json:
main.js:
Then I run
$ npm install,$ npm link <path_to_nodegit_with_rollback-libssh2_checked_out>, then$ ./node_modules/.bin/electron .maxkorp commentedon May 21, 2015
OHHHHHH So you're linking to nodegit. Aha!
So, nodegit determines what to build against (node version X, nwjs version Y, electron version Z etc) by looking up the tree to see if it's in a projects node_modules, until it finds the root project, then checks that projects engines. Not just where it's required from. So, it's building against node or iojs, not electron.
You'll have to actualy list the dependency in your package.json
Because with electron/nwjs the native modules have to build against different headers. We attempt to intelligently do that for you (in the case that we're inside another project with that engines property set appropriately), but we have no way to do that if we're in a not-descendent dir somewhere.
That intelligent build thing is going away asap (causes more confusion than it solves), and you'll have to use some other tool (same you would use to handle any other native modules) to rebuild. Linking should work, in that case.
Let me know if the updated package.json works, and I'll close this if it does.
arturadib commentedon May 21, 2015
BIN-GO! Many thanks Max. Looking forward to playing with nodegit now!
maxkorp commentedon May 21, 2015
Cool, glad that worked.
da1nerd commentedon Mar 1, 2016
Just for the sake of others looking at this. I ran around in circles trying to get nodegit working with electron on windows. It finally came down to a simple command.
where you'll change the electron version to match whatever you are using.
Run that from within your project directory just like you were installing any other package. If there's already a
nodegitdirectory in yournode_modulesdir then you'll have to delete it in order for the above command to work. It will take awhile to start and once it does you'll see a wall of text as it begin compiling things.There were pieces of the above command floating around but nothing was very clear.
Hope this helps someone!
mjschock commentedon Dec 5, 2016
Thank you @neutrinog!
I spent the better part of a weekend searching for a solution for a similar issue with nodegit on macOS. The following finally resolved the issue:
BUILD_ONLY=true ELECTRON_VERSION=1.4.10 npm install nodegit -DHere are my setup details: