Skip to content

Commit 586919c

Browse files
ramsay-jonesgitster
authored andcommitted
meson: fix installation when -Dlibexexdir is set
commit 837f637 ("meson.build: correct setting of GIT_EXEC_PATH", 2025-05-19) corrected the GIT_EXEC_PATH build setting, but then forgot to update the installation path for the library executables. This causes a regression when attempting to execute commands, after installing to a non-standard location (reported here[1]): $ meson -Dprefix=/tmp/git -Dlibexecdir=libexec-different build $ meson install $ /tmp/git/bin/git --exec-path /tmp/git/libexec-different $ /tmp/git/bin/git daemon git: 'daemon' is not a git command. See 'git --help' In order to fix the issue, use the 'git_exec_path' variable (calculated while processing -Dlibexecdir) as the 'install_dir' field during the installation of the library executables. [1]: <[email protected]> Reported-by: [email protected] Signed-off-by: Ramsay Jones <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 16bd9f2 commit 586919c

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

meson.build

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1744,43 +1744,43 @@ git_builtin = executable('git',
17441744
sources: builtin_sources + 'git.c',
17451745
dependencies: [libgit_commonmain],
17461746
install: true,
1747-
install_dir: get_option('libexecdir') / 'git-core',
1747+
install_dir: git_exec_path,
17481748
)
17491749
bin_wrappers += git_builtin
17501750

17511751
test_dependencies += executable('git-daemon',
17521752
sources: 'daemon.c',
17531753
dependencies: [libgit_commonmain],
17541754
install: true,
1755-
install_dir: get_option('libexecdir') / 'git-core',
1755+
install_dir: git_exec_path,
17561756
)
17571757

17581758
test_dependencies += executable('git-sh-i18n--envsubst',
17591759
sources: 'sh-i18n--envsubst.c',
17601760
dependencies: [libgit_commonmain],
17611761
install: true,
1762-
install_dir: get_option('libexecdir') / 'git-core',
1762+
install_dir: git_exec_path,
17631763
)
17641764

17651765
bin_wrappers += executable('git-shell',
17661766
sources: 'shell.c',
17671767
dependencies: [libgit_commonmain],
17681768
install: true,
1769-
install_dir: get_option('libexecdir') / 'git-core',
1769+
install_dir: git_exec_path,
17701770
)
17711771

17721772
test_dependencies += executable('git-http-backend',
17731773
sources: 'http-backend.c',
17741774
dependencies: [libgit_commonmain],
17751775
install: true,
1776-
install_dir: get_option('libexecdir') / 'git-core',
1776+
install_dir: git_exec_path,
17771777
)
17781778

17791779
bin_wrappers += executable('scalar',
17801780
sources: 'scalar.c',
17811781
dependencies: [libgit_commonmain],
17821782
install: true,
1783-
install_dir: get_option('libexecdir') / 'git-core',
1783+
install_dir: git_exec_path,
17841784
)
17851785

17861786
if curl.found()
@@ -1796,22 +1796,22 @@ if curl.found()
17961796
sources: 'remote-curl.c',
17971797
dependencies: [libgit_curl],
17981798
install: true,
1799-
install_dir: get_option('libexecdir') / 'git-core',
1799+
install_dir: git_exec_path,
18001800
)
18011801

18021802
test_dependencies += executable('git-http-fetch',
18031803
sources: 'http-fetch.c',
18041804
dependencies: [libgit_curl],
18051805
install: true,
1806-
install_dir: get_option('libexecdir') / 'git-core',
1806+
install_dir: git_exec_path,
18071807
)
18081808

18091809
if expat.found()
18101810
test_dependencies += executable('git-http-push',
18111811
sources: 'http-push.c',
18121812
dependencies: [libgit_curl],
18131813
install: true,
1814-
install_dir: get_option('libexecdir') / 'git-core',
1814+
install_dir: git_exec_path,
18151815
)
18161816
endif
18171817

@@ -1822,7 +1822,7 @@ if curl.found()
18221822
)
18231823

