pg_config_valid?

in lib/gdk/diagnostic/postgresql.rb [126:147]


      def pg_config_valid?
        return true unless pgvector_enabled?

        unless pg_config_ldflags.include?('-isysroot')
          @pgconfig_error = 'The `-isysroot` value not present in `pg_config --ldflags`.'
          return false
        end

        isysroot_path = pg_config_ldflags[/-isysroot\s(\S+)/, 1]
        unless Dir.exist?(isysroot_path)
          @pgconfig_error = "The `-isysroot` path #{isysroot_path} does not exist."
          return false
        end

        if macos? && !isysroot_path_matches_sdk?(isysroot_path, xcrun_sdk_path)
          @pgconfig_error = "The `pg_config --ldflags` shows #{isysroot_path}, but `xcrun --show-sdk-path` shows #{xcrun_sdk_path}."
          return false
        end

        true
      end