Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: MSRV 1.63 #163

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ examples/test*.png
*.ipr
*.iws
.idea/
.DS_Store

# Do not check Visual Studio Code-specific files into source control

*.code-workspace
*.code-workspace
33 changes: 19 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "pdfium-render"
version = "0.8.25"
edition = "2018"
rust-version = "1.60"
rust-version = "1.63"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change breaks the published MSRV for this crate. You need to clearly and persuasively explain why you are doing this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just like the problem encountered by the above image.

publish = true
description = "A high-level idiomatic Rust wrapper around Pdfium, the C++ PDF library used by the Google Chromium project."
readme = "README.md"
Expand All @@ -23,14 +23,14 @@ doctest = false
bitflags = "2"
bytes = "1"
bytemuck = "1"
chrono = "0.4, <= 0.4.31" # To meet crate MSRV target of Rust 1.60.
image = { version = ">= 0.24.0", optional = true } # DynamicImage trait definitions changed between 0.23.14 and 0.24.0; we use trait from version 0.24.0 and later.
chrono = "0.4"
itertools = "0"
log = "0"
maybe-owned = "0"
once_cell = "1"
utf16string = "0"
vecmath = "1"
image = { version = "0.24", default-features = false, optional = true }
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why 0.24 and not >= 0.24? The latter allows for using image 0.25 - does your change? What is the impact of default-features = false here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. 0.24 := >=0.24.0, <0.25.0

  2. image 0.24 requires msrv 1.63, image 0.25 requires msrv 1.67.1

$ cargo msrv
Fetching index
Determining the Minimum Supported Rust Version (MSRV) for toolchain aarch64-apple-darwin
Using check command cargo check

Check for toolchain '1.57.0-aarch64-apple-darwin' failed with:
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ error: failed to parse manifest at `/Users/fundon/dev/pdfium-render/Cargo.toml`                                                                │
│                                                                                                                                                │
│ Caused by:                                                                                                                                     │
│ namespaced features with the `dep:` prefix are only allowed on the nightly channel and requires the `-Z namespaced-features` flag on the       │
│ command-line                                                                                                                                   │
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Check for toolchain '1.70.0-aarch64-apple-darwin' succeeded
Check for toolchain '1.63.0-aarch64-apple-darwin' succeeded

Check for toolchain '1.60.0-aarch64-apple-darwin' failed with:
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ error: package `image v0.24.9` cannot be built because it requires rustc 1.63.0 or newer, while the currently active rustc version is 1.60.0   │
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

Check for toolchain '1.61.0-aarch64-apple-darwin' failed with:
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ error: package `image v0.24.9` cannot be built because it requires rustc 1.63.0 or newer, while the currently active rustc version is 1.61.0   │
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

Check for toolchain '1.62.1-aarch64-apple-darwin' failed with:
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ error: package `image v0.24.9` cannot be built because it requires rustc 1.63.0 or newer, while the currently active rustc version is 1.62.1   │
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
$ cargo msrv
Fetching index
Determining the Minimum Supported Rust Version (MSRV) for toolchain aarch64-apple-darwin
Using check command cargo check

Check for toolchain '1.57.0-aarch64-apple-darwin' failed with:
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ error: failed to parse manifest at `/Users/fundon/dev/pdfium-render/Cargo.toml`                                                                │
│                                                                                                                                                │
│ Caused by:                                                                                                                                     │
│ namespaced features with the `dep:` prefix are only allowed on the nightly channel and requires the `-Z namespaced-features` flag on the       │
│ command-line                                                                                                                                   │
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Check for toolchain '1.70.0-aarch64-apple-darwin' succeeded

Check for toolchain '1.63.0-aarch64-apple-darwin' failed with:
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ error: package `image v0.25.4` cannot be built because it requires rustc 1.67.1 or newer, while the currently active rustc version is 1.63.0   │
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Unable to install toolchain with `rustup install 1.66.1-aarch64-apple-darwin`.
  1. some default features of image are not used, so they can be turned off


[target.'cfg(target_arch = "wasm32")'.dependencies]
console_log = "1"
Expand All @@ -39,11 +39,11 @@ js-sys = "0"
wasm-bindgen = { version = "0", features = ["enable-interning"] }
wasm-bindgen-futures = { version = "0" }
web-sys = { version = "0", features = [
"TextDecoder",
"ImageData",
"Window",
"Response",
"Blob",
"TextDecoder",
"ImageData",
"Window",
"Response",
"Blob",
] }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
Expand All @@ -54,14 +54,19 @@ windows = { version = "0", optional = true }

[build-dependencies]
# Bindgen 0.70.0 and later cause build failures when compiling to WASM. For more details, see:
#
#
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there was meant to be a link to #156 here. I'll add it separately.

bindgen = { version = "<=0.69.4", optional = true }

[dev-dependencies]
# Dependencies specific to examples. Dependencies for the WASM example in examples/wasm.rs
# are specified separately in examples/Cargo.toml.
rand = "0" # Used by examples/create.rs, examples/matrix.rs
rand = "0" # Used by examples/create.rs, examples/matrix.rs
rayon = "1" # Used by examples/thread_safe.rs
image = { version = "0.24", default-features = false, features = [
"png",
"jpeg",
"webp",
] }
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an advantage to including the features list here, rather than at line 33?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several image format features are used in the test case, which can be enabled on demand to keep it simple.


[features]
default = ["pdfium_latest", "thread_safe", "image"]
Expand All @@ -85,10 +90,10 @@ flatten = []

pdfium_latest = ["pdfium_6666"]
pdfium_future = [
# For testing changes in Pdfium source control that are yet to be released.
"pdfium_use_skia",
"pdfium_enable_xfa",
"pdfium_enable_v8",
# For testing changes in Pdfium source control that are yet to be released.
"pdfium_use_skia",
"pdfium_enable_xfa",
"pdfium_enable_v8",
]
pdfium_6666 = []
pdfium_6611 = []
Expand Down