18241824
install_symlink(alias + executable_suffix,
1825-
install_dir: get_option('libexecdir') / 'git-core',
1825+
install_dir: git_exec_path,
18261826
pointing_to: 'git-remote-http',
18271827
)
18281828
endforeach
@@ -1832,7 +1832,7 @@ test_dependencies += executable('git-imap-send',
18321832
sources: 'imap-send.c',
18331833
dependencies: [ use_curl_for_imap_send ? libgit_curl : libgit_commonmain ],
18341834
install: true,
1835-
install_dir: get_option('libexecdir') / 'git-core',
1835+
install_dir: git_exec_path,
18361836
)
18371837

18381838
foreach alias : [ 'git-receive-pack', 'git-upload-archive', 'git-upload-pack' ]
@@ -1842,7 +1842,7 @@ foreach alias : [ 'git-receive-pack', 'git-upload-archive', 'git-upload-pack' ]
18421842
)
18431843

18441844
install_symlink(alias + executable_suffix,
1845-
install_dir: get_option('libexecdir') / 'git-core',
1845+
install_dir: git_exec_path,
18461846
pointing_to: 'git',
18471847
)
18481848
endforeach
@@ -1856,9 +1856,9 @@ foreach symlink : [
18561856
'scalar',
18571857
]
18581858
if meson.version().version_compare('>=1.3.0')
1859-
pointing_to = fs.relative_to(get_option('libexecdir') / 'git-core' / symlink, get_option('bindir'))
1859+
pointing_to = fs.relative_to(git_exec_path / symlink, get_option('bindir'))
18601860
else
1861-
pointing_to = '../libexec/git-core' / symlink
1861+
pointing_to = '..' / git_exec_path / symlink
18621862
endif
18631863

18641864
install_symlink(symlink,
@@ -1898,7 +1898,7 @@ foreach script : scripts_sh
18981898
meson.project_build_root() / 'GIT-BUILD-OPTIONS',
18991899
],
19001900
install: true,
1901-
install_dir: get_option('libexecdir') / 'git-core',
1901+
install_dir: git_exec_path,
19021902
)
19031903
endforeach
19041904

@@ -1931,7 +1931,7 @@ if perl_features_enabled
19311931
input: perl_header_template,
19321932
output: 'GIT-PERL-HEADER',
19331933
configuration: {
1934-
'GITEXECDIR_REL': get_option('libexecdir') / 'git-core',
1934+
'GITEXECDIR_REL': git_exec_path,
19351935
'PERLLIBDIR_REL': perllibdir,
19361936
'LOCALEDIR_REL': get_option('datadir') / 'locale',
19371937
'INSTLIBDIR': perllibdir,
@@ -1955,7 +1955,7 @@ if perl_features_enabled
19551955
output: fs.stem(script),
19561956
command: generate_perl_command,
19571957
install: true,
1958-
install_dir: get_option('libexecdir') / 'git-core',
1958+
install_dir: git_exec_path,
19591959
depends: [git_version_file],
19601960
)
19611961
test_dependencies += generated_script
@@ -1964,9 +1964,9 @@ if perl_features_enabled
19641964
bin_wrappers += generated_script
19651965

19661966
if meson.version().version_compare('>=1.3.0')
1967-
pointing_to = fs.relative_to(get_option('libexecdir') / 'git-core' / fs.stem(script), get_option('bindir'))
1967+
pointing_to = fs.relative_to(git_exec_path / fs.stem(script), get_option('bindir'))
19681968
else
1969-
pointing_to = '../libexec/git-core' / fs.stem(script)
1969+
pointing_to = '..' / git_exec_path / fs.stem(script)
19701970
endif
19711971

19721972
install_symlink(fs.stem(script),
@@ -1996,7 +1996,7 @@ if python.found()
19961996
'@OUTPUT@',
19971997
],
19981998
install: true,
1999-
install_dir: get_option('libexecdir') / 'git-core',
1999+
install_dir: git_exec_path,
20002000
)
20012001
test_dependencies += generated_python
20022002
endforeach
@@ -2030,7 +2030,7 @@ mergetools = [
20302030
]
20312031

20322032
foreach mergetool : mergetools
2033-
install_data(mergetool, install_dir: get_option('libexecdir') / 'git-core' / 'mergetools')
2033+
install_data(mergetool, install_dir: git_exec_path / 'mergetools')
20342034
endforeach
20352035

20362036
if intl.found()

0 commit comments

Comments
 (0)