pull/2541/head
Onder Kalaci 2018-12-12 10:22:54 +03:00 committed by Jason Petersen
parent ca83c48097
commit 9fff7d28a7
No known key found for this signature in database
GPG Key ID: 9F1D3510D110ABA9
5 changed files with 17 additions and 134 deletions

View File

@ -1,6 +1,8 @@
# Citus toplevel Makefile # Citus toplevel Makefile
EXTENSION = citus EXTENSION = citus
DATA = citus--7.0-15.sql
MODULE_big = citus MODULE_big = citus
@ -100,7 +102,6 @@ OBJS = src/backend/distributed/shared_library_init.o \
src/backend/distributed/utils/citus_outfuncs.o \ src/backend/distributed/utils/citus_outfuncs.o \
src/backend/distributed/utils/citus_readfuncs.o \ src/backend/distributed/utils/citus_readfuncs.o \
src/backend/distributed/utils/citus_ruleutils.o \ src/backend/distributed/utils/citus_ruleutils.o \
src/backend/distributed/utils/citus_version.o \
src/backend/distributed/utils/colocation_utils.o \ src/backend/distributed/utils/colocation_utils.o \
src/backend/distributed/utils/distribution_column.o \ src/backend/distributed/utils/distribution_column.o \
src/backend/distributed/utils/enable_ssl.o \ src/backend/distributed/utils/enable_ssl.o \
@ -133,6 +134,7 @@ OBJS = src/backend/distributed/shared_library_init.o \
$(WIN32RES) $(WIN32RES)
EXTENSION= EXTENSION=
DATA=
MODULE_big= MODULE_big=
OBJS= OBJS=

View File

@ -49,6 +49,11 @@ install:
# make postgres think we're a contrib module # make postgres think we're a contrib module
- git clone -b REL_10_STABLE https://github.com/postgres/postgres C:\projects\postgres - git clone -b REL_10_STABLE https://github.com/postgres/postgres C:\projects\postgres
- git -C C:\projects\postgres apply C:\projects\citus\windows\Mkvcbuild.pm.patch - git -C C:\projects\postgres apply C:\projects\citus\windows\Mkvcbuild.pm.patch
# temporary hack: mark enable_hashagg PGDLLIMPORT
- git -C C:\projects\postgres cherry-pick 935dee9ad5a8d12f4d3b772a6e6c99d245e5ad44 & exit 0
# an even bigger hack, this file has a merge conflict so skip it
- git -C C:\projects\postgres reset src\include\optimizer\cost.h
- git -C C:\projects\postgres checkout src\include\optimizer\cost.h
# only build Citus, don't build the other contrib modules # only build Citus, don't build the other contrib modules
- git -C C:\projects\postgres apply C:\projects\citus\windows\Mkvcbuild-minimize.patch - git -C C:\projects\postgres apply C:\projects\citus\windows\Mkvcbuild-minimize.patch
- rmdir /s /q C:\projects\postgres\contrib - rmdir /s /q C:\projects\postgres\contrib
@ -73,17 +78,6 @@ build_script:
#---------------------------------# #---------------------------------#
# tests configuration # # tests configuration #
#---------------------------------# #---------------------------------#
before_test:
- ps: cd C:\projects\postgres\src\tools\msvc
- install C:\projects\pgsql
- cd C:\projects\postgres\contrib\citus\src\backend\distributed
- copy citus--*.sql C:\projects\pgsql\share\extension\
- perl install.pl C:\projects\pgsql
test_script: # disable automatic tests
- ps: cd C:\projects\postgres\contrib\citus\src\test\regress test: off
- perl pg_regress_multi.pl --bindir=C:\projects\pgsql\bin --load-extension=citus -- --schedule=multi_schedule
on_failure:
- ps: cd C:\projects\postgres\contrib\citus\src\test\regress
- type regression.diffs

View File

@ -1,6 +0,0 @@
# Citus extension
comment = 'Citus distributed database'
default_version = '8.1-1'
module_pathname = '$libdir/citus'
relocatable = false
schema = pg_catalog

View File

