Skip to content

Conversation

@BVRazvan
Copy link

@BVRazvan BVRazvan commented Mar 3, 2025

Add rs-hello directory:

  • Makefile: builds the application
  • Makefile.uk: includes the app's object file
  • Cargo.lock, Cargo.toml, cargo/config.toml, src/main.rs: rust app configuration
  • setup: creates workdir
  • gitignore: ignores generated files

Linked to #26

Signed-off-by: Valentin-Razvan Bogdan <[email protected]>
Signed-off-by: Valentin-Razvan Bogdan <[email protected]>
Signed-off-by: Valentin-Razvan Bogdan <[email protected]>
@StefanJum
Copy link
Member

Hi @BVRazvan, thanks for this. You will need to follow the examples (e.g. nginx), and have the default .cfg files in the directory.
Did you manage to run the application using make menuconfig, make and then qemu? If so, you can just copy the generated config files, if not, then that should be the first step, try to make it run locally for you, then copy the files here.

@StefanJum StefanJum self-requested a review March 13, 2025 10:56
@BVRazvan
Copy link
Author

Yes, I ran the app using the steps you have mentioned. Regarding .cfg files for xen/fc, I didn't think that it would be still the case to add them as long as in the catalog repo it is mentioned that only qemu/x86_64 is supported for now.
I did a new commit just so you can see the .config generated.

@StefanJum
Copy link
Member

Yes, I ran the app using the steps you have mentioned. Regarding .cfg files for xen/fc, I didn't think that it would be still the case to add them as long as in the catalog repo it is mentioned that only qemu/x86_64 is supported for now. I did a new commit just so you can see the .config generated.

It's fine, you can leave the fc/xen files out. Can you please share a list of commands that you are using to build the application? I'm running C=$(pwd)/.config make -j 4 and I get this error:

*** No rule to make target '/projects/unikraft/catalog-core/rs-hello/target/x86_64-unknown-none/debug/deps/rs_hello-822b00486649cf34.o', needed by '/projects/unikraft/catalog-core/rs-hello/workdir/build/apprshello.ld.o'.  Stop.

Where does the filename in the Makefile.uk file comes from?

@BVRazvan
Copy link
Author

Yeah, I forgot to mention the compilation command; this is cargo rustc -- --emit=obj (the file in the Makefile.uk is the .o generated).
Next on, you can use the command you have provided for building the app .
In the end, run the app using qemu; for example:qemu-system-x86_64 -nographic -kernel workdir/build/rs-hello_qemu-x86_64.
These steps will be mentioned in a README file.

@StefanJum
Copy link
Member

Ah, works fine now. Please mention this in the README, and also add it to the build and run scripts when you create them. Thanks.

Signed-off-by: Valentin-Razvan Bogdan <[email protected]>
Signed-off-by: Valentin-Razvan Bogdan <[email protected]>
Signed-off-by: Valentin-Razvan Bogdan <[email protected]>
Signed-off-by: Valentin-Razvan Bogdan <[email protected]>
Copy link
Member

@StefanJum StefanJum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the comment and please squash the commits, there should be only one (signed-off) commit. Looks good besides that.

./setup.sh
make distclean
rustup target add x86_64-unknown-none
cargo +stable rustc -- --emit=obj
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get an error here

error: toolchain 'stable-x86_64-unknown-linux-gnu' is not installed

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, can you paste here your output of rustup show command in cli?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default host: x86_64-unknown-linux-gnu
rustup home:  /home/stefan/.rustup

installed targets for active toolchain
--------------------------------------

x86_64-unknown-linux-gnu
x86_64-unknown-none

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

nightly-x86_64-unknown-linux-gnu (default)
rustc 1.87.0-nightly (aa8f0fd71 2025-03-23)

Copy link
Author

@BVRazvan BVRazvan Mar 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, so you did a custom installation probably, otherwise stable channel is default (I will explicitly mention it in the readme file) .
As a side note, I matched your toolchain (on local as well as on a vanilla ubuntu image) and it seems that the stable channel gets installed automatically, but I won't take it for granted.
I will squash the commits when everything is fine.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @StefanJum. Did you manage to run the app after my last commit?

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

Successfully merging this pull request may close these issues.

2 participants