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

Update MSRV to 1.77 #6307

Merged
merged 3 commits into from
Sep 26, 2024
Merged
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
30 changes: 14 additions & 16 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }}
cancel-in-progress: true

env:
MACOSX_DEPLOYMENT_TARGET: "11.0"

Expand All @@ -30,7 +30,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-22.04, macos-12, windows-2022]
rust_version: [stable, "1.73"]
rust_version: [stable, "1.77"]
include:
- os: windows-2022
extra_args: "--exclude ffmpeg --exclude gstreamer-player"
Expand All @@ -44,8 +44,8 @@ jobs:
# rust_version: "nightly"
exclude:
- os: macos-12
rust_version: "1.73"
# We already test 1.73 and nightly. Stable is in the middle and already covered by other jobs
rust_version: "1.77"
# We already test 1.77 and nightly. Stable is in the middle and already covered by other jobs
- os: ubuntu-22.04
rust_version: "stable"

Expand Down Expand Up @@ -79,15 +79,13 @@ jobs:
with:
toolchain: ${{ matrix.rust_version }}
key: x-v2
- name: Pin dependencies to make it build with our MSRV
if: matrix.rust_version == '1.73'
shell: bash
run: |
if [ ! -f ./Cargo.lock ]; then
cargo update -p clap --precise 4.4.18
cargo update -p rowan --precise 0.15.15
cargo update -p plotters --precise 0.3.6
fi
# - name: Pin dependencies to make it build with our MSRV
# if: matrix.rust_version == '1.77'
# shell: bash
# run: |
# if [ ! -f ./Cargo.lock ]; then
# cargo update -p xxx --precise x.y.z
# fi
- name: Run tests (not qt)
run: DYLD_FRAMEWORK_PATH=$Qt5_DIR/lib cargo test --verbose --all-features --workspace ${{ matrix.extra_args }} --exclude slint-node --exclude pyslint --exclude test-driver-node --exclude slint-node --exclude test-driver-nodejs --exclude test-driver-cpp --exclude mcu-board-support --exclude printerdemo_mcu --exclude uefi-demo --exclude slint-cpp --exclude slint-python -- --skip=_qt::t
env:
Expand Down Expand Up @@ -244,7 +242,7 @@ jobs:
matrix:
include:
- os: macos-12
rust_version: "1.73"
rust_version: "1.77"
- os: windows-2022
rust_version: "nightly"
- os: ubuntu-22.04
Expand Down Expand Up @@ -326,7 +324,7 @@ jobs:
cmakeAppendedArgs: "-DCMAKE_BUILD_TYPE=Release -DSLINT_FEATURE_INTERPRETER=1 -DSLINT_FEATURE_BACKEND_QT=1"
buildDirectory: ${{ runner.workspace }}/examples/build
buildWithCMakeArgs: "--config Release"

vsce_build_test:
runs-on: ubuntu-22.04

Expand All @@ -335,7 +333,7 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
key: "vsce_1" # increment this to bust the cache if needed
- uses: ./.github/actions/install-linux-dependencies
- uses: ./.github/actions/install-linux-dependencies
- uses: actions/setup-node@v4
with:
node-version: 18
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,25 @@
# Changelog
All notable changes to this project are documented in this file.

## 1.9.0 - Unreleased
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, unrelated? :) Some of those items will hopefully be in 1.8.1, instead of 1.9.0?

Copy link
Member Author

Choose a reason for hiding this comment

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

I just wanted to not forget to add the MSRV in there so I did fill all entries.
But yes, when we cherry pick item we'll have to edit the changelog to remove the item which went in 1.8.1 if we do release a 1.8.1


### General

- Minumum Supported Rust Version (MSRC) is 1.77
- femtovg: Avoid artifacts of texture sampling with accidental wrap-around on texture boundaries

### Slint language

