Skip to content

Commit dc41616

Browse files
Merge pull request #156 from andrewdavidmackenzie/dependabot/cargo/bindgen-0.71.1
2 parents d0c6769 + 373a0e5 commit dc41616

File tree

4 files changed

+38
-14
lines changed

4 files changed

+38
-14
lines changed

.github/workflows/clippy_build_test.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
strategy:
2626
matrix:
2727
os: [ ubuntu-latest, macos-13, macos-14, macos-15 ]
28-
rust: [ stable, beta, 1.72.0 ] # Minimum Rust Version Supported = 1.72.0
28+
rust: [ stable, beta, 1.82.0 ] # Minimum Rust Version Supported = 1.82.0
2929
experimental: [ false ]
3030
include:
3131
- os: ubuntu-latest
@@ -34,6 +34,9 @@ jobs:
3434
- os: macos-13
3535
rust: nightly
3636
experimental: true
37+
- os: macos-13
38+
rust: 1.82.0
39+
experimental: true
3740
- os: macos-14
3841
rust: nightly
3942
experimental: true

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ documentation = "https://docs.rs/libproc/latest/libproc"
88
readme = "README.md"
99
license = "MIT"
1010
edition = "2018"
11-
rust-version = "1.72"
11+
rust-version = "1.82"
1212

1313
[dependencies]
1414
errno = "0.3.0"
@@ -19,7 +19,7 @@ name = "libproc"
1919
path = "src/lib.rs"
2020

2121
[build-dependencies]
22-
bindgen = { version = "0.70.0", default-features = false, features = ["runtime"] }
22+
bindgen = { version = "0.71.1", default-features = false, features = ["runtime"] }
2323

2424
# NOTE: This assumes that there is a procfs compatible FS in redox and the procfs crate
2525
# supports it. It's quite probably that neither of those two things ever happen.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
RUST_MIN_VERSION := 1.72.0
1+
RUST_MIN_VERSION := 1.82.0
22
ACT := $(shell command -v act 2> /dev/null)
33
UNAME := $(shell uname -s)
44

