Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dockerfile: packaging: Fix build check for centos-7 and failures of package creations #9043

Merged
merged 4 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmake/luajit.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# luajit cmake
option(LUAJIT_DIR "Path of LuaJIT 2.1 source dir" ON)
option(LUAJIT_SETUP_INCLUDE_DIR "Setup include dir if parent is present" OFF)
set(LUAJIT_DIR ${FLB_PATH_ROOT_SOURCE}/${FLB_PATH_LIB_LUAJIT})
add_subdirectory("lib/luajit-cmake")
4 changes: 3 additions & 1 deletion dockerfiles/Dockerfile.centos7
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
FROM centos:7

# hadolint ignore=DL3032, DL3033
RUN yum -y update && \
RUN sed -i -e "s/^mirrorlist=http:\/\/mirrorlist.centos.org/#mirrorlist=http:\/\/mirrorlist.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo && \
sed -i -e "s/^#baseurl=http:\/\/mirror.centos.org/baseurl=http:\/\/vault.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo && \
yum -y update && \
yum install -y rpm-build curl ca-certificates gcc gcc-c++ cmake make bash \
wget unzip systemd-devel wget flex bison \
cyrus-sasl-lib cyrus-sasl-devel openssl openss-libs openssl-devel \
Expand Down
13 changes: 9 additions & 4 deletions lib/luajit-cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.5)

option(LUA_DIR "Path of Lua 5.4 source dir" OFF)
option(LUAJIT_DIR "Path of LuaJIT 2.1 source dir" OFF)
option(LUAJIT_SETUP_INCLUDE_DIR "Setup include dir if parent is present" ON)

if(CMAKE_COMPILER_IS_GNUCC)
set(LUA_TARGET_SHARED ON)
Expand All @@ -17,17 +18,21 @@ if(LUAJIT_DIR)
if (hasParent)
set(LUA_TARGET $<TARGET_FILE:luajit> PARENT_SCOPE)
set(LUA_LIBRARIES luajit::lib PARENT_SCOPE)
get_target_property(LUA_INCLUDE_DIR luajit::header INCLUDE_DIRECTORIES)
set(LUA_INCLUDE_DIR ${LUA_INCLUDE_DIR} PARENT_SCOPE)
if (LUAJIT_SETUP_INCLUDE_DIR)
get_target_property(LUA_INCLUDE_DIR luajit::header INCLUDE_DIRECTORIES)
set(LUA_INCLUDE_DIR ${LUA_INCLUDE_DIR} PARENT_SCOPE)
endif()
endif()
elseif(LUA_DIR)
project(lua)
include(lua.cmake)
if (hasParent)
set(LUA_TARGET $<TARGET_FILE:lua> PARENT_SCOPE)
set(LUA_LIBRARIES lua::lib PARENT_SCOPE)
get_target_property(LUA_INCLUDE_DIR lua::header INCLUDE_DIRECTORIES)
set(LUA_INCLUDE_DIR ${LUA_INCLUDE_DIR} PARENT_SCOPE)
if (LUAJIT_SETUP_INCLUDE_DIR)
get_target_property(LUA_INCLUDE_DIR lua::header INCLUDE_DIRECTORIES)
set(LUA_INCLUDE_DIR ${LUA_INCLUDE_DIR} PARENT_SCOPE)
endif()
endif()
if (WITH_LIBFFI)
include(ffi.cmake)
Expand Down
23 changes: 20 additions & 3 deletions lib/luajit-cmake/LuaJIT.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -408,11 +408,28 @@ if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
set(GIT_FORMAT %%ct)
endif()

add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/luajit_relver.txt
COMMAND git show -s --format=${GIT_FORMAT} > ${CMAKE_CURRENT_BINARY_DIR}/luajit_relver.txt
WORKING_DIRECTORY ${LUAJIT_DIR}
execute_process(
COMMAND git --version
RESULT_VARIABLE GIT_EXISTENCE
OUTPUT_VARIABLE GIT_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)

if (GIT_EXISTENCE EQUAL 0)
message(STATUS "Using Git: ${GIT_VERSION}")
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/luajit_relver.txt
COMMAND git show -s --format=${GIT_FORMAT} > ${CMAKE_CURRENT_BINARY_DIR}/luajit_relver.txt
WORKING_DIRECTORY ${LUAJIT_DIR}
)
else()
string(TIMESTAMP current_epoch "%s")
message(STATUS "Using current epoch: ${current_epoch}")
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/luajit_relver.txt
COMMAND echo "${current_epoch}" > ${CMAKE_CURRENT_BINARY_DIR}/luajit_relver.txt
WORKING_DIRECTORY ${LUAJIT_DIR}
)
endif()

add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/luajit.h
COMMAND ${HOST_WINE} ${MINILUA_PATH} ${LUAJIT_DIR}/src/host/genversion.lua
ARGS ${LUAJIT_DIR}/src/luajit_rolling.h
Expand Down
8 changes: 6 additions & 2 deletions packaging/distros/centos/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ FROM multiarch/qemu-user-static:x86_64-aarch64 as multiarch-aarch64
FROM centos:7 as centos-7-base

# hadolint ignore=DL3033
RUN yum -y update && \
RUN sed -i -e "s/^mirrorlist=http:\/\/mirrorlist.centos.org/#mirrorlist=http:\/\/mirrorlist.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo && \
sed -i -e "s/^#baseurl=http:\/\/mirror.centos.org/baseurl=http:\/\/vault.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo && \
yum -y update && \
yum install -y rpm-build curl ca-certificates gcc gcc-c++ cmake make bash \
wget unzip systemd-devel wget flex bison \
cyrus-sasl-lib cyrus-sasl-devel openssl openss-libs openssl-devel \
Expand All @@ -32,7 +34,9 @@ FROM arm64v8/centos:7 as centos-7.arm64v8-base
COPY --from=multiarch-aarch64 /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static

# hadolint ignore=DL3033
RUN yum -y update && \
RUN sed -i -e "s/^mirrorlist=http:\/\/mirrorlist.centos.org/#mirrorlist=http:\/\/mirrorlist.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo && \
sed -i -e "s/^#baseurl=http:\/\/mirror.centos.org/baseurl=http:\/\/vault.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo && \
yum -y update && \
yum install -y rpm-build curl ca-certificates gcc gcc-c++ cmake make bash \
wget unzip systemd-devel wget flex bison \
cyrus-sasl-lib cyrus-sasl-devel openssl openss-libs openssl-devel \
Expand Down
Loading