1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-24 15:19:26 -05:00

chore: upgrade to Rust 1.70.0 (#19345)

Co-authored-by: linbingquan <695601626@qq.com>
This commit is contained in:
David Sherret 2023-06-05 20:35:39 -04:00 committed by GitHub
parent 8829a1d362
commit 5c55f2b4fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 56 additions and 73 deletions

View file

@ -5,7 +5,7 @@ import * as yaml from "https://deno.land/std@0.173.0/encoding/yaml.ts";
// Bump this number when you want to purge the cache.
// Note: the tools/release/01_bump_crate_versions.ts script will update this version
// automatically via regex, so ensure that this line maintains this format.
const cacheVersion = 33;
const cacheVersion = 34;
const Runners = (() => {
const ubuntuRunner = "ubuntu-22.04";
@ -24,16 +24,16 @@ const prCacheKeyPrefix =
`${cacheVersion}-cargo-target-\${{ matrix.os }}-\${{ matrix.profile }}-\${{ matrix.job }}-`;
const installPkgsCommand =
"sudo apt-get install --no-install-recommends debootstrap clang-15 lld-15";
"sudo apt-get install --no-install-recommends debootstrap clang-16 lld-16";
const sysRootStep = {
name: "Set up incremental LTO and sysroot build",
run: `# Avoid running man-db triggers, which sometimes takes several minutes
# to complete.
sudo apt-get remove --purge -y man-db
# Install clang-15, lld-15, and debootstrap.
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main" |
sudo dd of=/etc/apt/sources.list.d/llvm-toolchain-jammy-15.list
# Install clang-16, lld-16, and debootstrap.
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" |
sudo dd of=/etc/apt/sources.list.d/llvm-toolchain-jammy-16.list
curl https://apt.llvm.org/llvm-snapshot.gpg.key |
gpg --dearmor |
sudo dd of=/etc/apt/trusted.gpg.d/llvm-snapshot.gpg
@ -70,8 +70,8 @@ CARGO_PROFILE_RELEASE_INCREMENTAL=false
CARGO_PROFILE_RELEASE_LTO=false
RUSTFLAGS<<__1
-C linker-plugin-lto=true
-C linker=clang-15
-C link-arg=-fuse-ld=lld-15
-C linker=clang-16
-C link-arg=-fuse-ld=lld-16
-C link-arg=--sysroot=/sysroot
-C link-arg=-ldl
-C link-arg=-Wl,--allow-shlib-undefined
@ -81,8 +81,8 @@ RUSTFLAGS<<__1
__1
RUSTDOCFLAGS<<__1
-C linker-plugin-lto=true
-C linker=clang-15
-C link-arg=-fuse-ld=lld-15
-C linker=clang-16
-C link-arg=-fuse-ld=lld-16
-C link-arg=--sysroot=/sysroot
-C link-arg=-ldl
-C link-arg=-Wl,--allow-shlib-undefined
@ -90,7 +90,7 @@ RUSTDOCFLAGS<<__1
-C link-arg=-Wl,--thinlto-cache-policy,cache_size_bytes=700m
\${{ env.RUSTFLAGS }}
__1
CC=clang-15
CC=clang-16
CFLAGS=-flto=thin --sysroot=/sysroot
__0`,
};

View file

@ -210,15 +210,15 @@ jobs:
# to complete.
sudo apt-get remove --purge -y man-db
# Install clang-15, lld-15, and debootstrap.
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main" |
sudo dd of=/etc/apt/sources.list.d/llvm-toolchain-jammy-15.list
# Install clang-16, lld-16, and debootstrap.
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" |
sudo dd of=/etc/apt/sources.list.d/llvm-toolchain-jammy-16.list
curl https://apt.llvm.org/llvm-snapshot.gpg.key |
gpg --dearmor |
sudo dd of=/etc/apt/trusted.gpg.d/llvm-snapshot.gpg
sudo apt-get update
# this was unreliable sometimes, so try again if it fails
sudo apt-get install --no-install-recommends debootstrap clang-15 lld-15 || echo 'Failed. Trying again.' && sudo apt-get clean && sudo apt-get update && sudo apt-get install --no-install-recommends debootstrap clang-15 lld-15
sudo apt-get install --no-install-recommends debootstrap clang-16 lld-16 || echo 'Failed. Trying again.' && sudo apt-get clean && sudo apt-get update && sudo apt-get install --no-install-recommends debootstrap clang-16 lld-16
# Create ubuntu-16.04 sysroot environment, which is used to avoid
# depending on a very recent version of glibc.
@ -249,8 +249,8 @@ jobs:
CARGO_PROFILE_RELEASE_LTO=false
RUSTFLAGS<<__1
-C linker-plugin-lto=true
-C linker=clang-15
-C link-arg=-fuse-ld=lld-15
-C linker=clang-16
-C link-arg=-fuse-ld=lld-16
-C link-arg=--sysroot=/sysroot
-C link-arg=-ldl
-C link-arg=-Wl,--allow-shlib-undefined
@ -260,8 +260,8 @@ jobs:
__1
RUSTDOCFLAGS<<__1
-C linker-plugin-lto=true
-C linker=clang-15
-C link-arg=-fuse-ld=lld-15
-C linker=clang-16
-C link-arg=-fuse-ld=lld-16
-C link-arg=--sysroot=/sysroot
-C link-arg=-ldl
-C link-arg=-Wl,--allow-shlib-undefined
@ -269,7 +269,7 @@ jobs:
-C link-arg=-Wl,--thinlto-cache-policy,cache_size_bytes=700m
${{ env.RUSTFLAGS }}
__1
CC=clang-15
CC=clang-16
CFLAGS=-flto=thin --sysroot=/sysroot
__0
- name: Log versions
@ -293,7 +293,7 @@ jobs:
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
key: '33-cargo-home-${{ matrix.os }}-${{ hashFiles(''Cargo.lock'') }}'
key: '34-cargo-home-${{ matrix.os }}-${{ hashFiles(''Cargo.lock'') }}'
if: '!(github.event_name == ''pull_request'' && matrix.skip_pr)'
- name: Restore cache build output (PR)
uses: actions/cache/restore@v3
@ -305,7 +305,7 @@ jobs:
!./target/*/*.zip
!./target/*/*.tar.gz
key: never_saved
restore-keys: '33-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ matrix.job }}-'
restore-keys: '34-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ matrix.job }}-'
- name: Apply and update mtime cache
if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (!startsWith(github.ref, ''refs/tags/''))'
uses: ./.github/mtime_cache
@ -589,7 +589,7 @@ jobs:
!./target/*/gn_out
!./target/*/*.zip
!./target/*/*.tar.gz
key: '33-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}'
key: '34-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}'
publish-canary:
name: publish canary
runs-on: ubuntu-22.04

8
Cargo.lock generated
View file

@ -2787,9 +2787,9 @@ checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c"
[[package]]
name = "libffi"
version = "3.1.0"
version = "3.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6cb06d5b4c428f3cd682943741c39ed4157ae989fffe1094a08eaf7c4014cf60"
checksum = "ce826c243048e3d5cec441799724de52e2d42f820468431fc3fceee2341871e2"
dependencies = [
"libc",
"libffi-sys",
@ -2797,9 +2797,9 @@ dependencies = [
[[package]]
name = "libffi-sys"
version = "2.1.0"
version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "11c6f11e063a27ffe040a9d15f0b661bf41edc2383b7ae0e0ad5a7e7d53d9da3"
checksum = "f36115160c57e8529781b4183c2bb51fdc1f6d6d1ed345591d84be7703befb3c"
dependencies = [
"cc",
]

View file

@ -1,10 +1,10 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
///!
///! Provides information about what capabilities that are supported by the
///! language server, which helps determine what messages are sent from the
///! client.
///!
//!
//! Provides information about what capabilities that are supported by the
//! language server, which helps determine what messages are sent from the
//! client.
//!
use deno_core::serde_json::json;
use tower_lsp::lsp_types::*;

View file

@ -334,7 +334,7 @@ pub async fn upgrade(
};
let current_is_most_recent = if upgrade_flags.canary {
let latest_hash = latest_version.clone();
let latest_hash = &latest_version;
crate::version::GIT_COMMIT_HASH == latest_hash
} else if !crate::version::is_canary() {
let current = Version::parse_standard(crate::version::deno()).unwrap();

View file

@ -17,7 +17,7 @@ path = "lib.rs"
deno_core.workspace = true
dlopen.workspace = true
dynasmrt = "1.2.3"
libffi = "3.1.0"
libffi = "3.2.0"
serde.workspace = true
serde-value = "0.7"
serde_json = "1.0"

View file

@ -98,12 +98,12 @@ deno_core::extension!(deno_net,
ops::op_node_unstable_net_listen_udp<P>,
ops::op_net_recv_udp,
ops::op_net_send_udp<P>,
ops::op_net_join_multi_v4_udp<P>,
ops::op_net_join_multi_v6_udp<P>,
ops::op_net_leave_multi_v4_udp<P>,
ops::op_net_leave_multi_v6_udp<P>,
ops::op_net_set_multi_loopback_udp<P>,
ops::op_net_set_multi_ttl_udp<P>,
ops::op_net_join_multi_v4_udp,
ops::op_net_join_multi_v6_udp,
ops::op_net_leave_multi_v4_udp,
ops::op_net_leave_multi_v6_udp,
ops::op_net_set_multi_loopback_udp,
ops::op_net_set_multi_ttl_udp,
ops::op_dns_resolve<P>,
ops::op_set_nodelay,
ops::op_set_keepalive,

View file

@ -159,15 +159,12 @@ where
}
#[op]
async fn op_net_join_multi_v4_udp<NP>(
async fn op_net_join_multi_v4_udp(
state: Rc<RefCell<OpState>>,
rid: ResourceId,
address: String,
multi_interface: String,
) -> Result<(), AnyError>
where
NP: NetPermissions + 'static,
{
) -> Result<(), AnyError> {
let resource = state
.borrow_mut()
.resource_table
@ -184,15 +181,12 @@ where
}
#[op]
async fn op_net_join_multi_v6_udp<NP>(
async fn op_net_join_multi_v6_udp(
state: Rc<RefCell<OpState>>,
rid: ResourceId,
address: String,
multi_interface: u32,
) -> Result<(), AnyError>
where
NP: NetPermissions + 'static,
{
) -> Result<(), AnyError> {
let resource = state
.borrow_mut()
.resource_table
@ -208,15 +202,12 @@ where
}
#[op]
async fn op_net_leave_multi_v4_udp<NP>(
async fn op_net_leave_multi_v4_udp(
state: Rc<RefCell<OpState>>,
rid: ResourceId,
address: String,
multi_interface: String,
) -> Result<(), AnyError>
where
NP: NetPermissions + 'static,
{
) -> Result<(), AnyError> {
let resource = state
.borrow_mut()
.resource_table
@ -233,15 +224,12 @@ where
}
#[op]
async fn op_net_leave_multi_v6_udp<NP>(
async fn op_net_leave_multi_v6_udp(
state: Rc<RefCell<OpState>>,
rid: ResourceId,
address: String,
multi_interface: u32,
) -> Result<(), AnyError>
where
NP: NetPermissions + 'static,
{
) -> Result<(), AnyError> {
let resource = state
.borrow_mut()
.resource_table
@ -257,15 +245,12 @@ where
}
#[op]
async fn op_net_set_multi_loopback_udp<NP>(
async fn op_net_set_multi_loopback_udp(
state: Rc<RefCell<OpState>>,
rid: ResourceId,
is_v4_membership: bool,
loopback: bool,
) -> Result<(), AnyError>
where
NP: NetPermissions + 'static,
{
) -> Result<(), AnyError> {
let resource = state
.borrow_mut()
.resource_table
@ -283,14 +268,11 @@ where
}
#[op]
async fn op_net_set_multi_ttl_udp<NP>(
async fn op_net_set_multi_ttl_udp(
state: Rc<RefCell<OpState>>,
rid: ResourceId,
ttl: u32,
) -> Result<(), AnyError>
where
NP: NetPermissions + 'static,
{
) -> Result<(), AnyError> {
let resource = state
.borrow_mut()
.resource_table

View file

@ -142,7 +142,7 @@ fn op_base64_atob(mut s: ByteString) -> Result<ByteString, AnyError> {
fn forgiving_base64_decode_inplace(
input: &mut [u8],
) -> Result<usize, AnyError> {
let error: _ =
let error =
|| DomExceptionInvalidCharacterError::new("Failed to decode base64");
let decoded =
base64_simd::forgiving_decode_inplace(input).map_err(|_| error())?;

View file

@ -18,6 +18,7 @@ use deno_core::ModuleSpecifier;
use deno_core::OpState;
use log;
use once_cell::sync::Lazy;
use std::borrow::Cow;
use std::collections::HashSet;
use std::fmt;
use std::hash::Hash;
@ -872,8 +873,8 @@ impl UnaryPermission<NetDescriptor> {
.ok_or_else(|| uri_error("Missing host"))?
.to_string();
let display_host = match url.port() {
None => hostname.clone(),
Some(port) => format!("{hostname}:{port}"),
None => Cow::Borrowed(&hostname),
Some(port) => Cow::Owned(format!("{hostname}:{port}")),
};
let host = &(&hostname, url.port_or_known_default());
let (result, prompted, is_allow_all) = self.query(Some(host)).check(

View file

@ -1,3 +1,3 @@
[toolchain]
channel = "1.68.2"
channel = "1.70.0"
components = ["rustfmt", "clippy"]