Setup issues: the crate `panic_unwind` does not have the panic strategy `unwind`

9 views
Skip to first unread message

Marco Seravalli

unread,
Jan 26, 2024, 9:00:52 AMJan 26
to connecti...@fuchsia.dev
Hi,

I am trying to address fxbug.dev/42128029 . I am trying to set up the working environment, but I am running into several issues.

The last issue I am facing is that I can run `cargo check`, but `cargo test` fails due to `error: the crate `panic_unwind` does not have the panic strategy `unwind``

Here are the steps for reproducing: gpaste/4848033395638272
On my system I can reproduce it consistently.

I am not sure how the panic strategy is selected, still trying to figure it out, but I could not find much info in moma nor on the web.

Is this a known issue? Are there any suggestions on how to better investigate this? 

Thanks

Marco

--

Google Germany GmbH

Erika-Mann-Straße 33

80636 München


Geschäftsführer: Paul Manicle, Liana Sebastian

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg


Diese E-Mail ist vertraulich. Falls Sie diese fälschlicherweise erhalten haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter, löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen, dass die E-Mail an die falsche Person gesendet wurde. 

     

This e-mail is confidential. If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person.


Bruno Dal Bo

unread,
Jan 26, 2024, 12:49:53 PMJan 26
to Marco Seravalli, connecti...@fuchsia.dev
You need to set up fargo to use cargo within a Fuchsia checkout

--
All posts must follow the Fuchsia Code of Conduct https://fuchsia.dev/fuchsia-src/CODE_OF_CONDUCT or may be removed.
---
You received this message because you are subscribed to the Google Groups "connectivity-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to connectivity-d...@fuchsia.dev.
To view this discussion on the web visit https://groups.google.com/a/fuchsia.dev/d/msgid/connectivity-dev/CAD7RJtYz6PM8AZvaiLBvEEPo0VffEN1T7uOE4ObfzatuJB1HPA%40mail.gmail.com.


--
Bruno

Bruno Dal Bo

unread,
Jan 26, 2024, 12:49:53 PMJan 26
to Marco Seravalli, connecti...@fuchsia.dev
Sorry immediately noticed I misread your message, `cargo check` works which probably means `fargo` is working correctly.

I've been using `fx test --host netstack3_core_lib_test` to run the tests
--
Bruno

Marco Seravalli

unread,
Jan 29, 2024, 9:39:28 AMJan 29
to Bruno Dal Bo, connecti...@fuchsia.dev
thanks for the quick reply!

I'll try that as well

Marco Seravalli

unread,
Feb 2, 2024, 9:03:47 AMFeb 2
to Bruno Dal Bo, connecti...@fuchsia.dev
Sorry for the late reply, unfortunately, I only have time on Fridays to focus on this.

When I built everything with `fx build` and then ran `fx test --host netstack3_core_lib_test` it seems it finally worked.

Anyway I also tried to have cargo/fargo working but there are still issues. I tried on 2 machines and I still have problems on both: consistently `cargo check` works while `cargo test` fails with  `panic_unwind` does not have the panic strategy `unwind``.
Similarly `fx fargo check` works but `fx cargo test` fails now due to a different error (missing rust-lld), I tried to manually add the rust-lld to the prebuilt toolchain but then there are additional issues with compression "is compressed with ELFCOMPRESS_ZSTD, but lld is not built with zstd support", I didn't start going in the rabbit hole checking how prebuild is populated.

Another question, is `fx set minimal.x64` correct for the netstack? I used that because it seemed that core is deprecated (https://fuchsia.dev/fuchsia-src/contribute/governance/rfcs/0220_the_future_of_in_tree_products).

Should I also open some bugs about this? Is there a component that I should use? Also to indirectly document this for now and maybe someone will have some time in the future to dig more about this.

Thank you,

Marco

Charles Celerier

unread,
Feb 2, 2024, 10:36:22 AMFeb 2
to Marco Seravalli, Bruno Dal Bo, connecti...@fuchsia.dev
I don't know if this helps, but I was recently looking into Rust's panic strategies for another project.

The two options are abort and unwind. And I believe Fuchsia uses the abort strategy everywhere by default. See //build/config/rust/BUILD.gn and //build/config/BUILDCONFIG.gn.


Charles Celerier

Software Engineer

Fuchsia WLAN Core



Peter Johnston

unread,
Feb 2, 2024, 12:58:00 PMFeb 2
to Charles Celerier, Marco Seravalli, Bruno Dal Bo, connecti...@fuchsia.dev

Another question, is `fx set minimal.x64` correct for the netstack? I used that because it seemed that core is deprecated (https://fuchsia.dev/fuchsia-src/contribute/governance/rfcs/0220_the_future_of_in_tree_products).


Just to address the question of which product to use—yes, minimal.x64 should work fine. Note that this configuration will use Netstack2 as the system netstack, but since our unit and integration tests are hermetic, they package the netstack under test with the test itself, so you can run Netstack3 tests regardless of whether the system itself is running Netstack2 or Netstack3.

If you would like to use Netstack3 as the system stack, you could use core_with_netstack3.x64.

Marco Seravalli

unread,
Feb 6, 2024, 5:33:34 AMFeb 6
to Bruno Dal Bo, Peter Johnston, Charles Celerier, connecti...@fuchsia.dev
Thanks for the replies!

I quickly tried yesterday to `cargo test --target x86_64-unknown-linux-gnu` and it seems it worked.
I'll try to update the docs.

Best,

Marco

On Fri, Feb 2, 2024 at 7:01 PM Bruno Dal Bo <bruno...@google.com> wrote:
Hey Marco

So the "cargo" workflow is not really officially supported by the rust on fuchsia team, and it's kept around by volunteers that want tighter build loops when iterating locally during development. The sanctioned way is "fx build" and "fx test".

We do have some team-specific documentation here that you're welcome to amend.

We had a discussion last week after your e-mail and I forgot to loop back. In the condition where you're getting the linker error, if you run `cargo test --target x86_64-unknown-linux-gnu` (the linker error afaiu is because it's trying to build and run for Fuchsia) you'll run the netstack3-core tests on host with cargo.

If you have trouble with it still the recommendation (and honestly what I do day to day) is to use `cargo check` to compile fast and `fx test` to build and run. The following Environment variables make building a little bit faster:

FUCHSIA_DISABLED_incremental=0
NINJA_PERSISTENT_MODE=1

Hope that helps.


--
Bruno

Bruno Dal Bo

unread,
Feb 6, 2024, 5:33:34 AMFeb 6
to Peter Johnston, Charles Celerier, Marco Seravalli, connecti...@fuchsia.dev
Hey Marco

So the "cargo" workflow is not really officially supported by the rust on fuchsia team, and it's kept around by volunteers that want tighter build loops when iterating locally during development. The sanctioned way is "fx build" and "fx test".

We do have some team-specific documentation here that you're welcome to amend.

We had a discussion last week after your e-mail and I forgot to loop back. In the condition where you're getting the linker error, if you run `cargo test --target x86_64-unknown-linux-gnu` (the linker error afaiu is because it's trying to build and run for Fuchsia) you'll run the netstack3-core tests on host with cargo.

If you have trouble with it still the recommendation (and honestly what I do day to day) is to use `cargo check` to compile fast and `fx test` to build and run. The following Environment variables make building a little bit faster:

FUCHSIA_DISABLED_incremental=0
NINJA_PERSISTENT_MODE=1

Hope that helps.



On Fri, Feb 2, 2024 at 9:19 AM Peter Johnston <peterj...@google.com> wrote:


--
Bruno
Reply all
Reply to author
Forward
0 new messages