Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-12-20Remove MSVC scriptsMichael Paquier
This commit removes all the scripts located in src/tools/msvc/ to build PostgreSQL with Visual Studio on Windows, meson becoming the recommended way to achieve that. The scripts held some information that is still relevant with meson, information kept and moved to better locations. Comments that referred directly to the scripts are removed. All the documentation still relevant that was in install-windows.sgml has been moved to installation.sgml under a new subsection for Visual. All the content specific to the scripts is removed. Some adjustments for the documentation are planned in a follow-up set of changes. Author: Michael Paquier Reviewed-by: Peter Eisentraut, Andres Freund Discussion: https://postgr.es/m/ZQzp_VMJcerM1Cs_@paquier.xyz
2023-05-19Pre-beta mechanical code beautification.Tom Lane
Run pgindent, pgperltidy, and reformat-dat-files. This set of diffs is a bit larger than typical. We've updated to pg_bsd_indent 2.1.2, which properly indents variable declarations that have multi-line initialization expressions (the continuation lines are now indented one tab stop). We've also updated to perltidy version 20230309 and changed some of its settings, which reduces its desire to add whitespace to lines to make assignments etc. line up. Going forward, that should make for fewer random-seeming changes to existing code. Discussion: https://postgr.es/m/20230428092545.qfb3y5wcu4cm75ur@alvherre.pgsql
2023-01-02Update copyright for 2023Bruce Momjian
Backpatch-through: 11
2022-09-26windows: remove date from version number in win32ver.rcAndres Freund
This may have served a purpose at some point, but these days it just contributes to a non-reproducible build. Reviewed-by: Peter Eisentraut <peter.eisentraut@enterprisedb.com> Discussion: https://postgr.es/m/c5736f70-bb6d-8d25-e35c-e3d886e4e905@enterprisedb.com Discussion: https://postgr.es/m/1cef5b48-32bd-5cbf-fb62-fb648860f5ef@enterprisedb.com
2022-07-18Default to hidden visibility for extension libraries where possibleAndres Freund
Until now postgres built extension libraries with global visibility, i.e. exporting all symbols. On the one platform where that behavior is not natively available, namely windows, we emulate it by analyzing the input files to the shared library and exporting all the symbols therein. Not exporting all symbols is actually desirable, as it can improve loading speed, reduces the likelihood of symbol conflicts and can improve intra extension library function call performance. It also makes the non-windows builds more similar to windows builds. Additionally, with meson implementing the export-all-symbols behavior for windows, turns out to be more verbose than desirable. This patch adds support for hiding symbols by default and, to counteract that, explicit symbol visibility annotation for compilers that support __attribute__((visibility("default"))) and -fvisibility=hidden. That is expected to be most, if not all, compilers except msvc (for which we already support explicit symbol export annotations). Now that extension library symbols are explicitly exported, we don't need to export all symbols on windows anymore, hence remove that behavior from src/tools/msvc. The supporting code can't be removed, as we still need to export all symbols from the main postgres binary. Author: Andres Freund <andres@anarazel.de> Author: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/20211101020311.av6hphdl6xbjbuif@alap3.anarazel.de
2022-05-12Pre-beta mechanical code beautification.Tom Lane
Run pgindent, pgperltidy, and reformat-dat-files. I manually fixed a couple of comments that pgindent uglified.
2022-01-08Update copyright for 2022Bruce Momjian
Backpatch-through: 10
2021-11-30Disable unused-variable warning C4101 in MSVCDaniel Gustafsson
The C4101 warning for unused variable cannot be individually suppressed with PG_USED_FOR_ASSERTS_ONLY, and thus cause false-positive warnings for variables which are defined but only read/written in an assertion. Until a satisfactory solution for per-variable suppression like how we do for gcc and clang, disable the warning. Discussion: https://postgr.es/m/CAJcOf-c+KniGAp31pn8TC=9a-WHXpkX-3+8-2BkaCsZchhu=8w@mail.gmail.com
2021-08-09Remove some special cases from MSVC build scriptsDavid Rowley
Here we add additional parsing of Makefiles to determine when to add references to libpgport and libpgcommon. We also remove the need for adding the current contrib_extrasource by adding sine very basic logic to implement the Makefile rules which add .l and .y files when they exist for a given .o file in the Makefile. This is just some very basic additional parsing of Makefiles to try to keep things more consistent between builds using make and MSVC builds. This happens to work with how our current Makefiles are laid out, but it could easily be broken in the future if someone chooses do something in the Makefile that we don't have parsing support for. We will cross that bridge when we come to it. Author: David Rowley Discussion: https://postgr.es/m/CAApHDvoPULi5JW3933NxgwxOmu9Ncvpcyt87UhEHAUX16QqmpA@mail.gmail.com
2021-07-28Don't duplicate references and libraries in MSVC scriptsDavid Rowley
In order not to duplicate references and libraries in the Visual Studio project files produced by the MSVC build scripts, have them check if a particular reference or library already exists before adding the same one again. Reviewed-by: Álvaro Herrera, Andrew Dunstan, Dagfinn Ilmari Mannsåker Discussion: https://postgr.es/m/CAApHDvpo6g5csCTjc_0C7DMvgFPomVb0Rh-AcW5afd=Ya=LRuw@mail.gmail.com
2021-07-28Make the includes field an array in MSVC build scriptsDavid Rowley
Previously the 'includes' field was a string. It's slightly nicer to manage this when it's defined as an array instead. This allows us to more easily detect and eliminate duplicates. Reviewed-by: Álvaro Herrera, Andrew Dunstan, Dagfinn Ilmari Mannsåker Discussion: https://postgr.es/m/CAApHDvpo6g5csCTjc_0C7DMvgFPomVb0Rh-AcW5afd=Ya=LRuw@mail.gmail.com
2021-07-28Use the AddFile function consistently in MSVC build scriptsDavid Rowley
We seem to be using a mix of manually adding to the 'files' hash and calling the Addfile() method. Let's just consistently use AddFile(). Reviewed-by: Dagfinn Ilmari Mannsåker Discussion: https://postgr.es/m/CAApHDvpo6g5csCTjc_0C7DMvgFPomVb0Rh-AcW5afd=Ya=LRuw@mail.gmail.com
2021-05-07Add a copyright notice to perl files lacking one.Andrew Dunstan
2020-04-13Use perl's $/ more idiomaticallyAndrew Dunstan
This replaces a few occurrences of ugly code with a more clean and idiomatic usage. The problem was highlighted by perlcritic, but we're not enforcing the policy that led to the discovery. Discussion: https://postgr.es/m/20200412074245.GB623763@rfd.leadboat.com
2020-02-21Allow running src/tools/msvc/mkvcbuild.pl under not WindowsPeter Eisentraut
This to allow verifying the MSVC build file generation without having to have Windows. To do this, we avoid Windows-specific Perl modules and don't run the "cl" compiler or "nmake". The resulting build files won't actually be completely correct, but it's useful enough. Reviewed-by: Michael Paquier <michael@paquier.xyz> Reviewed-by: Julien Rouhaud <rjuju123@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/d73b2c7b-f081-8357-8422-7564d55f1aac%402ndquadrant.com
2020-01-15Remove libpq.rc, use win32ver.rc for libpqPeter Eisentraut
For historical reasons, libpq used a separate libpq.rc file for the Windows builds while all other components use a common file win32ver.rc. With a bit of tweaking, the libpq build can also use the win32ver.rc file. This removes a bit of duplicative code. Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com> Reviewed-by: Michael Paquier <michael@paquier.xyz> Discussion: https://www.postgresql.org/message-id/flat/ad505e61-a923-e114-9f38-9867d161073f@2ndquadrant.com
2019-10-04Handle spaces in OpenSSL install location for MSVCAndrew Dunstan
First, make sure that the .exe name is quoted when trying to get the version number. Also, don't quote the lib name for using in the project files if it's already been quoted. This second change applies to all libraries, not just OpenSSL. This has clearly been broken forever, so backpatch to all live branches.
2019-08-05Fix inconsistencies and typos in the tree, take 9Michael Paquier
This addresses more issues with code comments, variable names and unreferenced variables. Author: Alexander Lakhin Discussion: https://postgr.es/m/7ab243e0-116d-3e44-d120-76b3df7abefd@gmail.com
2018-05-31Fix compile-time warnings on all perl codeAndrew Dunstan
This patch does two things. First, it silences a number of compile-time warnings in the msvc tools files, mainly those due to the fact that in some cases we have more than one package per file. Second it supplies a dummy Perl library with just enough of the Windows API referred to in our code to let it run these checks cleanly, even on Unix machines where the code is never supposed to run. The dummy library should only be used for that purpose, as its README notes.
2018-05-27Don't fall off the end of perl functionsAndrew Dunstan
This complies with the perlcritic policy Subroutines::RequireFinalReturn, which is a severity 4 policy. Since we only currently check at severity level 5, the policy is raised to that level until we move to level 4 or lower, so that any new infringements will be caught. A small cosmetic piece of tidying of the pgperlcritic script is included. Mike Blackwell Discussion: https://postgr.es/m/CAESHdJpfFm_9wQnQ3koY3c91FoRQsO-fh02za9R3OEMndOn84A@mail.gmail.com
2018-05-09Restrict vertical tightness to parentheses in Perl codeAndrew Dunstan
The vertical tightness settings collapse vertical whitespace between opening and closing brackets (parentheses, square brakets and braces). This can make data structures in particular harder to read, and is not very consistent with our style in non-Perl code. This patch restricts that setting to parentheses only, and reformats all the perl code accordingly. Not applying this to parentheses has some unfortunate effects, so the consensus is to keep the setting for parentheses and not for the others. The diff for this patch does highlight some places where structures should have trailing commas. They can be added manually, as there is no automatic tool to do so. Discussion: https://postgr.es/m/a2f2b87c-56be-c070-bfc0-36288b4b41c1@2ndQuadrant.com
2018-04-27perltidy: Add option --nooutdent-long-commentsPeter Eisentraut
2018-04-25Reindent Perl files with perltidy version 20170521.Tom Lane
Discussion: https://postgr.es/m/CABUevEzK3cNiHZQ18f5tK0guoT+cN_jWeVzhYYxY=r+1Q3SmoA@mail.gmail.com
2017-03-27Clean up Perl code according to perlcriticPeter Eisentraut
Fix all perlcritic warnings of severity level 5, except in src/backend/utils/Gen_dummy_probes.pl, which is automatically generated. Reviewed-by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
2016-11-08Change qr/foo$/m to qr/foo\n/m, for Perl 5.8.8.Noah Misch
In each case, absence of a trailing newline would itself constitute a PostgreSQL bug. Therefore, this slightly enhances the changed tests. This works around a bug that last appeared in Perl 5.8.8, fixing src/test/modules/test_pg_dump when run against that version. Commit e7293e3271bf618eeb2d4779a15fc516a69fe463 worked around the bug, but the subsequent addition of test_pg_dump introduced affected code. As that commit had shown, slight increases in pattern complexity can suppress the bug. This commit edits qr/foo$/m patterns too complex to encounter the bug today, for style consistency and robustness against unrelated pattern changes. Back-patch to 9.6, where test_pg_dump was introduced. As of this writing, a fresh MSYS installation includes an affected Perl 5.8.8. The Perl 5.8.8 in Red Hat Enterprise Linux 5.11 carries a patch that renders it unaffected, but the Perl 5.8.5 of Red Hat Enterprise Linux 4.4 is affected.
2016-06-03Fix various common mispellings.Greg Stark
Mostly these are just comments but there are a few in documentation and a handful in code and tests. Hopefully this doesn't cause too much unnecessary pain for backpatching. I relented from some of the most common like "thru" for that reason. The rest don't seem numerous enough to cause problems. Thanks to Kevin Lyda's tool https://pypi.python.org/pypi/misspellings
2015-05-24pgindent run for 9.5Bruce Momjian
2015-04-25Replace backslashes by forward slashes in MSVC build codePeter Eisentraut
This makes it possible to run some stages of these build scripts on non-Windows systems. That way, we can more easily test whether file moves or makefile changes might break the MSVC build. Peter Eisentraut and Michael Paquier
2014-08-19Finish adding file version information to installed Windows binaries.Noah Misch
In support of this, have the MSVC build follow GNU make in preferring GNUmakefile over Makefile when a directory contains both. Michael Paquier, reviewed by MauMau.
2014-07-14MSVC: Process Makefile line continuations more like "make" does.Noah Misch
Unlike "make" itself, the MSVC build process recognized a continuation even with whitespace after the backslash. (Due to a typo, some code sites accepted the letter "s" instead of whitespace). Also, it would consume any number of newlines following a single backslash. This is mere cleanup; those behaviors were unlikely to cause bugs.
2013-05-29pgindent run for release 9.3Bruce Momjian
This is the first run of the Perl-based pgindent script. Also update pgindent instructions.
2013-02-12Create libpgcommon, and move pg_malloc et al to itAlvaro Herrera
libpgcommon is a new static library to allow sharing code among the various frontend programs and backend; this lets us eliminate duplicate implementations of common routines. We avoid libpgport, because that's intended as a place for porting issues; per discussion, it seems better to keep them separate. The first use case, and the only implemented by this patch, is pg_malloc and friends, which many frontend programs were already using. At the same time, we can use this to provide palloc emulation functions for the frontend; this way, some palloc-using files in the backend can also be used by the frontend cleanly. To do this, we change palloc() in the backend to be a function instead of a macro on top of MemoryContextAlloc(). This was previously believed to cause loss of performance, but this implementation has been tweaked by Tom and Andres so that on modern compilers it provides a slight improvement over the previous one. This lets us clean up some places that were already with localized hacks. Most of the pg_malloc/palloc changes in this patch were authored by Andres Freund. Zoltán Böszörményi also independently provided a form of that. libpgcommon infrastructure was authored by Álvaro.
2013-01-31Properly zero-pad the day-of-year part of the win32 build numberMagnus Hagander
This ensure the version number increases over time. The first three digits in the version number is still set to the actual PostgreSQL version number, but the last one is intended to be an ever increasing build number, which previosly failed when it changed between 1, 2 and 3 digits long values. Noted by Deepak
2012-07-05Run newly-configured perltidy script on Perl files.Bruce Momjian
Run on HEAD and 9.2.
2012-06-10Run pgindent on 9.2 source tree in preparation for first 9.3Bruce Momjian
commit-fest.
2012-02-29Move CRC tables to libpgport, and provide them in a separate include file.Tom Lane
This makes it much more convenient to build tools for Postgres that are separately compiled and require a matching CRC implementation. To prevent multiple copies of the CRC polynomial tables being introduced into the postgres binaries, they are now included in the static library libpgport that is mainly meant for replacement system functions. That seems like a bit of a kludge, but there's no better place. This cleans up building of the tools pg_controldata and pg_resetxlog, which previously had to build their own copies of pg_crc.o. In the future, external programs that need access to the CRC tables can include the tables directly from the new header file pg_crc_tables.h. Daniel Farina, reviewed by Abhijit Menon-Sen and Tom Lane
2012-01-03Support for building with MS Visual Studio 2010.Andrew Dunstan
Brar Piening, reviewed by Craig Ringer.
2010-09-20Remove cvs keywords from all files.Magnus Hagander
2010-04-09Perltidy run over the MSVC build system files, to clean up code formattingMagnus Hagander
and indentation styles.
2010-01-05Disable linker warning 4197 on Win64, that is caused by the fact that we exportMagnus Hagander
symbols both using __declspec(dllexport) (via the PGDLLIMPORT macro) and using full-dll-export. This works without warning on Win32, but not on Win64. In passing, fix the fact that the framework could never deal with more than one disbled linker warning - because MSVC wants commas between linker warnings, and semicolons between compiler warnings...
2010-01-02Silence compiler warning about size of size_t being larger than the resultMagnus Hagander
variable it's stored in. We know this can never happen. Per discussion.
2010-01-01Detect a 64-bit build environment on Windows, and generate the appropriateMagnus Hagander
project files. Based on the work of Tsutomu Yamada, but much refactored.
2009-12-23Add basic build support for Visual Studio 2008, without resorting toMagnus Hagander
generating the build files for 2005 and then converting them.
2009-11-12Remove plpgsql's separate lexer (finally!), in favor of using the core lexerTom Lane
directly. This was a lot of trouble, but should be worth it in terms of not having to keep the plpgsql lexer in step with core anymore. In addition the handling of keywords is significantly better-structured, allowing us to de-reserve a number of words that plpgsql formerly treated as reserved.
2009-07-27Enable the use of multiple CPUs/cores when building on MSVC. This onlyMagnus Hagander
affects the C compiler step - we still only build one target at a time.
2008-04-15Add multi-line flag to regex that needs it. Backpatch to 8.2. Fix from ↵Andrew Dunstan
Andreas Zeugswetter
2008-02-19Un-break msvc port yet again (it started pulling in the DarwinMagnus Hagander
port files, which obviously didn't compile)
2008-02-17Replace time_t with pg_time_t (same values, but always int64) in on-diskTom Lane
data structures and backend internal APIs. This solves problems we've seen recently with inconsistent layout of pg_control between machines that have 32-bit time_t and those that have already migrated to 64-bit time_t. Also, we can get out from under the problem that Windows' Unix-API emulation is not consistent about the width of time_t. There are a few remaining places where local time_t variables are used to hold the current or recent result of time(NULL). I didn't bother changing these since they do not affect any cross-module APIs and surely all platforms will have 64-bit time_t before overflow becomes an actual risk. time_t should be avoided for anything visible to extension modules, however.
2008-02-05Handle libraries in directories with spaces in them.Magnus Hagander
Gevik Babakhani
2007-12-11Use _USE_32BIT_TIME_T when building with MSVC. Also, enforce that it'sMagnus Hagander
used when building addons. Dave Page