Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
246d463
Refactor how space is reclaimed for flatpak builds
Ocraftyone Aug 3, 2024
b8fb093
Only use compression on flatpak builds
Ocraftyone Aug 3, 2024
1309558
Merge remote-tracking branch 'upstream/main' into flatpak-updates
Ocraftyone Sep 9, 2024
c3e6a70
Revert "Disable flatpak for now."
Ocraftyone Sep 9, 2024
5740818
Move flatpak build of wxWidgets back to main CMake build
Ocraftyone Sep 9, 2024
2ba7e94
Add wxWidgets to sources
Ocraftyone Sep 9, 2024
19204e7
Disable wxWidgets submodules
Ocraftyone Sep 9, 2024
c089521
Merge branch 'main' into flatpak-updates
Ocraftyone Sep 9, 2024
85d17cc
Don't pre-download sources and give orca_deps access to the network d…
Ocraftyone Sep 9, 2024
53e087d
Remove .git folder to free some space
Ocraftyone Sep 9, 2024
ec89b3f
Update build command for main slicer build
Ocraftyone Sep 9, 2024
e26e089
Add free space statistics to CI
Ocraftyone Sep 9, 2024
bdca0ea
Update to previous commit
Ocraftyone Sep 9, 2024
8598760
Try removing more dirs
Ocraftyone Sep 9, 2024
aa0b99f
Remove /__t from removed dirs
Ocraftyone Sep 9, 2024
5a9e4de
Remove flatpak repo from removed dirs
Ocraftyone Sep 9, 2024
8af57e9
Update getting disk usage
Ocraftyone Sep 10, 2024
07d4742
Update getting disk usage
Ocraftyone Sep 10, 2024
159df9a
Update getting disk usage
Ocraftyone Sep 10, 2024
c9db212
Update getting disk usage
Ocraftyone Sep 10, 2024
eb147b5
Update getting disk usage
Ocraftyone Sep 10, 2024
142cd95
Update getting disk usage
Ocraftyone Sep 10, 2024
8d32565
Revert updates to removing extra stuff
Ocraftyone Sep 10, 2024
22ffa93
Disable submodules on wxWidgets
Ocraftyone Sep 10, 2024
e9cd227
Fix patching steps
Ocraftyone Sep 10, 2024
c032097
Fix patching steps cont
Ocraftyone Sep 10, 2024
ec592c7
Revert "Disable submodules on wxWidgets"
Ocraftyone Sep 10, 2024
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
61 changes: 43 additions & 18 deletions .github/workflows/build_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,46 @@ jobs:
arch: ${{ matrix.arch }}
build-deps-only: ${{ inputs.build-deps-only || false }}
secrets: inherit
# flatpak:
# name: "Flatpak"
# runs-on: ubuntu-latest
# container:
# image: bilelmoussaoui/flatpak-github-actions:gnome-45
# options: --privileged
# steps:
# # maybe i'm too dumb and fucked up to do CI. OH WELL :D -ppd
# - name: "Remove unneeded stuff to free disk space"
# run:
# sudo rm -rf /usr/share/dotnet /opt/ghc "/usr/local/share/boost" "$AGENT_TOOLSDIRECTORY"
# - uses: actions/checkout@v4
# - uses: flatpak/flatpak-github-actions/flatpak-builder@v6
# with:
# bundle: orcaslicer.flatpak
# manifest-path: flatpak/io.github.softfever.OrcaSlicer.yml
# cache-key: flatpak-builder-${{ github.sha }}
# cache: false
flatpak:
name: "Flatpak"
runs-on: ubuntu-latest
container:
image: bilelmoussaoui/flatpak-github-actions:gnome-45
options: --privileged
steps:
# maybe i'm too dumb and fucked up to do CI. OH WELL :D -ppd
- name: "Remove unneeded stuff to free disk space"
run:
sudo rm -rf /usr/share/dotnet /opt/ghc "/usr/local/share/boost" "$AGENT_TOOLSDIRECTORY"

- uses: actions/checkout@v4

- name: "Get current disk usage"
if: always()
run: |
echo Disk Usage for /usr
sudo du -hd 1 /usr
echo Disk Usage for /opt
sudo du -hd 1 /opt
echo Disk Usage for ~
sudo du -hd 1 ~


- uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
bundle: orcaslicer.flatpak
manifest-path: flatpak/io.github.softfever.OrcaSlicer.yml
cache-key: flatpak-builder-${{ github.sha }}
cache: false

- name: "Get current disk usage"
if: always()
run: |
echo Disk Usage for /usr
sudo du -hd 1 /usr
echo Disk Usage for /opt
sudo du -hd 1 /opt
echo Disk Usage for ~
sudo du -hd 1 ~
echo Disk Usage for /run
sudo du -hd 2 /run
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ enable_testing ()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Flatpak overwrites the CXX standard
if (FLATPAK)
set(CMAKE_CXX_STANDARD 20)
endif ()

