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

Reduce disk space consumed after running fetchDependencies. #2047

Merged
merged 1 commit into from
Oct 25, 2023
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
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ on:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
# See the following, which includes links to supported macOS versions, including supported Xcode versions
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
jobs:
build:
strategy:
matrix:
xcode: [ "14.3.1" ]
xcode: [ "15.0" ]
platform: [ "all", "macos", "ios" ]
os: [ "macos-13" ]
upload_artifacts: [ true ]
Expand Down
9 changes: 9 additions & 0 deletions Docs/Whats_New.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ Copyright (c) 2015-2023 [The Brenwill Workshop Ltd.](http://www.brenwill.com)



MoltenVK 1.2.7
--------------

Released TBD

- Reduce disk space consumed after running `fetchDependencies` script by removing intermediate file caches.



MoltenVK 1.2.6
--------------

Expand Down
2 changes: 1 addition & 1 deletion MoltenVK/MoltenVK/API/mvk_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ extern "C" {
*/
#define MVK_VERSION_MAJOR 1
#define MVK_VERSION_MINOR 2
#define MVK_VERSION_PATCH 6
#define MVK_VERSION_PATCH 7

#define MVK_MAKE_VERSION(major, minor, patch) (((major) * 10000) + ((minor) * 100) + (patch))
#define MVK_VERSION MVK_MAKE_VERSION(MVK_VERSION_MAJOR, MVK_VERSION_MINOR, MVK_VERSION_PATCH)
Expand Down
3 changes: 2 additions & 1 deletion MoltenVK/MoltenVK/GPUObjects/MVKPipeline.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2506,7 +2506,8 @@ void serialize(Archive & archive, CompilerMSL::Options& opt) {
opt.force_sample_rate_shading,
opt.manual_helper_invocation_updates,
opt.check_discarded_frag_stores,
opt.sample_dref_lod_array_as_grad);
opt.sample_dref_lod_array_as_grad,
opt.replace_recursive_inputs);
}

template<class Archive>
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ platforms and simulators. The `--visionos` and `--visionossim` selections must b
with a separate invocation of `fetchDependencies`, because those selections require
Xcode 15+, and will cause a multi-platform build on older versions of Xcode to abort.

Running `fetchDependencies` repeatedly with different platforms will accumulate
targets in the `XCFramework`.
Running `fetchDependencies` repeatedly with different platforms will accumulate targets
in the `XCFramework`, if the `--keep-cache` option is used on each invocation.

For more information about the external open-source libraries used by **MoltenVK**,
see the [`ExternalRevisions/README.md`](ExternalRevisions/README.md) document.
Expand Down
2 changes: 2 additions & 0 deletions Scripts/create_ext_lib_xcframeworks.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

if [ "${SKIP_PACKAGING}" = "Y" ]; then exit 0; fi

. "${PROJECT_DIR}/Scripts/create_xcframework_func.sh"

export MVK_EXT_DIR="${PROJECT_DIR}/External"
Expand Down
8 changes: 8 additions & 0 deletions Scripts/package_ext_libs_finish.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
#!/bin/bash

if [ "${SKIP_PACKAGING}" = "Y" ]; then exit 0; fi

set -e

export MVK_EXT_LIB_DST_PATH="${PROJECT_DIR}/External/build/"

# Assign symlink to Latest
ln -sfn "${CONFIGURATION}" "${MVK_EXT_LIB_DST_PATH}/Latest"

# Remove the large Intermediates directory if no longer needed
if [ "${KEEP_CACHE}" != "Y" ]; then
echo Removing Intermediates library at "${MVK_EXT_LIB_DST_PATH}/Intermediates"
rm -rf "${MVK_EXT_LIB_DST_PATH}/Intermediates"
fi

# Clean MoltenVK to ensure the next MoltenVK build will use the latest external library versions.
make --quiet clean

18 changes: 16 additions & 2 deletions fetchDependencies
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@
# --no-parallel-build
# Build the external libraries serially instead of in parallel. This is the default.
#
# --keep-cache
# Do not remove the External/build/Intermediates cache directory after building.
# Removing the Intermediates directory returns significant disk space after the
# build, and is the default behaviour. Use this option if you intend to run this
# script repeatedly to incrementally build one platform at a time.
#
# --glslang-root path
# "path" specifies a directory path to a KhronosGroup/glslang repository.
# This repository does need to be built and the build directory must be in the
Expand Down Expand Up @@ -117,6 +123,7 @@ V_HEADERS_ROOT=""
SPIRV_CROSS_ROOT=""
GLSLANG_ROOT=""
BLD_SPV_TLS=""
export KEEP_CACHE=""

while (( "$#" )); do
case "$1" in
Expand Down Expand Up @@ -191,6 +198,10 @@ while (( "$#" )); do
XC_USE_BCKGND=""
shift 1
;;
--keep-cache)
KEEP_CACHE="Y"
shift 1
;;
-v)
XC_BUILD_VERBOSITY=""
shift 1
Expand Down Expand Up @@ -410,7 +421,6 @@ function execute_xcodebuild_command () {
# 2 - Platform
# 3 - Destination (Optional. Defaults to same as platform)
function build_impl() {
BLD_SPECIFIED="Y"
XC_OS=${1}
XC_PLTFM=${2}
if [ "${3}" != "" ]; then
Expand Down Expand Up @@ -442,7 +452,9 @@ function build_impl() {
# Select whether or not to run the build in parallel.
# 1 - OS
# 2 - platform
# 3 - Destination (Optional. Defaults to same as platform)
function build() {
BLD_SPECIFIED="Y"
if [ "$XC_USE_BCKGND" != "" ]; then
build_impl "${1}" "${2}" "${3}" &
else
Expand All @@ -453,6 +465,7 @@ function build() {
EXT_DEPS=ExternalDependencies
XC_PROJ="${EXT_DEPS}.xcodeproj"
XC_DD_PATH="${EXT_DIR}/build"
export SKIP_PACKAGING="Y"

# Determine if xcpretty is present
XCPRETTY_PATH=$(command -v xcpretty 2> /dev/null || true) # ignore failures
Expand Down Expand Up @@ -512,9 +525,10 @@ if [ "$XC_USE_BCKGND" != "" ]; then
fi

if [ "$BLD_SPECIFIED" != "" ]; then
# Build XCFrameworks, update latest symlink, and clean MoltenVK for rebuild
# Build XCFrameworks, update latest symlink, remove intermediates, and clean MoltenVK for rebuild
PROJECT_DIR="."
CONFIGURATION=${XC_CONFIG}
SKIP_PACKAGING=""
. "./Scripts/create_ext_lib_xcframeworks.sh"
. "./Scripts/package_ext_libs_finish.sh"
else
Expand Down