From b7836f3ce83b7ccbfa5bd66bd5823194e0304b9c Mon Sep 17 00:00:00 2001 From: Declan Tsien Date: Thu, 8 Feb 2024 14:12:57 +0800 Subject: [PATCH] update rust toolchain --- flake.lock | 163 ++++++++++++++++++----- flake.nix | 14 +- rust-toolchain | 2 +- rust_src/crates/emacs/src/symbol.rs | 4 +- rust_src/crates/webrender/src/font_db.rs | 4 +- rust_src/crates/webrender/src/lib.rs | 1 - 6 files changed, 140 insertions(+), 48 deletions(-) diff --git a/flake.lock b/flake.lock index 00a549183e6..74923f573f8 100644 --- a/flake.lock +++ b/flake.lock @@ -6,11 +6,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1676293499, - "narHash": "sha256-uIOTlTxvrXxpKeTvwBI1JGDGtCxMXE3BI0LFwoQMhiQ=", + "lastModified": 1705332421, + "narHash": "sha256-USpGLPme1IuqG78JNqSaRabilwkCyHmVWY0M9vYyqEA=", "owner": "numtide", "repo": "devshell", - "rev": "71e3022e3ab20bbf1342640547ef5bc14fb43bf4", + "rev": "83cb93d6d063ad290beee669f4badf9914cc16ec", "type": "github" }, "original": { @@ -22,14 +22,15 @@ "emacs-overlay": { "inputs": { "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_2", + "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1672247295, - "narHash": "sha256-nzwcwy6LVOLcqemTCUoJJp6nafCpcvyCG+T76Bb5OXM=", + "lastModified": 1707356707, + "narHash": "sha256-EPMnOYkQdpz9ch4qiDB+VQ+RusojToPgM88bo/TXHTE=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "8ad6bfa7413d59d408bf1ea8680a03b17a949082", + "rev": "ccaf577227e5a64f95c03d66b6ac50879b4a3521", "type": "github" }, "original": { @@ -41,11 +42,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", "owner": "edolstra", "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", "type": "github" }, "original": { @@ -55,12 +56,15 @@ } }, "flake-utils": { + "inputs": { + "systems": "systems" + }, "locked": { - "lastModified": 1642700792, - "narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=", + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", "owner": "numtide", "repo": "flake-utils", - "rev": "846b2ae0fc4cc943637d3d1def4454213e203cba", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", "type": "github" }, "original": { @@ -70,12 +74,15 @@ } }, "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, "locked": { - "lastModified": 1667395993, - "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", "owner": "numtide", "repo": "flake-utils", - "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", "type": "github" }, "original": { @@ -85,12 +92,15 @@ } }, "flake-utils_3": { + "inputs": { + "systems": "systems_3" + }, "locked": { - "lastModified": 1676283394, - "narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=", + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", "owner": "numtide", "repo": "flake-utils", - "rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", "type": "github" }, "original": { @@ -100,12 +110,15 @@ } }, "flake-utils_4": { + "inputs": { + "systems": "systems_4" + }, "locked": { - "lastModified": 1659877975, - "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", "owner": "numtide", "repo": "flake-utils", - "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", "type": "github" }, "original": { @@ -116,11 +129,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1643381941, - "narHash": "sha256-pHTwvnN4tTsEKkWlXQ8JMY423epos8wUOhthpwJjtpc=", + "lastModified": 1704161960, + "narHash": "sha256-QGua89Pmq+FBAro8NriTuoO/wNaUtugt29/qqA8zeeM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5efc8ca954272c4376ac929f4c5ffefcc20551d5", + "rev": "63143ac2c9186be6d9da6035fa22620018c85932", "type": "github" }, "original": { @@ -130,27 +143,45 @@ "type": "github" } }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1707238373, + "narHash": "sha256-WKxT0yLzWbFZwYi92lI0yWJpYtRaFSWHGX8QXzejapw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "fb0c047e30b69696acc42e669d02452ca1b55755", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-23.11", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { "locked": { - "lastModified": 1672249180, - "narHash": "sha256-ipos/gTMHqxS39asqNWEJZ7nXdcTHa0TB0AIZXkGapg=", + "lastModified": 1707092692, + "narHash": "sha256-ZbHsm+mGk/izkWtT4xwwqz38fdlwu7nUUKXTOmm4SyE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e58a7747db96c23b8a977e7c1bbfc5753b81b6fa", + "rev": "faf912b086576fd1a15fca610166c98d47bc667e", "type": "github" }, "original": { - "id": "nixpkgs", - "type": "indirect" + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" } }, "nixpkgs_3": { "locked": { - "lastModified": 1676790509, - "narHash": "sha256-W9uWAWokgS8US8rJf79qBLS2M+ZgIscfoz+KsNE7VGQ=", + "lastModified": 1707268954, + "narHash": "sha256-2en1kvde3cJVc3ZnTy8QeD2oKcseLFjYPLKhIGDanQ0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a1291d0d020a200c7ce3c48e96090bfa4890a475", + "rev": "f8e2ebd66d097614d51a56a755450d4ae1632df1", "type": "github" }, "original": { @@ -178,11 +209,11 @@ ] }, "locked": { - "lastModified": 1676860326, - "narHash": "sha256-Rsvi4Zl6N7phhC7RMoh05gAHSwTzWG+c+iR+/X0RqWU=", + "lastModified": 1707358215, + "narHash": "sha256-Nuhi8KEJ2e+2nTimSyEIPqN5eh7ECVWd+AnPXG6L+SY=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "98f11700e398cf2ae6da905df56badc17e265021", + "rev": "dd917bb1b67fc049fd56fe6de70266a9ab74a4aa", "type": "github" }, "original": { @@ -190,6 +221,66 @@ "repo": "rust-overlay", "type": "github" } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_4": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 222f4e4d3b6..8c53c9c894a 100644 --- a/flake.nix +++ b/flake.nix @@ -39,12 +39,12 @@ self.overlays.default emacs-overlay.overlay (import rust-overlay) - devshell.overlay + devshell.overlays.default ]; config = {}; }; in rec { - devShells.default = with pkgs; let + devshell = with pkgs; let custom-llvmPackages = llvmPackages_latest; in pkgs.devshell.mkShell { @@ -121,7 +121,7 @@ withWebrender = true; in ( - final.emacsGit.override + final.emacs-unstable.override { withImageMagick = true; withNS = false; @@ -219,6 +219,9 @@ ] ++ lib.optionals stdenv.isLinux [ "--with-dbus" + ] + ++ lib.optionalAttrs stdenv.cc.isClang [ + "LDFLAGS = \"-l${stdenv.cc.libcxx.cxxabi.libName}\"" ]; postPatch = @@ -244,10 +247,9 @@ python3 ] ++ rpathLibs) + ++ [cargo rustc] ++ (with rustPlatform; [ cargoSetupHook - rust.cargo - rust.rustc ]) ++ lib.optionals stdenv.isDarwin @@ -293,7 +295,7 @@ emacsng-noNativeComp = ( ( emacsng.override { - nativeComp = false; + withNativeCompilation = false; } ) .overrideAttrs ( diff --git a/rust-toolchain b/rust-toolchain index 590d1f2791a..ac78d18579b 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2023-02-20 +nightly-2024-01-25 diff --git a/rust_src/crates/emacs/src/symbol.rs b/rust_src/crates/emacs/src/symbol.rs index c4ab0e3711e..8ec4751397a 100644 --- a/rust_src/crates/emacs/src/symbol.rs +++ b/rust_src/crates/emacs/src/symbol.rs @@ -55,7 +55,7 @@ impl LispSymbolRef { } pub fn set_next(mut self, next: Option) { - let mut s = unsafe { self.u.s.as_mut() }; + let s = unsafe { self.u.s.as_mut() }; s.next = match next { Some(sym) => sym.as_ptr() as *mut Lisp_Symbol, None => ptr::null_mut(), @@ -110,7 +110,7 @@ impl LispObject { self.get_untaggedptr() as EmacsInt }; - let lispsym_offset = unsafe { &lispsym as *const _ as EmacsInt }; + let lispsym_offset = unsafe { ptr::addr_of!(lispsym) as *const _ as EmacsInt }; ptr_value + lispsym_offset } } diff --git a/rust_src/crates/webrender/src/font_db.rs b/rust_src/crates/webrender/src/font_db.rs index 07b16d52390..ac8e0635bcd 100644 --- a/rust_src/crates/webrender/src/font_db.rs +++ b/rust_src/crates/webrender/src/font_db.rs @@ -124,7 +124,7 @@ impl FontDB<'static> { } pub fn family_name(family_name: &str) -> Family { - match family_name.clone().to_lowercase().as_str() { + match family_name.to_lowercase().as_str() { "default" => Family::Monospace, // emacs reports default "serif" => Family::Serif, "sans-serif" => Family::SansSerif, @@ -155,7 +155,7 @@ impl FontDB<'static> { #[cfg(free_unix)] pub fn fc_family_name(name: &str) -> String { - match name.clone().to_lowercase().as_str() { + match name.to_lowercase().as_str() { "default" => { let mut property = system_fonts::FontPropertyBuilder::new().monospace().build(); let sysfonts = system_fonts::query_specific(&mut property); diff --git a/rust_src/crates/webrender/src/lib.rs b/rust_src/crates/webrender/src/lib.rs index 26d43423efc..85662dee3e5 100644 --- a/rust_src/crates/webrender/src/lib.rs +++ b/rust_src/crates/webrender/src/lib.rs @@ -1,7 +1,6 @@ #![allow(non_camel_case_types, non_snake_case, non_upper_case_globals)] #![feature(concat_idents)] #![allow(non_upper_case_globals)] -#![feature(once_cell)] #[macro_use] extern crate emacs;