Skip to content

Commit

Permalink
tools/unitctl: Improve quality of life on osx
Browse files Browse the repository at this point in the history
* unit-client-rs Mac build fix
* elaborate in Readme on build requirements
  with examples for Mac users.

Signed-off-by: Ava Hahn <a.hahn@f5.com>
  • Loading branch information
avahahn committed May 3, 2024
1 parent dee8796 commit 449cc08
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
19 changes: 16 additions & 3 deletions tools/unitctl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,23 @@ This project provides a Rust SDK interface to the
and a CLI (`unitctl`) that exposes the functionality provided by the SDK.

## Installation and Use
In order to build and use `unitctl` one needs a working installation of Maven
and Cargo. It is recommended to procure Cargo with Rustup. Rustup is packaged
In order to build and use `unitctl` one needs a working installation of
Cargo. It is recommended to procure Cargo with Rustup. Rustup is packaged
for use in many systems, but you can also find it at its
[Official Site](https://rustup.rs/).
[Official Site](https://rustup.rs/). Additionally, Macintosh users will
need to install GNU core utilities using brew (see the following command)

```
$ brew install make gnu-sed grep gawk maven
```

After installing a modern distribution of Make, Macintosh users can invoke
the makefile commands using `gmake`. For example: `gmake clean` or `gmake all`.

Finally, in order to run the OpenAPI code generation tooling, Users will
need a working
[Java runtime](https://www.java.com/en/download/help/mac_install.html)
as well as Maven. Macintosh users can install Maven from Brew.

With a working installation of Cargo it is advised to build unitctl with the
provided makefile. The `list-targets` target will inform the user of what
Expand Down
11 changes: 5 additions & 6 deletions tools/unitctl/unit-client-rs/src/unitd_process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,11 @@ impl UnitdProcess {
#[cfg(target_os = "linux")]
if pid_is_dockerized(p.0.as_u32().into()) {
false
} else {
let parent_pid = p.1.parent();
match parent_pid {
Some(pid) => !unitd_processes.contains_key(&pid),
None => false,
}
}
let parent_pid = p.1.parent();
match parent_pid {
Some(pid) => !unitd_processes.contains_key(&pid),
None => false,
}
})
.map(|p| {
Expand Down

0 comments on commit 449cc08

Please sign in to comment.