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

[Bug]: FlattenPdbs not copying any files #673

Closed
1 task done
jorticus-msft opened this issue Jan 12, 2024 · 0 comments
Closed
1 task done

[Bug]: FlattenPdbs not copying any files #673

jorticus-msft opened this issue Jan 12, 2024 · 0 comments
Assignees
Labels
state:needs-triage Needs to triaged to determine next steps type:bug Something isn't working urgency:low Little to no impact

Comments

@jorticus-msft
Copy link

jorticus-msft commented Jan 12, 2024

Is there an existing issue for this?

  • I have searched existing issues

Current Behavior

In #511, FlattenPdbs was modified to only include PDBs from the OUTPUT folder. However my build for whatever reason puts the PDB in the folder outside of this (plus the DEBUG folder), but not the OUTPUT folder, so no PDBs are getting copied to the PDB flat directory.

ie, my directory structure looks like this:

 DxeMain
 ├╴DEBUG
 │ ├╴AutoGen.c
 │ ├╴AutoGen.h
 │ ├╴DxeCore.dll
 │ ├╴DxeCore.efi
 │ ╰╴DxeCore.map
 ├╴OUTPUT
 │ ├╴AutoGen.c.deps
 │ ├╴AutoGen.obj
 │ ├╴DxeCore.depex
 │ ├╴DxeCore.efi
 │ ├╴DxeCore.inf
 │ ├╴DxeCore.lib
 │ ├╴DxeCore.map
 │ ├╴DxeCore.txt
 │ ├╴DxeCore.uni
 │ ├╴DxeCoreExtra.uni
 │ ├╴object_files.lst
 │ ╰╴static_library_files.lst
 ├╴AutoGenTimeStamp
 ├╴dependency
 ├╴deps.txt
 ├╴deps_target
 ├╴DxeCore.makefile
 ├╴DxeCore.pdb   <-- This should be copied out
 ╰╴Makefile

Suggested fix:

       logging.critical("Copying PDBs to flat directory")

       symbols = set()
       for file in Path(build_path).rglob("*.pdb"):
           pdb_out = Path(pdb_path / file.name)

           # Skip MSVC symbols
           if "vc1" in file.name.lower():
               continue

           # Deduplicate
           if not file.name in symbols:
               symbols.add(file.name)

               # If it exists and has the same file identifier, skip it.
               if pdb_out.exists() and file.stat().st_ino == pdb_out.stat().st_ino:
                   continue

               # Hard link it, which is slightly faster, but mainly allows us to tell
               # if the file has changed (st_ino is different)
               pdb_out.unlink(missing_ok=True)
               pdb_out.hardlink_to(file)

       if not symbols:
           logging.error('No symbols were copied')
           return -1

       return 0

Expected Behavior

PDBs should be copied under $BuildOutput\PDB.

Steps To Reproduce

Build platform, observe no symbols copied to PDB folder.

Build Environment

- OS(s): Windows 11
- Tool Chain(s): VS2022
- Targets Impacted: All

Version Information

5658e8a1f82238bfa2059f82f58699f7f3dcb8f3

Urgency

Low

Are you going to fix this?

I will fix it

Do you need maintainer feedback?

No maintainer feedback needed

Anything else?

No response

@jorticus-msft jorticus-msft added state:needs-triage Needs to triaged to determine next steps type:bug Something isn't working labels Jan 12, 2024
@github-actions github-actions bot added the urgency:low Little to no impact label Jan 12, 2024
@jorticus-msft jorticus-msft mentioned this issue Jan 15, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:needs-triage Needs to triaged to determine next steps type:bug Something isn't working urgency:low Little to no impact
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants