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

Crate build fails with message: "recipe for target 'zic' failed" #54

Open
rasouli opened this issue Feb 23, 2021 · 8 comments
Open

Crate build fails with message: "recipe for target 'zic' failed" #54

rasouli opened this issue Feb 23, 2021 · 8 comments

Comments

@rasouli
Copy link

rasouli commented Feb 23, 2021

Hi,

I added postgres-parser crate version 0.2.3 as dependency and it failed when cargo build was issued with the following errors:

  [stderr] Writing bitcode...
  [stderr] /usr/bin/ld: skipping incompatible ../../src/common/libpgcommon.a when searching for -lpgcommon
  [stderr] /usr/bin/ld: cannot find -lpgcommon
  [stderr] /usr/bin/ld: skipping incompatible ../../src/port/libpgport.a when searching for -lpgport
  [stderr] /usr/bin/ld: cannot find -lpgport
  [stderr] clang: error: linker command failed with exit code 1 (use -v to see invocation)
  [stderr] make[2]: *** [zic] Error 1
  [stderr] make[1]: *** [all-timezone-recurse] Error 2
  [stderr] make: *** [all-src-recurse] Error 2
  [stderr] + exit 1
  Error: Os { code: 11, kind: WouldBlock, message: "Resource temporarily unavailable" }

I am building the crate on ubuntu 18.04.5 LTS and I have gone through installing required dependencies, but I cannot figure out what has gone wrong here. I would appreciate if you can give your thoughts on this. Please kindly find the full build log in build.log.

Thanks!

@alex-dukhno
Copy link
Contributor

Hi. I had the same problem on MacOS. I fixed it with adding needed llvm tools to $PATH

@rasouli
Copy link
Author

rasouli commented Feb 24, 2021

Hi @alex-dukhno !
Can you please specify how you have modified your $PATH? as far as I can check, I can find all mentioned tools ( opt, clang, llvm-ar) on my $PATH. also can you please specify version of the tools you use as-well?

Thanks.

@alex-dukhno
Copy link
Contributor

I add this line to my ~/.zshrc:

export PATH="/usr/local/opt/llvm/bin:$PATH"

@alex-dukhno
Copy link
Contributor

Clang version

clang -v
clang version 11.1.0
Target: x86_64-apple-darwin20.3.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin

LLVM-ar

llvm-ar --version                                                                                                                                                                              1 ↵
LLVM (http://llvm.org/):
  LLVM version 11.1.0
  Optimized build.
  Default target: x86_64-apple-darwin20.3.0
  Host CPU: skylake

@eeeebbbbrrrr
Copy link
Collaborator

Yeah, make sure that your clang isn't the one installed by XCode in /Library/.... It's gotta be the package-provided version. Don't ask me why -- I haven't been able to figure that out.

@alex-dukhno
Copy link
Contributor

Hi @rasouli I got exactly same error as yours when trying to build my project with rust docker image.

I spent a lot of time on trying to find what is the problem. I found that it could be that zic depends on glibc. I tried to install latest glibc on Debian however it was to much hassle to work headless installation so I ended up using ubuntu:20.04 as a build image.

I could not check my theory but maybe it could help you.

Thanks

@rasouli
Copy link
Author

rasouli commented Mar 22, 2021

Hi @alex-dukhno thanks for the tip, I had been experimenting with different versions of dependencies to build, but I had given up back then as I had to work on something else, I will re-try with ubuntu image next time.

@alekitto
Copy link

Hi, I had the same exact issue. I've inspected the log file and I noted that there is a build.sh: line 72: [: -l: unary operator expected error in the build log.
I tried to change the -l flag to -h (in this commit) and it seems working correctly.

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

4 participants