Skip to content

libssh2_config.h: No such file or directory #650

Open

Description

@xifeiwu

when compile in branch mater or v0.4.1, the follow Error is encountered:

../vendor/libssh2/src/libssh2_priv.h:44:28: fatal error: libssh2_config.h: No such file or directory

the full output:

  COPY Release/zlib.a
  CC(target) Release/obj.target/http_parser/vendor/http_parser/http_parser.o
  AR(target) Release/obj.target/vendor/http_parser/http_parser.a
  COPY Release/http_parser.a
  CC(target) Release/obj.target/libssh2/vendor/libssh2/src/agent.o
In file included from ../vendor/libssh2/src/agent.c:40:0:
../vendor/libssh2/src/libssh2_priv.h:44:28: fatal error: libssh2_config.h: No such file or directory
 #include "libssh2_config.h"
                            ^
compilation terminated.
make: *** [Release/obj.target/libssh2/vendor/libssh2/src/agent.o] Error 1
make: Leaving directory `/home/cos/Documents/github/nodegit/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/cos/Templates/repode2/out/io.js/lib/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack     at emitTwo (events.js:85:13)
gyp ERR! stack     at ChildProcess.emit (events.js:153:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1044:12)
gyp ERR! System Linux 3.13.0-37-generic
gyp ERR! command "node" "/home/cos/Templates/repode2/out/io.js/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/cos/Documents/github/nodegit
gyp ERR! node -v v1.2.0
gyp ERR! node-gyp -v v2.0.2
gyp ERR! not ok 

Activity

  1. maxkorp commented on Sep 2, 2015

    @maxkorp
    Collaborator

    @xifeiwu Do you still get this issue trying to build master?

  2. samkelleher commented on Nov 5, 2015

    @samkelleher
    Contributor

    Compiling 0.5 master gives the same error. Tried on clean and latest Ubuntu and Debian. I have no idea how this works on Travis.

  3. maxkorp commented on Nov 5, 2015

    @maxkorp
    Collaborator

    if you cd into vendor/libssh2 and try ./configure do you get any errors?

  4. samkelleher commented on Nov 5, 2015

    @samkelleher
    Contributor

    Yeh I just end up getting the same error as seen in #728

    checking for libssl... no
    checking for libgcrypt... no
    configure: error: cannot find OpenSSL or Libgcrypt,
    try --with-libssl-prefix=PATH or --with-libgcrypt-prefix=PATH
    
    root@36407269e7f8:/nodegit4/vendor/libssh2# which openssl
    /usr/bin/openssl
    root@36407269e7f8:/nodegit4/vendor/libssh2# openssl version
    OpenSSL 1.0.1f 6 Jan 2014
    root@36407269e7f8:/nodegit4/vendor/libssh2#
    

    I've had this issue on Debian Jessie, and Alpine and Ubuntu Trusty. I've installed gcc 4.9. There must be a package missing somewhere. Trying to narrow it down.

  5. samkelleher commented on Nov 5, 2015

    @samkelleher
    Contributor

    I installed libssl-dev on Ubuntu and it built normally! 🎉 However, just like the other ticket, the build completes, the Release directory is empty, and config.log in the libssh2 folder is filled with errors about missing files. Fixes one error to give another.

  6. tbranyen commented on Nov 7, 2015

    @tbranyen
    Member

    I think we have a chicken & egg problem here. We are running the libssh2 configuration before openssl is built. I'm looking into how to do this all within GYP, because right now the libssh config is a lifecycle script.

    Basically what I'm imagining we need:

    • Build libssh2 (requires openssl)
    • openssl builds
    • libssh2 configure runs, pointing to the newly built openssl (not sure how to do this with GYP)
    • libssh2 compiles
    • everyone is happy
  7. samkelleher commented on Nov 7, 2015

    @samkelleher
    Contributor

    In #774 I split apart the promises that kicked off the build and forced one to wait for the previous to complete and since then the builds have been successful for me on Ubuntu.

  8. johnhaley81 commented on Dec 10, 2015

    @johnhaley81
    Collaborator

    @samkelleher let me know if you still get this as well please.

  9. webjay commented on Feb 15, 2016

    @webjay

    This also just happened to me with cd node_modules/nodegit && npm run-script recompile on Heroku:

    In file included from ../vendor/libssh2/src/agent.c:40:0:
    ../vendor/libssh2/src/libssh2_priv.h:44:28: fatal error: libssh2_config.h: No such file or directory
     #include "libssh2_config.h"
                                ^
    compilation terminated.
    make: *** [Release/obj.target/libssh2/vendor/libssh2/src/agent.o] Error 1
    make: Leaving directory `/app/node_modules/nodegit/build'
    gyp ERR! build error 
    gyp ERR! stack Error: `make` failed with exit code: 2
    gyp ERR! stack     at ChildProcess.onExit (/app/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270: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 (internal/child_process.js:200:12)
    gyp ERR! System Linux 3.13.0-71-generic
    gyp ERR! command "/app/.heroku/node/bin/node" "/app/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
    gyp ERR! cwd /app/node_modules/nodegit
    gyp ERR! node -v v5.1.1
    gyp ERR! node-gyp -v v3.0.3
    gyp ERR! not ok 
    
    npm ERR! Linux 3.13.0-71-generic
    npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "run-script" "recompile"
    npm ERR! node v5.1.1
    npm ERR! npm  v3.3.12
    npm ERR! code ELIFECYCLE
    npm ERR! nodegit@0.11.1 recompile: `node-gyp configure build`
    npm ERR! Exit status 1
    npm ERR! 
    npm ERR! Failed at the nodegit@0.11.1 recompile script 'node-gyp configure build'.
    
  10. maxkorp commented on Feb 15, 2016

    @maxkorp
    Collaborator

    I bet there was an error in your initial install. npm install inside that directory should either fix it, or replay the error. That's our best bet at figuring out what died.

  11. webjay commented on Feb 15, 2016

    @webjay

    I tried again: heroku run "npm install && cd node_modules/nodegit && npm install && npm run-script recompile":

    In file included from ../vendor/libssh2/src/agent.c:40:0:
    ../vendor/libssh2/src/libssh2_priv.h:44:28: fatal error: libssh2_config.h: No such file or directory
     #include "libssh2_config.h"
                                ^
    compilation terminated.
    make: *** [Release/obj.target/libssh2/vendor/libssh2/src/agent.o] Error 1
    make: Leaving directory `/app/node_modules/nodegit/build'
    gyp ERR! build error 
    gyp ERR! stack Error: `make` failed with exit code: 2
    gyp ERR! stack     at ChildProcess.onExit (/app/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270: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 (internal/child_process.js:200:12)
    gyp ERR! System Linux 3.13.0-71-generic
    gyp ERR! command "/app/.heroku/node/bin/node" "/app/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
    gyp ERR! cwd /app/node_modules/nodegit
    gyp ERR! node -v v5.1.1
    gyp ERR! node-gyp -v v3.0.3
    gyp ERR! not ok 
    
    npm ERR! Linux 3.13.0-71-generic
    npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "run-script" "recompile"
    npm ERR! node v5.1.1
    npm ERR! npm  v3.3.12
    npm ERR! code ELIFECYCLE
    npm ERR! nodegit@0.11.1 recompile: `node-gyp configure build`
    npm ERR! Exit status 1
    npm ERR! 
    npm ERR! Failed at the nodegit@0.11.1 recompile script 'node-gyp configure build'.
    
  12. maxkorp commented on Feb 15, 2016

    @maxkorp
    Collaborator

    What about without the npm run-script recompile

    Edit: Oh shit you're on heroku? Interesting that you're not getting a prebuilt. You're definitely getting a build error earlier, it's just not error-coding out. I bet if you record the entire log, theres an error earlier in the process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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