Skip to content

Commit

Permalink
flatpak: remove tests from the flatpak build
Browse files Browse the repository at this point in the history
Only the build should happen during the build phase.

Signed-off-by: Claudio André <[email protected]>
  • Loading branch information
claudioandre-br committed Apr 19, 2024
1 parent a00fb98 commit 8867dbe
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 37 deletions.
2 changes: 1 addition & 1 deletion deploy/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ FROM nvidia/cuda:12.4.1-base-ubuntu22.04@sha256:ee758c4b748a2f121a80dab16f394c60
COPY --from=build /build /john
RUN mkdir -p /usr/share/ && ln -s /john/run /usr/share/john
COPY docker-entrypoint.sh /usr/local/bin/

RUN ls -lR /john
RUN ln -s /usr/local/bin/docker-entrypoint.sh . && \
useradd -U -m JtR && \
apt-get update -qq && \
Expand Down
58 changes: 22 additions & 36 deletions deploy/flatpak/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@
arch=$(uname -m)
DEPLOY_PAK="Yes"
FLATPAK_BUILD=1
JTR_BIN='/app/bin/john'
TEST=';full;extra;' # Controls how the test will happen
BASE="Flatpak SDK"
TASK_RUNNING="Flatpak build"
export -p DEPLOY_PAK FLATPAK_BUILD JTR_BIN TEST BASE TASK_RUNNING
export -p DEPLOY_PAK FLATPAK_BUILD BASE TASK_RUNNING

# Build options (system wide, disable checks, etc.)
SYSTEM_WIDE='--with-systemwide --disable-opencl'
Expand All @@ -43,39 +41,27 @@ OTHER_NO_OPENMP="$SYSTEM_WIDE --disable-openmp"
# shellcheck source=/dev/null
source ../helper.sh

if [[ -z "$TASK" ]]; then
do_get_version
do_get_version

echo ""
echo "---------------------------- BUILDING -----------------------------"
echo ""
echo "---------------------------- BUILDING -----------------------------"

if [[ "$arch" == "x86_64" ]]; then
# x86_64 CPU (OMP and SIMD fallback)
do_configure "$X86_NO_OPENMP" --enable-simd=avx CPPFLAGS="-D_BOXED" && do_build ../run/john-avx
do_configure "$X86_REGULAR" --enable-simd=avx CPPFLAGS="-D_BOXED -DOMP_FALLBACK_BINARY=\"\\\"john-avx\\\"\" " && do_build ../run/john-avx-omp
do_configure "$X86_NO_OPENMP" --enable-simd=avx2 CPPFLAGS="-D_BOXED" && do_build ../run/john-avx2
do_configure "$X86_REGULAR" --enable-simd=avx2 CPPFLAGS="-D_BOXED -DOMP_FALLBACK_BINARY=\"\\\"john-avx2\\\"\" -DCPU_FALLBACK_BINARY=\"\\\"john-avx-omp\\\"\"" && do_build ../run/john-avx2-omp
do_configure "$X86_NO_OPENMP" --enable-simd=avx512f CPPFLAGS="-D_BOXED" && do_build ../run/john-avx512f
do_configure "$X86_REGULAR" --enable-simd=avx512f CPPFLAGS="-D_BOXED -DOMP_FALLBACK_BINARY=\"\\\"john-avx512f\\\"\" -DCPU_FALLBACK_BINARY=\"\\\"john-avx2-omp\\\"\"" && do_build ../run/john-avx512f-omp
do_configure "$X86_NO_OPENMP" --enable-simd=avx512bw CPPFLAGS="-D_BOXED" && do_build ../run/john-avx512bw
do_configure "$X86_REGULAR" --enable-simd=avx512bw CPPFLAGS="-D_BOXED -DOMP_FALLBACK_BINARY=\"\\\"john-avx512bw\\\"\" -DCPU_FALLBACK_BINARY=\"\\\"john-avx512f-omp\\\"\"" && do_build ../run/john-avx512bw-omp
BINARY="john-avx512bw-omp"
else
# Non X86 CPU (OMP fallback)
do_configure "$OTHER_NO_OPENMP" CPPFLAGS="-D_BOXED" && do_build "../run/john-$arch"
do_configure "$OTHER_REGULAR" CPPFLAGS="-D_BOXED -DOMP_FALLBACK_BINARY=\"\\\"john-$arch\\\"\"" && do_build ../run/john-omp
BINARY="john-omp"
fi
do_release "Yes" "No" "$BINARY" # --system-wide, --support-opencl, --binary-name
do_clean_package

elif [[ "$TASK" == "test" ]]; then
# "---------------------------- TESTING -----------------------------"

# Adjust the testing environment, import and run some testing
# shellcheck source=/dev/null
source ../disable_formats.sh

# shellcheck source=/dev/null
source ../run_tests.sh
if [[ "$arch" == "x86_64" ]]; then
# x86_64 CPU (OMP and SIMD fallback)
do_configure "$X86_NO_OPENMP" --enable-simd=avx CPPFLAGS="-D_BOXED" && do_build ../run/john-avx
do_configure "$X86_REGULAR" --enable-simd=avx CPPFLAGS="-D_BOXED -DOMP_FALLBACK_BINARY=\"\\\"john-avx\\\"\" " && do_build ../run/john-avx-omp
do_configure "$X86_NO_OPENMP" --enable-simd=avx2 CPPFLAGS="-D_BOXED" && do_build ../run/john-avx2
do_configure "$X86_REGULAR" --enable-simd=avx2 CPPFLAGS="-D_BOXED -DOMP_FALLBACK_BINARY=\"\\\"john-avx2\\\"\" -DCPU_FALLBACK_BINARY=\"\\\"john-avx-omp\\\"\"" && do_build ../run/john-avx2-omp
do_configure "$X86_NO_OPENMP" --enable-simd=avx512f CPPFLAGS="-D_BOXED" && do_build ../run/john-avx512f
do_configure "$X86_REGULAR" --enable-simd=avx512f CPPFLAGS="-D_BOXED -DOMP_FALLBACK_BINARY=\"\\\"john-avx512f\\\"\" -DCPU_FALLBACK_BINARY=\"\\\"john-avx2-omp\\\"\"" && do_build ../run/john-avx512f-omp
do_configure "$X86_NO_OPENMP" --enable-simd=avx512bw CPPFLAGS="-D_BOXED" && do_build ../run/john-avx512bw
do_configure "$X86_REGULAR" --enable-simd=avx512bw CPPFLAGS="-D_BOXED -DOMP_FALLBACK_BINARY=\"\\\"john-avx512bw\\\"\" -DCPU_FALLBACK_BINARY=\"\\\"john-avx512f-omp\\\"\"" && do_build ../run/john-avx512bw-omp
BINARY="john-avx512bw-omp"
else
# Non X86 CPU (OMP fallback)
do_configure "$OTHER_NO_OPENMP" CPPFLAGS="-D_BOXED" && do_build "../run/john-$arch"
do_configure "$OTHER_REGULAR" CPPFLAGS="-D_BOXED -DOMP_FALLBACK_BINARY=\"\\\"john-$arch\\\"\"" && do_build ../run/john-omp
BINARY="john-omp"
fi
do_release "Yes" "No" "$BINARY" # --system-wide, --support-opencl, --binary-name
do_clean_package

0 comments on commit 8867dbe

Please sign in to comment.