if ($using_osx)
          {
                  # On OS X, we need to examine the .o files
                  # exclude ecpg/test, which pgindent does too
                  my $obj_wanted = sub {
                          /^.*\.o\z/s
                            && !($File::Find::name =~ m!/ecpg/test/!s)
                            && push(@testfiles, $File::Find::name);
                  };

                  File::Find::find($obj_wanted, $bindir);
          }

I think we should use dsymutil --flat to assemble .dwarf files on Mac instead of inspecting the plain object files. This would allow you to use the script in the same way on presumably any system that Postgres supports, meaning we can drop this distinction:

 # The second argument is a directory. For everything except OSX it should be
 # a directory where postgres is installed (e.g. $installdir for the buildfarm).
 # It should have bin and lib subdirectories. On OSX it should instead be the
 # top of the build tree, as we need to examine the individual object files.

          my @err = `$objdump -W 2>&1`;
          my @readelferr = `readelf -w 2>&1`;
          my $using_osx = (`uname` eq "Darwin\n");

Is there any reason we can't use uname -s to detect the system instead of relying on error condition heuristics of readelf and objdump?

 # Note that this assumes there is not a platform-specific subdirectory of
 # lib like meson likes to use. (The buildfarm avoids this by specifying
 # --libdir=lib to meson setup.)

Should we just default the Meson build to libdir=lib in project(default_options:)? This assumes that you don't think what Tom said about running it on the build tree is better.

--
Tristan Partin
Neon (https://neon.tech)


Reply via email to