Skip to content

Commit 56a0e39

Browse files
brettfocolombod
authored andcommitted
add better detection for bad symlinks
1 parent 8563548 commit 56a0e39

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

DEVELOPER-GUIDE.md

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ If you would like to build `dotnet-interactive` tool and its associated librarie
66

77
## Prerequisites
88

9+
This repo depends on symbolic links between directories. By default Windows doesn't support this feature. To work around this scenario, please run the PowerShell script `<root>/src/ensure-symlinks.ps1` as an administrator. This usually only needs to be run once.
10+
911
This project depends on .NET 5.0. Before working on the project, check that the .NET prerequisites have been met:
1012

1113
- [Prerequisites for .NET on Windows](https://docs.microsoft.com/en-us/dotnet/core/install/windows?tabs=net50#dependencies)

eng/build.ps1

+19
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,25 @@ try {
3636
# }
3737
# }
3838

39+
$repoRoot = Resolve-Path "$PSScriptRoot\.."
40+
$symlinkDirectories = @(
41+
"$repoRoot\src\dotnet-interactive-vscode\stable\src\common",
42+
"$repoRoot\src\dotnet-interactive-vscode\stable\.vscode",
43+
"$repoRoot\src\dotnet-interactive-vscode\insiders\src\common",
44+
"$repoRoot\src\dotnet-interactive-vscode\insiders\.vscode",
45+
"$repoRoot\src\dotnet-interactive-npm\src\common",
46+
"$repoRoot\src\dotnet-interactive-npm\.vscode",
47+
"$repoRoot\src\Microsoft.DotNet.Interactive.Js\src\common",
48+
"$repoRoot\src\Microsoft.DotNet.Interactive.Js\.vscode"
49+
)
50+
51+
foreach ($symlinkDir in $symlinkDirectories) {
52+
$candidate = Get-Item $symlinkDir -ErrorAction SilentlyContinue
53+
if (($null -eq $candidate) -Or (-Not($candidate.Attributes -match "ReparsePoint"))) {
54+
throw "The directory '$symlinkDir' was not a symlink. Please run the script '$repoRoot\src\ensure-symlinks.ps1' **AS ADMIN**."
55+
}
56+
}
57+
3958
# invoke regular build/test script
4059
. (Join-Path $PSScriptRoot "common\build.ps1") -projects "$PSScriptRoot\..\dotnet-interactive.sln" @args
4160
if ($LASTEXITCODE -ne 0) {

src/dotnet-interactive-vscode/DEVGUIDE.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
The organization of this extension is a bit complicated.
22
===
33

4+
This repo depends on symbolic links between directories. By default Windows doesn't support this feature. To work around this scenario, please run the PowerShell script `<root>/src/ensure-symlinks.ps1` as an administrator. This usually only needs to be run once.
5+
46
# tl;dr -
57

68
0. Requirements:

0 commit comments

Comments
 (0)