windows10 Linux子系统(Ubuntu 18.04)编译EOS报错如下

surou@DESKTOP-444S803:/mnt/c/github/eos$ ./scripts/eosio_build.sh
EOSIO Version: 1.8.6
Sat Jan  4 05:50:58 UTC 2020
User: surou
Current branch: develop
./scripts/eosio_build.sh: line 129: set: -i: invalid option
set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]

原因是子系统的系统名不是Ubuntu

( [[ ! $NAME == "Ubuntu" ]] && [[ ! $ARCH == "Darwin" ]] ) && set -i # Ubuntu doesn't support interactive mode since it uses dash + Some folks are having this issue on Darwin; colors aren't supported yet anyway

查看子系统的Name

surou@DESKTOP-444S803:/mnt/c/github/eos$ echo $NAME
DESKTOP-444S803

所以编译时设置下环境变量即可
编辑环境变量配置文件

vim ~/.bashrc

将下面参数添加到文件尾部

export NAME=Ubuntu
export VERSION_ID=18.04

备注:如果安装1.8.x的EOS,且没配置过环境变量的话,可以一起加上

export PATH=$PATH:/home/surou(当前用户名)/eosio/1.8/bin

然后刷新环境变量

source ~/.bashrc

然后再次执行

surou@DESKTOP-444S803:/mnt/c/github/eos$ ./scripts/eosio_build.sh