nwoolls / homebrew-xgminer

Homebrew formulas for CGMiner and BFGMiner
35 stars 27 forks source link

Build error on Yosemite #8

Closed hansvangent closed 10 years ago

hansvangent commented 10 years ago

When trying to upgrade I get the following error, any idea what could have triggered this?

==> Upgrading 1 outdated package, with result: bfgminer 4.5.0 ==> Upgrading bfgminer ==> Downloading http://luke.dashjr.org/programs/bitcoin/files/bfgminer/4.5.x/bfg Already downloaded: /Library/Caches/Homebrew/bfgminer-4.5.0.zip ==> ./autogen.sh Getting submodules... fatal: Not a git repository (or any of the parent directories): .git

nwoolls commented 10 years ago

Reproduced. I'll look into it once 10.10 is out of beta.

hansvangent commented 10 years ago

Thanks a lot!

DomT4 commented 10 years ago

Pretty sure I've figured this out. You're missing the .git folder from bfgminer, and the autogen.sh script knows to look in that folder and without that folder there errors out.

The failure is with ./autogen.sh and exists outside of Homebrew as well. (ie, If you download the zip, unzip it, cd into it and then run ./autogen.sh it'll error out still).

If you put the .git folder back into the release zips & tarballs, it compiles perfectly again.

DomT4 commented 10 years ago

Well, I say you're missing, I guess it's actually Luke upstream who needs to address this really.

DomT4 commented 10 years ago

Or maybe that's not the root cause of the problem, because if you go and download Luke's release zip file directly it doesn't ship with .git but knows how to handle the autogen.sh script. Why is this only happening inside of the Homebrew sandbox then. Hmm. Will have to keep poking away and see if I can find out what's really behind all of this.

nwoolls commented 10 years ago

Even if the .git folder is there the error persists on Yosemite. One of the work-arounds I tried in the Homebrew formula was to specifically check for the .git folder before running autogen.sh. While that did fix things if the release tarball is used, it broke things if the --HEAD argument is used with brew install (which installs directly from Git).

nwoolls commented 10 years ago

If you run the following on Yosemite that will clone from Git with the .git folder, but the problem persists:

brew install bfgminer --HEAD
DomT4 commented 10 years ago

Frustratingly, this isn't even consistent. In 10 attempts, without modifying the package at all, I've had 2 successful ./autogen.sh and 8 failed ones.

DomT4 commented 10 years ago

It fails here:

==> Checking out branch bfgminer git checkout-index -a -f --prefix=/private/tmp/bfgminer-QsolhP/ git submodule --quiet foreach --recursive git checkout-index -a -f --prefix=/private/tmp/bfgminer-QsolhP/${toplevel/\/Library\/Caches\/Homebrew\/bfgminer--git/}/$path/

nwoolls commented 10 years ago

Another bit of info, to me it seems like what changed between 10.9 and 10.10 is - somehow - what Homebrew considers a fatal error.

If you run the install on 10.9, you will see the following error/warning:

fatal: Not a git repository (or any of the parent directories): .git

However, Homebrew carries on just fine. It's not a fatal error.

On Yosemite, Homebrew seems to consider this fatal and stop the install.

nwoolls commented 10 years ago

By the way, if you just need a build you can try here:

http://releases.xgminer.com

DomT4 commented 10 years ago

I've just flagged this issue up to the Homebrew maintainers to take a peek into. There shouldn't be any difference between the way Homebrew handles autogen on 10.9 to 10.10, so my concern is that this suddenly fatal git error is a sign of something deeper that needs to be fixed, either with autogen or Homebrew.

It's probably worth noting for anyone else that wanders into this thread that Homebrew's support for Yosemite is still experimental at this point largely. I was the one who wrote the pull request to start merging in tentative Yosemite support, so blame me :grin:.

It seems like the way to fix this for now is to either ship Luke's release versions with a .git folder in them, or to compile without the autogen stage. I'm going to try and pull apart what the autogen script is for exactly, and work out if there's a way to skip that stage. If you compile without ./autogen.sh and just ./configure && make install it works fine.

DomT4 commented 10 years ago

Thanks! Largely I was just curious to try and work out why the error popped up. My current ASIC isn't super-profitable to run, so it's been sat there collecting dust this last week or so.

DomT4 commented 10 years ago

For now, I've fixed it here, and the source code for my changes because the crypto crowd are understandably paranoid is here. All I did is essentially do the initial /.autogen.sh work for bgfminer, and linked it up correctly. With that process done the block in the formula no longer exists and it'll build on Yosemite. A temporary workaround, but a work around nonetheless.

nwoolls commented 10 years ago

Addressed in d416cc30b6bcb8f6178b246fc12bcc0c21f1fbc6