Compare commits

...

6 Commits

Author SHA1 Message Date
Scott Boggs 7c09814bba
Merge pull request #106 from vbrandl/fix/openssl-dependency
Disable default features for reqwest
2023-06-16 08:05:00 -04:00
Valentin Brandl 6ecde64fc3
Disable default features for reqwest
Using `reqwest` with default-features enabled will enable the
`default-tls`, which in turn will enable the `native-tls` feautre which
will result in an attempt to compile against OpenSSL [0]. If one wants
to use `mastodon-async` without depending on OpenSSL, the default
features for `reqwest` must be disabled.

The default features for `mastodon-async` will enable
`reqwest/default-tls`, so the default behaviour won't change, but now it
is possible to declare the dependency on `mastodon-async` with default
features disabled and the `rustls-tls` feature enabled, allowing to
compile without a dependency on OpenSSL.

[0]: e02df1f448/Cargo.toml (L30)
2023-06-14 19:00:00 +02:00
D. Scott Boggs a8dcd93bf4 Add shell.nix 2023-06-10 13:32:34 -04:00
D. Scott Boggs b3e3575f84 bump version in cargo.toml 2023-06-10 13:28:00 -04:00
Scott Boggs db6cbdb7fe
Merge pull request #103 from baummarten/fix_entities
Adding an explicit time >= 0.3.16
2023-06-10 13:21:54 -04:00
baummarten 1524895122 entities/Cargo.toml: time >= 0.3.16 2023-06-09 17:38:49 +02:00
4 changed files with 23 additions and 2 deletions

View File

@ -7,7 +7,7 @@ members = [
] ]
[workspace.package] [workspace.package]
version = "1.2.1" version = "1.2.2"
license = "MIT/Apache-2.0" license = "MIT/Apache-2.0"
authors = ["Aaron Power <theaaronepower@gmail.com>", "Paul Woolcock <paul@woolcock.us>", "D. Scott Boggs <scott@tams.tech>"] authors = ["Aaron Power <theaaronepower@gmail.com>", "Paul Woolcock <paul@woolcock.us>", "D. Scott Boggs <scott@tams.tech>"]
edition = "2021" edition = "2021"
@ -75,6 +75,7 @@ features = ["serde"]
[dependencies.reqwest] [dependencies.reqwest]
version = "0.11" version = "0.11"
features = ["multipart", "json", "stream"] features = ["multipart", "json", "stream"]
default-features = false
[dependencies.serde] [dependencies.serde]
version = "1" version = "1"

View File

@ -25,6 +25,14 @@ Alternatively, run the following command:
$ cargo add mastodon-async $ cargo add mastodon-async
~~~ ~~~
### Use Rustls instead of OpenSSL
To use Rustls instead of OpenSSL for HTTPS request, define the dependency as follows
```toml
mastodon-async = { version = "1", default-features = false, features = ["rustls-tls"] }
```
## A Note on Debugging ## A Note on Debugging
This library offers structured logging. To get better information about bugs or This library offers structured logging. To get better information about bugs or
how something is working, I recommend adding the femme crate as a dependency, how something is working, I recommend adding the femme crate as a dependency,

View File

@ -25,7 +25,7 @@ version = "1"
features = ["derive"] features = ["derive"]
[dependencies.time] [dependencies.time]
version = "0.3" version = ">=0.3.16"
features = ["parsing", "serde", "formatting"] features = ["parsing", "serde", "formatting"]
[dev-dependencies] [dev-dependencies]

12
shell.nix Normal file
View File

@ -0,0 +1,12 @@
# nix requires using nix-shell since native-tls requires pkg-config to
# configure openssl
#
# See also:
# https://nixos.wiki/wiki/C#pkg-config
# https://github.com/NixOS/nixpkgs/issues/64530
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "mastodon-async";
nativeBuildInputs = [ pkg-config ];
buildInputs = [ openssl ];
}