@ -1,96 +0,0 @@
#!/usr/bin/env perl
# Generates all the .sql files and puts them into the requested directory
use strict;
use warnings;
use File::Copy "copy";
use File::Spec::Functions "catdir";
my $EXTENSION = "citus";
my $argcount = @ARGV;
die "need a single argument saying where to install the sql files\n" if ($argcount != 1);
my $prefix = $ARGV[0];
die "install destination must exist!\n" unless (-e $prefix);
my $dest = catdir($prefix, "share/postgresql/extension");
unless (-e $dest)
{
$dest = catdir($prefix, "share/extension");
}
die "install destination must be a postgres installation!\n" unless (-e $dest);
# 1) check that we're installing into the real postgres installation
print "installing into $prefix\n";
# 2) parse Makefile's EXTVERSIONS to get the list of version pairs
die "could not find Makefile" unless (-e 'Makefile');
my $lines;
{
open(MAKEFILE, "Makefile") or die "cannot open Makefile\n";
local $/ = undef; # remove the record separator just for this scope
$lines = <MAKEFILE>; # read all the lines at once into a single variable
close(MAKEFILE);
}
my $versions;
if ($lines =~ /^EXTVERSIONS = ((?:[0-9. \t-]+(?:\\\n)?)*)/ms)
{
$versions = $1;
}
else
{
die "could not find EXTVERSIONS\n";
}
$versions =~ s/\\\n//g; # remove all newlines
$versions =~ s/\t/ /g; # also all tabs
$versions =~ s/\s+/ /g; # and, finally, all doubled whitespace
print "found list of versions: $versions\n";
# 3) generate all the sql files
my @versions = split(' ', $versions);
my @files = ("$EXTENSION--5.0.sql");
die "could not find $EXTENSION.sql" unless (-e "$EXTENSION.sql");
copy("$EXTENSION.sql", "$EXTENSION--5.0.sql");
while (scalar @versions > 1)
{
my $version = $versions[0];
my $next = $versions[1];
my $thisFile = "$EXTENSION--$version.sql";
my $updateFile = "$EXTENSION--$version--$next.sql";
my $nextFile = "$EXTENSION--$next.sql";
print "creating $nextFile\n";
copy($thisFile, $nextFile);
open(NEXT, ">>", $nextFile) or die "could not open $nextFile";
open(UPDATE, "<", $updateFile) or die "could not open $updateFile";
while(my $line = <UPDATE>){
print NEXT $line;
}
close(UPDATE);
close(NEXT);
push @files, $nextFile;
push @files, $updateFile;
shift @versions;
}
print "copying .sql files into $dest\n";
# 4) copy the sql files into the right place!
while(my $file = shift(@files))
{
my $fullDest = catdir($dest, $file);
copy($file, $fullDest);
}

View File

@ -116,11 +116,7 @@ if (defined $libdir)
$ENV{LD_LIBRARY_PATH} = "$libdir:".($ENV{LD_LIBRARY_PATH} || ''); $ENV{LD_LIBRARY_PATH} = "$libdir:".($ENV{LD_LIBRARY_PATH} || '');
$ENV{DYLD_LIBRARY_PATH} = "$libdir:".($ENV{DYLD_LIBRARY_PATH} || ''); $ENV{DYLD_LIBRARY_PATH} = "$libdir:".($ENV{DYLD_LIBRARY_PATH} || '');
$ENV{LIBPATH} = "$libdir:".($ENV{LIBPATH} || ''); $ENV{LIBPATH} = "$libdir:".($ENV{LIBPATH} || '');
if ($usingWindows) { $ENV{PATH} = "$libdir:".($ENV{PATH} || '');
$ENV{PATH} = "$libdir;".($ENV{PATH} || '');
} else {
$ENV{PATH} = "$libdir:".($ENV{PATH} || '');
}
} }
# Put $bindir to the end of PATH. We want to prefer system binaries by # Put $bindir to the end of PATH. We want to prefer system binaries by
@ -128,13 +124,10 @@ if (defined $libdir)
# want to find binaries if they're not in PATH. # want to find binaries if they're not in PATH.
if (defined $bindir) if (defined $bindir)
{ {
if ($usingWindows) { $ENV{PATH} = ($ENV{PATH} || '').":$bindir";
$ENV{PATH} = ($ENV{PATH} || '').";$bindir";
} else {
$ENV{PATH} = ($ENV{PATH} || '').":$bindir";
}
} }
# Most people are used to unified diffs these days, rather than the # Most people are used to unified diffs these days, rather than the
# context diffs pg_regress defaults to. Change default to avoid # context diffs pg_regress defaults to. Change default to avoid
# everyone having to (re-)learn how to change that setting. Also add # everyone having to (re-)learn how to change that setting. Also add
@ -460,21 +453,23 @@ if ($usingWindows)
{ {
print $fh "--variable=dev_null=\"/nul\" "; print $fh "--variable=dev_null=\"/nul\" ";
print $fh "--variable=temp_dir=\"%TEMP%\" "; print $fh "--variable=temp_dir=\"%TEMP%\" ";
print $fh "--variable=psql=\"".catfile($bindir, "psql")."\" ";
} }
else else
{ {
print $fh "--variable=dev_null=\"/dev/null\" "; print $fh "--variable=dev_null=\"/dev/null\" ";
print $fh "--variable=temp_dir=\"/tmp/\" "; print $fh "--variable=temp_dir=\"/tmp/\" ";
print $fh "--variable=psql=\"psql\" ";
} }
if ($usingWindows) if ($usingWindows)
{ {
print $fh " %*\n"; # pass on the commandline arguments print $fh "%*\n"; # pass on the commandline arguments
} }
else else
{ {
print $fh " \"\$@\"\n"; # pass on the commandline arguments print $fh "\"\$@\"\n"; # pass on the commandline arguments
} }
close $fh; close $fh;
@ -525,12 +520,6 @@ else
} }
} }
if ($usingWindows)
{
# takeown returns a failing result code no matter what happens, so skip the check
system("takeown /f data");
system("icacls data /grant \%userdomain\%\\\%username\%:F");
}
# Routine to shutdown servers at failure/exit # Routine to shutdown servers at failure/exit
sub ShutdownServers() sub ShutdownServers()