C plug-in fail with latest source
Environment/Versions
- GIMP version: 2.99.17, built from source
- Operating System: Linux
Description of the bug
A self compiled plug-in failed in the latest source build.
(set-items-visibility:127497): LibGimpBase-CRITICAL **: 18:21:43.469: gimp_value_array_index: assertion 'index < value_array->n_values' failed
(set-items-visibility:127497): GLib-GObject-CRITICAL **: 18:21:43.469: g_value_get_int: assertion 'G_VALUE_HOLDS_INT (value)' failed
/home/mark/.config/GIMP/2.99/plug-ins/set-items-visibility/set-items-visibility: fatal error: Segmentation fault
/home/mark/.config/GIMP/2.99/plug-ins/set-items-visibility/set-items-visibility (pid:127522): [E]xit, show [S]tack trace or [P]roceed:
(set-items-visibility:127549): LibGimpBase-CRITICAL **: 18:21:44.754: gimp_value_array_index: assertion 'index < value_array->n_values' failed
when I tried to compile it again, all plug-ins fail with the message:
/home/mark/Code/gimp-source/include/gimp-3.0/libgimpbase/gimpbase.h:27:10: fatal error: libgimpbase/gimpchoice.h: No such file or directory
27 | #include <libgimpbase/gimpchoice.h>
gimpchoice.h does exist at the location.
I use gimptool to provide compiling links;
#!/usr/bin/env bash
# Set target directory to search for C plug-ins to compile
target_dir="$HOME/Code/plug-ins-C/plug-ins"
# GIMP build environment from another shell script
source "$HOME/Artwork/Misc/linux-scripts/gimp_definitions.sh"
# Define paths and plug-in name
gimp_source_dir="$HOME/Code/gimp-source"
source_dir="$HOME/Code/plug-ins-C/${plugin_name}"
output_dir_base="${gimp_source_dir}/lib/x86_64-linux-gnu/gimp/2.99/plug-ins"
flatpak_dir_base="$HOME/.config/GIMP/2.99/plug-ins"
meson_config="/build/gimp/_build"
meson_intl="/build/gimp/libgimp"
pixelmixer="$HOME/Code/plug-ins-C/include"
pixelmixer_source="$HOME/Code/plug-ins-C/include/pixelmixer.c"
# Store gimptool output in a variable
gimptool_libs=$("${gimp_source_dir}/bin/gimptool-2.99" --libs)
gimptool_flags=$("${gimp_source_dir}/bin/gimptool-2.99" --cflags)
# Find source files and compile
find "$target_dir" -name "*.c" | while IFS= read -r source_file; do
plugin_name=$(basename "$(dirname "$source_file")")
output_dir="${gimp_source_dir}/lib/x86_64-linux-gnu/gimp/2.99/plug-ins/${plugin_name}"
flatpak_dir="$HOME/.config/GIMP/2.99/plug-ins/${plugin_name}"
# Create output and flatpak directories for the current plugin
mkdir -p "$output_dir"
mkdir -p "$flatpak_dir"
# Compile only if the source file or dependencies have changed
if [ "$source_file" -nt "$output_dir/$plugin_name" ] || [ "$pixelmixer_source" -nt "$output_dir/$plugin_name" ]; then
# Compile
gcc "$source_file" "$pixelmixer_source" \
$gimptool_libs \
$gimptool_flags \
-I"${gimp_source_dir}${meson_config}" \
-I"${gimp_source_dir}${meson_intl}" \
-I"${pixelmixer}" \
-o "$output_dir/$plugin_name"
# Check compilation status
if [ $? -eq 0 ]; then
echo "Compilation successful for $plugin_name. Copying plugin to $flatpak_dir."
cp "$output_dir/$plugin_name" "$flatpak_dir"
else
echo "Compilation failed for $plugin_name. Plugin not copied."
fi
else
echo "No changes detected for $plugin_name. Skipping compilation."
fi
done
read -rp "Press Enter to exit..."
Additional information
Plug in code:
set-items-visibility.c