diff options
author | Ankit Jain <radical@gmail.com> | 2020-01-23 21:34:26 +0300 |
---|---|---|
committer | Alexander Köplinger <alex.koeplinger@outlook.com> | 2020-01-23 21:34:26 +0300 |
commit | cc6e927d10173ba7d90805348e8350e6dd80e142 (patch) | |
tree | 1d5e444cf62c0e7b3120cc1df44e872439f6f992 /packaging | |
parent | 6b475d5d0018787ed2f65c2d6eb236b5350e0ad8 (diff) |
[bockbuild] preinstall: kill any running VBCSCompiler processes (#18488)
- roslyn's shared compiler server hashes it's pipename on the path to
the assembly.
- On macOS, this looks like `/Library/Frameworks/Mono.framework/Versions/6.8.0/lib/mono/msbuild/Current/bin/Roslyn/VBCSCompiler.exe`
- When installing a new mono, with that same `x.y.z` version, this
process will effectively be out of sync with the new updated
mono/msbuild/roslyn
- This manifests as:
```
Using shared compilation with compiler from directory: /Library/Frameworks/Mono.framework/Versions/6.8.0/lib/mono/msbuild/Current/bin/Roslyn
/Library/Frameworks/Mono.framework/Versions/6.8.0/lib/mono/msbuild/Current/bin/Roslyn/Microsoft.CSharp.Core.targets(59,5): error : Roslyn compiler server reports different hash version than build task. [/Users/builder/azdo/_work/3/s/xamarin-android/build-tools/xaprepare/xaprepare/xaprepare.csproj]
```
- See https://github.com/xamarin/xamarin-android/pull/4108
- So, we kill any running roslyn shared compiler servers
Diffstat (limited to 'packaging')
-rwxr-xr-x | packaging/MacSDK/packaging/resources/preinstall | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/packaging/MacSDK/packaging/resources/preinstall b/packaging/MacSDK/packaging/resources/preinstall index 13594e1d67e..e1a98730a61 100755 --- a/packaging/MacSDK/packaging/resources/preinstall +++ b/packaging/MacSDK/packaging/resources/preinstall @@ -5,5 +5,8 @@ PREVIOUS_INSTALL=/Library/Frameworks/Mono.framework/Versions/@@MONO_VERSION@@ # delete any preexisting install of this version # to make sure we're starting from a clean slate if [ -d "$PREVIOUS_INSTALL" ]; then + # Kill any running VBCSCompiler processes + pgrep -lf "^${PREVIOUS_INSTALL}/bin/mono[^/]*${PREVIOUS_INSTALL}/lib/mono/msbuild/[^/]*/bin/Roslyn/VBCSCompiler.exe" | awk '{$1=""; system($0 " -shutdown")}' + rm -rf "$PREVIOUS_INSTALL" fi |