Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/contributing/Building, Debugging, and Testing on Unix.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,9 @@ Make sure to install the following via `apt install`
- lldb
- cmake
- xrdp


## Troubleshooting

See the [Troubleshooting section](Building,%20Debugging,%20and%20Testing%20on%20Windows.md#troubleshooting)
in the Windows doc, which is not Windows-specific (use `rm -rf` in place of `Remove-Item`).
Comment on lines +118 to +119
24 changes: 24 additions & 0 deletions docs/contributing/Building, Debugging, and Testing on Windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,30 @@ Before pushing a relevant fix to CI, you can validate locally using the `-testUs
C:\Source> dotnet format analyzers .\roslyn\Compilers.slnf --diagnostics=RS0016 --no-restore --include-generated -v diag
```

## Troubleshooting

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we probably don't need two copies of this (it doesn't seem to be platform specific). Maybe keep the windows one and just link it here from unix.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 920da00 — the detailed section now lives only in the Windows doc, and the Unix doc links to it.


If you hit an unexpected build failure, especially one that doesn't reproduce on a clean
clone, a good first step is to delete the `artifacts` folder and rebuild. If that doesn't
help, the bigger hammer is `git clean -xdfn` (dry run) followed by `git clean -xdf`. Note
that this also deletes the locally-provisioned `.dotnet` SDK, forcing a full restore and
rebuild, so prefer just deleting `artifacts` first.

For example, renaming or moving your clone can leave stale cached files under
`artifacts\obj\...\*.xlf\` referencing the old path, which causes `Build.cmd` to fail with
errors like:

```
error MSB3103: Invalid Resx file. Could not find a part of the path
'<OLD-PATH>\src\RoslynAnalyzers\Text.Analyzers\Core\Dictionary.dic'. [Text.Analyzers.csproj]
```

This happens because the [XliffTasks](https://github.com/dotnet/xliff-tasks) MSBuild tasks

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we need so much info here. Feels like we should make this a bit more generic. Like in general if you hit weird build issues, its a good idea to wipe the artifacts folder, and then if that doesn't work do a git clean. We can maybe mention this issue as a small example.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reworked in 920da00 — the section now leads with general advice (delete artifacts, then git clean -xdf if that doesn't help) and uses the MSB3103/rename case as a concrete example.

bake the **absolute** path of `ResXFileRef` entries into those cached translated `.resx`
files, and MSBuild's incremental-build check doesn't detect the rename because the file
timestamps and contents haven't changed. Deleting `artifacts\obj` (or just the affected
`.xlf` folders) as described above resolves it. This is being tracked upstream in
[dotnet/xliff-tasks](https://github.com/dotnet/xliff-tasks).
Comment on lines +263 to +265

## Contributing

Please see [Contributing Code](https://github.com/dotnet/roslyn/blob/main/CONTRIBUTING.md) for details on contributing changes back to the code.