bash - /bin/sh: 无法执行二进制文件
问题描述
我将https://github.com/feast-dev/feast/blob/master/Makefile#L147修改为
install-dependencies-proto-docs:
cd ${ROOT_DIR}/protos;
rm -r $$HOME/bin
rm -r $$HOME/include
mkdir -p $$HOME/bin
mkdir -p $$HOME/include
go get github.com/golang/protobuf/proto && \
go get github.com/russross/blackfriday/v2 && \
cd $$(mktemp -d) && \
git clone https://github.com/istio/tools.git && \
cd tools/cmd/protoc-gen-docs && \
go build && \
cp protoc-gen-docs $$HOME/bin && \
cd $$HOME && curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.11.2/protoc-3.11.2-linux-x86_64.zip && \
unzip protoc-3.11.2-linux-x86_64.zip -d protoc3 && \
mv protoc3/bin/* $$HOME/bin/ && \
chmod +x $$HOME/bin/protoc && \
mv protoc3/include/* $$HOME/include
但是当我跑步时make compile-protos-docs
,我得到了
$ make compile-protos-docs
cd /Users/c/others/feast/protos; protoc --docs_out=../dist/grpc feast/*/*.proto || \
cd /Users/c/others/feast; /Library/Developer/CommandLineTools/usr/bin/make install-dependencies-proto-docs && cd /Users/c/others/feast/protos; PATH=$HOME/bin:$PATH protoc -I $HOME/include/ -I . --docs_out=../dist/grpc feast/*/*.proto
protoc-gen-docs: program not found or is not executable
Please specify a program using absolute path or make sure the program is available in your PATH system variable
--docs_out: protoc-gen-docs: Plugin failed with status code 1.
cd /Users/c/others/feast/protos;
rm -r $HOME/bin
rm -r $HOME/include
mkdir -p $HOME/bin
mkdir -p $HOME/include
go get github.com/golang/protobuf/proto && \
go get github.com/russross/blackfriday/v2 && \
cd $(mktemp -d) && \
git clone https://github.com/istio/tools.git && \
cd tools/cmd/protoc-gen-docs && \
go build && \
cp protoc-gen-docs $HOME/bin && \
cd $HOME && curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.11.2/protoc-3.11.2-linux-x86_64.zip && \
unzip protoc-3.11.2-linux-x86_64.zip -d protoc3 && \
mv protoc3/bin/* $HOME/bin/ && \
chmod +x $HOME/bin/protoc && \
mv protoc3/include/* $HOME/include
Cloning into 'tools'...
remote: Enumerating objects: 77, done.
remote: Counting objects: 100% (77/77), done.
remote: Compressing objects: 100% (55/55), done.
remote: Total 12090 (delta 34), reused 35 (delta 19), pack-reused 12013
Receiving objects: 100% (12090/12090), 18.55 MiB | 1.80 MiB/s, done.
Resolving deltas: 100% (5883/5883), done.
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 641 100 641 0 0 4092 0 --:--:-- --:--:-- --:--:-- 4108
100 1547k 100 1547k 0 0 998k 0 0:00:01 0:00:01 --:--:-- 1301k
Archive: protoc-3.11.2-linux-x86_64.zip
replace protoc3/include/google/protobuf/type.proto? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
inflating: protoc3/include/google/protobuf/type.proto
...
/bin/sh: /Users/c/bin/protoc: cannot execute binary file
make: *** [compile-protos-docs] Error 126
错误是:
protoc-gen-docs: program not found or is not executable
/bin/sh: /Users/c/bin/protoc: cannot execute binary file
但是,我也得到了
$ protoc
Usage: protoc [OPTION] PROTO_FILES
Parse PROTO_FILES and generate output based on the options given:
...
$ protoc-gen-docs
bash: protoc-gen-docs: command not found
看来我可以跑了protoc
,但不行protoc-gen-docs
。我也不能跑make compile-protos-docs
。
任何想法?谢谢
解决方案
推荐阅读
- java - 通过 FreeMarker 和 spring 控制器出现 403 错误
- javascript - 如何在最外面的矩形内移动最里面的矩形
- sql-server - 插入唯一值的每个组合而不循环
- python - 如何从随机列表中绘制数字以用作海龟图形的 Y 坐标
- c - for 循环的值意外下降
- r - 参数化全局环境中输出数据帧的名称,分配给函数
- google-cloud-platform - 谷歌云服务停止并且永远不会重新启动
- amazon-web-services - 在控制台中配置 CloudWatch 警报阈值和时间段
- react-native - 模态和平面列表
- javascript - 使用选项卡正确显示表格