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: upgrade to Rust 1.70.0 #19345

Merged
merged 7 commits into from
Jun 6, 2023
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
20 changes: 10 additions & 10 deletions .github/workflows/ci.generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as yaml from "https://deno.land/[email protected]/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";
Expand All @@ -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:https://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:https://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
Expand Down Expand Up @@ -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
Expand All @@ -81,16 +81,16 @@ 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
-C link-arg=-Wl,--thinlto-cache-dir=$(pwd)/target/release/lto-cache
-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`,
};
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:https://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:https://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.
Expand Down Expand Up @@ -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
Expand All @@ -260,16 +260,16 @@ 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
-C link-arg=-Wl,--thinlto-cache-dir=$(pwd)/target/release/lto-cache
-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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions cli/lsp/capabilities.rs
Original file line number Diff line number Diff line change
@@ -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::*;

Expand Down
2 changes: 1 addition & 1 deletion cli/tools/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion ext/ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 6 additions & 6 deletions ext/net/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
42 changes: 12 additions & 30 deletions ext/net/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ext/web/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())?;
Expand Down
5 changes: 3 additions & 2 deletions runtime/permissions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.68.2"
channel = "1.70.0"
components = ["rustfmt", "clippy"]