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

Re: [PATCH 06/12] meson: wire up credential helpers

From
Patrick Steinhardt <ps@pks.im>
Date
Feb 18, 2025, 11:13 UTC
Message-ID
<Z7RrbZqq9VrTg-Bz@pks.im>
In-Reply-To
<CAGJzqs=+mL_GyXfR44iQ6o6L+gb=D7DWm2Bq4eW19XhuEFuHew@mail.gmail.com>
On Tue, Feb 18, 2025 at 10:11:23AM +0000, M Hickford wrote:
Show 6 quoted lines
> > Note that ideally, we'd also wire up t0303 to be executed with each of
> > the credential helpers to verify their functionality. Unfortunately
> > though, none of them pass the test suite right now, so this is left for
> > a future change.
> 
> Out of curiosity, which tests failed?

Basically all of them. I originally had the patch at the bottom of this email. With that in place, we re-run t0303 for every configured credential helper, where `GIT_TEST_CREDENTIAL_HELPER` is set to the respective credential helper under test. We have to disable parallel tests there because the test state directories would otherwise conflict with one another.

Now you can for example:
    $ meson setup build -Dcredential_helpers=libsecret,netrc
    $ meson test -C build t0303-*
And that shows failures like:
    --- expect-stderr	2025-02-18 11:09:33.323668205 +0000
    +++ stderr	2025-02-18 11:09:33.347668278 +0000
    @@ -1,2 +1,4 @@
    +
    +** (process:75536): CRITICAL **: 11:09:33.339: lookup failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.secrets was not provided by any .service files
     askpass: Username for 'https://example.com':
     askpass: Password for 'https://askpass-username@example.com':
    error: last command exited with $?=1
    not ok 1 - helper (/home/pks/Development/git/build/contrib/credential/libsecret/git-credential-libsecret) has no existing data

I might be missing how exactly to set all of this up so that things actually work. Maybe I have to do something specific for each of the helpers via `GIT_TEST_CREDENTIAL_HELPER_SETUP`. But t0303 isn't wired up via our Makefiles for any of the helpers, as far as I can see, so I'm unable to figure out what such a setup would look like.

