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

Failure to compile #468

Closed
Canop opened this issue Dec 16, 2021 · 12 comments
Closed

Failure to compile #468

Canop opened this issue Dec 16, 2021 · 12 comments
Labels
bug Something isn't working

Comments

@Canop
Copy link
Owner

Canop commented Dec 16, 2021

Several users see a failure to compile version 1.7.4.

If that's the case for you, please precise in comment your os, version of rustc. I'm trying to gather evidences.

@rsignavong
Copy link

Hello I have the issue.

My setup is the following

OS
Apple Chip M1 running MacOS Monterey 12.1

My rust toolchain

❯ rustup show
Default host: aarch64-apple-darwin
rustup home:  /Users/.../.rustup

installed toolchains
--------------------

stable-aarch64-apple-darwin (default)
nightly-aarch64-apple-darwin
1.56.0-aarch64-apple-darwin

active toolchain
----------------

stable-aarch64-apple-darwin (default)
rustc 1.57.0 (f1edd0429 2021-11-29)

The error is the following

error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-arch" "arm64" "/Users/rockysignavong/workspace/broot/target/release/deps/broot-eae58f3f52cb5933.broot.e296e78c-cgu.0.rcgu.o" "-L" "/Users/rockysignavong/workspace/broot/target/release/deps" "-L" "/Applications/Postgres.app/Contents/Versions/latest/lib" "-L" "/Users/rockysignavong/workspace/broot/target/release/build/ansi_colours-e4b784b0a69b43f5/out" "-L" "/Users/rockysignavong/workspace/broot/target/release/build/libgit2-sys-469b8be5bf0fdccc/out/build" "-L" "/Users/rockysignavong/workspace/broot/target/release/build/onig_sys-32784666a519ee3f/out" "-L" "/Users/rockysignavong/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "/var/folders/8t/fn6f5ynj3dj7yx3mjjxk9chr0000gn/T/rustc1d3Q6T/libonig_sys-384b7c5ff8751bcd.rlib" "/var/folders/8t/fn6f5ynj3dj7yx3mjjxk9chr0000gn/T/rustc1d3Q6T/liblibgit2_sys-04d973464607c50d.rlib" "/var/folders/8t/fn6f5ynj3dj7yx3mjjxk9chr0000gn/T/rustc1d3Q6T/libansi_colours-070d8033118a8aa6.rlib" "/Users/rockysignavong/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcompiler_builtins-56bb43a121401f7f.rlib" "-lxcb" "-lxcb-render" "-lxcb-shape" "-lxcb-xfixes" "-liconv" "-framework" "Security" "-framework" "CoreFoundation" "-lz" "-liconv" "-lSystem" "-lresolv" "-lc" "-lm" "-liconv" "-L" "/Users/rockysignavong/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "-o" "/Users/rockysignavong/workspace/broot/target/release/deps/broot-eae58f3f52cb5933" "-Wl,-dead_strip" "-nodefaultlibs"
  = note: ld: library not found for -lxcb
          clang: error: linker command failed with exit code 1 (use -v to see invocation)


error: could not compile `broot` due to previous error

@Canop Canop added the bug Something isn't working label Dec 16, 2021
@Stargateur
Copy link
Contributor

Stargateur commented Dec 16, 2021

@rsignavong can you try to compile this crate ? https://github.com/rust-x-bindings/rust-xcb/tree/main 0.10.1 the main branch.

git clone https://github.com/rust-x-bindings/rust-xcb.git
git checkout v0.10.1
cargo build --features "thread" --features "xfixes"

@Canop
Copy link
Owner Author

Canop commented Dec 16, 2021

@rsignavong can you try the installation without the clipboard feature ?

 cargo build --release --no-default-features

@rsignavong
Copy link

cargo build --features "thread" --features "xfixes"

It builds correctly, in debug or release mode, with and without the features

rust-xcb on  HEAD (df60154) is 📦 v0.10.1 via 🦀 v1.57.0 on ☁️  (us-east-1) took 2s
❯ cargo build
   Compiling memchr v2.4.1
   Compiling libc v0.2.112
   Compiling log v0.4.14
   Compiling cfg-if v1.0.0
   Compiling quick-xml v0.22.0
   Compiling xcb v0.10.1 (/Users/rockysignavong/workspace/rust-xcb)
    Finished dev [unoptimized + debuginfo] target(s) in 3.12s

