Thread: compiling postgres on windows - how to deal with unmatched file extension?

compiling postgres on windows - how to deal with unmatched file extension?

From
"Yang, T. Andy"
Date:
I'm trying to build postgresql from source code on windows. The build ran into a bunch of errors like 

'src/backend/bootstrap/bootparse.c': No such file or directory
'src/backend/parser/gram.c': No such file or directory

These .c files are referenced in postgres.vcxproj. They actual exist but their extension is either .l or .y instead of .c. What am I supposed to do so the build process will find these files with correct extension? I don't think I need to modify vcxproj files to make it work.

I checked out source code from the latest master version on github. I was expecting the build would go smoothly since I didn't modify anything.

If this is not the right group to post this kind of question, please let me know the right one.

Thanks,
Andy
"Yang, T. Andy" <tyang99@yahoo.com> writes:
> I'm trying to build postgresql from source code on windows. The build ran into a bunch of errors like 
> 'src/backend/bootstrap/bootparse.c': No such file or directory
>  'src/backend/parser/gram.c': No such file or directory

I know little about building on Windows, but these are derived files
that should be built by running flex on the corresponding .l file
or bison on the corresponding .y file.  A likely explanation is that
you don't have those tools installed, in which case you should have
seen associated errors earlier in the build log.

            regards, tom lane



Re: compiling postgres on windows - how to deal with unmatched file extension?

From
"David G. Johnston"
Date:
On Tue, Dec 13, 2022 at 9:56 PM Yang, T. Andy <tyang99@yahoo.com> wrote:
I checked out source code from the latest master version on github. I was expecting the build would go smoothly since I didn't modify anything.

That philosophy unfortunately doesn't work here.  There are many pre-requisites and there isn't a package.json equivalent kind of file in which we can define all of our dependencies (especially due to the lack of intermediary engine like the JVM or Node to cover over platform differences) so that the build is fully self-contained.  Instead we have to document those requirements in the documentation (they are indirectly documented in the configuration files/scripts I suppose...).


The msvc README in the repo also covers these two extensions explicitly:


pgbison.pl             internal tool to process .y files using bison
pgflex.pl              internal tool to process .l files using flex

David J.

SV: compiling postgres on windows - how to deal with unmatched file extension?

From
Niels Jespersen
Date:

>I'm trying to build postgresql from source code on windows. The build ran into a bunch of errors like 

>'src/backend/bootstrap/bootparse.c': No such file or directory

>src/backend/parser/gram.c': No such file or directory

>These .c files are referenced in postgres.vcxproj. They actual exist but their extension is either .l or .y instead of .c. What am I supposed to do so the build process will find these files with correct extension? I don't think I need to modify vcxproj files to make it work.

>I checked out source code from the latest master version on github. I was expecting the build would go smoothly since I didn't modify anything.

I once wrote this:

 

https://github.com/njesp/build_pgaudit_on_windows#build-pgaudit-as-part-of-a-full-postgresql-build

 

as part of something else.

 

Regards Niels

 

 

Re: compiling postgres on windows - how to deal with unmatched file extension?

From
Mladen Gogala
Date:
On 12/13/22 23:55, Yang, T. Andy wrote:
src/backend/bootstrap/bootparse.c': No such file or directory
'src/backend/parser/gram.c': No such file or directory

Have you tried using cygwin?

-- 
Mladen Gogala
Database Consultant
Tel: (347) 321-1217
https://dbwhisperer.wordpress.com