Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

purl2dwarf: Get DWARFs from a PURL #260

Closed
Tracked by #246
pombredanne opened this issue Dec 14, 2023 · 13 comments
Closed
Tracked by #246

purl2dwarf: Get DWARFs from a PURL #260

pombredanne opened this issue Dec 14, 2023 · 13 comments
Assignees

Comments

@pombredanne
Copy link
Member

pombredanne commented Dec 14, 2023

Create a PURL a service backed by new SCIO analysis pipelines that takes a PURL for a native binary package as an input, and returns the DWARF debug symbol compilation unit paths when available. This will specifically be worked out for Debian native binary packages.

@pombredanne pombredanne changed the title purl2dwarf: Create a PURL a service backed by new SCIO analysis pipelines that takes a PURL for a native binary package as an input, and returns the DWARF debug symbol compilation unit paths when available. This will specifically be worked out for Debian native binary packages. purl2dwarf: Get DWARFs from a PURL Dec 14, 2023
@armijnhemel
Copy link

As a package can contain multiple binaries I guess that the result would be a list of "DWARF information per binary"?

@pombredanne
Copy link
Member Author

As a package can contain multiple binaries I guess that the result would be a list of "DWARF information per binary"?

Yes, that's per binary file

@armijnhemel
Copy link

As a package can contain multiple binaries I guess that the result would be a list of "DWARF information per binary"?

Yes, that's per binary file

What would this look like for a package like coreutils (with ~100 binaries)?

@pombredanne
Copy link
Member Author

What would this look like for a package like coreutils (with ~100 binaries)?

more or less like this:

- files:
  - path: foo/bar/find
    dwarf_paths:
      - /home/joe/coreutil/includes/baz.h
      - /home/joe/coreutil/find.c
  - path: foo/bar/ls
    dwarf_paths:
      - /home/joe/coreutil/includes/baz.h
      - /home/joe/coreutil/js.c

@TG1999
Copy link
Member

TG1999 commented Jan 26, 2024

It should be an add-on pipeline in the data model, it should be used for d2d on elfs. This part is just to collect dwarfs.

@pombredanne
Copy link
Member Author

The basis would be provided by the https://github.com/nexb/elf-inspector

@TG1999 TG1999 self-assigned this Jan 30, 2024
@TG1999
Copy link
Member

TG1999 commented Feb 1, 2024

Will be closed by nexB/scancode.io#1068

@TG1999
Copy link
Member

TG1999 commented Mar 14, 2024

Now we have an add-on pipeline in scancode.io to get dwarfs from a codebase, but we need this support for a package URL, so some of the ways we could achieve this, we can check if there is a download URL associated with that purl in qualifiers. If there is no download URL, we can try to get it from purlDB, and if there is nothing in purldb regarding that purl, get it from purl2url module from purl.

@pombredanne
Copy link
Member Author

@TG1999 you should sync up with @keshav-space on this #260 (comment) as he has some things in the works for purl2sym

@pombredanne
Copy link
Member Author

A good example of a package with DWARFs is https://repo1.maven.org/maven2/com/sun/jna/jna/3.0.9/jna-3.0.9.jar which has the PURL: pkg:maven/com.sun.jna/jna@3.0.9

@pombredanne
Copy link
Member Author

Related is this issue: nexB/scancode.io#1121

Another example pkg:generic/debug@1.23?download_url=https://github.com/nexB/elf-inspector/raw/4333e1601229da87fa88961389d7397af6e027c4/tests/data/dwarf_and_elf/analyze.so.debug

@JonoYang
Copy link
Contributor

@TG1999 I've merged #353

@TG1999
Copy link
Member

TG1999 commented Mar 28, 2024

This is done. We now have:

a pipeline inspect_elf_binaries from scancode.io that can get dwarf data for ELFs
These PRs have been merged

To test this feature:

  • Install PurlDB
  • Make a request for a purl that contains ELFs at /api/packages/ and then check it's "resources", you will find dwarf data in "extra_data" field of every ELF resource.

And to test this first part of purl2dwarf, install the latest scancode.io

@TG1999 TG1999 closed this as completed Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

5 participants