mozilla / tofino

Project Tofino is a browser interaction experiment.
https://mozilla.github.io/tofino
Apache License 2.0
649 stars 67 forks source link

Builds fail on a fresh clone #497

Closed victorporof closed 8 years ago

victorporof commented 8 years ago

npm install fails: https://pastebin.mozilla.org/8872691

Apparently node-gyp rebuild doesn't work.

😢

victorporof commented 8 years ago

@Mossop looks like you might be able to help?

victorporof commented 8 years ago

Maybe related to https://github.com/mozilla/tofino/issues/491 ?

victorporof commented 8 years ago

npm start then tells me

> tofino@0.1.0 start /Users/victorporof/Work/Mozilla/tofino
> node build/main.js --run

Dependency checks failed.
electron-rebuild: not installed!
Invoke npm install to install missing packages
victorporof commented 8 years ago

Simply installing python 3.5.1 fixed it...

victorporof commented 8 years ago

If we require python 3 as a dependecy or build stage for some reason, we should add that to the readme. Or maybe have more helpful error messages.

Mossop commented 8 years ago

I don't think we need python 3.5 but do need a python, probably at least some version of 2.7.x. What version did you have previously?

victorporof commented 8 years ago

Having just 2.7.11 installed, I got the errors mentioned in the pastebin. Maybe installing python 3 also installs some dependencies that we need?

victorporof commented 8 years ago

Figured it out: brew install python3 also installs openssl. Running brew edit python3 shows the formula that confirms this. OpenSSL is used while running node-pre-gyp install --fallback-to-build to compute sha1 and/or md5 hashes. The code complains that there's no modules available that do that, since python 2.7 doesn't come with openssl by default.

🙌

Mossop commented 8 years ago

That's odd, the hashlib docs say that sha1() and md5() are always available regardless of installed openssl version

victorporof commented 8 years ago

https://github.com/mozilla/tofino/commit/e579c136421b61dcf9e32069d96b1559edf7bb41

Mossop commented 8 years ago

brew edit python shows that python 2 in homebrew also requires openssl so I'm not sure how you got into a state without it but it shouldn't affect most folks. Also it is unnecessary to install python through homebrew, OSX ships with a usable python and openssl which are used by default.

victorporof commented 8 years ago

In that case, what happened to me was indeed very weird. For some reason I had to manually install openssl. The python 2.7 formuae indeed lists openssl as a "recommended" dependency, rather than "mandatory", which might be a reason why it wasn't working for me on a fresh system.

If you prefer removing the readme edits, let me know.

Mossop commented 8 years ago

Maybe you haven't brew updated? It shows openssl as mandatory for me.

On Mon, May 23, 2016 at 1:00 PM, Victor Porof notifications@github.com wrote:

In that case, what happened to me was very weird, and for some reason required me to manually install openssl. The python 2.7 formuae indeed lists openssl as a "recommended" dependency, rather than "mandatory", which might be a reason why it wasn't working for me on a fresh system.

If you prefer removing the readme edits, let me know.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/mozilla/tofino/issues/497#issuecomment-221079037

victorporof commented 8 years ago

Ugh. Indeed.

Mossop commented 8 years ago

Anyway might as well leave the changes in, no harm in getting users a newer version of python.

On Mon, May 23, 2016 at 1:02 PM, Victor Porof notifications@github.com wrote:

Ugh. Indeed.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/mozilla/tofino/issues/497#issuecomment-221079395

victorporof commented 8 years ago

Well, I didn't list python3 as a dependency, just regular python. So I guess users will get 2.7.11 from homebrew instead of using OS X's 2.7.10. 👍

victorporof commented 8 years ago

Anyway, making sure those system dependencies are installed is probably a good idea no matter what.