mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-10-06 01:12:40 +02:00
Issue #11385: revert creating/deleting a config dir for every in-build GIMP calls.
While theoretically, commit 2f9881c03f
was better (perfectly fresh
config directory then cleanup at the end of each run of GIMP during the
build), it looks that in practice, it makes the build a lot slower, in
particular on Windows.
I think it might be related to slower file access on Windows (while
creating/deleting files is faster on Linux).
So I'm reverting to how it was before, except that I add a unique
cleanup step (at the start of the build only, just before creating a new
directory) and also, I get slightly better "depends" organization.
This commit is contained in:
19
meson.build
19
meson.build
@@ -1931,6 +1931,25 @@ endif
|
||||
|
||||
gimp_exe = find_program('tools'/'in-build-gimp.sh')
|
||||
|
||||
# Use a temporary config directory in the top build root for 2 reasons: first
|
||||
# because we don't want to pollute any existing user config folder; second
|
||||
# because the default directory may not be writable (we have the case in macOS
|
||||
# CI), but the build dir always is.
|
||||
# We start by deleting this directory before every use, ensuring we
|
||||
# always start from a fresh config.
|
||||
gimp_exe_cleanup_config_dir = custom_target('gimp_exe_rm_config_dir',
|
||||
output: [ '.bogus' ],
|
||||
command: [ 'rm', '-fr', '@OUTDIR@' + '/.tmp-config' ],
|
||||
build_by_default: true)
|
||||
gimp_exe_config_dir = custom_target('gimp_exe_config_dir',
|
||||
output: [ '.tmp-config' ],
|
||||
depends: [ gimp_exe_cleanup_config_dir ],
|
||||
command: [ 'mkdir', '-p', '@OUTDIR@' + '/.tmp-config' ],
|
||||
build_by_default: true)
|
||||
gimp_exe_depends += [ gimp_exe_config_dir ]
|
||||
gimp_run_env.set('GIMP3_DIRECTORY', gimp_exe_config_dir.full_path())
|
||||
|
||||
|
||||
################################################################################
|
||||
# Subdirs: part 2
|
||||
|
||||
|
@@ -2,9 +2,6 @@
|
||||
|
||||
set -e
|
||||
|
||||
export GIMP3_DIRECTORY=$(mktemp -d ${GIMP_GLOBAL_BUILD_ROOT}/.GIMP3-build-config-XXX)
|
||||
echo INFO: temporary GIMP configuration directory: $GIMP3_DIRECTORY
|
||||
|
||||
if [ -n "$GIMP_TEMP_UPDATE_RPATH" ]; then
|
||||
# Earlier code used to set DYLD_LIBRARY_PATH environment variable instead, but
|
||||
# it didn't work on contributor's builds because of System Integrity
|
||||
@@ -41,32 +38,3 @@ if [ -n "$GIMP_TEMP_UPDATE_RPATH" ]; then
|
||||
done;
|
||||
unset IFS
|
||||
fi
|
||||
|
||||
# Clean-up the temporary config directory after each usage, yet making sure we
|
||||
# don't get tricked by weird redirections or anything of the sort. In particular
|
||||
# we check that this is a directory with user permission, not a symlink, and
|
||||
# that it's inside inside the project build's root.
|
||||
if [ -n "$GIMP3_DIRECTORY" ] && [ -d "$GIMP3_DIRECTORY" ] && [ -O "$GIMP3_DIRECTORY" ]; then
|
||||
if [ -L "$GIMP3_DIRECTORY" ]; then
|
||||
echo "ERROR: \$GIMP3_DIRECTORY ($GIMP3_DIRECTORY) should not be a symlink."
|
||||
exit 1
|
||||
fi
|
||||
used_dir_prefix=$(realpath "$GIMP3_DIRECTORY")
|
||||
used_dir_prefix=${used_dir_prefix%???}
|
||||
tmpl_dir_prefix=$(realpath "$GIMP_GLOBAL_BUILD_ROOT")/.GIMP3-build-config-
|
||||
if [ "$used_dir_prefix" != "$tmpl_dir_prefix" ]; then
|
||||
echo "ERROR: \$GIMP3_DIRECTORY ($GIMP3_DIRECTORY) should be under the build directory with a specific prefix."
|
||||
echo " \"$used_dir_prefix\" != \"$tmpl_dir_prefix\""
|
||||
exit 1
|
||||
fi
|
||||
echo INFO: Running: rm -fr --preserve-root --one-file-system \"$GIMP3_DIRECTORY\"
|
||||
if [ -n "$GIMP_TEMP_UPDATE_RPATH" ]; then
|
||||
# macOS doesn't have the additional security options.
|
||||
rm -fr "$GIMP3_DIRECTORY"
|
||||
else
|
||||
rm -fr --preserve-root --one-file-system "$GIMP3_DIRECTORY"
|
||||
fi
|
||||
else
|
||||
echo "ERROR: \$GIMP3_DIRECTORY ($GIMP3_DIRECTORY) is not a directory or does not belong to the user"
|
||||
exit 1
|
||||
fi
|
||||
|
Reference in New Issue
Block a user