Skip to content

32-bit support? #974

Closed
Closed

Description

@SEAPUNK

From atom issue atom/atom#10819 (atom/atom#10819 (comment)), a lot of 32-bit Linux users have been having troubles installing nodegit. From my research, it seemed to be a two-part problem of there not being a 32-bit prebuilt binary of nodegit

Error: 403 status code downloading tarball https://nodegit.s3.amazonaws.com/nodegit/nodegit/nodegit-v0.11.9-node-v47-linux-ia32.tar.gz

and npm failing during the fallback build script

[nodegit] Building manually. (You'll be here a while.)
[nodegit] Regenerating and configuring code
npm WARN deprecated [email protected]: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
npm WARN deprecated [email protected]: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
npm WARN deprecated [email protected]: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
npm WARN deprecated [email protected]: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
npm ERR! Linux 4.4.5-1-ARCH
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "--ignore-scripts"
npm ERR! node v5.9.1
npm ERR! npm  v3.8.2

npm ERR! Cannot read property 'target' of null
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /home/ivan/code/__/node_modules/nodegit/npm-debug.log

If the build problem is an issue with npm, could there at least be a prebuilt binary for 32-bit linux systems available for us to use?

Activity

  1. tbranyen commented on Mar 28, 2016

    @tbranyen
    Member

    Its probably because our Travis setup publishes 64bit builds and not 32bit. This was a big concern of mine with going full automated. We'll need to set up a secondary target that hits x86 32bit.

  2. johnhaley81 commented on Mar 28, 2016

    @johnhaley81
    Collaborator
  3. SEAPUNK commented on Mar 28, 2016

    @SEAPUNK
    ContributorAuthor

    Oh, that sucks. Is there a way to publish a 32-bit binary manually as a temporary workaround, then?

  4. johnhaley81 commented on Mar 28, 2016

    @johnhaley81
    Collaborator

    @tbranyen nice find! That might be a way forward.. When running a build with TRAVIS_TAG we could do 2 compiles and publishes.

  5. SEAPUNK commented on Apr 1, 2016

    @SEAPUNK
    ContributorAuthor

    Bump; is there any progress on this? Is there any way I can help?

  6. johnhaley81 commented on Apr 1, 2016

    @johnhaley81
    Collaborator

    @SEAPUNK could you start looking into what tbranyen said in #974 (comment)? That would be a great starting point I think. Add that to the CI matrix on Travis.

  7. SEAPUNK commented on Apr 1, 2016

    @SEAPUNK
    ContributorAuthor

    Alright, I'll do some research.

  8. SEAPUNK commented on Apr 1, 2016

    @SEAPUNK
    ContributorAuthor

    Question: Are there any needed environment variables for Travis for the builds? Are there any pieces from the build script that I can remove (e.g. publishing to S3)?

  9. johnhaley81 commented on Apr 1, 2016

    @johnhaley81
    Collaborator

    When we push a tag travis will (pick that up)[https://github.com/nodegit/nodegit/blob/master/.travis.yml#L84] and do a publish to S3 with the resulting binary. If you don't push a tag you won't publish so I wouldn't worry about that.

    Apart from that though, the (matrix)[https://github.com/nodegit/nodegit/blob/master/.travis.yml#L16-L18] is defined here and will declare environment variables that will be picked up. If you add a 32-bit one you'll have to ignore it on OSX and then use the above idea from Tim to build the 32-bit stuff on linux.

  10. SEAPUNK commented on Apr 1, 2016

    @SEAPUNK
    ContributorAuthor

    I've added an extra handler for an additional environment variable, TARGET_ARCH, and after installing the 32-bit compiler files (lib32-gcc-libs on Arch Linux), it seems to be compiling. I'll be sure to inspect the built .node file to see if it's truly built for 32-bit machines.

    On a side note, I know that I had to do --arch=ia32 on node-gyp, but don't you have to do the same for node-pre-gyp, just under a different flag?

  11. SEAPUNK commented on Apr 1, 2016

    @SEAPUNK
    ContributorAuthor

    I made it compile! I just had the wrong compilation packages installed.

    [ivan@omega Release]$ file nodegit.node 
    nodegit.node: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, BuildID[sha1]=38f3e8f240dc21947067d2b32abc442d33ed9aa2, not stripped
    

    Here's the builder patch:

    diff --git a/lifecycleScripts/install.js b/lifecycleScripts/install.js
    index 0302d67..59c0cfd 100644
    --- a/lifecycleScripts/install.js
    +++ b/lifecycleScripts/install.js
    @@ -81,6 +81,7 @@ function build() {
       var builder = "node-gyp";
       var debug = (process.env.BUILD_DEBUG ? "--debug" : "");
       var target = "";
    +  var arch = (process.env.TARGET_ARCH ? "--arch=" + process.env.TARGET_ARCH : "");
       var distUrl = "";
       var runtime = "";
    
    @@ -114,6 +115,7 @@ function build() {
         "rebuild",
         debug,
         target,
    +    arch,
         distUrl,
         runtime
       ]

    And when compiling, just provide TARGET_ARCH=ia32.

    All that's left is the node-pre-gyp part, I think, and updating the travis file to include the 32-bit matrix, and having it excluse the 32-bit builds on osx (I have absolutely no idea how to do that).

  12. SEAPUNK commented on Apr 1, 2016

    @SEAPUNK
    ContributorAuthor

    Alright, I was able to create a successful build for 32-bit systems. The problem now is when it actually tests the binary -- it can't load nodegit.node because it's built for 32-bit systems, but the system itself is 64-bit.

    What do I do? I'm trying a fix, hold on.

  13. SEAPUNK commented on Apr 1, 2016

    @SEAPUNK
    ContributorAuthor

    Alright, I think I got it. PR: #980

  14. roshimon commented on Apr 16, 2016

    @roshimon

    Upgrading to atom 1.8.0-beta1 has fixed the issue for me. Working flawlessly now :)

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