if(NOT WIN32)
# Add DEBUG flags to debug builds.
add_compile_options("$<$<CONFIG:DEBUG>:-DDEBUG>")
Expand Down Expand Up @@ -298,7 +303,7 @@ if (NOT MSVC AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMP
endif()

# Bit of a hack for flatpak building: compress the debug info with zstd to save space in CI
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 13.0)
if(FLATPACK AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 13.0)
add_compile_options(-gz=zstd)
endif()

Expand Down
77 changes: 33 additions & 44 deletions deps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ if (NOT _is_multi AND NOT CMAKE_BUILD_TYPE)
endif ()

function(orcaslicer_add_cmake_project projectname)
cmake_parse_arguments(P_ARGS "" "INSTALL_DIR;BUILD_COMMAND;INSTALL_COMMAND" "CMAKE_ARGS" ${ARGN})
cmake_parse_arguments(P_ARGS "" "INSTALL_DIR" "CMAKE_ARGS;BUILD_COMMAND;INSTALL_COMMAND" ${ARGN})

set(_configs_line -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE})
if (_is_multi OR MSVC)
Expand All @@ -120,40 +120,18 @@ function(orcaslicer_add_cmake_project projectname)
set(_build_j "/m")
endif ()

if (NOT P_ARGS_BUILD_COMMAND)
set(P_ARGS_BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Release -- ${_build_j})
endif ()

if (NOT P_ARGS_INSTALL_COMMAND)
set(P_ARGS_INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config Release)
endif ()

if (NOT IS_CROSS_COMPILE OR NOT APPLE)
ExternalProject_Add(
dep_${projectname}
EXCLUDE_FROM_ALL ON
INSTALL_DIR ${DESTDIR}
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/${projectname}
${_gen}
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:STRING=${DESTDIR}
-DCMAKE_MODULE_PATH:STRING=${PROJECT_SOURCE_DIR}/../cmake/modules
-DCMAKE_PREFIX_PATH:STRING=${DESTDIR}
-DCMAKE_DEBUG_POSTFIX:STRING=d
-DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_COMPILER}
-DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
-DBUILD_SHARED_LIBS:BOOL=OFF
${_cmake_osx_arch}
"${_configs_line}"
${DEP_CMAKE_OPTS}
${P_ARGS_CMAKE_ARGS}
${P_ARGS_UNPARSED_ARGUMENTS}
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Release -- ${_build_j}
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config Release
)
elseif(FLATPAK)
# the only reason this is here is because of the HACK at the bottom for ci
#
# note for future devs: shared libs may actually create a size reduction
# but orcaslicer_deps tends to get really funny regarding linking after that (notably boost)
# so, as much as I would like to use that, it's not happening
ExternalProject_Add(
dep_${projectname}
EXCLUDE_FROM_ALL ON
INSTALL_DIR ${DESTDIR}
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/${projectname}
${_gen}
CMAKE_ARGS
Expand All @@ -169,14 +147,26 @@ elseif(FLATPAK)
"${_configs_line}"
${DEP_CMAKE_OPTS}
${P_ARGS_CMAKE_ARGS}
${P_ARGS_UNPARSED_ARGUMENTS}
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Release -- ${_build_j}
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config Release
# HACK: save space after each compile job, because CI
# reasoning: cmake changes directory after this command, so just keep only the folders
# so that it can navigate out
COMMAND find "${CMAKE_BINARY_DIR}/dep_${projectname}-prefix/" -type f -delete
${P_ARGS_UNPARSED_ARGUMENTS}
BUILD_COMMAND ${P_ARGS_BUILD_COMMAND}
INSTALL_COMMAND ${P_ARGS_INSTALL_COMMAND}
)

# Free up space during flatpak builds to prevent running out of space during CI/CD
if (FLATPAK)
ExternalProject_Add_Step(dep_${projectname} free_download_space
DEPENDEES download # do after download
COMMENT "Freeing Space: Removing source archive"
WORKING_DIRECTORY ${DEP_DOWNLOAD_DIR}
COMMAND ${CMAKE_COMMAND} -E rm -r ${projectname}
)
ExternalProject_Add_Step(dep_${projectname} free_build_space
DEPENDEES install # do after install
COMMENT "Freeing Space: Removing source and build files"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/dep_${projectname}-prefix/src
COMMAND ${CMAKE_COMMAND} -E rm -rf dep_${projectname} dep_${projectname}-build
)
endif ()
else()
ExternalProject_Add(
dep_${projectname}
Expand All @@ -192,11 +182,10 @@ else()
"${_configs_line}"
${DEP_CMAKE_OPTS}
${P_ARGS_CMAKE_ARGS}
${P_ARGS_UNPARSED_ARGUMENTS}
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Release -- ${_build_j}
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config Release
${P_ARGS_UNPARSED_ARGUMENTS}
BUILD_COMMAND ${P_ARGS_BUILD_COMMAND}
INSTALL_COMMAND ${P_ARGS_INSTALL_COMMAND}
)

endif()

endfunction(orcaslicer_add_cmake_project)
Expand Down Expand Up @@ -326,10 +315,10 @@ if (NOT TIFF_FOUND)
set(TIFF_PKG "dep_TIFF")
endif()