- Added animation `direction` property. (#6260)

### Widgets

- Checkbox: fix text color in fluent style (#6239)

### LSP and tooling

- Bring the window to the front and focus when clicking on "Show preview" in the editor. (#196)

## 1.8.0 - 2024-09-23

### Slint language
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ homepage = "https://slint.dev"
keywords = ["gui", "toolkit", "graphics", "design", "ui"]
license = "GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0"
repository = "https://github.com/slint-ui/slint"
rust-version = "1.73"
rust-version = "1.77"
version = "1.9.0"

[workspace.dependencies]
Expand Down Expand Up @@ -137,7 +137,7 @@ cfg_aliases = { version = "0.2.0" }
clap = { version = "4.0", features = ["derive", "wrap_help"] }
clru = { version = "0.6.0" }
css-color-parser2 = { version = "1.0.1" }
derive_more = { version = "0.99.17" }
derive_more = { version = "1.0.0", default-features = false, features = ["deref", "deref_mut", "into", "from", "add", "add_assign", "mul", "not", "display"] }
euclid = { version = "0.22.1", default-features = false }
fontdb = { version = "0.18.0", default-features = false }
fontdue = { version = "0.9.0" }
Expand Down
2 changes: 1 addition & 1 deletion api/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ FetchContent_Declare(
FetchContent_MakeAvailable(Corrosion)

list(PREPEND CMAKE_MODULE_PATH ${Corrosion_SOURCE_DIR}/cmake)
find_package(Rust 1.73 REQUIRED MODULE)
find_package(Rust 1.77 REQUIRED MODULE)

option(BUILD_SHARED_LIBS "Build Slint as shared library" ON)
option(SLINT_FEATURE_COMPILER "Enable support for compiling .slint files to C++ ahead of time" ON)
Expand Down
2 changes: 1 addition & 1 deletion api/cpp/docs/cmake.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ In the next section you will learn how to use the installed library in your appl
First you need to install the prerequisites:

* Install Rust by following the [Rust Getting Started Guide](https://www.rust-lang.org/learn/get-started). If you already
have Rust installed, make sure that it's at least version 1.73 or newer. You can check which version you have installed
have Rust installed, make sure that it's at least version 1.77 or newer. You can check which version you have installed
by running `rustc --version`. Once this is done, you should have the `rustc` compiler and the `cargo` build system installed in your path.

You can either choose to compile Slint from source along with your application or include Slint as an external CMake package.
Expand Down
4 changes: 2 additions & 2 deletions api/cpp/docs/mcu/generic.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ following generic instructions on what's needed to compile and use Slint.
## Prerequisites

* Install Rust by following the [Rust Getting Started Guide](https://www.rust-lang.org/learn/get-started). If you already
have Rust installed, make sure that it's at least version 1.73 or newer. You can check which version you have installed
have Rust installed, make sure that it's at least version 1.77 or newer. You can check which version you have installed
by running `rustc --version`. Once this is done, you should have the `rustc` compiler and the `cargo` build system installed in your path.

* A C++ cross-compiler compiler that supports C++20.
Expand Down Expand Up @@ -44,7 +44,7 @@ cmake -DRust_CARGO_TARGET=thumbv7em-none-eabihf -DSLINT_FEATURE_FREESTANDING=ON
```

## Next Steps

- Check out the [](../getting_started.md) instructions for a generic "Hello World" with C++.
- Study the [](../api/library_root), in particular the `slint::platform` namespace for
writing a Slint platform integration to handle touch input and render pixel, which you
Expand Down
2 changes: 1 addition & 1 deletion api/node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ You need to install the following components:

* **[Node.js](https://nodejs.org/download/release/)** (v16. or newer)
* **[npm](https://www.npmjs.com/)**
* **[Rust compiler](https://www.rust-lang.org/tools/install)** (1.73 or newer)
* **[Rust compiler](https://www.rust-lang.org/tools/install)** (1.77 or newer)

You will also need a few more dependencies, see <https://github.com/slint-ui/slint/blob/master/docs/building.md#prerequisites>

Expand Down
5 changes: 2 additions & 3 deletions api/node/cover.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ To use Slint with Deno, ensure the following programs are installed:
Slint-node comes with pre-built binaries for macOS, Linux, and Windows. If you'd like to use Slint-node on a system
without pre-built binaries, you need to additional software:

* **[Rust compiler](https://www.rust-lang.org/tools/install)** (1.73 or newer)
* Depending on your operating system, you may need additional components. For a list of required system libraries,
* **[Rust compiler](https://www.rust-lang.org/tools/install)** (1.77 or newer) * Depending on your operating system, you may need additional components. For a list of required system libraries,
see <https://github.com/slint-ui/slint/blob/master/docs/building.md#prerequisites>.

## Getting Started (Node.js)
Expand Down Expand Up @@ -259,7 +258,7 @@ The types used for properties in .slint design markup each translate to specific
[Array properties](../slint/src/language/syntax/types#arrays-and-models) can be set from JavaScript by passing
either `Array` objects or implementations of the {@link Model} interface.

When passing a JavaScript `Array` object, the contents of the array are copied. Any changes to the JavaScript afterwards will not be visible on the Slint side.
When passing a JavaScript `Array` object, the contents of the array are copied. Any changes to the JavaScript afterwards will not be visible on the Slint side.

Reading a Slint array property from JavaScript will always return a @{link Model}.

Expand Down
2 changes: 1 addition & 1 deletion docs/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This page explains how to build and test Slint.
### Installing Rust

Install Rust by following the [Rust Getting Started Guide](https://www.rust-lang.org/learn/get-started). If you already
have Rust installed, make sure that it's at least version 1.73 or newer. You can check which version you have installed
have Rust installed, make sure that it's at least version 1.77 or newer. You can check which version you have installed
by running `rustc --version`.

Once this is done, you should have the `rustc` compiler and the `cargo` build system installed in your path.
Expand Down
5 changes: 2 additions & 3 deletions internal/compiler/generator/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2139,10 +2139,9 @@ fn compile_expression(expr: &Expression, ctx: &EvaluationContext) -> TokenStream
Expression::Array { element_ty: _, values, as_model: _ } => values
.iter()
.map(|path_elem_expr|
// Close{} is a struct with no fields in markup, and PathElement::Close has no fields, so map to an empty token stream
// and thus later just unit type, which can convert into PathElement::Close.
// Close{} is a struct with no fields in markup, and PathElement::Close has no fields
if matches!(path_elem_expr, Expression::Struct { ty: Type::Struct { fields, .. }, .. } if fields.is_empty()) {
::core::default::Default::default()
quote!(sp::PathElement::Close)
Copy link
Member Author

Choose a reason for hiding this comment

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

derive_more::From used to generate a From<()> for PathElement because of the empty PathElement::Close, but that's no longer the case (imho for good reasons).
So just explicitly write Close in this special case anyway. (and rely of the impl From<T> for <T>)

} else {
compile_expression(path_elem_expr, ctx)
}
Expand Down
3 changes: 1 addition & 2 deletions internal/compiler/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,8 @@ macro_rules! declare_syntax {

pub mod syntax_nodes {
use super::*;
use derive_more::*;
$(
#[derive(Debug, Clone, Deref, Into)]
#[derive(Debug, Clone, derive_more::Deref, derive_more::Into)]
pub struct $nodekind(SyntaxNode);
#[cfg(test)]
impl SyntaxNodeVerify for $nodekind {
Expand Down
Loading
Loading