Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't run this repo locally because of glibc bug on pganalyze/pg_query/ repo. #151

Open
theokkj opened this issue Jan 2, 2025 · 9 comments
Labels
bug Something isn't working

Comments

@theokkj
Copy link

theokkj commented Jan 2, 2025

Bug report

I tried running it on Windows, WSL and on a new Docker container. It always generates an error.

After cloning the repo to my machine, i run "npm install" and always get this error log:

https://drive.google.com/file/d/145O-poTkiodmGYwAnm3jf4adAnGQdJFe/view?usp=drive_link

Describe the bug

I did some research and discovered that this bug comes from the pganalyze/pg_query/ repo.

Some useful links are:

pganalyze/pg_query_go#95
pganalyze/libpg_query#202
pganalyze/pg_query#298

And the resolution

pganalyze/pg_query#299

To Reproduce

  1. Git clone the database-build repo
  2. cd database-build
  3. npm install
  4. see error

Expected behavior

I expect it to npm install successfuly.

System information

  • OS: Windows 11 WSL Ubuntu 24.04.1 LTS
  • Version of Node.js: v20.18.1
@theokkj theokkj added the bug Something isn't working label Jan 2, 2025
@gregnr
Copy link
Collaborator

gregnr commented Jan 2, 2025

Thanks for reporting @theokkj. I'll try to reproduce this on WSL2 and see if we can get to the bottom of it.

@theokkj
Copy link
Author

theokkj commented Jan 10, 2025

Thanks for reporting @theokkj. I'll try to reproduce this on WSL2 and see if we can get to the bottom of it.

Hey @gregnr, were you able to take a look at that issue?

@psk001
Copy link

psk001 commented Jan 12, 2025

Has there been any resolution? Getting the same issue on ubuntu 24.

@mgold
Copy link

mgold commented Jan 13, 2025

+1 for seeing this in Ubuntu 24.04.1 LTS.

.../node_modules/libpg-query install: src/postgres/src_port_snprintf.c:374:1: error: conflicting types for ‘strchrnul’; have ‘const char *(const char *, int)’
.../node_modules/libpg-query install:   374 | strchrnul(const char *s, int c)
.../node_modules/libpg-query install:       | ^~~~~~~~~
.../node_modules/libpg-query install: In file included from ./src/postgres/include/c.h:61,
.../node_modules/libpg-query install:                  from src/postgres/src_port_snprintf.c:62:
.../node_modules/libpg-query install: /usr/include/string.h:286:14: note: previous declaration of ‘strchrnul’ with type ‘char *(const char *, int)’
.../node_modules/libpg-query install:   286 | extern char *strchrnul (const char *__s, int __c)
.../node_modules/libpg-query install:       |              ^~~~~~~~~
.../node_modules/libpg-query install: make[1]: *** [Makefile:171: src/postgres/src_port_snprintf.o] Error 1

@yadazula
Copy link

yadazula commented Jan 15, 2025

A side note, it works fine with Ubuntu 22.04 LTS.

For my use-case, I changed the target OS to Ubuntu 22.04 LTS in the GitHub Actions workflow file as a workaround solution.

@theokkj
Copy link
Author

theokkj commented Jan 15, 2025

A side note, it works fine with Ubuntu 22.04 LTS.

For my use-case, I changed the target OS to Ubuntu 22.04 LTS in the GitHub Actions workflow file as a workaround solution.

Can you show the steps that you've done?

@yadazula
Copy link

Can you show the steps that you've done?

Oh, it's a different project but the error is same. I reproduced it here and fixed with this workaround.

@mgold
Copy link

mgold commented Jan 15, 2025

Upgrading libpg-query to 13.3.2 seems to work for me.

@psk001
Copy link

psk001 commented Jan 16, 2025

@mgold changing version to 13.3.2 gives below error
image

NPM page of this package doesnt show 13.3.2 a supported version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants