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

[Bug]: cdk doesn't compile on on non musl target #4140

Closed
sehz opened this issue Aug 16, 2024 · 3 comments
Closed

[Bug]: cdk doesn't compile on on non musl target #4140

sehz opened this issue Aug 16, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@sehz
Copy link
Contributor

sehz commented Aug 16, 2024

What happened
cdk build doesn't work without musl target installed

Expected behavior
cdk build should work on all supported platform

Describe the setup

$> fluvio version
 Fluvio CLI                     : 0.11.11                                                          
 Fluvio CLI Arch                : aarch64-unknown-linux-musl                                       
 Fluvio CLI SHA256              : fb8267e3ba8762d2942a26e5c5e9ef79701789c6f31c294b0349e3455e5cf868 
 Fluvio Channel Frontend SHA256 : fb8267e3ba8762d2942a26e5c5e9ef79701789c6f31c294b0349e3455e5cf868 
 Fluvio Platform                : Not available (local)                                            
 Git Commit                     : 98cfc21314c93d4c2898edc9e2160f280622be21                         
 OS Details                     : Ubuntu 22.10 (kernel 6.9.8-orbstack-00170-g7b4100b7ced4)         
$> uname -a
Linux ubuntu 6.9.8-orbstack-00170-g7b4100b7ced4 #1 SMP Thu Jul 11 03:32:20 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux

How to reproduce it (as minimally and precisely as possible)
Steps to reproduce the behavior:

  1. Make sure to use linux.
  2. Install Rust without musl target
  3. Follow https://nightly.fluvio.io/docs/latest/connectors/developers/generate
  4. cdk build

Log output


error[E0463]: can't find crate for `core`
   --> /home/sehyo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bitflags-2.6.0/src/lib.rs:259:13
    |
259 |     pub use core;
    |             ^^^^ can't find crate
    |
    = note: the `aarch64-unknown-linux-musl` target may not be installed
    = help: consider downloading the target with `rustup target add aarch64-unknown-linux-musl`

Environment (please complete the following information):

  • OS: [Linux]
  • Fluvio Version [0.11.11]
@sehz sehz added the bug Something isn't working label Aug 16, 2024
@sehz sehz changed the title [Bug]: cdk doesn't compile on on musl target [Bug]: cdk doesn't compile on on non musl target Aug 16, 2024
@digikata
Copy link
Contributor

digikata commented Aug 19, 2024

This Dockerfile can reproduce a similar error for cdk on Ubuntu, trying to build to an x86-unknown-linux-musl target.

Dockerfile.txt

In a directory:
Rename Dockerfile.txt -> Dockerfile
Build the image: docker build -t my-ubuntu .
Run the image: docker run --rm -it my-ubuntu

In the image:

cdk generate testproj
cd testproj
cdk build  # -> link error with musl build

# workaround for local connector development
cdk build --target x86-unknown-linux-gnu

Note: We may need to move this to an associated issue as this is for x86-unknown-linux-gnu system.

The workardound (provided by @nacardin) is:

CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=x86_64-linux-musl-gcc cdk build

We will provide more complete instructions for the Ubuntu environment

@sehz
Copy link
Contributor Author

sehz commented Aug 24, 2024

From Safe:

zig gust builds and links all without any questions

@digikata digikata self-assigned this Sep 3, 2024
@digikata
Copy link
Contributor

Native builds fix w/ this PR #4168

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
Status: Done
Development

No branches or pull requests

2 participants