Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix universal builds of libgcrypt #18345

Closed
wants to merge 1 commit into from

6 participants

Thijs Alkemade Jack Nagel Adam Vandenberg Garth Kidd Mike McQuaid Samuel John
Thijs Alkemade

https://trac.macports.org/ticket/20866 also applies to homebrew. ./configure always sets SIZEOF_UNSIGNED_LONG to 8, while it should be 8 on x86_64 and 4 on i386. This leads to hangs and crashes when trying to use libgcrypt on 32-bit Macs.

Thijs Alkemade xnyhps Fix universal builds of libgcrypt.
SIZEOF_UNSIGNED_LONG was incorrectly set to 8 on i386, use a patch from
macports to make it depend on arch.
746009f
Jack Nagel
Owner

That ticket is 4 years old. Has this been reported upstream?

Jack Nagel
Owner

As far as I can tell, macports doesn't even apply that ed script anymore...

Thijs Alkemade

Afaict, MacPorts' build process (currently?) runs the configure step into two separate directories, once for i386 and once for x86_64. That would make the patch unnecessary for them.

I have a test case I was using which I've copied here: https://gist.github.com/xnyhps/5130255. Without the ed patch to the generated config.h, the second invocation of test hangs forever.

I wasn't able to find a real bugtracker for libgcrypt, only a mailing list where my search turned up nothing.

Jack Nagel
Owner

Our usual response is "please report this upstream". We're happy to carry patches so long as upstream is aware of the issue and hopefully weighing a fix. Otherwise we end up like MacPorts, carrying the same patches for years and years.

Adam Vandenberg
Owner

Can we get a test that demonstrates the breakage and that the fix fixes it?

Garth Kidd

Jack, I'm concerned that leaving "please report this upstream" to the users in all cases will leave you with a different but equally toxic problem: an ever-increasing number of broken packages.

Jack Nagel
Owner

We consider it reasonable to have bugs reported upstream before applying patches for them. It's worked out pretty well so far.

Mike McQuaid
Owner

Unfortunately if we were to report all bugs upstream ourselves we'd never get time to work on Homebrew.

Samuel John

Most upstream devs are aware of the weight homebrew has now and are willing to fix quickly.

Adam Vandenberg
Owner
Adam Vandenberg
Owner

MacPorts switched to an alternate fix in: https://trac.macports.org/browser/trunk/dports/devel/libgcrypt/Portfile?rev=91558

It now fills in the proper ${os.arch}-apple-darwin${os.major} instead of editing the .h file after the fact.

Jack Nagel jacknagel closed this pull request from a commit
Jack Nagel jacknagel libgcrypt: fix universal builds
Closes #18345.
6ee2f27
Jack Nagel jacknagel closed this in 6ee2f27
Sinclair Sun sxprophet referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
Yago Riveiro yriveiro referenced this pull request from a commit in yriveiro/homebrew
Jack Nagel jacknagel libgcrypt: fix universal builds
Closes #18345.
34f45f8
Pavel Borzenkov pborzenkov referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
Ernie Hershey ehershey referenced this pull request from a commit in ehershey/homebrew
Jack Nagel jacknagel libgcrypt: fix universal builds
Closes #18345.
cc9c373
Evan Shelhamer shelhamer referenced this pull request from a commit
Jack Nagel jacknagel libgcrypt: fix universal builds
Closes #18345.
ebe75e0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 8, 2013
  1. Thijs Alkemade

    Fix universal builds of libgcrypt.

    xnyhps authored
    SIZEOF_UNSIGNED_LONG was incorrectly set to 8 on i386, use a patch from
    macports to make it depend on arch.
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 0 deletions.
  1. +5 −0 Library/Formula/libgcrypt.rb
5 Library/Formula/libgcrypt.rb
View
@@ -29,6 +29,11 @@ def install
"--prefix=#{prefix}",
"--disable-asm",
"--with-gpg-error-prefix=#{HOMEBREW_PREFIX}"
+
+ if build.universal?
+ system "curl 'https://trac.macports.org/export/56608/trunk/dports/devel/libgcrypt/files/config.h.ed' | ed - config.h"
+ end
+
# Parallel builds work, but only when run as separate steps
system "make", "CFLAGS=#{cflags}"
system "make check"
Something went wrong with that request. Please try again.