# flatpak builds wxwidgets separately
include(wxWidgets/wxWidgets.cmake)
# flatpak builds wxwidgets separatelyj
set(WXWIDGETS_PKG "")
if (NOT FLATPAK)
include(wxWidgets/wxWidgets.cmake)
set(WXWIDGETS_PKG "dep_wxWidgets")
endif()

Expand Down
5 changes: 2 additions & 3 deletions deps/GMP/GMP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,10 @@ else ()
set(_cross_compile_arg --host=${TOOLCHAIN_PREFIX})
endif ()

ExternalProject_Add(dep_GMP
orcaslicer_add_cmake_project(GMP
URL https://github.com/SoftFever/OrcaSlicer_deps/releases/download/gmp-6.2.1/gmp-6.2.1.tar.bz2
URL_HASH SHA256=eae9326beb4158c386e39a356818031bd28f3124cf915f8c5b1dc4c7a36b4d7c
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/GMP
BUILD_IN_SOURCE ON
BUILD_IN_SOURCE ON
CONFIGURE_COMMAND env "CFLAGS=${_gmp_ccflags}" "CXXFLAGS=${_gmp_ccflags}" ./configure ${_cross_compile_arg} --enable-shared=no --enable-cxx=yes --enable-static=yes "--prefix=${DESTDIR}" ${_gmp_build_tgt}
BUILD_COMMAND make -j
INSTALL_COMMAND make install
Expand Down
3 changes: 1 addition & 2 deletions deps/MPFR/MPFR.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@ else ()
set(_cross_compile_arg --host=${TOOLCHAIN_PREFIX})
endif ()

ExternalProject_Add(dep_MPFR
orcaslicer_add_cmake_project(MPFR
URL https://www.mpfr.org/mpfr-current/mpfr-4.2.1.tar.bz2
URL_HASH SHA256=b9df93635b20e4089c29623b19420c4ac848a1b29df1cfd59f26cab0d2666aa0
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/MPFR
BUILD_IN_SOURCE ON
CONFIGURE_COMMAND autoreconf -f -i &&
env "CFLAGS=${_gmp_ccflags}" "CXXFLAGS=${_gmp_ccflags}" ./configure ${_cross_compile_arg} --prefix=${DESTDIR} --enable-shared=no --enable-static=yes --with-gmp=${DESTDIR} ${_gmp_build_tgt}
Expand Down
4 changes: 1 addition & 3 deletions deps/OpenEXR/OpenEXR.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ if (APPLE AND IS_CROSS_COMPILE)
set(_openexr_arch ${CMAKE_OSX_ARCHITECTURES})
set(_cmake_openexr_arch -DCMAKE_OSX_ARCHITECTURES:STRING=${_openexr_arch})
endif()
ExternalProject_Add(dep_OpenEXR
orcaslicer_add_cmake_project(OpenEXR
EXCLUDE_FROM_ALL ON
URL https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v2.5.5.zip
URL_HASH SHA256=0307a3d7e1fa1e77e9d84d7e9a8694583fbbbfd50bdc6884e2c96b8ef6b902de
INSTALL_DIR ${DESTDIR}
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/OpenEXR
${_openxr_list_sep}
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:STRING=${DESTDIR}
Expand Down
4 changes: 1 addition & 3 deletions deps/OpenSSL/OpenSSL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,11 @@ else()
endif ()
endif()

ExternalProject_Add(dep_OpenSSL
#EXCLUDE_FROM_ALL ON
orcaslicer_add_cmake_project(OpenSSL
URL "https://github.com/openssl/openssl/archive/OpenSSL_1_1_1w.tar.gz"
URL_HASH SHA256=2130E8C2FB3B79D1086186F78E59E8BC8D1A6AEDF17AB3907F4CB9AE20918C41
# URL "https://github.com/openssl/openssl/archive/refs/tags/openssl-3.1.2.tar.gz"
# URL_HASH SHA256=8c776993154652d0bb393f506d850b811517c8bd8d24b1008aef57fbe55d3f31
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/OpenSSL
CONFIGURE_COMMAND ${_conf_cmd} ${_cross_arch}
"--openssldir=${DESTDIR}"
"--prefix=${DESTDIR}"
Expand Down
5 changes: 0 additions & 5 deletions deps/wxWidgets/wxWidgets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ else ()
set(_wx_edge "-DwxUSE_WEBVIEW_EDGE=OFF")
endif ()

# Note: The flatpak build builds wxwidgets separately due to CI size constraints.
# ANY CHANGES MADE IN HERE MUST ALSO BE REFLECTED IN `flatpak/io.github.SoftFever.OrcaSlicer.yml`.
# ** THIS INCLUDES BUILD ARGS. **
# ...if you can find a way around this size limitation, be my guest.

orcaslicer_add_cmake_project(
wxWidgets
GIT_REPOSITORY "https://github.com/SoftFever/Orca-deps-wxWidgets"
Expand Down
Loading