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

build error #6

Open
ShonFrazier opened this issue Apr 20, 2021 · 10 comments
Open

build error #6

ShonFrazier opened this issue Apr 20, 2021 · 10 comments

Comments

@ShonFrazier
Copy link

ShonFrazier commented Apr 20, 2021

I'm experiencing an issue building, but I don't have any extra space to remove like in #4. Here is my output:

$ go version
go version go1.16.3 darwin/amd64
$ postgres --version
postgres (PostgreSQL) 13.2
$ make
Makefile:25: warning: overriding commands for target 'pg_ulid.so'
/usr/local/lib/postgresql/pgxs/src/makefiles/../../src/Makefile.shlib:293: warning: ignoring old commands for target 'pg_ulid.so'
make: Circular pg_ulid.so <- pg_ulid.so dependency dropped.
go build -buildmode=c-shared -o pg_ulid.so main.go pg_ulid.go
pg_ulid.go:10:2: no required module provides package github.com/oklog/ulid: go.mod file not found in current directory or 
any parent directory; see 'go help modules'
make: *** [pg_ulid.so] Error 1
@basaran
Copy link

basaran commented May 10, 2021

I'm the one who created the #4 but it seems the issue with the MakeFile is already fixed. However, when I tried to compile this on another server, I also had run into the same issue which might be related to the recent changes with go and the way they do the modules. No go programmer here, anyhow, what you can try is:

a. git clone the github.com/oklog/ulid and move everything into the pg_ulid git clone.

b. then run go get github.com/oklog/ulid inside pg_ulid.

but it doesn't end here, it also seems there is a missing library from postgresql-libs, which is utils/nabstime.h so you might need to remove that from the go main mod, but that still doesn't end here.

It also seems some things have changed from v12 to v13

microo8/plgo#35 (comment)

You would need to edit both main.go and pg_ulid.go to replace %s/FunctionCallInfoData/FunctionCallInfoBaseData/g

After all these steps, I was able to have the compilation finish but I didn't try it on the server yet. It's very possible everything I had done was wrong :) so try at your own risk. At this point, I think I might give up on this extension. Sadly, this was the fastest ulid extension in the community and @iCyberon is not responding.

@iCyberon
Copy link
Owner

I might be able to allocate some time during the week to investigate the issue.

@basaran
Copy link

basaran commented May 11, 2021

hello, it seems to be working fine after switching the function names and taking out the nabstime.h. I can send a PR for you to test if it will help.

@iCyberon
Copy link
Owner

@basaran that would be great.

@basaran
Copy link

basaran commented May 12, 2021

PR sent, thank you for your time. If you could add the go get instructions to the readme, that would be very helpful too. Makefile was not able to get the module on my Arch go1.16.3.

@msawangwan
Copy link

msawangwan commented Dec 22, 2021

@basaran hi is there any chance you could help me troubleshoot this error:

#10 4.416 /usr/bin/install -c -m 644 pg_ulid.so '/usr/local/lib/postgresql/bitcode'/pg_ulid/./
#10 4.418 cd '/usr/local/lib/postgresql/bitcode' && /usr/lib/llvm12/bin/llvm-lto -thinlto -thinlto-action=thinlink -o pg_ulid.index.bc pg_ulid/pg_ulid.so
#10 4.441 LLVM ERROR: ThinLTO cannot create input file: The file was not recognized as a valid object file
#10 4.441 PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
#10 4.441 Stack dump:
#10 4.441 0.    Program arguments: /usr/lib/llvm12/bin/llvm-lto -thinlto -thinlto-action=thinlink -o pg_ulid.index.bc pg_ulid/pg_ulid.so
#10 4.444 make: *** [/usr/local/lib/postgresql/pgxs/src/makefiles/pgxs.mk:238: install] Aborted

Trying to build using docker alpine linux, the command [sudo] make install fails (the last step!).

BTW I'm using your fork of this project but I'm asking here because there's no issue tracker in yours 😄 .

@basaran
Copy link

basaran commented Dec 22, 2021

hola, well I'm not sure :)

You should try to compile locally first, and if you are using the fork from my repo, make sure you use pg13.

Also, do note, this pg_ulid gets loaded as an extension (added to postgres, not compiled in it). So, I am not sure why you need the llvm to compile it.

But that is okay as I'm generally not sure about many things in life.

@AshnaSabu123
Copy link

Hi,

Getting the same error . Please check the below logs

Makefile:25: warning: overriding recipe for target 'pg_ulid.so'
/usr/lib/postgresql/13/lib/pgxs/src/makefiles/../../src/Makefile.shlib:293: warning: ignoring old recipe for target 'pg_ulid.so'
make: Circular pg_ulid.so <- pg_ulid.so dependency dropped.
go build -buildmode=c-shared -o pg_ulid.so main.go pg_ulid.go

command-line-arguments

./main.go:11:10: fatal error: utils/nabstime.h: No such file or directory
11 | #include "utils/nabstime.h"
| ^~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:25: pg_ulid.so] Error 2

@e-Miracle
Copy link

Hi,

Getting the same error . Please check the below logs

Makefile:25: warning: overriding recipe for target 'pg_ulid.so' /usr/lib/postgresql/13/lib/pgxs/src/makefiles/../../src/Makefile.shlib:293: warning: ignoring old recipe for target 'pg_ulid.so' make: Circular pg_ulid.so <- pg_ulid.so dependency dropped. go build -buildmode=c-shared -o pg_ulid.so main.go pg_ulid.go

command-line-arguments

./main.go:11:10: fatal error: utils/nabstime.h: No such file or directory 11 | #include "utils/nabstime.h" | ^~~~~~~~~~~~~~~~~~ compilation terminated. make: *** [Makefile:25: pg_ulid.so] Error 2

same here

@saadahmedkhan
Copy link

Hi,
Getting the same error . Please check the below logs
Makefile:25: warning: overriding recipe for target 'pg_ulid.so' /usr/lib/postgresql/13/lib/pgxs/src/makefiles/../../src/Makefile.shlib:293: warning: ignoring old recipe for target 'pg_ulid.so' make: Circular pg_ulid.so <- pg_ulid.so dependency dropped. go build -buildmode=c-shared -o pg_ulid.so main.go pg_ulid.go

command-line-arguments

./main.go:11:10: fatal error: utils/nabstime.h: No such file or directory 11 | #include "utils/nabstime.h" | ^~~~~~~~~~~~~~~~~~ compilation terminated. make: *** [Makefile:25: pg_ulid.so] Error 2

same here

Same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants