Commit Graph

8 Commits

Author SHA1 Message Date
Daniel Thornburgh 6b92bb4790 [Support] [DebugInfo] Lazily create cache dir.
This change defers creating Support/Caching.cpp's cache directory until
it actually writes to the cache.

This allows using Caching library in a read-only fashion. If read-only,
the cache is guaranteed not to write to disk. This keeps tools using
DebugInfod (currently llvm-symbolizer) hermetic when not configured to
perform remote lookups.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D117589
2022-01-20 19:27:15 +00:00
Noah Shutty 3d595eccc7 [Debuginfod] Fix debuginfod unit test when $HOME is not writable.
The directory returned from `cache_directory` may not be writable if the unit tests are run with limited permissions (e.g. if $HOME is not writable).
This fixes a unit test of the debuginfod client to set the cache path to the system temporary directory to avoid this issue.

Reviewed By: estewart08

Differential Revision: https://reviews.llvm.org/D115813
2021-12-15 22:13:13 +00:00
Noah Shutty d9941f7454 [Support] [Debuginfod] Move HTTPClient to Debuginfod library.
Following the discussion in D112753, this moves the HTTPClient from Support to Debuginfod library so that tools depending on Support do not automatically depend on Curl as well. This also removes `HTTPClient::initialize()` and `HTTPClient::cleanup()` from `InitLLVM` so these steps should be implemented by user tools instead.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D115131
2021-12-07 01:19:21 +00:00
Noah Shutty 0e0f1b28fc [llvm] [Debuginfo] Debuginfod client library.
This adds a Debuginfod client library which queries servers specified by the `DEBUGINFOD_URLS` environment variable for the debuginfo, executable, or a specified source file associated with a given build id.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D112758
2021-12-06 21:52:38 +00:00
Noah Shutty f45c9c56c5 Revert "[llvm] [Debuginfo] Debuginfod client library."
This reverts commit 4a16fe1369 because it
caused failures on Windows builds.
2021-12-06 19:19:14 +00:00
Noah Shutty 4a16fe1369 [llvm] [Debuginfo] Debuginfod client library.
This adds a Debuginfod client library which queries servers specified by the `DEBUGINFOD_URLS` environment variable for the debuginfo, executable, or a specified source file associated with a given build id.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D112758
2021-12-06 17:52:35 +00:00
Noah Shutty b5bb05d355 Revert "[llvm] [Debuginfo] Debuginfod client library."
This reverts commit af69947e70 because it
caused buildbot failures.
2021-12-06 05:39:05 +00:00
Noah Shutty af69947e70 [llvm] [Debuginfo] Debuginfod client library.
This adds a Debuginfod library containing the `fetchDebuginfo` function which queries servers specified by the `DEBUGINFOD_URLS` environment variable for the debuginfo, executable, or a specified source file associated with a given build id.

This diff was split out from D111252.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D112758
2021-12-06 04:38:14 +00:00