127 Star 0 Fork 18

src-openEuler/umoci

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
fix-bad-build-flags.patch 1.83 KB
一键复制 编辑 原始数据 按行查看 历史
caodongxia 提交于 2022-02-15 15:07 +08:00 . fix bad build flags
From a5d1ee156b76c4f823ae2554a0fd2e2ab9aaccaa Mon Sep 17 00:00:00 2001
From: Aleksa Sarai <cyphar@cyphar.com>
Date: Thu, 8 Apr 2021 18:55:40 +1000
Subject: [PATCH] makefile: fix bad build flags
Fix mistake in the Makefile which prevents the version field (as well as
some other build flags) from being passed to "go build". Update the
"runc --version" integration test to make sure that the contents of
VERSION are actually present.
Fixes: 6fbd32e48b66 ("Make Makefile more portable")
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
---
Makefile | 2 +-
test/help.bats | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index d760e928..1fdcf650 100644
--- a/Makefile
+++ b/Makefile
@@ -71,7 +71,7 @@ BASE_LDFLAGS := -s -w -X ${PROJECT}.gitCommit=${COMMIT} -X ${PROJECT}.version=${
# Specific build flags for build type.
ifeq ($(GOOS), linux)
- TEST_BUILD_FLAGS := ${BASE_FLAGS} -buildmode=pie -ldflags "${BASE_LDFLAGS} -X ${PROJECT}/pkg/testutils.binaryType=test" DYN_BUILD_FLAGS := ${BASE_FLAGS} -buildmode=pie -ldflags "${BASE_LDFLAGS}"
+ DYN_BUILD_FLAGS := ${BASE_FLAGS} -buildmode=pie -ldflags "${BASE_LDFLAGS}"
TEST_BUILD_FLAGS := ${BASE_FLAGS} -buildmode=pie -ldflags "${BASE_LDFLAGS} -X ${PROJECT}/pkg/testutils.binaryType=test"
else
DYN_BUILD_FLAGS := ${BASE_FLAGS} -ldflags "${BASE_LDFLAGS}"
diff --git a/test/help.bats b/test/help.bats
index 3d6dc975..a3826435 100644
--- a/test/help.bats
+++ b/test/help.bats
@@ -17,13 +17,15 @@
load helpers
@test "umoci --version" {
+ VERSION="$(cat "$INTEGRATION_ROOT/../VERSION")"
+
umoci --version
[ "$status" -eq 0 ]
- [[ "$output" =~ "umoci version "+ ]]
+ [[ "$output" =~ "umoci version $VERSION"+ ]]
umoci -v
[ "$status" -eq 0 ]
- [[ "$output" =~ "umoci version "+ ]]
+ [[ "$output" =~ "umoci version $VERSION"+ ]]
}
@test "umoci --help" {
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/umoci.git
git@gitee.com:src-openeuler/umoci.git
src-openeuler
umoci
umoci
master

搜索帮助