Skip to content

The PublishSymbols source indexing should handle relative paths #20814

Open
@danmohrmsft

Description

In order to pursue deterministic builds and to generally clean up FILE macros in binaries, we attempted to use the new Visual Studio /d1trimfile compiler switch to trim off the repository root directory. This works well enough and, instead of having an obscure ADO agent path in the file paths, e.g. C:\__w\1\s\Src\Foo.cpp, we now just have Src\Foo.cpp.

But this breaks the source indexing in the PublishSymbols ADO task because it explicitly checks the source file paths to ensure they start with the sources directory and, if not, ignores them:

if (!$sourceFilePath.StartsWith($SourcesRootPath, [System.StringComparison]::OrdinalIgnoreCase)) {
# The source file path is not under sources root.
$notUnderSourcesRootPaths.Add($sourceFilePath)
} else {

Instead, it should assume that any relative path it sees should live under the sources directory, prepend the sources directory to it, test for its existence, and, if it exists, include it.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions