Code Monkey home page Code Monkey logo

bin-wrapper's People

Contributors

artnez avatar brettp avatar kevva avatar realityking avatar rejas avatar shinnn avatar sindresorhus avatar xhmikosr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bin-wrapper's Issues

Instructions if everything fails

It should be possible to print out instructions on how to manually install if everything else fails.

Consumer either supplies a note or better get an event.

Allow specifying a checksum of the bin

For security-conscious applications, it'd be nice to be able to add a set of hashes for each src that the library checks to make sure the binaries match.

Not sure if this would make more sense as a 4th and 5th arg src(..., [hash], [hash-method]) or as an entirely new call tacked at the end with a map or array of hashes that correspond to each src.

High security vulnerability reported due to dependency on decompress

As reported by npm audit:

┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High          │ Arbitrary File Write                                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ decompress                                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ No patch available                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ gatsby-plugin-sharp                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ bin-wrapper > download > decompress                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://npmjs.com/advisories/1217                            │
└───────────────┴──────────────────────────────────────────────────────────────┘

Should not make assumptions based on process architecture

If I'm using a 32-bit version of Node on a 64-bit version of Windows, and only configure a win32 x64 binary using bin-wrapper, it throws the following error:

No binary found matching your system. It's probably not supported.

This is misleading, as there is a binary matching my system. The real error is something like "No binary found matching the architecture of your Node.js process", as it's not even checking the system architecture. The only time it should care about the architecture of the Node.js process is if you want to load something into that process itself (for example, a DLL file).

See facebook/flow#2288

Expose decompressing

bin-wrapper is a bit of a black-box if the use-case doesn't fit exactly how bin-wrapper works.

For example I had the need to decompress .tar.xz which requires a plugin to decompress and this is impossible because of all the leaky abstractions.

I had to hack around in the meantime...

Symlink global binaries to vendor folder

It would be great that global binaries would be symlinked in vendor folder, so the result of building this module would be determistic. We are doing deterministic builds of our applications and this would help us a lot :)

This is also related to #18

Bin-wrapper recompiles, no matter if binary is avalible in PATH?

This statement is in all views wrong:

if (isbin(this.bin)) {
    if (!which.sync(self.bin).indexOf('node_modules/.bin')) {
      return which.sync(self.bin);
    }
}

The return part never gets called(actually it does if node_packages/.bin starts at char 0, but i guess that's not a desired behaviour).

Even if i fix this and bin-wrapper finds path, my CPU goes to 100%, and i don't know what's wrong from there on.

node 0.10.12
npm 1.2.32
bin-wrapper 0.1.6

request-progress isn't showing correctly

Simplify bin testing

This piece of code can be used in most scenarios to test the binary. Would be nice if I could instead just call a method on bin-wrapper to do that, so to reduce useless boilerplate.

Add support of choosing binary based on standard lib c library.

There are few standard lib c libraries, musl and glibc.
BInary files builded on one linux system e.g. ubuntu doesn't compatible with another system, e.g. Alpine Linux.
I would like to have opportunity to choose binary file based on standard lib c library.
It will be very useful for Linux systems.

What do you think about this feature?

Cannot download when behind proxy

Looks like because it is not using proxy settings when using Download,
it hangs then npm install process in corporate/enterprise proxy environment.

> [email protected] postinstall .../node_modules/gifsicle
> node lib/install.js
{ hangs like forever }

Windows binaries

Add .exe on the bin property when process.platform === 'win32'.

Ability to download an archive

Users should be able to download an archive containing an executable file which should be moved to the correct destination along with other files defined in a files prop.

prefer to use system binary if available

Hi,

it were nice if bin wrapper would just use the systems binaries if available. This especially makes sense for alpine Linux where static compiled binaries often do not work.

Greetings, Sascha

node: possible EventEmitter memory leak detected.

I have been trying to solve this issue:
imagemin/gifsicle-bin#11 (comment)

When trying to build on the build server I get the following warning:

[Step 1/1] (node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
[20:45:23][Step 1/1] Trace
[20:45:23][Step 1/1]     at IncomingMessage.EventEmitter.addListener (events.js:160:15)
[20:45:23][Step 1/1]     at Through2.<anonymous> (/root/BuildAgent/work/443e455e9b41081f/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/bin-wrapper/bin-wrapper.js:124:13)
[20:45:23][Step 1/1]     at Through2.EventEmitter.emit (events.js:117:20)
[20:45:23][Step 1/1]     at Request.<anonymous> (/root/BuildAgent/work/443e455e9b41081f/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/bin-wrapper/node_modules/download/download.js:37:20)
[20:45:23][Step 1/1]     at Request.EventEmitter.emit (events.js:117:20)
[20:45:23][Step 1/1]     at Request.onResponse (/root/BuildAgent/work/443e455e9b41081f/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/index.js:830:10)
[20:45:23][Step 1/1]     at ClientRequest.g (events.js:175:14)
[20:45:23][Step 1/1]     at ClientRequest.EventEmitter.emit (events.js:95:17)
[20:45:23][Step 1/1]     at HTTPParser.parserOnIncomingClient [as onIncoming] (http.js:1688:21)
[20:45:23][Step 1/1]     at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:121:23)

I believe there is an issues with the event emitter that is why on imagemin/gifsicle-bin#11 (comment) we get looping downloads.

Override URLs

URLs should be overridden when defining platform and arch.

bin
    .addUrl('url')
    .addUrl('url2', 'linux')
    .addUrl('url3', 'linux', 'x64');

Update dependencies

Some dependencies of the version 3.0.2 are vulnerable. It would be nice to update them.

Or at least (in package.json) :
"download": "^4.0.0" to "download": "^5.0.1" because 4.4.3 is vulnerable and 5.0.1 fixed it.

The better would be to update "download": "^4.0.0" to "download": "^6.2.5" (the latest version released).

I can open a PR in case you don't have the time.


EDIT : Seems to be fixed here.

This package needs a new maintainer - or an archive-flag

This project is stale. No PRs merged since 2018, no commits since 2018. No communication on any issues by the repository-owner. I guess this project should be handed over to a new maintainer or at least should be marked "archived".

dest() affects the success of run() finding a binary

dest()

Accepts a path which the files will be downloaded to.

run()

Runs the search for the binary. If no binary is found it will download the file using the URL provided in .src().

Oddly, the path given to dest() appears to affect the success of run()? I was trying to figure out why bin-wrapper was not working in the imagemin-cwebp/cwebp-bin package, cwebp -version works just like they test for, which cwebp points to /usr/bin, but when running the package install.js which uses bin-wrapper it fails to run the command.

Multiple binaries and shared resources from one archive?

I was toying around with the idea we outlined for Elm-Platform (elm-lang/elm-platform#19) and realized that the archive would look a bit different from what the others here look like:

.
├── bin
│   ├── elm-doc
│   ├── elm-make
│   ├── elm-package
│   └── elm-repl
└── share
    └── reactor
        ├── _reactor
        │   ├── core.js
        │   ├── debugger
        │   │   ├── pause-button-down.png
        │   │   ├── pause-button-hover.png
        │   │   ├── pause-button-up.png
        │   │   ├── play-button-down.png
        │   │   ├── play-button-hover.png
        │   │   ├── play-button-up.png
        │   │   ├── restart-button-down.png
        │   │   ├── restart-button-hover.png
        │   │   └── restart-button-up.png
        │   ├── reactor.js
        │   ├── toString.js
        │   └── wrench.png
        └── favicon.ico

Firstly, there's more than one binary in there. You could certainly split them up into different modules or cache the archive somewhere so you don't have to re-download them for each individual module.

Secondly and probably more important, there are some shared resources in the archive that need to be placed somewhere. I don't think it's actually that uncommon. Is that something this module wants to tackle or is this out of scope?

Thoughts?

That's weird

I tried to install node-pngquant-bin on Smartos but after I got error and I started read the code.
For smartos I wrote package for pngquant and installed it with dependencies (zlib, libpng). With bin-wrapper I need url for binary for pngquant but how it possible? If I'll make binary for both architectures then I can't give any guarantee because some libs (and version hell) maybe not exists on system. If I'll ship binary with static linking then some users will get segfault when trying to execute. Universal binary is not possible, it is a lie as universal string for making binary from source.
Maybe we can it resolve with making url option as not required if need binary exists in the path? I can do PR for this.
Thanks.

ARM architecture is not considered.

In the _parse function on line 189 only the x64 and x86 architectures are currently considered.

I was recently trying to install node-pngquant-bin on arm machine but it fails because of the lack of support for the architecture. I forked the node-pngquant-bin repository, compiled the binary for the arm platform and included it in the repository but the lack of support for the architecture in bin-wrapper means that the x86 is always downloaded.

Support for JAR files

Is it possible to use bin-wrapper with JAR files? If yes, it would be nice to add it to the docs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.