Skip to content

Commit a6080cf

Browse files
committed
Moving to go1.21 with newer dependencies, updating build container
Making sure libget2 is properly using new stdlib (http client) Cleaning CMakeLists, old SQL library is not compatible with newer GLIBC
1 parent f1c6797 commit a6080cf

File tree

9 files changed

+36
-29
lines changed

9 files changed

+36
-29
lines changed

.gitignore

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,16 @@ build/
2525
[Dd]ebug*/
2626
[Rr]elease*/
2727

28-
mariadb-??.?.*-linux-glibc_*-x86_64.tar.gz
2928
lib2inpx-*.tar.xz
3029

30+
mariadb-??.?.*-linux-systemd-x86_64.tar.gz
31+
mariadb-??.?.*-linux-systemd-x86_64/**
32+
mariadb-??.?.*-linux-systemd-x86.tar.gz
33+
mariadb-??.?.*-linux-systemd-x86/**
3134
mariadb-??.?.*-linux-glibc_*-x86_64.tar.gz
3235
mariadb-??.?.*-linux-glibc_*-x86_64/**
33-
mariadb-??.?.*-linux-glibc_*-i686.tar.gz
34-
mariadb-??.?.*-linux-glibc_*-i686i/**
36+
mariadb-??.?.*-linux-glibc_*-x86.tar.gz
37+
mariadb-??.?.*-linux-glibc_*-x86/**
3538
mariadb-??.?.*-win32.zip
3639
mariadb-??.?.*-win32/**
3740
mariadb-??.?.*-winx64.zip

CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
1313

1414
# Project version number
1515
set(PRJ_VERSION_MAJOR 9)
16-
set(PRJ_VERSION_MINOR 47)
16+
set(PRJ_VERSION_MINOR 48)
1717

1818
if(WIN32 AND NOT DEFINED ENV{MSYSTEM})
1919
message(FATAL_ERROR "Currently unsuppored environment. Use MINGW for Windows builds. CMake willl exit now.")
@@ -100,6 +100,10 @@ find_package(Iconv REQUIRED)
100100

101101
get_filename_component(MYSQL_NAME ${MYSQL_LIBRARIES} NAME_WE)
102102

103+
if(Threads_FOUND AND "${CMAKE_THREAD_LIBS_INIT}" STREQUAL "")
104+
message(FATAL_ERROR "We are using old version of database library which requires libpthread - not compatible with newer GLIBC")
105+
endif()
106+
103107
# Prepare history file
104108
execute_process(COMMAND ${CMAKE_COMMAND} -E env ${GIT_EXECUTABLE} changelog --final-tag ${PRJ_VERSION_MAJOR}.${PRJ_VERSION_MINOR} --stdout OUTPUT_FILE ${PROJECT_BINARY_DIR}/history.txt ERROR_QUIET)
105109

@@ -119,6 +123,7 @@ add_executable(lib2inpx ${SRCS_LIB2INPX})
119123
add_dependencies(lib2inpx gen_git_ver)
120124
if(UNIX)
121125
set(ADD_LIBS "${CMAKE_THREAD_LIBS_INIT} -lm -lrt -ldl -lcrypt -laio")
126+
string(STRIP ${ADD_LIBS} ADD_LIBS)
122127
if(ICONV_LIBRARIES MATCHES "libc")
123128
target_link_libraries(lib2inpx minizip ${Boost_LIBRARIES} ${MYSQL_LIBRARIES} ${ZLIB_LIBRARIES} ${EXPAT_LIBRARIES} ${ADD_LIBS})
124129
else()

cmake/FindMariaDB.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ if(CMAKE_CROSSCOMPILING OR WIN32)
1010
file(GLOB SEARCH_LIBS LIST_DIRECTORIES true "$ENV{MYSQL_DIR}/lib")
1111
endif()
1212
else()
13-
file(GLOB SEARCH_INCLUDES LIST_DIRECTORIES true "$ENV{HOME}/mariadb-*-linux-glibc*/include/mysql" "${CMAKE_SOURCE_DIR}/mariadb-*-linux-glibc*/include/mysql" "$ENV{MYSQL_DIR}/include")
14-
file(GLOB SEARCH_LIBS LIST_DIRECTORIES true "$ENV{HOME}/mariadb-*-linux-glibc*/lib" "${CMAKE_SOURCE_DIR}/mariadb-*-linux-glibc*/lib" "$ENV{MYSQL_DIR}/lib")
13+
file(GLOB SEARCH_INCLUDES LIST_DIRECTORIES true "$ENV{HOME}/mariadb-*-linux-*/include/mysql" "${CMAKE_SOURCE_DIR}/mariadb-*-linux-*/include/mysql" "$ENV{MYSQL_DIR}/include")
14+
file(GLOB SEARCH_LIBS LIST_DIRECTORIES true "$ENV{HOME}/mariadb-*-linux-*/lib" "${CMAKE_SOURCE_DIR}/mariadb-*-linux-*/lib" "$ENV{MYSQL_DIR}/lib")
1515
endif()
1616

