Trouble with setting up Netstack3 development environment

46 views
Skip to first unread message

Yosuke Matsuda

unread,
Feb 28, 2021, 8:04:54 PM2/28/21
to connectivity-dev
Dear team,

I'm interested in contributing to Netstack3 but I got stuck in setting up the development environment.

I executed `fx build //src/connectivity/network/netstack3/core:netstack3-core` with reference to this doc but following error occurred.

```
$ fx set core.x64 --with //src/connectivity/network/netstack3:bin
Generating compile_commands took 209ms
Generating rust-project.json took 106ms
Done. Made 111419 targets from 4825 files in 8584ms

$ fx build //src/connectivity/network/netstack3/core:netstack3-core
ninja: Entering directory `/home/ymatsuda/development/src/fuchsia/out/default'
ninja: error: unknown target '/src/connectivity/network/netstack3/core:netstack3-core', did you mean 'src/connectivity/network/netstack3/core:netstack3-core'?
Hint: run `fx build` with the option `--log LOGFILE` to generate a debug log if you are reporting a bug.
```

I used `src/connectivity/network/netstack3/core:netstack3-core` instead of `//src/connectivity/network/netstack3/core:netstack3-core` as suggested, it seemed to work.
But then, `fx gen-cargo` failed.

```
$ fx build src/connectivity/network/netstack3/core:netstack3-core
Generating compile_commands took 216ms
Generating rust-project.json took 109ms
Done. Made 111419 targets from 4825 files in 9376ms
ninja: Entering directory `/home/ymatsuda/development/src/fuchsia/out/default'
[1931/1931] RUST obj/src/connectivity/network/netstack3/core/libnetstack3_core.rlib

$ fx gen-cargo //src/connectivity/network/netstack3/core:netstack3-core
Could not find a Cargo.toml file at '/home/ymatsuda/development/src/fuchsia/out/default/cargo/60942068d119e3a01dbd549664aa79da89032fc0/Cargo.toml'

Is '//src/connectivity/network/netstack3/core:netstack3-core' an existing Rust target?
If so, make sure it is included in your build configuration and that you have run 'fx build'.

$ fx gen-cargo src/connectivity/network/netstack3/core:netstack3-core
Could not find a Cargo.toml file at '/home/ymatsuda/development/src/fuchsia/out/default/cargo/60942068d119e3a01dbd549664aa79da89032fc0/Cargo.toml'

Is '//src/connectivity/network/netstack3/core:netstack3-core' an existing Rust target?
If so, make sure it is included in your build configuration and that you have run 'fx build'.
```

out/default/cargo directory seemed to be missing.

```
$ ls -la /home/ymatsuda/development/src/fuchsia/out/default/ | grep cargo
$
```

My environment:

```
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.2 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.2 LTS"
VERSION_ID="20.04"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
$ printenv | grep FUCHSIA
FUCHSIA_DIR=/home/ymatsuda/development/src/fuchsia
```

Is there something wrong with the settings?
Sorry to ask something so elementary.

Thank you for your help.
ymatsuda

Bruno Dal Bo

unread,
Mar 1, 2021, 11:44:23 AM3/1/21
to Yosuke Matsuda, connectivity-dev
Hello,

Thank you for reaching out! I've filed fxbug.dev/71180 to track updating the docs there.
I believe what you're missing is `--cargo-toml-gen` in your `fx set` line. That should hopefully get you across the `fx gen-cargo` part.

Cheers,
Bruno

--
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/15cb7dea-1365-42c2-9ac7-97c5a0b7f0e4n%40fuchsia.dev.


--
Bruno

Y Matsuda

unread,
Mar 1, 2021, 6:46:32 PM3/1/21
to connectivity-dev, Bruno Dal Bo, connectivity-dev, Yosuke Matsuda
Thank you for your reply.
The fixed instructions work fine!

I appreciate your support,
ymatsuda

2021年3月2日火曜日 1:44:23 UTC+9 Bruno Dal Bo:
Reply all
Reply to author
Forward
0 new messages