Skip to content

Commit

Permalink
Packaging optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
maxirmx committed Feb 11, 2023
1 parent 7d2db0f commit 4fda15b
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 50 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/alpine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ concurrency:

env:
# Cache version
CACHE_VER: 14
CACHE_VER: 15
DEBIAN_FRONTEND: "noninteractive"
TZ: "Etc/UTC"
VERBOSE: no
VERBOSE: yes

jobs:
setup:
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ env:
CC: clang
CXX: clang++
# Cache version
CACHE_VER: 15
VERBOSE: no
CACHE_VER: 16
VERBOSE: yes

jobs:
setup:
Expand All @@ -80,11 +80,11 @@ jobs:
xcode-version: '12.4'

- name: Install packages
# Already installed: pkg-config, openssl@1.1, libevent, libsodium, lz4, xz, zlib, gdbm
# Already installed: pkg-config, openssl@1.1, libevent, libsodium, lz4, xz, zlib, gdbm, ncurses
run: |
brew install \
bison flex binutils libarchive double-conversion boost jemalloc fmt glog gflags \
gnu-getopt gnu-sed bash ncurses libffi
bison flex binutils libffi double-conversion boost jemalloc fmt glog \
gnu-getopt gnu-sed bash
- name: Create deps folder
run: mkdir ${{ github.workspace }}/${{ env.DEPS }}
Expand Down Expand Up @@ -124,11 +124,11 @@ jobs:
xcode-version: '12.4'

- name: Install packages
# Already installed: pkg-config, openssl@1.1, libevent, libsodium, lz4, xz, zlib, gdbm
# Already installed: pkg-config, openssl@1.1, libevent, libsodium, lz4, xz, zlib, gdbm, ncurses
run: |
brew install \
bison flex binutils libarchive double-conversion boost jemalloc fmt glog \
gnu-getopt gnu-sed bash ncurses libffi
bison flex binutils libffi double-conversion boost jemalloc fmt glog \
gnu-getopt gnu-sed bash
- name: Create deps folder
run: mkdir ${{ github.workspace }}/${{ env.DEPS }}
Expand Down Expand Up @@ -194,11 +194,11 @@ jobs:
xcode-version: '12.4'

- name: Install packages
# Already installed: pkg-config, openssl@1.1, libevent, libsodium, lz4, xz, zlib, gdbm
# Already installed: pkg-config, openssl@1.1, libevent, libsodium, lz4, xz, zlib, gdbm, ncurses
run: |
brew install \
bison flex binutils libarchive double-conversion boost jemalloc fmt glog gflags \
gnu-getopt gnu-sed bash ncurses libffi
bison flex binutils libffi double-conversion boost jemalloc fmt glog \
gnu-getopt gnu-sed bash
- name: Install Ruby
uses: ruby/setup-ruby@v1
Expand Down Expand Up @@ -273,11 +273,11 @@ jobs:
xcode-version: '12.4'

