Hi!
Thank you for looking into this!
On Thu, 19 Mar 2026 at 01:23, Zsolt Parragi <zsolt.parragi@percona.com> wrote:
> + bitcode_targets += custom_target(
> + targetname,
> + depends: [bitcode_obj],
> + input: [srcfile],
> + output: targetname,
> + command: [llvm_irgen_command, bitcode_cflags_gen_local],
> + install: true,
> + install_dir: dir_bitcode,
> + )
>
> This seems overeager to rebuild to me. If I touch a single header
> file, it rebuilds all bc files because bitcode_obj (postgres_lib)
> changes.
bitcode_obj is equal to postgres_lib only for postgres.index.bc.
> Wouldn't something like the following work?
>
> bitcode_targets += custom_target(
> targetname,
> depends: [generated_backend_headers_stamp], # instead of [postgres_lib]
> input: [srcfile],
> output: targetname,
> command: [llvm_irgen_command, llvm_irgen_dep_args,
> bitcode_cflags_local], # added llvm_irgen_dep_args
Could you mean 'bitcode_cflags_gen_local' instead of
'bitcode_cflags_local' here? Otherwise code doesn't compile.
> depfile: targetname + '.d', # added
> install: true,
> install_dir: dir_bitcode,
> )
>
> It seems to work in my testing, and results in less rebuilds. But I
> also have a fairly recent meson version, there might be some
> issues/limitations with earlier versions?
I couldn't reproduce this. There are 43 .bc files and header change (I
changed simd.h) triggers a recompilation of only 'postgres.index.bc'
on my end. This behavior seems correct to me. Could you please share
steps to reproduce the behavior you saw?
> +bitcode_modules += {
> + 'target': hstore_plpython,
> + 'srcfiles': hstore_plpython_sources,
> + 'additional_flags': [
> + '-I@0@'.format(hstore_dir_up),
> + '-DPLPYTHON_LIBNAME="plpython3"',
> + '-I@0@'.format(python3_incdir),
> + '-I@0@'.format(plpython_dir),
> + perl_ccflags,
> + ]
> +}
>
> Do we need perl_ccflags for python?
No, it seems I mixed plpython and plperl. Fixed.
> +meson_args = ' '.join(args.meson_args)
> ...
> + if meson_args:
> + meson_setup_command = [meson_bin, meson_args, 'setup',
> test_args, test_out_dir]
> + else:
>
> Will this properly work with multiple args?
Updated. Previous version was merging all args into one string, now
each argument is one string.
> +
> +project('auth_delay', 'c')
> +
>
> Seems like a copy paste mistake, this is in postgres_fdw
Fixed.
> + if meson_args:
> + meson_setup_command = [meson_bin, meson_args, 'setup',
> test_args, test_out_dir]
> + else:
> + meson_setup_command = [meson_bin, 'setup', test_args, test_out_dir]
> +
> + meson_compile_command = ['meson', 'compile', '-C', test_out_dir, '-v']
>
> last one should also be meson_bin
Fixed.
> +
> +exit_code = 0
> +
>
> This is an unused variable
Removed.
> src/makefiles/meson.build contains the following, this should be
> updated with this patch?
>
> # TODO: requires bitcode generation to be implemented for meson
> 'BITCODE_CFLAGS': '',
> 'BITCODE_CXXFLAGS': '',
You are right, done.
--
Regards,
Nazir Bilal Yavuz
Microsoft