Any hints would be welcome.
Patrick
--- >8 ---
diff --git a/contrib/credential/libsecret/meson.build b/contrib/credential/libsecret/meson.build
index 0137660fe02..cb5f7280823 100644
--- a/contrib/credential/libsecret/meson.build
+++ b/contrib/credential/libsecret/meson.build
@@ -1,4 +1,4 @@
-executable('git-credential-libsecret',
+credential_helpers += executable('git-credential-libsecret',
   sources: 'git-credential-libsecret.c',
   dependencies: [
     dependency('glib-2.0'),
diff --git a/contrib/credential/meson.build b/contrib/credential/meson.build
index 4216296ae05..f04525b728e 100644
--- a/contrib/credential/meson.build
+++ b/contrib/credential/meson.build
@@ -1,3 +1,20 @@
+credential_helpers = []
+
 foreach helper : get_option('credential_helpers')
   subdir(helper)
 endforeach
+
+foreach helper : credential_helpers
+  helper_test_environment = test_environment
+  helper_test_environment.set('GIT_TEST_CREDENTIAL_HELPER', helper.full_path())
+
+  test('t0303-credential-external-' + fs.stem(helper.full_path()),
+    shell,
+    args: [ meson.project_source_root() / 't/t0303-credential-external.sh' ],
+    workdir: meson.project_source_root() / 't',
+    env: helper_test_environment,
+    depends: test_dependencies + bin_wrappers + helper,
+    timeout: 0,
+    is_parallel: false,
+  )
+endforeach
diff --git a/contrib/credential/netrc/meson.build b/contrib/credential/netrc/meson.build
index a990dbb86da..110eac8f2f8 100644
--- a/contrib/credential/netrc/meson.build
+++ b/contrib/credential/netrc/meson.build
@@ -6,6 +6,7 @@ credential_netrc = custom_target(
   install: true,
   install_dir: get_option('libexecdir') / 'git-core',
 )
+credential_helpers += credential_netrc
 
 credential_netrc_testenv = test_environment
 credential_netrc_testenv.set('CREDENTIAL_NETRC_PATH', credential_netrc.full_path())
diff --git a/contrib/credential/osxkeychain/meson.build b/contrib/credential/osxkeychain/meson.build
index 3c7677f736c..545a8a25b4b 100644
--- a/contrib/credential/osxkeychain/meson.build
+++ b/contrib/credential/osxkeychain/meson.build
@@ -1,4 +1,4 @@
-executable('git-credential-osxkeychain',
+credential_helpers += executable('git-credential-osxkeychain',
   sources: 'git-credential-osxkeychain.c',
   dependencies: [
     dependency('CoreFoundation'),
diff --git a/contrib/credential/wincred/meson.build b/contrib/credential/wincred/meson.build
index 6de23ca17d4..fa669f038fe 100644
--- a/contrib/credential/wincred/meson.build
+++ b/contrib/credential/wincred/meson.build
@@ -1,4 +1,4 @@
-executable('git-credential-wincred',
+credential_helpers += executable('git-credential-wincred',
   sources: 'git-credential-wincred.c',
   install: true,
   install_dir: get_option('libexecdir') / 'git-core',
Previous: M HickfordNext: M Hickford
Message 9 of 37 in “meson: wire up bits and pieces from "contrib/"”
  1. 00/12 meson: wire up bits and pieces from "contrib/"Patrick Steinhardt, Feb 18, 2025
  2. 01/12 GIT-BUILD-OPTIONS: propagate project's source directoryPatrick Steinhardt, Feb 18, 2025
  3. 02/12 contrib/credential: fix "netrc" tests with out-of-tree buildsPatrick Steinhardt, Feb 18, 2025
  4. 03/12 contrib/credential: fix compilation of wincred helper with MSVCPatrick Steinhardt, Feb 18, 2025
  5. 05/12 contrib/credential: fix compilation of "osxkeychain" helperPatrick Steinhardt, Feb 18, 2025
  6. 04/12 contrib/credential: fix compiling "libsecret" helperPatrick Steinhardt, Feb 18, 2025
  7. 06/12 meson: wire up credential helpersPatrick Steinhardt, Feb 18, 2025
  8. M HickfordFeb 18, 2025
  9. Patrick SteinhardtFeb 18, 2025
  10. M HickfordMar 29, 2025
  11. Patrick SteinhardtMar 31, 2025
  12. 07/12 meson: wire up git-contacts(1)Patrick Steinhardt, Feb 18, 2025
  13. 08/12 meson: wire up static analysis via CoccinellePatrick Steinhardt, Feb 18, 2025
  14. 09/12 gitk: extract script to build GitkPatrick Steinhardt, Feb 18, 2025
  15. Junio C HamanoFeb 18, 2025
  16. Patrick SteinhardtFeb 19, 2025
  17. Johannes SixtFeb 19, 2025
  18. Patrick SteinhardtFeb 19, 2025
  19. Johannes SixtFeb 19, 2025
  20. 10/12 meson: wire up GitkPatrick Steinhardt, Feb 18, 2025
  21. 11/12 ci: fix propagating UTF-8 test locale in musl-based Meson jobPatrick Steinhardt, Feb 18, 2025
  22. 12/12 ci: exercise credential helpersPatrick Steinhardt, Feb 18, 2025
  23. M HickfordFeb 18, 2025
  24. 00/10 meson: wire up bits and pieces from "contrib/"Patrick Steinhardt, Feb 19, 2025
  25. 01/10 GIT-BUILD-OPTIONS: propagate project's source directoryPatrick Steinhardt, Feb 19, 2025
  26. 02/10 contrib/credential: fix "netrc" tests with out-of-tree buildsPatrick Steinhardt, Feb 19, 2025
  27. 03/10 contrib/credential: fix compilation of wincred helper with MSVCPatrick Steinhardt, Feb 19, 2025
  28. 05/10 contrib/credential: fix compilation of "osxkeychain" helperPatrick Steinhardt, Feb 19, 2025
  29. 04/10 contrib/credential: fix compiling "libsecret" helperPatrick Steinhardt, Feb 19, 2025
  30. 06/10 meson: wire up credential helpersPatrick Steinhardt, Feb 19, 2025
  31. 07/10 meson: wire up git-contacts(1)Patrick Steinhardt, Feb 19, 2025
  32. 08/10 meson: wire up static analysis via CoccinellePatrick Steinhardt, Feb 19, 2025
  33. 09/10 ci: fix propagating UTF-8 test locale in musl-based Meson jobPatrick Steinhardt, Feb 19, 2025
  34. 10/10 ci: exercise credential helpersPatrick Steinhardt, Feb 19, 2025
  35. Ramsay JonesFeb 20, 2025
  36. Patrick SteinhardtFeb 20, 2025
  37. Ramsay JonesFeb 21, 2025

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.