From 4d83ca55b50ce1aa3370d5cd90d53849abca3e0b Mon Sep 17 00:00:00 2001 From: mattx <10520670+mattx433@users.noreply.github.com> Date: Mon, 13 Nov 2023 13:35:27 +0100 Subject: [PATCH] inform user when wsl2 interop causes build issues --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile b/Makefile index be7ff06a3c3..35fb4b19fb7 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)