rust-xcb on  HEAD (df60154) is 📦 v0.10.1 via 🦀 v1.57.0 on ☁️  (us-east-1)
❯ cargo build --release
   Compiling libc v0.2.112
   Compiling memchr v2.4.1
   Compiling log v0.4.14
   Compiling cfg-if v1.0.0
   Compiling quick-xml v0.22.0
   Compiling xcb v0.10.1 (/Users/rockysignavong/workspace/rust-xcb)
    Finished release [optimized] target(s) in 2.31s

rust-xcb on  HEAD (df60154) is 📦 v0.10.1 via 🦀 v1.57.0 on ☁️  (us-east-1)
❯ cargo build --features "thread" --features "xfixes"
   Compiling memchr v2.4.1
   Compiling libc v0.2.112
   Compiling log v0.4.14
   Compiling cfg-if v1.0.0
   Compiling quick-xml v0.22.0
   Compiling xcb v0.10.1 (/Users/rockysignavong/workspace/rust-xcb)
    Finished dev [unoptimized + debuginfo] target(s) in 4.41s

rust-xcb on  HEAD (df60154) is 📦 v0.10.1 via 🦀 v1.57.0 on ☁️  (us-east-1)
❯ cargo build --release --features "thread" --features "xfixes"
   Compiling libc v0.2.112
   Compiling memchr v2.4.1
   Compiling log v0.4.14
   Compiling cfg-if v1.0.0
   Compiling quick-xml v0.22.0
   Compiling xcb v0.10.1 (/Users/rockysignavong/workspace/rust-xcb)
    Finished release [optimized] target(s) in 4.48s

@rsignavong
Copy link

@rsignavong can you try the installation without the clipboard feature ?

 cargo build --release --no-default-features

It compiled succesfully

   Compiling onig v6.3.1
   Compiling bincode v1.3.3
   Compiling plist v1.3.1
   Compiling toml v0.5.8
   Compiling deser-hjson v1.0.2
   Compiling syntect v4.6.0
   Compiling git2 v0.13.24
    Finished release [optimized] target(s) in 45.82s

@rsignavong
Copy link

Is it related to my rustflags?

❯ cat ~/.cargo/config
[target.aarch64-apple-darwin]
rustflags = ["-C", "link-arg=-undefined", "-C", "link-arg=dynamic_lookup"]

@Canop
Copy link
Owner Author

Canop commented Dec 16, 2021

My clipboard library seems to be the problem (due to one of its dependencies).
As it's hard to me to develop for Mac (a Mac would be needed), I'll probably not support the clipboard on Mac, at least until I find a solution.
Right now, the broot you built without this feature should be OK

@rsignavong
Copy link

Ok I see, thank you for your help!

@Canop
Copy link
Owner Author

Canop commented Dec 16, 2021

I've just released broot v1.7.5 which brings nothing else than an easier compilation.

@Canop Canop closed this as completed Dec 16, 2021
@levone1
Copy link

levone1 commented Dec 20, 2021

I've just released broot v1.7.5 which brings nothing else than an easier compilation.

quick tangent for you, if you don't mind... I just tried to compile another Cargo project, (https://github.com/alacritty/alacritty), which gets all the way to the end, and then throws the same lxcb dep error that Broot was giving me before... Do you think you could tell me how to edit the source similarly to what you did, to skip that, (I am on SailfishOS, with no X packages), or maybe even fork or something for me?

Thanks

@Canop
Copy link
Owner Author

Canop commented Dec 20, 2021

You should create an issue on the Alacritty project. It's probably a problem for other users too.
In order to solve that issue, you, or another coder but I don't really have the time this week, should probably have a look at where X11 is used. It's maybe for the clipboard, as in broot, or maybe for other uses, I don't know.

@levone1
Copy link

levone1 commented Dec 22, 2021

You should create an issue on the Alacritty project. It's probably a problem for other users too. In order to solve that issue, you, or another coder but I don't really have the time this week, should probably have a look at where X11 is used. It's maybe for the clipboard, as in broot, or maybe for other uses, I don't know.

If you had a minute or two At some point, just wonder your thoughts on this - Smithay/client-toolkit#210

Thanks

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

4 participants