Hi, On 2018-08-22 05:02:11 -0700, Andres Freund wrote: > If we agree on that, I'm going to propose a patch that includes: > - relevant cleanups to configure > - adapts sources.sgml to refer to C99 instead of C89 > - add some trivial conversions to for(int i;;) and struct initializers, > so the relevant old animals fail > - adds a configure check to enable errors with vla usage (-Werror=vla) > > Questions: > > - do we want to make declarations at arbitrary points errors? It's > already a warning currently. > - other new restrictions that we want to introduce at the same time?
Attached is a version doing so. Turns out ripping < msvc 2010 support allows us to get rid of a fair bit of code. Using appveyor I tested that I didn't bungle things too badly. But I don't really know what I'm doing in that area, Andrew or Craig, your input would be appreciated. I tried to update sources.sgml to reflect my understanding of the subset of C99 we're going to use. I'd rather start more restrictive and then argue about relaxing things separately. There's a few further potential cleanups due to relying on c99: - Use __func__ unconditionally, rather than having configure test for it - Use inline unconditionally, rather than having configure test for it - Remove tests for AC_TYPE_INTPTR_T, AC_TYPE_UINTPTR_T, AC_TYPE_LONG_LONG_INT, we can rely on them being present. - probably more in that vein I'd rather do these separately lateron, in case one of them causes trouble on some animals. There's some potential ones I think we should *not* do: - remove AC_C_FLEXIBLE_ARRAY_MEMBER, and rely on it unconditionally. I'm disinclined to do this, because C++ IIRC doesn't support it in any version, and I don't want to make Peter's life unnecessarily hard. - remove AC_C_RESTRICT check, rely on it unconditionally: MSVC still spells this differently. Greetings, Andres Freund
>From c579be2ae7a020d6005d84a5b6f24872ba8b1b05 Mon Sep 17 00:00:00 2001 From: Andres Freund <and...@anarazel.de> Date: Wed, 22 Aug 2018 15:10:23 -0700 Subject: [PATCH v1 1/4] Require C99 (and thus MSCV 2013 upwards). Author: Andres Freund Discussion: https://postgr.es/m/97d4b165-192d-3605-749c-f614a0c4e...@2ndquadrant.com --- configure | 49 ++++++++++++++++++++++++++++++++ configure.in | 10 +++++++ doc/src/sgml/sources.sgml | 33 ++++++++++++++------- src/tools/msvc/MSBuildProject.pm | 2 +- src/tools/msvc/README | 6 ++-- src/tools/msvc/build.pl | 6 +--- 6 files changed, 86 insertions(+), 20 deletions(-) diff --git a/configure b/configure index 836d68dad37..dd439ddd2f6 100755 --- a/configure +++ b/configure @@ -4602,6 +4602,13 @@ if test "x$ac_cv_prog_cc_c99" != xno; then : fi + +# Error out if the compiler does not support C99, as the codebase +# relies on that. +if test "$ac_cv_prog_cc_c99" = no; then + as_fn_error $? "C compiler \"$CC\" does not support C99" "$LINENO" 5 +fi + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -5361,6 +5368,48 @@ fi # -Wdeclaration-after-statement isn't applicable for C++ + # Really don't want VLAs to be used in our dialect of C + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Werror=vla, for CFLAGS" >&5 +$as_echo_n "checking whether ${CC} supports -Werror=vla, for CFLAGS... " >&6; } +if ${pgac_cv_prog_CC_cflags__Werror_vla+:} false; then : + $as_echo_n "(cached) " >&6 +else + pgac_save_CFLAGS=$CFLAGS +pgac_save_CC=$CC +CC=${CC} +CFLAGS="${CFLAGS} -Werror=vla" +ac_save_c_werror_flag=$ac_c_werror_flag +ac_c_werror_flag=yes +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + pgac_cv_prog_CC_cflags__Werror_vla=yes +else + pgac_cv_prog_CC_cflags__Werror_vla=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_c_werror_flag=$ac_save_c_werror_flag +CFLAGS="$pgac_save_CFLAGS" +CC="$pgac_save_CC" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Werror_vla" >&5 +$as_echo "$pgac_cv_prog_CC_cflags__Werror_vla" >&6; } +if test x"$pgac_cv_prog_CC_cflags__Werror_vla" = x"yes"; then + CFLAGS="${CFLAGS} -Werror=vla" +fi + + + # -Wvla is not applicable for C++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wendif-labels, for CFLAGS" >&5 $as_echo_n "checking whether ${CC} supports -Wendif-labels, for CFLAGS... " >&6; } diff --git a/configure.in b/configure.in index 6e141064e5c..5869ab7c5bc 100644 --- a/configure.in +++ b/configure.in @@ -359,6 +359,13 @@ esac AC_PROG_CC([$pgac_cc_list]) AC_PROG_CC_C99() + +# Error out if the compiler does not support C99, as the codebase +# relies on that. +if test "$ac_cv_prog_cc_c99" = no; then + AC_MSG_ERROR([C compiler "$CC" does not support C99]) +fi + AC_PROG_CXX([$pgac_cxx_list]) # Check if it's Intel's compiler, which (usually) pretends to be gcc, @@ -477,6 +484,9 @@ if test "$GCC" = yes -a "$ICC" = no; then # These work in some but not all gcc versions PGAC_PROG_CC_CFLAGS_OPT([-Wdeclaration-after-statement]) # -Wdeclaration-after-statement isn't applicable for C++ + # Really don't want VLAs to be used in our dialect of C + PGAC_PROG_CC_CFLAGS_OPT([-Werror=vla]) + # -Wvla is not applicable for C++ PGAC_PROG_CC_CFLAGS_OPT([-Wendif-labels]) PGAC_PROG_CXX_CFLAGS_OPT([-Wendif-labels]) PGAC_PROG_CC_CFLAGS_OPT([-Wmissing-format-attribute]) diff --git a/doc/src/sgml/sources.sgml b/doc/src/sgml/sources.sgml index e53ee1dc6ad..419f753c7bc 100644 --- a/doc/src/sgml/sources.sgml +++ b/doc/src/sgml/sources.sgml @@ -867,19 +867,30 @@ BETTER: unrecognized node type: 42 <title>C Standard</title> <para> Code in <productname>PostgreSQL</productname> should only rely on language - features available in the C89 standard. That means a conforming - C89 compiler has to be able to compile postgres, at least aside - from a few platform dependent pieces. Features from later - revision of the C standard or compiler specific features can be - used, if a fallback is provided. + features available in the C99 standard. That means a conforming + C99 compiler has to be able to compile postgres, at least aside + from a few platform dependent pieces. </para> <para> - For example <literal>static inline</literal> and - <literal>_StaticAssert()</literal> are currently used, even - though they are from newer revisions of the C standard. If not - available we respectively fall back to defining the functions - without inline, and to using a C89 compatible replacement that - performs the same checks, but emits rather cryptic messages. + A few features included in the C99 standard are, at this time, not be + permitted to be used in core <productname>PostgreSQL</productname> + code. This currently includes variable length arrays, intermingled + declarations and code, <literal>//</literal> comments, universal + character names. Reasons for that include portability and historical + practices. + </para> + <para> + Features from later revision of the C standard or compiler specific + features can be used, if a fallback is provided. + </para> + <para> + For example <literal>_StaticAssert()</literal> and + <literal>__builtin_constant_p</literal> are currently used, even though + they are from newer revisions of the C standard and a + <productname>GCC</productname> extension respectively. If not available + we respectively fall back to using a C99 compatible replacement that + performs the same checks, but emits rather cryptic messages and do not + use <literal>__builtin_constant_p</literal>. </para> </simplesect> diff --git a/src/tools/msvc/MSBuildProject.pm b/src/tools/msvc/MSBuildProject.pm index 47252533a1b..dd6a610e5b2 100644 --- a/src/tools/msvc/MSBuildProject.pm +++ b/src/tools/msvc/MSBuildProject.pm @@ -1,7 +1,7 @@ package MSBuildProject; # -# Package that encapsulates a MSBuild project file (Visual C++ 2010 or greater) +# Package that encapsulates a MSBuild project file (Visual C++ 2013 or greater) # # src/tools/msvc/MSBuildProject.pm # diff --git a/src/tools/msvc/README b/src/tools/msvc/README index bfa98045f22..2827d76b2d1 100644 --- a/src/tools/msvc/README +++ b/src/tools/msvc/README @@ -67,7 +67,7 @@ Install.pm module containing the install logic Mkvcbuild.pm module containing the code to generate the Visual Studio build (project/solution) files MSBuildProject.pm module containing the code to generate MSBuild based - project files (Visual Studio 2010 or greater) + project files (Visual Studio 2013 or greater) Project.pm module containing the common code to generate the Visual Studio project files. Also provides the common interface of all project file generators @@ -99,5 +99,5 @@ VC2010Project or VC2012Project or VC2013Project or VC2015Project or VC2017Projec from MSBuildProject.pm) to it. When Solution::Save is called, the implementations of Solution and Project save their content in the appropriate format. -The final step of starting the appropriate build program (msbuild or vcbuild) -is performed in build.pl again. +The final step of starting the appropriate build program (msbuild) is +performed in build.pl again. diff --git a/src/tools/msvc/build.pl b/src/tools/msvc/build.pl index 9a234d1cc25..35649fe5a24 100644 --- a/src/tools/msvc/build.pl +++ b/src/tools/msvc/build.pl @@ -53,16 +53,12 @@ elsif (uc($ARGV[0]) ne "RELEASE") # ... and do it -if ($buildwhat and $vcver >= 10.00) +if ($buildwhat) { system( "msbuild $buildwhat.vcxproj /verbosity:normal $msbflags /p:Configuration=$bconf" ); } -elsif ($buildwhat) -{ - system("vcbuild $msbflags $buildwhat.vcproj $bconf"); -} else { system( -- 2.18.0.rc2.dirty
>From 5f6bedf514c9fa30ce5f3f3e88e95f77a2bde91c Mon Sep 17 00:00:00 2001 From: Andres Freund <and...@anarazel.de> Date: Wed, 22 Aug 2018 16:04:47 -0700 Subject: [PATCH v1 2/4] Remove test for VA_ARGS, implied by C99. Author: Andres Freund Discussion: https://postgr.es/m/97d4b165-192d-3605-749c-f614a0c4e...@2ndquadrant.com --- config/c-compiler.m4 | 19 -- configure | 34 +--- configure.in | 1 - doc/src/sgml/install-windows.sgml | 26 +-- src/include/pg_config.h.in | 3 - src/include/pg_config.h.win32 | 3 - src/include/utils/elog.h | 8 +- src/pl/plpython/plpy_elog.h | 4 - src/tools/msvc/MSBuildProject.pm | 76 +------- src/tools/msvc/README | 12 +- src/tools/msvc/Solution.pm | 102 ---------- src/tools/msvc/VCBuildProject.pm | 309 ------------------------------ src/tools/msvc/VSObjectFactory.pm | 37 +--- 13 files changed, 27 insertions(+), 607 deletions(-) delete mode 100644 src/tools/msvc/VCBuildProject.pm diff --git a/config/c-compiler.m4 b/config/c-compiler.m4 index 67675a31bb6..eedaf12d69c 100644 --- a/config/c-compiler.m4 +++ b/config/c-compiler.m4 @@ -415,25 +415,6 @@ fi])# PGAC_C_COMPUTED_GOTO -# PGAC_C_VA_ARGS -# -------------- -# Check if the C compiler understands C99-style variadic macros, -# and define HAVE__VA_ARGS if so. -AC_DEFUN([PGAC_C_VA_ARGS], -[AC_CACHE_CHECK(for __VA_ARGS__, pgac_cv__va_args, -[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>], -[#define debug(...) fprintf(stderr, __VA_ARGS__) -debug("%s", "blarg"); -])], -[pgac_cv__va_args=yes], -[pgac_cv__va_args=no])]) -if test x"$pgac_cv__va_args" = xyes ; then -AC_DEFINE(HAVE__VA_ARGS, 1, - [Define to 1 if your compiler understands __VA_ARGS__ in macros.]) -fi])# PGAC_C_VA_ARGS - - - # PGAC_PROG_VARCC_VARFLAGS_OPT # ----------------------- # Given a compiler, variable name and a string, check if the compiler diff --git a/configure b/configure index dd439ddd2f6..af090ffb08f 100755 --- a/configure +++ b/configure @@ -13962,38 +13962,6 @@ if test x"$pgac_cv_computed_goto" = xyes ; then $as_echo "#define HAVE_COMPUTED_GOTO 1" >>confdefs.h -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __VA_ARGS__" >&5 -$as_echo_n "checking for __VA_ARGS__... " >&6; } -if ${pgac_cv__va_args+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdio.h> -int -main () -{ -#define debug(...) fprintf(stderr, __VA_ARGS__) -debug("%s", "blarg"); - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - pgac_cv__va_args=yes -else - pgac_cv__va_args=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__va_args" >&5 -$as_echo "$pgac_cv__va_args" >&6; } -if test x"$pgac_cv__va_args" = xyes ; then - -$as_echo "#define HAVE__VA_ARGS 1" >>confdefs.h - fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } @@ -19635,7 +19603,7 @@ PostgreSQL config.status 12devel configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." diff --git a/configure.in b/configure.in index 5869ab7c5bc..3280afa0dab 100644 --- a/configure.in +++ b/configure.in @@ -1434,7 +1434,6 @@ PGAC_C_BUILTIN_BSWAP64 PGAC_C_BUILTIN_CONSTANT_P PGAC_C_BUILTIN_UNREACHABLE PGAC_C_COMPUTED_GOTO -PGAC_C_VA_ARGS PGAC_STRUCT_TIMEZONE PGAC_UNION_SEMUN PGAC_STRUCT_SOCKADDR_UN diff --git a/doc/src/sgml/install-windows.sgml b/doc/src/sgml/install-windows.sgml index 9597bc35a14..22a2ffd55ee 100644 --- a/doc/src/sgml/install-windows.sgml +++ b/doc/src/sgml/install-windows.sgml @@ -22,7 +22,7 @@ Microsoft tools is to install <productname>Visual Studio Express 2017 for Windows Desktop</productname> and use the included compiler. It is also possible to build with the full - <productname>Microsoft Visual C++ 2005 to 2017</productname>. + <productname>Microsoft Visual C++ 2013 to 2017</productname>. In some cases that requires the installation of the <productname>Windows SDK</productname> in addition to the compiler. </para> @@ -77,20 +77,24 @@ <para> Both 32-bit and 64-bit builds are possible with the Microsoft Compiler suite. 32-bit PostgreSQL builds are possible with - <productname>Visual Studio 2005</productname> to + <productname>Visual Studio 2013</productname> to <productname>Visual Studio 2017</productname> (including Express editions), as well as standalone Windows SDK releases 6.0 to 8.1. 64-bit PostgreSQL builds are supported with <productname>Microsoft Windows SDK</productname> version 6.0a to 8.1 or - <productname>Visual Studio 2008</productname> and above. Compilation - is supported down to <productname>Windows XP</productname> and - <productname>Windows Server 2003</productname> when building with - <productname>Visual Studio 2005</productname> to - <productname>Visual Studio 2013</productname>. Building with - <productname>Visual Studio 2015</productname> is supported down to - <productname>Windows Vista</productname> and <productname>Windows Server 2008</productname>. - Building with <productname>Visual Studio 2017</productname> is supported - down to <productname>Windows 7 SP1</productname> and <productname>Windows Server 2008 R2 SP1</productname>. + <productname>Visual Studio 2013</productname> and above. Compilation + is supported down to <productname>Windows 7</productname> and + <productname>Windows Server 2008 R2 SP1</productname> when building with + <productname>Visual Studio 2013</productname> to + <productname>Visual Studio 2017</productname>. + <!-- + For 2013 requirements: + https://docs.microsoft.com/en-us/visualstudio/productinfo/vs2013-sysrequirements-vs + For 2015 requirements: + https://docs.microsoft.com/en-us/visualstudio/productinfo/vs2015-sysrequirements-vs + For 2017 requirements: + https://docs.microsoft.com/en-us/visualstudio/productinfo/vs2017-system-requirements-vs + --> </para> <para> diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in index 827574ee40d..37649d77d67 100644 --- a/src/include/pg_config.h.in +++ b/src/include/pg_config.h.in @@ -754,9 +754,6 @@ /* Define to 1 if your compiler understands _Static_assert. */ #undef HAVE__STATIC_ASSERT -/* Define to 1 if your compiler understands __VA_ARGS__ in macros. */ -#undef HAVE__VA_ARGS - /* Define to 1 if you have the `__strtoll' function. */ #undef HAVE___STRTOLL diff --git a/src/include/pg_config.h.win32 b/src/include/pg_config.h.win32 index 46ce49def2f..4e2bd3c1352 100644 --- a/src/include/pg_config.h.win32 +++ b/src/include/pg_config.h.win32 @@ -597,9 +597,6 @@ /* Define to 1 if your compiler understands _Static_assert. */ /* #undef HAVE__STATIC_ASSERT */ -/* Define to 1 if your compiler understands __VA_ARGS__ in macros. */ -#define HAVE__VA_ARGS 1 - /* Define to the appropriate printf length modifier for 64-bit ints. */ #define INT64_MODIFIER "ll" diff --git a/src/include/utils/elog.h b/src/include/utils/elog.h index 4350b120aab..33c6b53e278 100644 --- a/src/include/utils/elog.h +++ b/src/include/utils/elog.h @@ -207,9 +207,8 @@ extern int getinternalerrposition(void); * elog(ERROR, "portal \"%s\" not found", stmt->portalname); *---------- */ -#ifdef HAVE__VA_ARGS /* - * If we have variadic macros, we can give the compiler a hint about the + * Using variadic macros, we can give the compiler a hint about the * call not returning when elevel >= ERROR. See comments for ereport(). * Note that historically elog() has called elog_start (which saves errno) * before evaluating "elevel", so we preserve that behavior here. @@ -236,11 +235,6 @@ extern int getinternalerrposition(void); } \ } while(0) #endif /* HAVE__BUILTIN_CONSTANT_P */ -#else /* !HAVE__VA_ARGS */ -#define elog \ - elog_start(__FILE__, __LINE__, PG_FUNCNAME_MACRO), \ - elog_finish -#endif /* HAVE__VA_ARGS */ extern void elog_start(const char *filename, int lineno, const char *funcname); extern void elog_finish(int elevel, const char *fmt,...) pg_attribute_printf(2, 3); diff --git a/src/pl/plpython/plpy_elog.h b/src/pl/plpython/plpy_elog.h index e4b30c3cca1..b56ac412476 100644 --- a/src/pl/plpython/plpy_elog.h +++ b/src/pl/plpython/plpy_elog.h @@ -15,7 +15,6 @@ extern PyObject *PLy_exc_spi_error; * * See comments at elog() about the compiler hinting. */ -#ifdef HAVE__VA_ARGS #ifdef HAVE__BUILTIN_CONSTANT_P #define PLy_elog(elevel, ...) \ do { \ @@ -32,9 +31,6 @@ extern PyObject *PLy_exc_spi_error; pg_unreachable(); \ } while(0) #endif /* HAVE__BUILTIN_CONSTANT_P */ -#else /* !HAVE__VA_ARGS */ -#define PLy_elog PLy_elog_impl -#endif /* HAVE__VA_ARGS */ extern void PLy_elog_impl(int elevel, const char *fmt,...) pg_attribute_printf(2, 3); diff --git a/src/tools/msvc/MSBuildProject.pm b/src/tools/msvc/MSBuildProject.pm index dd6a610e5b2..149213378cf 100644 --- a/src/tools/msvc/MSBuildProject.pm +++ b/src/tools/msvc/MSBuildProject.pm @@ -257,6 +257,7 @@ sub WriteConfigurationPropertyGroup <UseOfMfc>false</UseOfMfc> <CharacterSet>MultiByte</CharacterSet> <WholeProgramOptimization>$p->{wholeopt}</WholeProgramOptimization> + <PlatformToolset>$self->{PlatformToolset}</PlatformToolset> </PropertyGroup> EOF return; @@ -391,75 +392,6 @@ EOF return; } -package VC2010Project; - -# -# Package that encapsulates a Visual C++ 2010 project file -# - -use strict; -use warnings; -use base qw(MSBuildProject); - -no warnings qw(redefine); ## no critic - -sub new -{ - my $classname = shift; - my $self = $classname->SUPER::_new(@_); - bless($self, $classname); - - $self->{vcver} = '10.00'; - - return $self; -} - -package VC2012Project; - -# -# Package that encapsulates a Visual C++ 2012 project file -# - -use strict; -use warnings; -use base qw(MSBuildProject); - -no warnings qw(redefine); ## no critic - -sub new -{ - my $classname = shift; - my $self = $classname->SUPER::_new(@_); - bless($self, $classname); - - $self->{vcver} = '11.00'; - $self->{PlatformToolset} = 'v110'; - - return $self; -} - -# This override adds the <PlatformToolset> element -# to the PropertyGroup labeled "Configuration" -sub WriteConfigurationPropertyGroup -{ - my ($self, $f, $cfgname, $p) = @_; - my $cfgtype = - ($self->{type} eq "exe") - ? 'Application' - : ($self->{type} eq "dll" ? 'DynamicLibrary' : 'StaticLibrary'); - - print $f <<EOF; - <PropertyGroup Condition="'\$(Configuration)|\$(Platform)'=='$cfgname|$self->{platform}'" Label="Configuration"> - <ConfigurationType>$cfgtype</ConfigurationType> - <UseOfMfc>false</UseOfMfc> - <CharacterSet>MultiByte</CharacterSet> - <WholeProgramOptimization>$p->{wholeopt}</WholeProgramOptimization> - <PlatformToolset>$self->{PlatformToolset}</PlatformToolset> - </PropertyGroup> -EOF - return; -} - package VC2013Project; # @@ -468,7 +400,7 @@ package VC2013Project; use strict; use warnings; -use base qw(VC2012Project); +use base qw(MSBuildProject); no warnings qw(redefine); ## no critic @@ -493,7 +425,7 @@ package VC2015Project; use strict; use warnings; -use base qw(VC2012Project); +use base qw(MSBuildProject); no warnings qw(redefine); ## no critic @@ -518,7 +450,7 @@ package VC2017Project; use strict; use warnings; -use base qw(VC2012Project); +use base qw(MSBuildProject); no warnings qw(redefine); ## no critic diff --git a/src/tools/msvc/README b/src/tools/msvc/README index 2827d76b2d1..4ab81d3402f 100644 --- a/src/tools/msvc/README +++ b/src/tools/msvc/README @@ -4,7 +4,7 @@ MSVC build ========== This directory contains the tools required to build PostgreSQL using -Microsoft Visual Studio 2005 - 2017. This builds the whole backend, not just +Microsoft Visual Studio 2013 - 2017. This builds the whole backend, not just the libpq frontend library. For more information, see the documentation chapter "Installation on Windows" and the description below. @@ -73,8 +73,6 @@ Project.pm module containing the common code to generate the common interface of all project file generators Solution.pm module containing the code to generate the Visual Studio solution files. -VCBuildProject.pm module containing the code to generate VCBuild based - project files (Visual Studio 2005/2008) VSObjectFactory.pm factory module providing the code to create the appropriate project/solution files for the current environment @@ -90,13 +88,11 @@ config_default.pl to create the configuration arguments. These configuration arguments are passed over to Mkvcbuild::mkvcbuild (Mkvcbuild.pm) which creates the Visual Studio project and solution files. It does this by using VSObjectFactory::CreateSolution to create an object -implementing the Solution interface (this could be either a VS2005Solution, -a VS2008Solution, a VS2010Solution or a VS2012Solution or a VS2013Solution, +implementing the Solution interface (this could be either a VS2013Solution, or a VS2015Solution or a VS2017Solution, all in Solution.pm, depending on the user's build environment) and adding objects implementing the corresponding -Project interface (VC2005Project or VC2008Project from VCBuildProject.pm or -VC2010Project or VC2012Project or VC2013Project or VC2015Project or VC2017Project -from MSBuildProject.pm) to it. +Project interface (VC2013Project or VC2015Project or VC2017Project from +MSBuildProject.pm) to it. When Solution::Save is called, the implementations of Solution and Project save their content in the appropriate format. The final step of starting the appropriate build program (msbuild) is diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm index 78db247b291..7d7ce8b0312 100644 --- a/src/tools/msvc/Solution.pm +++ b/src/tools/msvc/Solution.pm @@ -760,108 +760,6 @@ sub GetFakeConfigure return $cfg; } -package VS2005Solution; - -# -# Package that encapsulates a Visual Studio 2005 solution file -# - -use strict; -use warnings; -use base qw(Solution); - -no warnings qw(redefine); ## no critic - -sub new -{ - my $classname = shift; - my $self = $classname->SUPER::_new(@_); - bless($self, $classname); - - $self->{solutionFileVersion} = '9.00'; - $self->{vcver} = '8.00'; - $self->{visualStudioName} = 'Visual Studio 2005'; - - return $self; -} - -package VS2008Solution; - -# -# Package that encapsulates a Visual Studio 2008 solution file -# - -use strict; -use warnings; -use base qw(Solution); - -no warnings qw(redefine); ## no critic - -sub new -{ - my $classname = shift; - my $self = $classname->SUPER::_new(@_); - bless($self, $classname); - - $self->{solutionFileVersion} = '10.00'; - $self->{vcver} = '9.00'; - $self->{visualStudioName} = 'Visual Studio 2008'; - - return $self; -} - -package VS2010Solution; - -# -# Package that encapsulates a Visual Studio 2010 solution file -# - -use Carp; -use strict; -use warnings; -use base qw(Solution); - -no warnings qw(redefine); ## no critic - -sub new -{ - my $classname = shift; - my $self = $classname->SUPER::_new(@_); - bless($self, $classname); - - $self->{solutionFileVersion} = '11.00'; - $self->{vcver} = '10.00'; - $self->{visualStudioName} = 'Visual Studio 2010'; - - return $self; -} - -package VS2012Solution; - -# -# Package that encapsulates a Visual Studio 2012 solution file -# - -use Carp; -use strict; -use warnings; -use base qw(Solution); - -no warnings qw(redefine); ## no critic - -sub new -{ - my $classname = shift; - my $self = $classname->SUPER::_new(@_); - bless($self, $classname); - - $self->{solutionFileVersion} = '12.00'; - $self->{vcver} = '11.00'; - $self->{visualStudioName} = 'Visual Studio 2012'; - - return $self; -} - package VS2013Solution; # diff --git a/src/tools/msvc/VCBuildProject.pm b/src/tools/msvc/VCBuildProject.pm deleted file mode 100644 index 6cdf822a637..00000000000 --- a/src/tools/msvc/VCBuildProject.pm +++ /dev/null @@ -1,309 +0,0 @@ -package VCBuildProject; - -# -# Package that encapsulates a VCBuild (Visual C++ 2005/2008) project file -# -# src/tools/msvc/VCBuildProject.pm -# - -use Carp; -use strict; -use warnings; -use base qw(Project); - -no warnings qw(redefine); ## no critic - -sub _new -{ - my $classname = shift; - my $self = $classname->SUPER::_new(@_); - bless($self, $classname); - - $self->{filenameExtension} = '.vcproj'; - - return $self; -} - -sub WriteHeader -{ - my ($self, $f) = @_; - - print $f <<EOF; -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject ProjectType="Visual C++" Version="$self->{vcver}" Name="$self->{name}" ProjectGUID="$self->{guid}"> - <Platforms><Platform Name="$self->{platform}"/></Platforms> - <Configurations> -EOF - - $self->WriteConfiguration( - $f, 'Debug', - { - defs => "_DEBUG;DEBUG=1", - wholeopt => 0, - opt => 0, - strpool => 'false', - runtime => 3 - }); - $self->WriteConfiguration( - $f, - 'Release', - { - defs => "", - wholeopt => 0, - opt => 3, - strpool => 'true', - runtime => 2 - }); - print $f <<EOF; - </Configurations> -EOF - $self->WriteReferences($f); - return; -} - -sub WriteFiles -{ - my ($self, $f) = @_; - print $f <<EOF; - <Files> -EOF - my @dirstack = (); - my %uniquefiles; - foreach my $fileNameWithPath (sort keys %{ $self->{files} }) - { - confess "Bad format filename '$fileNameWithPath'\n" - unless ($fileNameWithPath =~ m!^(.*)/([^/]+)\.(c|cpp|y|l|rc)$!); - my $dir = $1; - my $file = $2; - - # Walk backwards down the directory stack and close any dirs - # we're done with. - while ($#dirstack >= 0) - { - if (join('/', @dirstack) eq - substr($dir, 0, length(join('/', @dirstack)))) - { - last if (length($dir) == length(join('/', @dirstack))); - last - if (substr($dir, length(join('/', @dirstack)), 1) eq '/'); - } - print $f ' ' x $#dirstack . " </Filter>\n"; - pop @dirstack; - } - - # Now walk forwards and create whatever directories are needed - while (join('/', @dirstack) ne $dir) - { - my $left = substr($dir, length(join('/', @dirstack))); - $left =~ s/^\///; - my @pieces = split /\//, $left; - push @dirstack, $pieces[0]; - print $f ' ' x $#dirstack - . " <Filter Name=\"$pieces[0]\" Filter=\"\">\n"; - } - - # VC builds do not like file paths with forward slashes. - my $fileNameWithPathFormatted = $fileNameWithPath; - $fileNameWithPathFormatted =~ s/\//\\/g; - - print $f ' ' x $#dirstack - . " <File RelativePath=\"$fileNameWithPathFormatted\""; - if ($fileNameWithPath =~ /\.y$/) - { - my $of = $fileNameWithPath; - $of =~ s/\.y$/.c/; - $of =~ - s{^src/pl/plpgsql/src/gram.c$}{src/pl/plpgsql/src/pl_gram.c}; - print $f '>' - . $self->GenerateCustomTool( - 'Running bison on ' . $fileNameWithPath, - "perl src/tools/msvc/pgbison.pl $fileNameWithPath", $of) - . '</File>' . "\n"; - } - elsif ($fileNameWithPath =~ /\.l$/) - { - my $of = $fileNameWithPath; - $of =~ s/\.l$/.c/; - print $f '>' - . $self->GenerateCustomTool( - 'Running flex on ' . $fileNameWithPath, - "perl src/tools/msvc/pgflex.pl $fileNameWithPath", $of) - . '</File>' . "\n"; - } - elsif (defined($uniquefiles{$file})) - { - - # File already exists, so fake a new name - my $obj = $dir; - $obj =~ s!/!_!g; - print $f - "><FileConfiguration Name=\"Debug|$self->{platform}\"><Tool Name=\"VCCLCompilerTool\" ObjectFile=\".\\debug\\$self->{name}\\$obj" - . "_$file.obj\" /></FileConfiguration><FileConfiguration Name=\"Release|$self->{platform}\"><Tool Name=\"VCCLCompilerTool\" ObjectFile=\".\\release\\$self->{name}\\$obj" - . "_$file.obj\" /></FileConfiguration></File>\n"; - } - else - { - $uniquefiles{$file} = 1; - print $f " />\n"; - } - } - while ($#dirstack >= 0) - { - print $f ' ' x $#dirstack . " </Filter>\n"; - pop @dirstack; - } - print $f <<EOF; - </Files> -EOF - return; -} - -sub Footer -{ - my ($self, $f) = @_; - - print $f <<EOF; - <Globals/> -</VisualStudioProject> -EOF - return; -} - -sub WriteConfiguration -{ - my ($self, $f, $cfgname, $p) = @_; - my $cfgtype = - ($self->{type} eq "exe") ? 1 : ($self->{type} eq "dll" ? 2 : 4); - my $libs = $self->GetAdditionalLinkerDependencies($cfgname, ' '); - - my $targetmachine = $self->{platform} eq 'Win32' ? 1 : 17; - - print $f <<EOF; - <Configuration Name="$cfgname|$self->{platform}" OutputDirectory=".\\$cfgname\\$self->{name}" IntermediateDirectory=".\\$cfgname\\$self->{name}" - ConfigurationType="$cfgtype" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="2" WholeProgramOptimization="$p->{wholeopt}"> - <Tool Name="VCCLCompilerTool" Optimization="$p->{opt}" - AdditionalIncludeDirectories="$self->{prefixincludes}src/include;src/include/port/win32;src/include/port/win32_msvc;$self->{includes}" - PreprocessorDefinitions="WIN32;_WINDOWS;__WINDOWS__;__WIN32__;EXEC_BACKEND;WIN32_STACK_RLIMIT=4194304;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE$self->{defines}$p->{defs}" - StringPooling="$p->{strpool}" - RuntimeLibrary="$p->{runtime}" DisableSpecificWarnings="$self->{disablewarnings}" - AdditionalOptions="/MP" -EOF - print $f <<EOF; - AssemblerOutput="0" AssemblerListingLocation=".\\$cfgname\\$self->{name}\\" ObjectFile=".\\$cfgname\\$self->{name}\\" - ProgramDataBaseFileName=".\\$cfgname\\$self->{name}\\" BrowseInformation="0" - WarningLevel="3" SuppressStartupBanner="TRUE" DebugInformationFormat="3" CompileAs="0"/> - <Tool Name="VCLinkerTool" OutputFile=".\\$cfgname\\$self->{name}\\$self->{name}.$self->{type}" - AdditionalDependencies="$libs" - LinkIncremental="0" SuppressStartupBanner="TRUE" AdditionalLibraryDirectories="" IgnoreDefaultLibraryNames="libc" - StackReserveSize="4194304" DisableSpecificWarnings="$self->{disablewarnings}" - GenerateDebugInformation="TRUE" ProgramDatabaseFile=".\\$cfgname\\$self->{name}\\$self->{name}.pdb" - GenerateMapFile="FALSE" MapFileName=".\\$cfgname\\$self->{name}\\$self->{name}.map" - RandomizedBaseAddress="FALSE" - SubSystem="1" TargetMachine="$targetmachine" -EOF - if ($self->{disablelinkerwarnings}) - { - print $f - "\t\tAdditionalOptions=\"/ignore:$self->{disablelinkerwarnings}\"\n"; - } - if ($self->{implib}) - { - my $l = $self->{implib}; - $l =~ s/__CFGNAME__/$cfgname/g; - print $f "\t\tImportLibrary=\"$l\"\n"; - } - if ($self->{def}) - { - my $d = $self->{def}; - $d =~ s/__CFGNAME__/$cfgname/g; - print $f "\t\tModuleDefinitionFile=\"$d\"\n"; - } - - print $f "\t/>\n"; - print $f - "\t<Tool Name=\"VCLibrarianTool\" OutputFile=\".\\$cfgname\\$self->{name}\\$self->{name}.lib\" IgnoreDefaultLibraryNames=\"libc\" />\n"; - print $f - "\t<Tool Name=\"VCResourceCompilerTool\" AdditionalIncludeDirectories=\"src\\include\" />\n"; - if ($self->{builddef}) - { - print $f - "\t<Tool Name=\"VCPreLinkEventTool\" Description=\"Generate DEF file\" CommandLine=\"perl src\\tools\\msvc\\gendef.pl $cfgname\\$self->{name} $self->{platform}\" />\n"; - } - print $f <<EOF; - </Configuration> -EOF - return; -} - -sub WriteReferences -{ - my ($self, $f) = @_; - print $f " <References>\n"; - foreach my $ref (@{ $self->{references} }) - { - print $f - " <ProjectReference ReferencedProjectIdentifier=\"$ref->{guid}\" Name=\"$ref->{name}\" />\n"; - } - print $f " </References>\n"; - return; -} - -sub GenerateCustomTool -{ - my ($self, $desc, $tool, $output, $cfg) = @_; - if (!defined($cfg)) - { - return $self->GenerateCustomTool($desc, $tool, $output, 'Debug') - . $self->GenerateCustomTool($desc, $tool, $output, 'Release'); - } - return - "<FileConfiguration Name=\"$cfg|$self->{platform}\"><Tool Name=\"VCCustomBuildTool\" Description=\"$desc\" CommandLine=\"$tool\" AdditionalDependencies=\"\" Outputs=\"$output\" /></FileConfiguration>"; -} - -package VC2005Project; - -# -# Package that encapsulates a Visual C++ 2005 project file -# - -use strict; -use warnings; -use base qw(VCBuildProject); - -no warnings qw(redefine); ## no critic - -sub new -{ - my $classname = shift; - my $self = $classname->SUPER::_new(@_); - bless($self, $classname); - - $self->{vcver} = '8.00'; - - return $self; -} - -package VC2008Project; - -# -# Package that encapsulates a Visual C++ 2008 project file -# - -use strict; -use warnings; -use base qw(VCBuildProject); - -no warnings qw(redefine); ## no critic - -sub new -{ - my $classname = shift; - my $self = $classname->SUPER::_new(@_); - bless($self, $classname); - - $self->{vcver} = '9.00'; - - return $self; -} - -1; diff --git a/src/tools/msvc/VSObjectFactory.pm b/src/tools/msvc/VSObjectFactory.pm index 92a4fb6841f..1a94cd866ee 100644 --- a/src/tools/msvc/VSObjectFactory.pm +++ b/src/tools/msvc/VSObjectFactory.pm @@ -13,7 +13,6 @@ use warnings; use Exporter; use Project; use Solution; -use VCBuildProject; use MSBuildProject; our (@ISA, @EXPORT); @@ -31,23 +30,7 @@ sub CreateSolution $visualStudioVersion = DetermineVisualStudioVersion(); } - if ($visualStudioVersion eq '8.00') - { - return new VS2005Solution(@_); - } - elsif ($visualStudioVersion eq '9.00') - { - return new VS2008Solution(@_); - } - elsif ($visualStudioVersion eq '10.00') - { - return new VS2010Solution(@_); - } - elsif ($visualStudioVersion eq '11.00') - { - return new VS2012Solution(@_); - } - elsif ($visualStudioVersion eq '12.00') + if ($visualStudioVersion eq '12.00') { return new VS2013Solution(@_); } @@ -78,23 +61,7 @@ sub CreateProject $visualStudioVersion = DetermineVisualStudioVersion(); } - if ($visualStudioVersion eq '8.00') - { - return new VC2005Project(@_); - } - elsif ($visualStudioVersion eq '9.00') - { - return new VC2008Project(@_); - } - elsif ($visualStudioVersion eq '10.00') - { - return new VC2010Project(@_); - } - elsif ($visualStudioVersion eq '11.00') - { - return new VC2012Project(@_); - } - elsif ($visualStudioVersion eq '12.00') + if ($visualStudioVersion eq '12.00') { return new VC2013Project(@_); } -- 2.18.0.rc2.dirty
>From e0a39e6ecd0542ee8274351e2e3ed3655b85f15f Mon Sep 17 00:00:00 2001 From: Andres Freund <and...@anarazel.de> Date: Wed, 22 Aug 2018 16:44:33 -0700 Subject: [PATCH v1 3/4] Introduce minimal C99 usage to verify compiler support. This just converts a few for loops in postgres.c to declare variables in the loop initializer, and uses designated initializers in smgr.c's definition of smgr callbacks. Author: Andres Freund Discussion: https://postgr.es/m/97d4b165-192d-3605-749c-f614a0c4e...@2ndquadrant.com --- src/backend/storage/smgr/smgr.c | 21 ++++++++++++++++++--- src/backend/tcop/postgres.c | 25 +++++++------------------ 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/src/backend/storage/smgr/smgr.c b/src/backend/storage/smgr/smgr.c index 08f06bade25..189342ef86a 100644 --- a/src/backend/storage/smgr/smgr.c +++ b/src/backend/storage/smgr/smgr.c @@ -67,9 +67,24 @@ typedef struct f_smgr static const f_smgr smgrsw[] = { /* magnetic disk */ - {mdinit, NULL, mdclose, mdcreate, mdexists, mdunlink, mdextend, - mdprefetch, mdread, mdwrite, mdwriteback, mdnblocks, mdtruncate, - mdimmedsync, mdpreckpt, mdsync, mdpostckpt + { + .smgr_init = mdinit, + .smgr_shutdown = NULL, + .smgr_close = mdclose, + .smgr_create = mdcreate, + .smgr_exists = mdexists, + .smgr_unlink = mdunlink, + .smgr_extend = mdextend, + .smgr_prefetch = mdprefetch, + .smgr_read = mdread, + .smgr_write = mdwrite, + .smgr_writeback = mdwriteback, + .smgr_nblocks = mdnblocks, + .smgr_truncate = mdtruncate, + .smgr_immedsync = mdimmedsync, + .smgr_pre_ckpt = mdpreckpt, + .smgr_sync = mdsync, + .smgr_post_ckpt = mdpostckpt } }; diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 07b956553a7..7a9ada2c719 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -1310,7 +1310,6 @@ exec_parse_message(const char *query_string, /* string to execute */ { Query *query; bool snapshot_set = false; - int i; raw_parse_tree = linitial_node(RawStmt, parsetree_list); @@ -1366,7 +1365,7 @@ exec_parse_message(const char *query_string, /* string to execute */ /* * Check all parameter types got determined. */ - for (i = 0; i < numParams; i++) + for (int i = 0; i < numParams; i++) { Oid ptype = paramTypes[i]; @@ -1555,10 +1554,8 @@ exec_bind_message(StringInfo input_message) numPFormats = pq_getmsgint(input_message, 2); if (numPFormats > 0) { - int i; - pformats = (int16 *) palloc(numPFormats * sizeof(int16)); - for (i = 0; i < numPFormats; i++) + for (int i = 0; i < numPFormats; i++) pformats[i] = pq_getmsgint(input_message, 2); } @@ -1641,8 +1638,6 @@ exec_bind_message(StringInfo input_message) */ if (numParams > 0) { - int paramno; - params = (ParamListInfo) palloc(offsetof(ParamListInfoData, params) + numParams * sizeof(ParamExternData)); /* we have static list of params, so no hooks needed */ @@ -1654,7 +1649,7 @@ exec_bind_message(StringInfo input_message) params->parserSetupArg = NULL; params->numParams = numParams; - for (paramno = 0; paramno < numParams; paramno++) + for (int paramno = 0; paramno < numParams; paramno++) { Oid ptype = psrc->param_types[paramno]; int32 plength; @@ -1782,10 +1777,8 @@ exec_bind_message(StringInfo input_message) numRFormats = pq_getmsgint(input_message, 2); if (numRFormats > 0) { - int i; - rformats = (int16 *) palloc(numRFormats * sizeof(int16)); - for (i = 0; i < numRFormats; i++) + for (int i = 0; i < numRFormats; i++) rformats[i] = pq_getmsgint(input_message, 2); } @@ -2212,7 +2205,6 @@ errdetail_params(ParamListInfo params) { StringInfoData param_str; MemoryContext oldcontext; - int paramno; /* This code doesn't support dynamic param lists */ Assert(params->paramFetch == NULL); @@ -2222,7 +2214,7 @@ errdetail_params(ParamListInfo params) initStringInfo(¶m_str); - for (paramno = 0; paramno < params->numParams; paramno++) + for (int paramno = 0; paramno < params->numParams; paramno++) { ParamExternData *prm = ¶ms->params[paramno]; Oid typoutput; @@ -2325,7 +2317,6 @@ static void exec_describe_statement_message(const char *stmt_name) { CachedPlanSource *psrc; - int i; /* * Start up a transaction command. (Note that this will normally change @@ -2384,7 +2375,7 @@ exec_describe_statement_message(const char *stmt_name) * message type */ pq_sendint16(&row_description_buf, psrc->num_params); - for (i = 0; i < psrc->num_params; i++) + for (int i = 0; i < psrc->num_params; i++) { Oid ptype = psrc->param_types[i]; @@ -4179,10 +4170,8 @@ PostgresMain(int argc, char *argv[], numParams = pq_getmsgint(&input_message, 2); if (numParams > 0) { - int i; - paramTypes = (Oid *) palloc(numParams * sizeof(Oid)); - for (i = 0; i < numParams; i++) + for (int i = 0; i < numParams; i++) paramTypes[i] = pq_getmsgint(&input_message, 4); } pq_getmsgend(&input_message); -- 2.18.0.rc2.dirty
>From 1905cc80e205f390cdc7acfe79293dce969eed68 Mon Sep 17 00:00:00 2001 From: Andres Freund <and...@anarazel.de> Date: Wed, 22 Aug 2018 16:18:59 -0700 Subject: [PATCH v1 4/4] [robot] Add CI control files This commit adds control files to trigger building and testing. It is not part of the patch set. --- .travis.yml | 34 ++++++++++++++++++++++++++++++++++ README.md | 21 +++++++++++++++++++++ appveyor.yml | 27 +++++++++++++++++++++++++++ buildsetup.pl | 38 ++++++++++++++++++++++++++++++++++++++ dumpregr.pl | 20 ++++++++++++++++++++ 5 files changed, 140 insertions(+) create mode 100644 .travis.yml create mode 100644 README.md create mode 100644 appveyor.yml create mode 100644 buildsetup.pl create mode 100644 dumpregr.pl diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000000..08ef1fbf9a0 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,34 @@ +sudo: required +addons: + apt: + packages: + - gdb + - lcov + - libipc-run-perl + - libperl-dev + - libpython-dev + - tcl-dev + - libldap2-dev + - libicu-dev + - docbook + - docbook-dsssl + - docbook-xsl + - libxml2-utils + - openjade1.3 + - opensp + - xsltproc +language: c +cache: ccache +before_install: + - echo '/tmp/%e-%s-%p.core' | sudo tee /proc/sys/kernel/core_pattern +script: ./configure --enable-debug --enable-cassert --enable-coverage --enable-tap-tests --with-tcl --with-python --with-perl --with-ldap --with-icu && make -j4 all contrib docs && make check-world +#after_success: +# - bash <(curl -s https://codecov.io/bash) +after_failure: + - for f in $(find . -name regression.diffs) ; do echo "========= Contents of $f" ; head -1000 $f ; done + - | + for corefile in $(find /tmp/ -name '*.core' 2>/dev/null) ; do + binary=$(gdb -quiet -core $corefile -batch -ex 'info auxv' | grep AT_EXECFN | perl -pe "s/^.*\"(.*)\"\$/\$1/g") + echo dumping $corefile for $binary + gdb --batch --quiet -ex "thread apply all bt full" -ex "quit" $binary $corefile + done diff --git a/README.md b/README.md new file mode 100644 index 00000000000..81e7b3c27ad --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +Zheap Part I: Undo Log Storage + +This branch is maintained by a robot. It is automatically filtered and +combined from the commit history in the zheap-tmunro branch at +at https://github.com/EnterpriseDB/zheap into a more presentable form. +It's a preview of the lowest level patch-set in the Zheap proposal. +It's work in progress. + +There are five patches in this patch set: + +* [0001-Add-undo-log-manager.patch](../../commit/417481eaf562a36808cc7dbdbffbdef0361eff4f) +* [0002-Provide-access-to-undo-log-data-via-the-buffer-manager.patch](../../commit/88ce7dcbf20f243649aea1bd0ca3f42c7e0cc129) +* [0003-Add-developer-documentation-for-the-undo-log-manager.patch](../../commit/0c741fec6ffa4e69436a7e38dabc85b388477297) +* [0004-Add-tests-for-the-undo-log-manager.patch](../../commit/5d44b81eab636cb7f002704ca685af8a2800024b) +* [0005-Add-user-facing-documentation-for-undo-logs.patch](../../commit/892e5202b1c45a3f2032d4bef671413268738348) + +This branch is automatically tested by: + +* Ubuntu build bot over at Travis CI: [<img src="https://travis-ci.org/macdice/postgres.svg?branch=undo-log-storage"/>](https://travis-ci.org/macdice/postgres/branches) +* Windows build bot over at AppVeyor: [<img src="https://ci.appveyor.com/api/projects/status/github/macdice?branch=undo-log-storage&svg=true"/>](https://ci.appveyor.com/project/macdice/postgres/branch/undo-log-storage) + diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000000..af1ce3da32a --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,27 @@ +# appveyor.yml +install: + - cinst winflexbison + - '"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64' + - '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86_amd64' + + +before_build: + - rename c:\ProgramData\chocolatey\bin\win_flex.exe flex.exe + - rename c:\ProgramData\chocolatey\bin\win_bison.exe bison.exe + - perl buildsetup.pl + +build: + project: pgsql.sln + +before_test: + - 'perl -p -i.bak -e "s/^test: tablespace/#test: tablespace/" src/test/regress/serial_schedule' + - 'perl -p -i.bak -e "s/^test: tablespace/#test: tablespace/" src/test/regress/parallel_schedule' + +test_script: + - cd src\tools\msvc && vcregress check + +on_failure: + - perl dumpregr.pl + +configuration: + - Release diff --git a/buildsetup.pl b/buildsetup.pl new file mode 100644 index 00000000000..23df2fb1aa4 --- /dev/null +++ b/buildsetup.pl @@ -0,0 +1,38 @@ +# first part of postgres build.pl, just doesn't run msbuild + +use strict; + +BEGIN +{ + + chdir("../../..") if (-d "../msvc" && -d "../../../src"); + +} + +use lib "src/tools/msvc"; + +use Cwd; + +use Mkvcbuild; + +# buildenv.pl is for specifying the build environment settings +# it should contain lines like: +# $ENV{PATH} = "c:/path/to/bison/bin;$ENV{PATH}"; + +if (-e "src/tools/msvc/buildenv.pl") +{ + do "src/tools/msvc/buildenv.pl"; +} +elsif (-e "./buildenv.pl") +{ + do "./buildenv.pl"; +} + +# set up the project +our $config; +do "config_default.pl"; +do "config.pl" if (-f "src/tools/msvc/config.pl"); + +# print "PATH: $_\n" foreach (split(';',$ENV{PATH})); + +Mkvcbuild::mkvcbuild($config); diff --git a/dumpregr.pl b/dumpregr.pl new file mode 100644 index 00000000000..d9039da7844 --- /dev/null +++ b/dumpregr.pl @@ -0,0 +1,20 @@ +use strict; +use warnings FATAL => qw(all); + +use File::Find; + +my $Target = "regression.diffs"; + +find(\&dump, "src"); + +sub dump { + if ($_ eq $Target) { + my $path = $File::Find::name; + print "=== $path ===\n"; + open(my $fh, "<", $_) || die "wtf"; + while (my $line = <$fh>) { + print $line; + if ($. > 1000) { last; } + } + } +} -- 2.18.0.rc2.dirty