- name: Install packages
# Already installed: pkg-config, openssl@1.1, libevent, libsodium, lz4, xz, zlib, gdbm
# Already installed: pkg-config, openssl@1.1, libevent, libsodium, lz4, xz, zlib, gdbm, ncurses
run: |
brew install \
bison flex binutils libarchive double-conversion boost jemalloc fmt glog gflags \
gnu-getopt gnu-sed bash ncurses libffi
bison flex binutils libffi double-conversion boost jemalloc fmt glog \
gnu-getopt gnu-sed bash
- name: Create deps folder
run: mkdir ${{ github.workspace }}/${{ env.DEPS }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ concurrency:
cancel-in-progress: true

env:
CACHE_VER: 13
CACHE_VER: 14
DEBIAN_FRONTEND: "noninteractive"
TZ: "Etc/UTC"
# show cmake output aka verbose (yes/no)
VERBOSE: no
VERBOSE: yes


jobs:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/windows-msys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ concurrency:
cancel-in-progress: true

env:
CACHE_VER: 8
CACHE_VER: 10
VERBOSE: yes

jobs:
setup:
Expand Down Expand Up @@ -207,6 +208,4 @@ jobs:
fetch-depth: 1

- name: Run tebako tests (set no. 1)
env:
VERBOSE: yes
run: tests/scripts/functional-tests.sh
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ ExternalProject_Add(${RUBY_PRJ}
DOWNLOAD_NO_PROGRESS true
SOURCE_DIR ${RUBY_SOURCE_DIR}
BUILD_IN_SOURCE true
PATCH_COMMAND ${GNU_BASH} ${PATCHES}/ruby/pass1.sh ${RUBY_SOURCE_DIR} ${DEPS}
PATCH_COMMAND ${GNU_BASH} ${PATCHES}/ruby/pass1.sh ${RUBY_SOURCE_DIR} full
CONFIGURE_COMMAND ${GNU_BASH} -c "${RUBY_SOURCE_DIR}/configure \
--enable-bundled-libyaml \
--without-gmp \
Expand Down Expand Up @@ -494,7 +494,7 @@ else (${SETUP_MODE})
COMMAND ${CMAKE_COMMAND} -E make_directory ${DATA_SRC_DIR}
COMMAND ${CMAKE_COMMAND} -E make_directory ${DATA_PRE_DIR}
COMMAND ${CMAKE_COMMAND} -E make_directory ${DATA_BIN_DIR}
COMMAND ${GNU_BASH} ${PATCHES}/ruby/pass1.sh ${RUBY_SOURCE_DIR} ${DEPS}
COMMAND ${GNU_BASH} ${PATCHES}/ruby/pass1.sh ${RUBY_SOURCE_DIR} fast
COMMAND ${CMAKE_COMMAND} -E chdir ${RUBY_SOURCE_DIR} make install
DEPENDS ${RUBY_PRJ}
)
Expand Down Expand Up @@ -648,7 +648,8 @@ else (${SETUP_MODE})
${DATA_SRC_DIR}/bin/ri${CMD_SUFFIX} ${DATA_SRC_DIR}/bin/y2racc${CMD_SUFFIX}
${DATA_SRC_DIR}/bin/ruby${EXE_SUFFIX} ${DATA_SRC_DIR}/bin/ruby${RUBY_SUFFIX}${EXE_SUFFIX}

COMMAND ${GNU_BASH} -c "rm ${DATA_SRC_DIR}/lib/*.a"
COMMAND ${GNU_BASH} -c "rm ${DATA_SRC_DIR}/**/*.a"
COMMAND ${GNU_BASH} -c "rm -f ${DATA_SRC_DIR}/**/*.o"
COMMAND chmod +x ${DEPS_BIN_DIR}/*
COMMAND ${DEPS_BIN_DIR}/mkdwarfs -o ${DATA_BIN_FILE} -i ${DATA_SRC_DIR}
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_SOURCE_DIR}/src/tebako-fs.cpp
Expand Down
22 changes: 13 additions & 9 deletions patches/ruby/pass1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,22 +145,26 @@ if [[ "$OSTYPE" == "msys"* ]]; then
sbst="# tebako patched $re"
"$gSed" -i "0,/$re/s//$sbst/g" "$1/cygwin/GNUmakefile.in"

if [[ "$2" == "full" ]]; then
# ....................................................
# ruby/configure
restore_and_save "$1/configure"
re=" LIBRUBY='lib\$(RUBY_SO_NAME).a'"
sbst=" LIBRUBY='lib\$(RUBY_SO_NAME)-static.a' #tebako patched"
"$gSed" -i "0,/$re/s//$sbst/g" "$1/configure"
# restore_and_save "$1/configure"
re=" LIBRUBY='lib\$(RUBY_SO_NAME).a'"
sbst=" LIBRUBY='lib\$(RUBY_SO_NAME)-static.a' #tebako patched"
"$gSed" -i "0,/$re/s//$sbst/g" "$1/configure"
fi
fi

if [[ "$2" == "full" ]]; then
# ....................................................
# ruby/template/configure-ext.mk.tmpl
# restore_and_save "$1/template/configure-ext.mk.tmpl"
# re="<%=d%>\/exts.mk: FORCE"
# sbst="<%=d%>\/exts.mk: #tebako patched"
# "$gSed" -i "0,/$re/s//$sbst/g" "$1/template/configure-ext.mk.tmpl"

restore_and_save "$1/template/configure-ext.mk.tmpl"
re="<%=d%>\/exts.mk: FORCE"
sbst="<%=d%>\/exts.mk: #tebako patched"
"$gSed" -i "0,/$re/s//$sbst/g" "$1/template/configure-ext.mk.tmpl"
fi


# ....................................................
# Roll-back pass2 patches from the previous run
restore_and_save "$1/main.c"
Expand Down
34 changes: 17 additions & 17 deletions tests/scripts/functional-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,16 @@ press_runner_with_error() {
# ......................................................................
# Tests
# 00. Basic tebako CLI tests (error handling)
# -- tebako setup
# -- tebako setup [commented out, redundant]
# AU. Check that it is possible to extract image content (--tebako-extract option)
# 01. Simple Ruby script, absolute path to root, relative path to entry point
# 02. Simple Ruby script, absolute path to root, relative path to entry point, entry point does not exist [Expected error at build step]
# 03. Simple Ruby script, absolute path to root, absolute path to entry point
# 04. Simple Ruby script, relative path to root, relative path to entry point
# 05. Simple Ruby script, absolute path to root absolute path to entry point, entry point not within root [Expected error at configure step]
# -06. Rails project [TODO: this test is failing]
# 07. Rails project, ruby and bundler version mismatch [Expected error at build step]
# 08. Rails project, entry point does not exists [Expected error at build step]
# -06. Rails project [commented out]
# -07. Rails project, ruby and bundler version mismatch [commented out]
# -08. Rails project, entry point does not exists [commented out]
# 09. Ruby gem (xxx.gem, no gemspec, no gemfile)
# 10. Ruby gem (xxx.gem, no gemspec, no gemfile), entry point does not exist [Expected error at build step]
# 11. Ruby gem (no gemfile, with gemspec)
Expand Down Expand Up @@ -153,21 +153,21 @@ test_CLI_no_entry_point() {

# ......................................................................
# -- tebako setup
test_tebako_setup() {
echo "tebako setup ... patience, please, it may take up to 1 hour."
if [ "${VERBOSE}" == "yes" ]; then
"$DIR_BIN"/tebako setup 2>&1 | tee tebako_test.log
assertEquals 0 "${PIPESTATUS[0]}"
result="$( cat tebako_test.log )"
else
result=$( "$DIR_BIN"/tebako setup 2>&1 )
assertEquals 0 "${PIPESTATUS[0]}"
fi
#test_tebako_setup() {
# echo "tebako setup ... patience, please, it may take up to 1 hour."
# if [ "${VERBOSE}" == "yes" ]; then
# "$DIR_BIN"/tebako setup 2>&1 | tee tebako_test.log
# assertEquals 0 "${PIPESTATUS[0]}"
# result="$( cat tebako_test.log )"
# else
# result=$( "$DIR_BIN"/tebako setup 2>&1 )
# assertEquals 0 "${PIPESTATUS[0]}"
# fi

# Check the first and the last messages expected from CMake script
assertContains "$result" "Running tebako setup script"
assertContains "$result" "Tebako setup has completed"
}
# assertContains "$result" "Running tebako setup script"
# assertContains "$result" "Tebako setup has completed"
#}

# ......................................................................
# AU. Check that it is possible to extract image content (--tebako-extract option)
Expand Down

0 comments on commit 4fda15b

Please sign in to comment.