1717
if(CMAKE_CROSSCOMPILING OR WIN32)

docker/Dockerfile.build

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ apt-get -qqy install tzdata wget curl build-essential git git-extras automake pk
88
WORKDIR /root/
99

1010
# ---------- We either patch cmake to support up to date boost (/usr/share/cmake-3.5/Modules/FindBoost.cmake) or build fresh one
11-
RUN curl -LO https://cmake.org/files/v3.25/cmake-3.25.3.tar.gz \
12-
&& tar -xvf cmake-3.25.3.tar.gz \
13-
&& cd cmake-3.25.3 \
11+
RUN curl -LO https://cmake.org/files/v3.27/cmake-3.27.8.tar.gz \
12+
&& tar -xvf cmake-3.27.8.tar.gz \
13+
&& cd cmake-3.27.8 \
1414
&& ./bootstrap --system-curl \
1515
&& make install \
1616
&& cd .. \
17-
&& rm -rf cmake-3.25.3.tar.gz cmake-3.25.3
17+
&& rm -rf cmake-3.27.8.tar.gz cmake-3.27.8
1818

1919
# ---------- mingw does not have expat
2020
RUN git clone https://github.com/libexpat/libexpat.git \
@@ -66,9 +66,9 @@ COPY get-maria.sh .
6666
RUN ./get-maria.sh
6767

6868
# ---------- download golang
69-
RUN curl -LO https://go.dev/dl/go1.20.4.linux-amd64.tar.gz \
70-
&& tar -xvf go1.20.4.linux-amd64.tar.gz \
71-
&& rm go1.20.4.linux-amd64.tar.gz \
69+
RUN curl -LO https://go.dev/dl/go1.21.4.linux-amd64.tar.gz \
70+
&& tar -xvf go1.21.4.linux-amd64.tar.gz \
71+
&& rm go1.21.4.linux-amd64.tar.gz \
7272
&& sed -i -e '$a export PATH=$PATH:/root/go/bin' .bashrc \
7373
&& sed -i -e '$a export GOROOT=/root/go' .bashrc
7474

src/inpxcreator/cmd/libget2/main.go

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -119,20 +119,17 @@ func httpReq(hostAddr, verb string, start int64) (*http.Response, *time.Timer, e
119119

120120
var redirect = func(req *http.Request, via []*http.Request) error {
121121

122-
if len(via) >= 10 {
123-
return errors.New("httpReq: stopped after 10 redirects")
122+
if len(via) >= 5 {
123+
return errors.New("httpReq: stopped after 5 redirects")
124124
}
125125
if verbose {
126-
fmt.Printf("Detected redirect from \"%s\" to \"%s\"", hostURL.Host, req.URL.Host)
126+
fmt.Printf("Detected redirect from \"%s\" to \"%s\" ", hostURL.String(), req.URL.String())
127127
}
128128
if noRedirect {
129129
if verbose {
130-
fmt.Printf("\t...Ignoring")
130+
fmt.Printf(" ..Ignoring ")
131131
}
132-
req.URL.Host = hostURL.Host
133-
}
134-
if verbose {
135-
fmt.Println()
132+
return http.ErrUseLastResponse
136133
}
137134
return nil
138135
}
@@ -313,7 +310,7 @@ func fetchFile(url, tmpIn string, start int64) (tmpOut string, size int64, err e
313310
err = fmt.Errorf("fetchFile: %w", err)
314311
return
315312
}
316-
_, err = out.Seek(start, os.SEEK_SET)
313+
_, err = out.Seek(start, io.SeekStart)
317314
if err != nil {
318315
err = fmt.Errorf("fetchFile: %w", err)
319316
return

src/inpxcreator/go.mod

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
module inpxcreator
22

3-
go 1.20
3+
go 1.21
44

5-
require golang.org/x/net v0.8.0
5+
toolchain go1.21.4
6+
7+
require golang.org/x/net v0.18.0

src/inpxcreator/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ=
2-
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
1+
golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg=
2+
golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ=

src/inpxcreator/vendor/golang.org/x/net/internal/socks/socks.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/inpxcreator/vendor/modules.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# golang.org/x/net v0.8.0
2-
## explicit; go 1.17
1+
# golang.org/x/net v0.18.0
2+
## explicit; go 1.18
33
golang.org/x/net/internal/socks
44
golang.org/x/net/proxy

0 commit comments

Comments
 (0)