Giter Site home page Giter Site logo

Comments (28)

cardoe avatar cardoe commented on June 15, 2024

In theory yes, in practice I'm not sure if anyone has actually tested that.

from meta-rust.

tekjar avatar tekjar commented on June 15, 2024

I'll test that. All I've to do is include rustc and cargo to image bb file right?

from meta-rust.

cardoe avatar cardoe commented on June 15, 2024

Should be

from meta-rust.

cardoe avatar cardoe commented on June 15, 2024

@kteza1 I'm assuming this has not worked for you? I just did bitbake rust-llvm and it failed to build for me.

from meta-rust.

tekjar avatar tekjar commented on June 15, 2024

@cardoe Oops sorry for not getting back. I tried this some time back and it failed I think. I'll report back if I try this again.

from meta-rust.

codyps avatar codyps commented on June 15, 2024

I've tried to do this too with the experiment in merging the rust-llvm build into rust. IIRC, it failed there too due to llvm not recognizing the target it was being built for. llvm's build likely needs to be passed an llvm-flavor target instead of a OE target.

from meta-rust.

cardoe avatar cardoe commented on June 15, 2024

So in my branch to build rust-llvm with cmake I've managed to get it compiled for the target. I haven't tried to build rust with it yet. But figured I'd provide an update.

from meta-rust.

cardoe avatar cardoe commented on June 15, 2024

While #105 fixes rust-llvm it does not fix rust which still fails with the following:

-isystem/var/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -D_GLIBCXX_USE_CXX11_ABI=0  --sysroot=/var/build/build/tmp/sysroots/qemux86-64  -I /var/build/build/tmp/sysroots/x86_64-linux/usr/include -I /var/build/build/tmp/work/core2-64-poky-linux/rust/1.10.0-r0/rustc-1.10.0/src/rustllvm/include /var/build/build/tmp/work/core2-64-poky-linux/rust/1.10.0-r0/rustc-1.10.0/src/rustllvm/RustWrapper.cpp
In file included from /var/build/build/tmp/sysroots/x86_64-linux/usr/include/llvm/ADT/Hashing.h:48:0,
                 from /var/build/build/tmp/sysroots/x86_64-linux/usr/include/llvm/ADT/ArrayRef.h:13,
                 from /var/build/build/tmp/sysroots/x86_64-linux/usr/include/llvm/IR/IRBuilder.h:18,
                 from /var/build/build/tmp/work/core2-64-poky-linux/rust/1.10.0-r0/rustc-1.10.0/src/rustllvm/rustllvm.h:11,
                 from /var/build/build/tmp/work/core2-64-poky-linux/rust/1.10.0-r0/rustc-1.10.0/src/rustllvm/ExecutionEngineWrapper.cpp:11:
/var/build/build/tmp/sysroots/x86_64-linux/usr/include/llvm/Support/DataTypes.h:35:17: fatal error: cmath: No such file or directory
 #include <cmath>

from meta-rust.

cardoe avatar cardoe commented on June 15, 2024

Guessing we're missing libstdc++-dev in DEPEND but adding that doesn't work. Unfortunately I don't have the error message anymore but it says something about gcc-runtime RPROVIDES libstdc++ and it can't be directly depended on. I'm guessing I just have something wrong. If someone that's a bit more knowledgable about Yocto has some ideas I bet we can fix it.

from meta-rust.

srwalter avatar srwalter commented on June 15, 2024

If this is a build failure, then you'd need to DEPEND on gcc-runtime, rather RDEPEND, right?

from meta-rust.

cardoe avatar cardoe commented on June 15, 2024

I do not believe anyone is working on this but we would certainly accept patches for this support.

from meta-rust.

macpijan avatar macpijan commented on June 15, 2024

Currently (I am on 0621067 commit), the error message is:

Sstate summary: Wanted 5 Found 0 Missed 5 Current 92 (0% match, 94% complete)                                                                                                                                        
NOTE: Executing SetScene Tasks                                                                                                                                                                                       
NOTE: Executing RunQueue Tasks                                                                                                                                                                                       
ERROR: rust-1.33.0-r0 do_compile: Function failed: do_compile (log file is located at /work/build/tmp/work/aarch64-poky-linux/rust/1.33.0-r0/temp/log.do_compile.224)
ERROR: Logfile of failure stored in: /work/build/tmp/work/aarch64-poky-linux/rust/1.33.0-r0/temp/log.do_compile.224
Log data follows:                                    
| DEBUG: Executing shell function do_compile                                                                                                                                                                         
| COMPILE rust build                      
| running: /work/build/tmp/work/aarch64-poky-linux/rust/1.33.0-r0/rust-snapshot/bin/cargo build --manifest-path /work/build/tmp/work/aarch64-poky-linux/rust/1.33.0-r0/rustc-1.33.0-src/src/bootstrap/Cargo.toml --f$
ozen
|     Finished dev [unoptimized] target(s) in 7.95s
| running: /work/build/tmp/work/aarch64-poky-linux/rust/1.33.0-r0/rustc-1.33.0-src/build/bootstrap/debug/bootstrap build --verbose
|                                    
|                                 
| failed to execute command: "/work/build/tmp/work/aarch64-poky-linux/rust/1.33.0-r0/recipe-sysroot/usr/lib/llvm-rust/bin/llvm-config" "--bindir"
| error: No such file or directory (os error 2)
|                                
|                             
| Traceback (most recent call last):
|   File "src/bootstrap/bootstrap.py", line 860, in <module>
|     main()                                                                    
|   File "src/bootstrap/bootstrap.py", line 843, in main                
|     bootstrap(help_triggered)                                          
|   File "src/bootstrap/bootstrap.py", line 829, in bootstrap          
|     run(args, env=env, verbose=build.verbose)
|   File "src/bootstrap/bootstrap.py", line 141, in run
|     raise RuntimeError(err)                                         
| RuntimeError: failed to run: /work/build/tmp/work/aarch64-poky-linux/rust/1.33.0-r0/rustc-1.33.0-src/build/bootstrap/debug/bootstrap build --verbose
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /work/build/tmp/work/aarch64-poky-linux/rust/1.33.0-r0/temp/log.do_compile.224)
ERROR: Task (/work/meta-rust/recipes-devtools/rust/rust_1.33.0.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 596 tasks of which 595 didn't need to be rerun and 1 failed.

I am going to spend a while figuring this out

from meta-rust.

david-mcgillicuddy-moixa avatar david-mcgillicuddy-moixa commented on June 15, 2024

Hi @macpijan did you ever figure this out? I'm getting exactly this error when trying to run the build on an AWS codebuild server.

from meta-rust.

macpijan avatar macpijan commented on June 15, 2024

@david-mcgillicuddy-moixa Sadly no, I had to finish that project and shipped prebuild rustc compiler on the target. I hope to get back to rust and maybe have some more time to work on that next time.

from meta-rust.

david-mcgillicuddy-moixa avatar david-mcgillicuddy-moixa commented on June 15, 2024

My case might just have been an OOM actually, trying again with more seemed to work.

from meta-rust.

macpijan avatar macpijan commented on June 15, 2024

Interesting. Are you building the rustc compiler to be installed on the target board, or something else? What is the target arch?

from meta-rust.

david-mcgillicuddy-moixa avatar david-mcgillicuddy-moixa commented on June 15, 2024

I didn't set the build up, but it's:

BUILD_SYS = "x86_64-linux" 
TARGET_SYS = "arm-oe-linux-gnueabi" 

Precompiled rustc binaries would probably work for our use case too - they are not installed on the target board, only the artifact image.

from meta-rust.

wdehoog avatar wdehoog commented on June 15, 2024

I tried to build cargo for arm target and got:

error[E0463]: can't find crate for `proc_macro`
  --> /usr/src/debug/cargo/1.37.0-r0/rustc-1.37.0-src/vendor/proc-macro2/src/lib.rs:87:1
   |
87 | extern crate proc_macro;
   | ^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate

from meta-rust.

SrijanNandi avatar SrijanNandi commented on June 15, 2024

Same issue building rust-1.46.0-r0 on x86_64 for a x86_64 target.

| Compiling bootstrap v0.0.0 (/opt/grays-poky-dunfell/build-grays-dunfell/tmp/work/core2-64-poky-linux/rust/1.46.0-r0/rustc-1.46.0-src/src/bootstrap)
| Finished dev [unoptimized + debuginfo] target(s) in 1m 05s
| running: /opt/grays-poky-dunfell/build-grays-dunfell/tmp/work/core2-64-poky-linux/rust/1.46.0-r0/rustc-1.46.0-src/build/bootstrap/debug/bootstrap -j 10 build --verbose
|
|
| failed to execute command: "/opt/grays-poky-dunfell/build-grays-dunfell/tmp/work/core2-64-poky-linux/rust/1.46.0-r0/recipe-sysroot/usr/lib/llvm-rust/bin/llvm-config" "--bindir"
| error: No such file or directory (os error 2)
|
|
| Traceback (most recent call last):
| File "src/bootstrap/bootstrap.py", line 998, in
| main()
| File "src/bootstrap/bootstrap.py", line 981, in main
| bootstrap(help_triggered)
| File "src/bootstrap/bootstrap.py", line 967, in bootstrap
| run(args, env=env, verbose=build.verbose)
| File "src/bootstrap/bootstrap.py", line 143, in run
| raise RuntimeError(err)
| RuntimeError: failed to run: /opt/grays-poky-dunfell/build-grays-dunfell/tmp/work/core2-64-poky-linux/rust/1.46.0-r0/rustc-1.46.0-src/build/bootstrap/debug/bootstrap -j 10 build --verbose
| WARNING: exit code 1 from a shell command.
|
ERROR: Task (/opt/grays-poky-dunfell/meta-rust/recipes-devtools/rust/rust_1.46.0.bb:do_compile) failed with exit code '1'

from meta-rust.

SrijanNandi avatar SrijanNandi commented on June 15, 2024

Same issue building rust-1.49.0-r0 on x86_64 for a x86_64 target.

Log data follows:
| DEBUG: Executing shell function do_compile
| COMPILE rust build --stage 2
| running: /opt/grays-poky-dunfell/build-grays-dunfell/tmp/work/core2-64-poky-linux/rust/1.49.0-r0/rust-snapshot/bin/cargo build --manifest-path /opt/grays-poky-dunfell/build-grays-dunfell/tmp/work/core2-64-poky-linux/rust/1.49.0-r0/rustc-1.49.0-src/src/bootstrap/Cargo.toml --frozen
| Finished dev [unoptimized + debuginfo] target(s) in 0.34s
| running: /opt/grays-poky-dunfell/build-grays-dunfell/tmp/work/core2-64-poky-linux/rust/1.49.0-r0/rustc-1.49.0-src/build/bootstrap/debug/bootstrap -j 10 build --stage 2 --verbose
| finding compilers
| CC_x86_64-unknown-linux-gnu = "/opt/grays-poky-dunfell/build-grays-dunfell/tmp/work/core2-64-poky-linux/rust/1.49.0-r0/wrapper/build-rust-cc"
| CFLAGS_x86_64-unknown-linux-gnu = ["-ffunction-sections", "-fdata-sections", "-fPIC", "-m64", "-isystem/opt/grays-poky-dunfell/build-grays-dunfell/tmp/work/core2-64-poky-linux/rust/1.49.0-r0/recipe-sysroot-native/usr/include", "-pipe"]
| CXX_x86_64-unknown-linux-gnu = "/opt/grays-poky-dunfell/build-grays-dunfell/tmp/work/core2-64-poky-linux/rust/1.49.0-r0/wrapper/build-rust-cxx"
| CXXFLAGS_x86_64-unknown-linux-gnu = ["-ffunction-sections", "-fdata-sections", "-fPIC", "-m64", "-isystem/opt/grays-poky-dunfell/build-grays-dunfell/tmp/work/core2-64-poky-linux/rust/1.49.0-r0/recipe-sysroot-native/usr/include", "-pipe"]
| AR_x86_64-unknown-linux-gnu = "x86_64-poky-linux-gcc-ar"
| CC_x86_64-poky-linux = "/opt/grays-poky-dunfell/build-grays-dunfell/tmp/work/core2-64-poky-linux/rust/1.49.0-r0/wrapper/target-rust-cc"
| CFLAGS_x86_64-poky-linux = ["-ffunction-sections", "-fdata-sections", "-fPIC", "-m64", "-pipe", "-g", "-feliminate-unused-debug-types", "-fmacro-prefix-map=/opt/grays-poky-dunfell/build-grays-dunfell/tmp/work/core2-64-poky-linux/rust/1.49.0-r0=/usr/src/debug/rust/1.49.0-r0", "-fdebug-prefix-map=/opt/grays-poky-dunfell/build-grays-dunfell/tmp/work/core2-64-poky-linux/rust/1.49.0-r0=/usr/src/debug/rust/1.49.0-r0", "-fdebug-prefix-map=/opt/grays-poky-dunfell/build-grays-dunfell/tmp/work/core2-64-poky-linux/rust/1.49.0-r0/recipe-sysroot=", "-fdebug-prefix-map=/opt/grays-poky-dunfell/build-grays-dunfell/tmp/work/core2-64-poky-linux/rust/1.49.0-r0/recipe-sysroot-native="]
| CXX_x86_64-poky-linux = "/opt/grays-poky-dunfell/build-grays-dunfell/tmp/work/core2-64-poky-linux/rust/1.49.0-r0/wrapper/target-rust-cxx"
| CXXFLAGS_x86_64-poky-linux = ["-ffunction-sections", "-fdata-sections", "-fPIC", "-m64", "-pipe", "-g", "-feliminate-unused-debug-types", "-fmacro-prefix-map=/opt/grays-poky-dunfell/build-grays-dunfell/tmp/work/core2-64-poky-linux/rust/1.49.0-r0=/usr/src/debug/rust/1.49.0-r0", "-fdebug-prefix-map=/opt/grays-poky-dunfell/build-grays-dunfell/tmp/work/core2-64-poky-linux/rust/1.49.0-r0=/usr/src/debug/rust/1.49.0-r0", "-fdebug-prefix-map=/opt/grays-poky-dunfell/build-grays-dunfell/tmp/work/core2-64-poky-linux/rust/1.49.0-r0/recipe-sysroot=", "-fdebug-prefix-map=/opt/grays-poky-dunfell/build-grays-dunfell/tmp/work/core2-64-poky-linux/rust/1.49.0-r0/recipe-sysroot-native="]
| AR_x86_64-poky-linux = "x86_64-poky-linux-gcc-ar"
| running sanity check
|
|
| failed to execute command: "/opt/grays-poky-dunfell/build-grays-dunfell/tmp/work/core2-64-poky-linux/rust/1.49.0-r0/recipe-sysroot/usr/lib/llvm-rust/bin/llvm-config" "--bindir"
| error: No such file or directory (os error 2)
|
|
| Traceback (most recent call last):
| File "src/bootstrap/bootstrap.py", line 1099, in
| main()
| File "src/bootstrap/bootstrap.py", line 1082, in main
| bootstrap(help_triggered)
| File "src/bootstrap/bootstrap.py", line 1068, in bootstrap
| run(args, env=env, verbose=build.verbose)
| File "src/bootstrap/bootstrap.py", line 153, in run
| raise RuntimeError(err)
| RuntimeError: failed to run: /opt/grays-poky-dunfell/build-grays-dunfell/tmp/work/core2-64-poky-linux/rust/1.49.0-r0/rustc-1.49.0-src/build/bootstrap/debug/bootstrap -j 10 build --stage 2 --verbose
| WARNING: exit code 1 from a shell command.
| ERROR: Execution of '/opt/grays-poky-dunfell/build-grays-dunfell/tmp/work/core2-64-poky-linux/rust/1.49.0-r0/temp/run.do_compile.2593' failed with exit code 1:

from meta-rust.

kraj avatar kraj commented on June 15, 2024

this is known limitation

from meta-rust.

SrijanNandi avatar SrijanNandi commented on June 15, 2024

Any workaround to get rust working on x86_64

from meta-rust.

ramumr06 avatar ramumr06 commented on June 15, 2024

Any workaround to get rust working on x86_64

Hi SrijanNandi,
I am getting llvm-rust/bin/llvm-config" "--bindir" | error: No such file or directory (os error 2).
Host System : x86-64
Target : ARM
Do you know any work around for this ??

from meta-rust.

ramumr06 avatar ramumr06 commented on June 15, 2024

Currently (I am on 0621067 commit), the error message is:

Sstate summary: Wanted 5 Found 0 Missed 5 Current 92 (0% match, 94% complete)                                                                                                                                        
NOTE: Executing SetScene Tasks                                                                                                                                                                                       
NOTE: Executing RunQueue Tasks                                                                                                                                                                                       
ERROR: rust-1.33.0-r0 do_compile: Function failed: do_compile (log file is located at /work/build/tmp/work/aarch64-poky-linux/rust/1.33.0-r0/temp/log.do_compile.224)
ERROR: Logfile of failure stored in: /work/build/tmp/work/aarch64-poky-linux/rust/1.33.0-r0/temp/log.do_compile.224
Log data follows:                                    
| DEBUG: Executing shell function do_compile                                                                                                                                                                         
| COMPILE rust build                      
| running: /work/build/tmp/work/aarch64-poky-linux/rust/1.33.0-r0/rust-snapshot/bin/cargo build --manifest-path /work/build/tmp/work/aarch64-poky-linux/rust/1.33.0-r0/rustc-1.33.0-src/src/bootstrap/Cargo.toml --f$
ozen
|     Finished dev [unoptimized] target(s) in 7.95s
| running: /work/build/tmp/work/aarch64-poky-linux/rust/1.33.0-r0/rustc-1.33.0-src/build/bootstrap/debug/bootstrap build --verbose
|                                    
|                                 
| failed to execute command: "/work/build/tmp/work/aarch64-poky-linux/rust/1.33.0-r0/recipe-sysroot/usr/lib/llvm-rust/bin/llvm-config" "--bindir"
| error: No such file or directory (os error 2)
|                                
|                             
| Traceback (most recent call last):
|   File "src/bootstrap/bootstrap.py", line 860, in <module>
|     main()                                                                    
|   File "src/bootstrap/bootstrap.py", line 843, in main                
|     bootstrap(help_triggered)                                          
|   File "src/bootstrap/bootstrap.py", line 829, in bootstrap          
|     run(args, env=env, verbose=build.verbose)
|   File "src/bootstrap/bootstrap.py", line 141, in run
|     raise RuntimeError(err)                                         
| RuntimeError: failed to run: /work/build/tmp/work/aarch64-poky-linux/rust/1.33.0-r0/rustc-1.33.0-src/build/bootstrap/debug/bootstrap build --verbose
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /work/build/tmp/work/aarch64-poky-linux/rust/1.33.0-r0/temp/log.do_compile.224)
ERROR: Task (/work/meta-rust/recipes-devtools/rust/rust_1.33.0.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 596 tasks of which 595 didn't need to be rerun and 1 failed.

I am going to spend a while figuring this out

Hi macpijan
I am getting llvm-rust/bin/llvm-config" "--bindir" | error: No such file or directory (os error 2).
Host System : x86-64
Target : ARM
Do you know any work around for this ??

from meta-rust.

rwmacleod avatar rwmacleod commented on June 15, 2024

It's possible using oe-core/langdale or oe-core/master. I haven't tried it yet, have you? If so and it works well for you then please consider closing this bug. I'm hoping to get to that this weekend.

from meta-rust.

rwmacleod avatar rwmacleod commented on June 15, 2024

cargo doesn't build for the target https://bugzilla.yoctoproject.org/show_bug.cgi?id=14975

Rust does build but fails for me with:

root@qemux86-64:~# cat /tmp/hw.rs
fn main() {
    println!("Hello, world!")
}

root@qemux86-64:~# rustc /tmp/hw.rs
error: Error loading target specification: Could not find specification for target "x86_64-poky-linux-gnu". Run `rustc --print target-list` for a list of built-in targets

root@qemux86-64:~# rustc --print target-list
error: Error loading target specification: Could not find specification for target "x86_64-poky-linux-gnu". Run `rustc --print target-list` for a list of built-in targets

from meta-rust.

rwmacleod avatar rwmacleod commented on June 15, 2024

If you manually copy
tmp/work/core2-64-poky-linux/rust/1.65.0-r0/rustc-1.65.0-src/src/test/run-make-fulldeps/rustdoc-target-spec-json-path/target.json
to:
/usr/lib/rustlib/x86_64-poky-linux-gnu/target.json
and have this in your local.conf:
IMAGE_INSTALL:append = " rust packagegroup-core-buildessential"

it works. Patch coming for master and langdale soon.

from meta-rust.

rwmacleod avatar rwmacleod commented on June 15, 2024

Yes, fixed in oe-core/master:
https://git.openembedded.org/openembedded-core/commit/?id=b187185ceecf1c852b1fdc47451d157a41962d69
Please try that out and close this issue.

from meta-rust.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.