Обсуждение: Encountering missing sourcefiles when building postgres on windows

Поиск
Список
Период
Сортировка

Encountering missing sourcefiles when building postgres on windows

От
Jürgen Zornig
Дата:
Hello List,

I'm trying to build postgres on Windows 11 Enterprise / Visual Studio 2022 Professional, so I basically followed the instructions, installed the devenvironment (flex, bison, perl, ...), got the sources from git (I've tried master and REL_15_2 branches) and ran /src/tools/msvc/build

The buildprocess itself seems to work, but I am encountering quite a lot of missing sourcefiles (and also headers) as the errors tell me:

"c:\_build\postgresql\pgsql.sln" (default target) (1) ->
"c:\_build\postgresql\initdb.vcxproj" (default target) (5) ->
"c:\_build\postgresql\libpgfeutils.vcxproj" (default target) (6) ->
(ClCompile target) ->
  c1 : fatal  error C1083: Cannot open source file: 'src/fe_utils/psqlscan.c': No such file or directory [c:\_build\pos
tgresql\libpgfeutils.vcxproj]


"c:\_build\postgresql\pgsql.sln" (default target) (1) ->
"c:\_build\postgresql\cyrillic_and_mic.vcxproj" (default target) (38) ->
"c:\_build\postgresql\postgres.vcxproj" (default target) (39) ->
  c1 : fatal  error C1083: Cannot open source file: 'src/backend/bootstrap/bootparse.c': No such file or directory [c:\
_build\postgresql\postgres.vcxproj]
  c1 : fatal  error C1083: Cannot open source file: 'src/backend/bootstrap/bootscanner.c': No such file or directory [c
:\_build\postgresql\postgres.vcxproj]
  c1 : fatal  error C1083: Cannot open source file: 'src/backend/parser/gram.c': No such file or directory [c:\_build\p
ostgresql\postgres.vcxproj]
  c1 : fatal  error C1083: Cannot open source file: 'src/backend/parser/scan.c': No such file or directory [c:\_build\p
ostgresql\postgres.vcxproj]
  c:\_build\postgresql\src\backend\parser\gramparse.h(29,10): fatal  error C1083: Cannot open include file: 'gram.h': N
o such file or directory (compiling source file src/backend/parser/parser.c) [c:\_build\postgresql\postgres.vcxproj]
  c1 : fatal  error C1083: Cannot open source file: 'src/backend/replication/repl_gram.c': No such file or directory [c
:\_build\postgresql\postgres.vcxproj]
  c1 : fatal  error C1083: Cannot open source file: 'src/backend/replication/repl_scanner.c': No such file or directory
 [c:\_build\postgresql\postgres.vcxproj]
  c1 : fatal  error C1083: Cannot open source file: 'src/backend/replication/syncrep_gram.c': No such file or directory
 [c:\_build\postgresql\postgres.vcxproj]
  c1 : fatal  error C1083: Cannot open source file: 'src/backend/replication/syncrep_scanner.c': No such file or direct
ory [c:\_build\postgresql\postgres.vcxproj]
  c1 : fatal  error C1083: Cannot open source file: 'src/backend/utils/adt/jsonpath_gram.c': No such file or directory
[c:\_build\postgresql\postgres.vcxproj]
  c1 : fatal  error C1083: Cannot open source file: 'src/backend/utils/adt/jsonpath_scan.c': No such file or directory
[c:\_build\postgresql\postgres.vcxproj]
  c1 : fatal  error C1083: Cannot open source file: 'src/backend/utils/misc/guc-file.c': No such file or directory [c:\
_build\postgresql\postgres.vcxproj]


"c:\_build\postgresql\pgsql.sln" (default target) (1) ->
"c:\_build\postgresql\ecpg.vcxproj" (default target) (69) ->
  c:\_build\postgresql\src\interfaces\ecpg\preproc\c_keywords.c(15,10): fatal  error C1083: Cannot open include file: '
preproc.h': No such file or directory [c:\_build\postgresql\ecpg.vcxproj]
  c:\_build\postgresql\src\interfaces\ecpg\preproc\ecpg_keywords.c(19,10): fatal  error C1083: Cannot open include file
: 'preproc.h': No such file or directory [c:\_build\postgresql\ecpg.vcxproj]
  c:\_build\postgresql\src\interfaces\ecpg\preproc\keywords.c(30,10): fatal  error C1083: Cannot open include file: 'pr
eproc.h': No such file or directory [c:\_build\postgresql\ecpg.vcxproj]
  c1 : fatal  error C1083: Cannot open source file: 'src/interfaces/ecpg/preproc/pgc.c': No such file or directory [c:\
_build\postgresql\ecpg.vcxproj]
  c1 : fatal  error C1083: Cannot open source file: 'src/interfaces/ecpg/preproc/preproc.c': No such file or directory
[c:\_build\postgresql\ecpg.vcxproj]
  c:\_build\postgresql\src\interfaces\ecpg\preproc\parser.c(25,10): fatal  error C1083: Cannot open include file: 'prep
roc.h': No such file or directory [c:\_build\postgresql\ecpg.vcxproj]


"c:\_build\postgresql\pgsql.sln" (default target) (1) ->
"c:\_build\postgresql\isolationtester.vcxproj" (default target) (73) ->
  c1 : fatal  error C1083: Cannot open source file: 'src/test/isolation/specparse.c': No such file or directory [c:\_bu
ild\postgresql\isolationtester.vcxproj]
  c1 : fatal  error C1083: Cannot open source file: 'src/test/isolation/specscanner.c': No such file or directory [c:\_
build\postgresql\isolationtester.vcxproj]

    16 Warning(s)
    21 Error(s)

Time Elapsed 00:07:30.09


I've also downloaded the 15.2 Tarball where some of these sourcefiles are contained and copied them each by each into the according locations. This works for most of these errors, nevertheless one file keeps missing, it's 'specparse.c' which belongs to the isolationtester test. Because of that my build doesn't run all the way through.

The purpose of my endeavour is to get windows builds of some Foreign Data Wrappers I'd like to use in our projects, mainly the jdbc_fdw. Also we want to gain more knowledge in building postgres on windows . So I would appreciate any help to get the very basic building process up and running as intended.


Best regards

Re: Encountering missing sourcefiles when building postgres on windows

От
Tom Lane
Дата:
=?iso-8859-1?Q?J=FCrgen_Zornig?= <juergen.zornig@msgis.com> writes:
> I'm trying to build postgres on Windows 11 Enterprise / Visual Studio 2022 Professional, so I basically followed the
instructions,installed the devenvironment (flex, bison, perl, ...), got the sources from git (I've tried master and
REL_15_2branches) and ran /src/tools/msvc/build 

> The buildprocess itself seems to work, but I am encountering quite a lot of missing sourcefiles (and also headers) as
theerrors tell me: 

The files you seem to be missing are precisely those that are generated
by flex or bison (if you build from a git pull instead of a tarball).
So it'd appear that either you misinstalled those tools, or something
is going wrong when the build script calls them (maybe they are not in
your PATH?).  I'd advise looking further up in the build log to get
a clue of what's going wrong.

            regards, tom lane