From 5d5b282d123ff49e6ab889cbd75ceca6e3d69ce2 Mon Sep 17 00:00:00 2001 From: mattx <10520670+mattx433@users.noreply.github.com> Date: Mon, 13 Nov 2023 14:29:25 +0100 Subject: [PATCH] Inform user when wsl2 interop causes build issues (#952) --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile b/Makefile index be7ff06a3..35fb4b19f 100644 --- a/Makefile +++ b/Makefile @@ -73,6 +73,14 @@ MODE := $(m) endif endif +# detect wsl2 running cosmopolitan binaries on the host by checking whether: +# - user ran build/bootstrap/make.com, in which case make's working directory is in wsl +# - user ran make, in which case cocmd.com's working directory is in wsl +ifneq ($(findstring //wsl.localhost/,$(CURDIR) $(shell pwd)),) +$(warning wsl2 interop is enabled) +$(error you need to run sudo sh -c 'echo -1 > /proc/sys/fs/binfmt_misc/WSLInterop') +endif + UNAME_M = $(shell uname -m) UNAME_S = $(shell uname -s)