summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDavid Lönnhager <david.l@mullvad.net>2024-12-02 08:38:28 +0100
committerDavid Lönnhager <david.l@mullvad.net>2024-12-02 14:09:33 +0100
commit8f63994ba53d56bbb8ba3c60ab0f70db7a8650e8 (patch)
tree6cb39d5108383debaf6ab5f1f890208216a592cb
parent3ed024c53913678e1a557bd66b5bef5be774367e (diff)
downloadmullvadvpn-8f63994ba53d56bbb8ba3c60ab0f70db7a8650e8.tar.xz
mullvadvpn-8f63994ba53d56bbb8ba3c60ab0f70db7a8650e8.zip
Add workaround for cargo linker issues in MSVC when targeting i686
When running cargo from MSVC, as of Rust 1.83, it uses build tools for the target MSVC architecture rather than host, when building build scripts. Unsetting 'VSTEL_MSBuildProjectFullPath' works around this issue. This workaround can be removed once the upstream issue has been fixed: https://github.com/rust-lang/cc-rs/issues/1308
-rw-r--r--windows/nsis-plugins/src/cleanup/cleanup.vcxproj6
-rw-r--r--windows/nsis-plugins/src/log/log.vcxproj6
2 files changed, 8 insertions, 4 deletions
diff --git a/windows/nsis-plugins/src/cleanup/cleanup.vcxproj b/windows/nsis-plugins/src/cleanup/cleanup.vcxproj
index f60a100eb5..324264a0c0 100644
--- a/windows/nsis-plugins/src/cleanup/cleanup.vcxproj
+++ b/windows/nsis-plugins/src/cleanup/cleanup.vcxproj
@@ -75,7 +75,8 @@
<ModuleDefinitionFile>cleanup.def</ModuleDefinitionFile>
</Link>
<PreBuildEvent>
- <Command>cargo build --target i686-pc-windows-msvc --release -p mullvad-nsis</Command>
+ <Command>powershell.exe -Command "&amp; { Remove-Item Env:VSTEL_MSBuildProjectFullPath; cargo build --target i686-pc-windows-msvc --release -p mullvad-nsis }"
+</Command>
<Message>Build mullvad-nsis library</Message>
</PreBuildEvent>
</ItemDefinitionGroup>
@@ -105,7 +106,8 @@
<ModuleDefinitionFile>cleanup.def</ModuleDefinitionFile>
</Link>
<PreBuildEvent>
- <Command>cargo build --target i686-pc-windows-msvc --release -p mullvad-nsis</Command>
+ <Command>powershell.exe -Command "&amp; { Remove-Item Env:VSTEL_MSBuildProjectFullPath; cargo build --target i686-pc-windows-msvc --release -p mullvad-nsis }"
+</Command>
<Message>Build mullvad-nsis library</Message>
</PreBuildEvent>
</ItemDefinitionGroup>
diff --git a/windows/nsis-plugins/src/log/log.vcxproj b/windows/nsis-plugins/src/log/log.vcxproj
index 7509919f19..b80ae3545f 100644
--- a/windows/nsis-plugins/src/log/log.vcxproj
+++ b/windows/nsis-plugins/src/log/log.vcxproj
@@ -75,7 +75,8 @@
<ModuleDefinitionFile>log.def</ModuleDefinitionFile>
</Link>
<PreBuildEvent>
- <Command>cargo build --target i686-pc-windows-msvc --release -p mullvad-nsis</Command>
+ <Command>powershell.exe -Command "&amp; { Remove-Item Env:VSTEL_MSBuildProjectFullPath; cargo build --target i686-pc-windows-msvc --release -p mullvad-nsis }"
+</Command>
<Message>Build mullvad-nsis library</Message>
</PreBuildEvent>
</ItemDefinitionGroup>
@@ -105,7 +106,8 @@
<ModuleDefinitionFile>log.def</ModuleDefinitionFile>
</Link>
<PreBuildEvent>
- <Command>cargo build --target i686-pc-windows-msvc --release -p mullvad-nsis</Command>
+ <Command>powershell.exe -Command "&amp; { Remove-Item Env:VSTEL_MSBuildProjectFullPath; cargo build --target i686-pc-windows-msvc --release -p mullvad-nsis }"
+</Command>
<Message>Build mullvad-nsis library</Message>
</PreBuildEvent>
</ItemDefinitionGroup>