git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] Makefile: use sha1collisiondetection by default on OSX and Darwin

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 15, 2022, 21:17 UTC
Message-ID
<xmqqlen8s6xv.fsf@gitster.g>
In-Reply-To
<patch-v2-1.1-3de7cdbd260-20221215T084129Z-avarab@gmail.com>
Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
> Let's also use sha1collisiondetection on OSX, to do so we'll need to
> split up the "APPLE_COMMON_CRYPTO" flag into that flag and a new
> "APPLE_COMMON_CRYPTO_SHA1".
That's well reasoned
This leaves these in Makefile:
        # Define NO_APPLE_COMMON_CRYPTO if you are building on Darwin/Mac OS X
        # and do not want to use Apple's CommonCrypto library.  This allows you
        # to provide your own OpenSSL library, for example from MacPorts.
        ifndef NO_APPLE_COMMON_CRYPTO
                NO_OPENSSL = YesPlease
                APPLE_COMMON_CRYPTO = YesPlease
                COMPAT_CFLAGS += -DAPPLE_COMMON_CRYPTO
        endif

Because we only mention what it does to use NO_APPLE_COMMON_CRYPTO here, without promising anything about what happens otherwise, we can do this change without breaking any promises ;-)

However there is this bit:
        ifdef APPLE_COMMON_CRYPTO
                LIB_4_CRYPTO += -framework Security -framework CoreFoundation
        endif
So, if one says 
    make NO_APPLE_COMMON_CRYPTO=NoThanks APPLE_COMMON_CRYPTO_SHA1=YesPlease

presumably the end result will fail to link? I _think_ that falls into "if it hurts, don't do that", and

 (1) automatically disabling the latter when the former is set would
     be more confusing than helpful.
 (2) explicitly detecting the situation and issue an error message
     from the Makefile might appear nicer, but if the linker does
     the failing with a messaage fine, that would be sufficient.
so in the end, the posted patch as-is should be fine, I think.
Previous: Ævar Arnfjörð Bjarmason
Message 5 of 5 in “Makefile: use sha1collisiondetection by default on OSX and Darwin”
  1. Makefile: use sha1collisiondetection by default on OSX and DarwinÆvar Arnfjörð Bjarmason, Oct 20, 2022
  2. Junio C HamanoOct 20, 2022
  3. Ævar Arnfjörð BjarmasonOct 20, 2022
  4. Makefile: use sha1collisiondetection by default on OSX and DarwinÆvar Arnfjörð Bjarmason, Dec 15, 2022
  5. Junio C HamanoDec 15, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.