This is an archive of the discontinued LLVM Phabricator instance.

[Debuginfod] DEBUGINFOD_HEADERS_FILE environment variable
ClosedPublic

Authored by mysterymath on Oct 19 2022, 4:47 PM.

Details

Summary

This change adds a DEBUGINFOD_HEADERS_FILE environment variable provides
a file containing HTTP headers to attach to outgoing HTTP requests, one
per line. This allows a file permissioned with OS access control
mechanisms to supply bearer credentials for Debuginfod requests.

This matches the mechanism recently added to elfutils' libdebuginfod.

Diff Detail

Event Timeline

mysterymath created this revision.Oct 19 2022, 4:47 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 19 2022, 4:47 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
mysterymath requested review of this revision.Oct 19 2022, 4:47 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 19 2022, 4:47 PM
phosek added inline comments.Oct 20 2022, 12:00 AM
llvm/test/tools/llvm-debuginfod-find/Inputs/capture_req.py
16

Wouldn't this fail if something was already running on a port 8000 (which is pretty common)? Is it possible to instead choose first available?

Let OS automatically assign port.

mysterymath marked an inline comment as done.Oct 20 2022, 10:50 AM
mysterymath added inline comments.
llvm/test/tools/llvm-debuginfod-find/Inputs/capture_req.py
16

Ah, good call. Done.

mysterymath marked an inline comment as done.

Note that this flag just landed in the elfutils libdebuginfod client.

MaskRay added a comment.EditedNov 5 2022, 11:28 AM

I see a 2022-10-28 elfutils commit adding DEBUGINFOD_HEADERS_FILE. The message should mention that the feature matches debuginfod.
I'd use llvm-debuginfod instead of Debuginfod as the tag to make it clear the one in llvm-project is an alternative implementation.

Also, I'd remove the trailing dot in the subject line.

Thanks. Generally LG

llvm/lib/Debuginfod/Debuginfod.cpp
195

For StringExtras STLExtras, llvm:: is common, llvm::split

196

Should there be a warning for non-header lines? If comments are useful, we can allow # comment markers.

llvm/test/tools/llvm-debuginfod-find/Inputs/capture_req.py
21

Single quotes are more common

llvm/test/tools/llvm-debuginfod-find/headers.test
14

The check can be made stricter

HEADERS:      Accept: */*
HEADERS-NEXT: A: B
HEADERS-NEXT: ...
HEADERS-NOT:  {{.}}

Then NO-HEADERS-NOT can be removed

mysterymath marked 4 inline comments as done.EditedNov 7 2022, 1:37 PM
This comment has been deleted.
llvm/lib/Debuginfod/Debuginfod.cpp
196

Added a warning; this should help keep the semantics of this file very simple.

llvm/test/tools/llvm-debuginfod-find/headers.test
14

Mostly done, but I think we still do want a check of some kind in the NO-HEADERS case.

mysterymath marked 2 inline comments as done.Nov 7 2022, 1:40 PM

I see a 2022-10-28 elfutils commit adding DEBUGINFOD_HEADERS_FILE. The message should mention that the feature matches debuginfod.

Done.

I'd use llvm-debuginfod instead of Debuginfod as the tag to make it clear the one in llvm-project is an alternative implementation.

I would, but there's already a llvm-debuginfod utility in LLVM that makes this ambiguous. The library is named Debuginfod, so that's what I've been using to tag CLs against the client library.

Also, I'd remove the trailing dot in the subject line.

Done.

Address review comments.

Fix formatting.

mysterymath retitled this revision from [Debuginfod] DEBUGINFOD_HEADERS_FILE environment variable. to [Debuginfod] DEBUGINFOD_HEADERS_FILE environment variable.Nov 7 2022, 1:43 PM
mysterymath edited the summary of this revision. (Show Details)
MaskRay accepted this revision.Nov 7 2022, 2:17 PM
MaskRay added inline comments.
llvm/test/tools/llvm-debuginfod-find/headers.test
18

Align HEADERS's value when HEADER-NEXT is present.

26

Add -NEXT if applicable

This revision is now accepted and ready to land.Nov 7 2022, 2:17 PM
mysterymath marked 2 inline comments as done.

Add -NEXT to tests.

This revision was landed with ongoing or failed builds.Nov 7 2022, 4:34 PM
This revision was automatically updated to reflect the committed changes.