{"thread":{"id":"60622","subject":"Unable to install git-2.43.0 from source on macOS Big Sur 11.7.10","startedAt":"2023-12-17T22:54:35Z","lastAt":"2023-12-21T19:40:25Z","messageCount":4,"participants":["Jonathan Abrams","Eric Sunshine"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"485761","messageId":"IA1PR12MB604488A775E3390E9B7E56BEB891A@IA1PR12MB6044.namprd12.prod.outlook.com","threadId":"60622","inReplyTo":null,"subject":"Unable to install git-2.43.0 from source on macOS Big Sur 11.7.10","fromName":"Jonathan Abrams","fromEmail":"jonathansabrams@outlook.com","sentAt":"2023-12-17T22:54:33Z","receivedAt":"2023-12-17T22:54:35Z","isPatch":false,"sender":{"key":"jonathansabrams@outlook.com","avatar":null},"body":"Hello,\n\nI am trying to install git-2.43.0 from source on macOS Big Sur 11.7.10.  I have Xcode 13.2.1 installed.  I have read https://github.com/git/git/blob/master/INSTALL.\n\nThe command that will not complete successfully is sudo make all doc.  The Terminal output before the error is as follows.\n--\n    AR libgit.a\n/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libgit.a(zlib-uncompress2.o) has no symbols\n    CC xdiff/xdiffi.o\n    CC xdiff/xemit.o\n    CC xdiff/xhistogram.o\n    CC xdiff/xmerge.o\n    CC xdiff/xpatience.o\n    CC xdiff/xprepare.o\n    CC xdiff/xutils.o\n    AR xdiff/lib.a\n    CC reftable/basics.o\n    CC reftable/error.o\n    CC reftable/block.o\n    CC reftable/blocksource.o\n    CC reftable/iter.o\n    CC reftable/publicbasics.o\n    CC reftable/merged.o\n    CC reftable/pq.o\n    CC reftable/reader.o\n    CC reftable/record.o\n    CC reftable/refname.o\n    CC reftable/generic.o\n    CC reftable/stack.o\n    CC reftable/tree.o\n    CC reftable/writer.o\n    AR reftable/libreftable.a\n    LINK git-daemon\nUndefined symbols for architecture x86_64:\n  \"_libiconv\", referenced from:\n      _precompose_utf8_readdir in libgit.a(precompose_utf8.o)\n      _reencode_string_iconv in libgit.a(utf8.o)\n  \"_libiconv_close\", referenced from:\n      _precompose_string_if_needed in libgit.a(precompose_utf8.o)\n      _precompose_utf8_closedir in libgit.a(precompose_utf8.o)\n      _reencode_string_len in libgit.a(utf8.o)\n  \"_libiconv_open\", referenced from:\n      _precompose_string_if_needed in libgit.a(precompose_utf8.o)\n      _precompose_utf8_opendir in libgit.a(precompose_utf8.o)\n      _reencode_string_len in libgit.a(utf8.o)\nld: symbol(s) not found for architecture x86_64\nclang: error: linker command failed with exit code 1 (use -v to see invocation)\nmake: *** [git-daemon] Error 1\n--\nDoes anyone reading this know how to resolve this error?\n\nThank you,\n\nJonathan S. Abrams"},{"id":"485763","messageId":"CAPig+cTEmiQzD7D7qEKDsyGf+08AtNQzy=GfPZDrRtM2ytKnUw@mail.gmail.com","threadId":"60622","inReplyTo":"IA1PR12MB604488A775E3390E9B7E56BEB891A@IA1PR12MB6044.namprd12.prod.outlook.com","subject":"Re: Unable to install git-2.43.0 from source on macOS Big Sur 11.7.10","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2023-12-18T01:02:39Z","receivedAt":"2023-12-18T01:02:51Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sun, Dec 17, 2023 at 5:54 PM Jonathan Abrams\n<jonathansabrams@outlook.com> wrote:\n> I am trying to install git-2.43.0 from source on macOS Big Sur 11.7.10.  I have Xcode 13.2.1 installed.  I have read https://github.com/git/git/blob/master/INSTALL.\n>\n> The command that will not complete successfully is sudo make all doc.  The Terminal output before the error is as follows.\n\nWhat steps did you take to build the project? Did you simply use `make\nall` alone, or did you run `configure` first? Generally speaking,\nrunning `configure` should be unnecessary on most platforms.\n\n> Undefined symbols for architecture x86_64:\n>   \"_libiconv\", referenced from:\n>       _precompose_utf8_readdir in libgit.a(precompose_utf8.o)\n>       _reencode_string_iconv in libgit.a(utf8.o)\n\nIt looks like it's not linking against `libiconv`. Aside from\nanswering the above question (and reporting the contents of\n\"config.mak.autogen\" if you did run `configure`), you can also run\nmake as:\n\n    make V=1 all\n\nto see the actual command it's running at the point of failure. If you\npaste that command, then we can find out whether or not it's trying to\nlink against `libiconv`.\n"},{"id":"485798","messageId":"CAPig+cQgTNq8rKiXm_dDha+Rz-=Z9O4_gvWLWdcPJe1yp=hQ8Q@mail.gmail.com","threadId":"60622","inReplyTo":"IA1PR12MB60445F50DD0F844B2B779BA8B890A@IA1PR12MB6044.namprd12.prod.outlook.com","subject":"Re: Unable to install git-2.43.0 from source on macOS Big Sur 11.7.10","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2023-12-19T07:55:05Z","receivedAt":"2023-12-19T07:55:17Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, Dec 18, 2023 at 7:03 AM Jonathan Abrams\n<jonathansabrams@outlook.com> wrote:\n> The contents of \"config.mak.autogen\" are as follows:\n> --\n> CURL_LDFLAGS=-L/Users/jonathana/opt/anaconda3/lib -lcurl\n> CHARSET_LIB=-liconv\n\nSo, 'configure' found a \"libiconv\". Okay.\n\n> The last output of make V=1 all is as follows.\n> --\n> gcc   -g -O2 -I. -o git-daemon daemon.o common-main.o libgit.a xdiff/lib.a reftable/libreftable.a libgit.a -lz  -liconv  -liconv\n\nAnd it's linking against \"libiconv\" (the \"-iconv\" part). Good.\n\n> Undefined symbols for architecture x86_64:\n>   \"_libiconv\", referenced from:\n>       _precompose_utf8_readdir in libgit.a(precompose_utf8.o)\n>       _reencode_string_iconv in libgit.a(utf8.o)\n\nBut it doesn't seem to like your \"libiconv\" for some reason.\n\nI notice that you seem to have an Anaconda environment active. Do you\nknow if this \"libiconv\" happens to reside within the Anaconda\nenvironment? If so, what version is it and from where was it installed\n(\"conda-forge\", \"anaconda\", some other)?\n\nHave you tried deactivating the Anaconda environment (\"conda\ndeactivate\") before building Git? Also, I would suggest trying without\neven running the configure script at all. So, for instance:\n\n  % cd git\n  % conda deactivate\n  % make distclean\n  % make all\n"},{"id":"485950","messageId":"IA1PR12MB6044112A08508ED982F743E2B895A@IA1PR12MB6044.namprd12.prod.outlook.com","threadId":"60622","inReplyTo":"CAPig+cQgTNq8rKiXm_dDha+Rz-=Z9O4_gvWLWdcPJe1yp=hQ8Q@mail.gmail.com","subject":"Re: Unable to install git-2.43.0 from source on macOS Big Sur 11.7.10","fromName":"Jonathan Abrams","fromEmail":"jonathansabrams@outlook.com","sentAt":"2023-12-21T19:40:23Z","receivedAt":"2023-12-21T19:40:25Z","isPatch":false,"sender":{"key":"jonathansabrams@outlook.com","avatar":null},"body":"After deactivating the conda environment, I get a different error.  The commands I entered are:\n\nconda deactivate\nmake configure\n./configure --prefix=/usr\nmake V=1 all doc\n\nThis ends with the following error.\n/usr/bin/perl ./build-docdep.perl >doc.dep\n/Applications/Xcode.app/Contents/Developer/usr/bin/make -C ../  GIT-VERSION-FILE\nmake[2]: `GIT-VERSION-FILE' is up to date.\nfatal: not a git repository (or any of the parent directories): .git\n/Applications/Xcode.app/Contents/Developer/usr/bin/make -C ../  GIT-VERSION-FILE\nmake[2]: `GIT-VERSION-FILE' is up to date.\n    * new asciidoc flags\nasciidoc  -f asciidoc.conf -amanmanual='Git Manual' -amansource='Git 2.43.0' -arevdate='' -b xhtml11 -d manpage -o git-add.html git-add.txt\nmake[1]: asciidoc: No such file or directory\nmake[1]: *** [git-add.html] Error 1\nmake: *** [doc] Error 2\n\nYour suggestion to run the following commands results in a different error.  The suggested commands were:\ncd git-2.43.0\nconda deactivate\nmake distclean\nmake all\n\nThis ends with the following error.\nGIT_VERSION = 2.43.0\n    * new build flags\n    CC oss-fuzz/fuzz-commit-graph.o\n    CC oss-fuzz/fuzz-pack-headers.o\n    CC oss-fuzz/fuzz-pack-idx.o\n    CC daemon.o\n    * new link flags\n    CC common-main.o\nIn file included from common-main.c:3:\n./gettext.h:17:11: fatal error: 'libintl.h' file not found\n#       include <libintl.h>\n                ^~~~~~~~~~~\n1 error generated.\nmake: *** [common-main.o] Error 1\n\nLooking around line 17 in ./gettext.h, I see this.\n#ifndef NO_GETTEXT\n#\tinclude <libintl.h>\n\nExecuting gettext --version returned nothing.  I then downloaded gettext and installed it using the following commands.\n./configure\nmake\nmake check\nsudo make install\n\nI then executed your suggested commands again.\nconda deactivate\nmake distclean\nmake all\nsudo make install\n\nThis installed GIT.  Thank you for your guidance!\n\nJonathan S. Abrams"}]}