README.md

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,23 @@
22
[![codecov](https://codecov.io/gh/andrewdavidmackenzie/libproc-rs/branch/master/graph/badge.svg)](https://codecov.io/gh/andrewdavidmackenzie/libproc-rs)
33

44
# libproc-rs
5+
56
This is a library for getting information about running processes for Mac OS X and Linux.
67

78
Add it to your project's `Cargo.toml`:
9+
810
```toml
911
libproc = "0.14.4"
1012
```
1113

1214
And then use it in your code:
15+
1316
```rust
1417
use libproc::libproc::proc_pid;
1518

1619
match proc_pid::pidpath(pid) {
17-
Ok(path) => println!("PID {}: has path {}", pid, path),
18-
Err(err) => writeln!(&mut std::io::stderr(), "Error: {}", err).unwrap()
20+
Ok(path) => println ! ("PID {}: has path {}", pid, path),
21+
Err(err) => writeln ! ( & mut std::io::stderr(), "Error: {}", err).unwrap()
1922
}
2023
```
2124

@@ -26,61 +29,74 @@ You can find the browseable docs for the latest release on [docs.rs](https://doc
2629
NOTE: `master` branch (code and docs) can differ from those docs prior to a new release.
2730

2831
# Minimum rust version
32+
2933
The minimum rust version required, by version:
30-
* libproc-rs: 0.14.6 --> 1.74.1
34+
35+
* libproc-rs: 0.14.6 --> 1.74.1
3136
* libproc-rs: 0.14.7 --> 1.72.0
37+
* libproc-rs: 0.14.10 --> 1.82.0
3238

3339
This is tested in CI and must pass.
3440

3541
# Test Matrix
42+
3643
The Github Actions CI test `libproc-rs` on :
3744

3845
rust versions:
46+
3947
* `stable` (must pass)
4048
* `beta` (must pass)
41-
* `1.72.0` (currently the minimum rust version supported) (must pass)
42-
* `nightly` (allowed to fail)
49+
* `1.82.0` (currently the minimum rust version supported) (must pass)
50+
* `nightly` (allowed to fail)
4351

4452
on the following platforms:
53+
4554
* `ubuntu-latest`
4655
* `macos-12` (Monterey) (Intel)
4756
* `macos-13` (Ventura) (Intel)
4857
* `macos-14` (Sonoma) (Arm64)
4958

5059
# Examples
60+
5161
Two simple examples are included to show libproc-rs working.
5262

5363
- `procinfo` that takes a PID as an optional argument (uses it's own pid if none supplied) and returns
5464
information about the process on stdout
5565
- `dmesg` is a version of dmesg implemented in rust that uses libproc-rs.
5666

5767
These can be ran thus:
58-
`sudo cargo run --example procinfo` or
68+
`sudo cargo run --example procinfo` or
5969
`sudo cargo run --example dmesg`
6070

6171
# Contributing
72+
6273
You are welcome to fork this repo and make a pull request, or write an issue.
6374

6475
## Experiment in OSS funding
65-
I am exploring the ideas around Open Source Software funding from [RadWorks Foundation]([https://radworks.org/) via the [Drips Project](https://www.drips.network/)
76+
77+
I am exploring the ideas around Open Source Software funding from [RadWorks Foundation]([https://radworks.org/) via
78+
the [Drips Project](https://www.drips.network/)
6679

6780
This project is in Drips [here](https://www.drips.network/app/projects/github/andrewdavidmackenzie/libproc-rs)
6881

6982
## Input Requested
83+
7084
* Suggestions for API, module re-org and cross-platform abstractions are welcome.
7185
* How to do error reporting? Define own new Errors, or keep simple with Strings?
7286
* Would like Path/PathBuf returned when it makes sense instead of String?
7387

7488
## TODO
75-
See the [list of issues](https://github.com/andrewdavidmackenzie/libproc-rs/issues).
89+
90+
See the [list of issues](https://github.com/andrewdavidmackenzie/libproc-rs/issues).
7691
I put the "help wanted" label where I need help from others.
77-
92+
7893
- Look at what similar methods could be implemented as a starting poon Linux
7994
- Complete the API on Mac OS X - figuring out all the Mac OS X / Darwin version mess....
8095
- Add more documentation (including samples with documentation test)
8196
- Add own custom error type and implement From::from to ease reporting of multiple error types in clients
8297

8398
## Build and Test Locally
99+
84100
If you're feeling lucky today, start with `make` that will run `clippy`, `test` and will build docs also.
85101

86102
If you want to stay "pure rust" : `cargo test` will build and test as usual.
@@ -96,29 +112,34 @@ In order to have tests pass when run as `root` or not, some tests need to check
96112
at run-time (using our own `am_root()` function is handy) and avoid failing if *not* run as `root`.
97113

98114
### Using `act` to run GH Actions locally
115+
99116
If you develop on macos but want to ensure code builds and tests pass on linux while making changes,
100117
you can use the [act](https://github.com/nektos/act) tool to run the Github Actions Workflows on
101118
the test matrix.
102119

103120
Just install `act` (`brew install act` on macOS) (previously install docker if you don't have it already,
104-
and make sure the daemon is running) then run `act push`. You can test a subset of the rust
121+
and make sure the daemon is running) then run `act push`. You can test a subset of the rust
105122
and os versions of the matrix with something like `act push --matrix os:ubuntu-latest`
106123

107124
## Enter the matrix
125+
108126
If you want to test locally as much of the test matrix as possible (different OS and
109127
versions of rust), that you can use `make matrix`. On macos, if you have `act`
110128
installed, it will use it to run the linux part of the matrix.
111129

112130
### Macos: clang detection and header file finding
131+
113132
Newer versions of `bindgen` have improved the detection of `clang` and hence macos header files.
114133
If you also have llvm/clang installed directly or via `brew` this may cause the build to fail saying it
115134
cannot find `libproc.h`. This can be fixed by setting `CLANG_PATH="/usr/bin/clang"` so that `bindgen`
116135
detects the Xcode version and hence can fidn the correct header files.
117136

118137
# Other docs
138+
119139
* [Reference docs](doc/References.md) used to build and document libproc-rs
120140
* Details on methods available in different [macOS versions](doc/MacosVersions.md)
121141

122142
# LICENSE
143+
123144
This code is licensed under MIT license (see LICENCE).
124145

0 commit comments

Comments
 (0)