From 58def24712b9e6a448d9916c48c133210edd759a Mon Sep 17 00:00:00 2001 From: Lee Read Date: Fri, 26 Jul 2024 06:56:34 -0400 Subject: [PATCH] docs: dev: windows tips (#1712) Some extra notes for Windows that I expect will benefit others and also future-me! --- doc/dev.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/doc/dev.md b/doc/dev.md index ba8d8ab0..f4ca481f 100644 --- a/doc/dev.md +++ b/doc/dev.md @@ -111,6 +111,46 @@ If the library you want to add doesn't work automatically, you can manually do t Note: If you have to modify any test file or configuration to have it work with bb, add an inline comment with prefix `BB-TEST-PATCH:` explaining what you did. +## Windows +We have corresponding `.bat` scripts for Windows, examples: + +```shell +script\test.bat +script\run_lib_tests.bat +set BABASHKA_TEST_ENV=native & script\run_lib_tests.bat +``` + +### Enable Windows Symbolic Links +You'll need to **enable symbolic links**. +You must do this before you git clone babashka otherwise some tests will fail. +There seems to be many ways to achieve this; I found the following worked from PowerShell: +```shell +Install-Module -Name Carbon -Force +Import-Module Carbon +Grant-CPrivilege -Identity lee -Privilege SeCreateSymbolicLinkPrivilege +``` +You'll need to reboot: +```shell +shutdown /r /t 0 +``` +After reboot, verify the new privilege via: +```shell +whoami /priv +``` +Test if you can create a symbolic link via: +``` +mklink foofoo barbar +``` + +> **TIP**: Symbolic links are not supported in some folder-sharing technologies. +For example, if you are running Windows as a VirtualBox guest, sharing babashka +source folders from your host OS will not share the symbolic links as symbolic links. +One solution is to re-clone babashka to a non-shared folder on Windows. + +### Git for Windows +Install [Git for Windows](https://gitforwindows.org/). +It includes a version of `cat` that babashka tests currently rely on. + ## Build See [build.md](build.md).