Skip to content

Commit

Permalink
chore: upgrade to rust 1.79 (denoland#24207)
Browse files Browse the repository at this point in the history
  • Loading branch information
satyarohith committed Jun 14, 2024
1 parent e19ee6e commit 0f48313
Show file tree
Hide file tree
Showing 27 changed files with 58 additions and 220 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const prCacheKeyPrefix =
`${cacheVersion}-cargo-target-\${{ matrix.os }}-\${{ matrix.arch }}-\${{ matrix.profile }}-\${{ matrix.job }}-`;

// Note that you may need to add more version to the `apt-get remove` line below if you change this
const llvmVersion = 17;
const llvmVersion = 18;
const installPkgsCommand =
`sudo apt-get install --no-install-recommends clang-${llvmVersion} lld-${llvmVersion} clang-tools-${llvmVersion} clang-format-${llvmVersion} clang-tidy-${llvmVersion}`;
const sysRootStep = {
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -261,14 +261,14 @@ jobs:
sudo apt-get -qq remove 'clang-12*' 'clang-13*' 'clang-14*' 'clang-15*' 'clang-16*' 'llvm-12*' 'llvm-13*' 'llvm-14*' 'llvm-15*' 'llvm-16*' 'lld-12*' 'lld-13*' 'lld-14*' 'lld-15*' 'lld-16*' > /dev/null 2> /dev/null
# Install clang-XXX, lld-XXX, and debootstrap.
echo "deb http:https://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main" |
sudo dd of=/etc/apt/sources.list.d/llvm-toolchain-jammy-17.list
echo "deb http:https://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main" |
sudo dd of=/etc/apt/sources.list.d/llvm-toolchain-jammy-18.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 clang-17 lld-17 clang-tools-17 clang-format-17 clang-tidy-17 || echo 'Failed. Trying again.' && sudo apt-get clean && sudo apt-get update && sudo apt-get install --no-install-recommends clang-17 lld-17 clang-tools-17 clang-format-17 clang-tidy-17
sudo apt-get install --no-install-recommends clang-18 lld-18 clang-tools-18 clang-format-18 clang-tidy-18 || echo 'Failed. Trying again.' && sudo apt-get clean && sudo apt-get update && sudo apt-get install --no-install-recommends clang-18 lld-18 clang-tools-18 clang-format-18 clang-tidy-18
# Fix alternatives
(yes '' | sudo update-alternatives --force --all) > /dev/null 2> /dev/null || true
Expand Down Expand Up @@ -305,8 +305,8 @@ jobs:
CARGO_PROFILE_RELEASE_LTO=false
RUSTFLAGS<<__1
-C linker-plugin-lto=true
-C linker=clang-17
-C link-arg=-fuse-ld=lld-17
-C linker=clang-18
-C link-arg=-fuse-ld=lld-18
-C link-arg=-ldl
-C link-arg=-Wl,--allow-shlib-undefined
-C link-arg=-Wl,--thinlto-cache-dir=$(pwd)/target/release/lto-cache
Expand All @@ -316,16 +316,16 @@ jobs:
__1
RUSTDOCFLAGS<<__1
-C linker-plugin-lto=true
-C linker=clang-17
-C link-arg=-fuse-ld=lld-17
-C linker=clang-18
-C link-arg=-fuse-ld=lld-18
-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
--cfg tokio_unstable
$RUSTFLAGS
__1
CC=/usr/bin/clang-17
CC=/usr/bin/clang-18
CFLAGS=-flto=thin $CFLAGS
" > $GITHUB_ENV
- name: Remove macOS cURL --ipv4 flag
Expand Down
153 changes: 1 addition & 152 deletions cli/cdp.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.

/// <https://chromedevtools.github.io/devtools-protocol/tot/>
use deno_core::serde_json;
use deno_core::serde_json::Value;
use serde::Deserialize;
use serde::Deserializer;
Expand All @@ -18,14 +17,6 @@ pub struct AwaitPromiseArgs {
pub generate_preview: Option<bool>,
}

/// <https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#method-awaitPromise>
#[derive(Debug, Clone, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AwaitPromiseResponse {
pub result: RemoteObject,
pub exception_details: Option<ExceptionDetails>,
}

/// <https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#method-callFunctionOn>
#[derive(Debug, Clone, Serialize)]
#[serde(rename_all = "camelCase")]
Expand Down Expand Up @@ -72,14 +63,6 @@ pub struct CompileScriptArgs {
pub execution_context_id: Option<ExecutionContextId>,
}

/// <https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#method-compileScript>
#[derive(Debug, Clone, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CompileScriptResponse {
pub script_id: Option<ScriptId>,
pub exception_details: Option<ExceptionDetails>,
}

/// <https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#method-evaluate>
#[derive(Debug, Clone, Serialize)]
#[serde(rename_all = "camelCase")]
Expand Down Expand Up @@ -147,9 +130,6 @@ pub struct GetPropertiesArgs {
#[serde(rename_all = "camelCase")]
pub struct GetPropertiesResponse {
pub result: Vec<PropertyDescriptor>,
pub internal_properties: Option<Vec<InternalPropertyDescriptor>>,
pub private_properties: Option<Vec<PrivatePropertyDescriptor>>,
pub exception_details: Option<ExceptionDetails>,
}

/// <https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#method-globalLexicalScopeNames>
Expand All @@ -176,13 +156,6 @@ pub struct QueryObjectsArgs {
pub object_group: Option<String>,
}

/// <https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#method-queryObjects>
#[derive(Debug, Clone, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct QueryObjectsResponse {
pub objects: RemoteObject,
}

/// <https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#method-releaseObject>
#[derive(Debug, Clone, Serialize)]
#[serde(rename_all = "camelCase")]
Expand Down Expand Up @@ -221,14 +194,6 @@ pub struct RunScriptArgs {
pub await_promise: Option<bool>,
}

/// <https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#method-runScript>
#[derive(Debug, Clone, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct RunScriptResponse {
pub result: RemoteObject,
pub exception_details: Option<ExceptionDetails>,
}

/// <https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#method-setAsyncCallStackDepth>
#[derive(Debug, Clone, Serialize)]
#[serde(rename_all = "camelCase")]
Expand All @@ -244,15 +209,11 @@ pub struct SetAsyncCallStackDepthArgs {
pub struct RemoteObject {
#[serde(rename = "type")]
pub kind: String,
pub subtype: Option<String>,
pub class_name: Option<String>,
#[serde(default, deserialize_with = "deserialize_some")]
pub value: Option<Value>,
pub unserializable_value: Option<UnserializableValue>,
pub description: Option<String>,
pub object_id: Option<RemoteObjectId>,
pub preview: Option<ObjectPreview>,
pub custom_preview: Option<CustomPreview>,
}

// Any value that is present is considered Some value, including null.
Expand All @@ -265,61 +226,12 @@ where
Deserialize::deserialize(deserializer).map(Some)
}

/// <https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#type-ObjectPreview>
#[derive(Debug, Clone, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ObjectPreview {
#[serde(rename = "type")]
pub kind: String,
pub subtype: Option<String>,
pub description: Option<String>,
pub overflow: bool,
pub properties: Vec<PropertyPreview>,
pub entries: Option<Vec<EntryPreview>>,
}

/// <https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#type-PropertyPreview>
#[derive(Debug, Clone, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PropertyPreview {
pub name: String,
#[serde(rename = "type")]
pub kind: String,
pub value: Option<String>,
pub value_preview: Option<ObjectPreview>,
pub subtype: Option<String>,
}

/// <https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#type-EntryPreview>
#[derive(Debug, Clone, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct EntryPreview {
pub key: Option<ObjectPreview>,
pub value: ObjectPreview,
}

/// <https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#type-CustomPreview>
#[derive(Debug, Clone, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CustomPreview {
pub header: String,
pub body_getter_id: RemoteObjectId,
}

/// <https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#type-ExceptionDetails>
#[derive(Debug, Clone, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ExceptionDetails {
pub exception_id: u64,
pub text: String,
pub line_number: u64,
pub column_number: u64,
pub script_id: Option<ScriptId>,
pub url: Option<String>,
pub stack_trace: Option<StackTrace>,
pub exception: Option<RemoteObject>,
pub execution_context_id: Option<ExecutionContextId>,
pub exception_meta_data: Option<serde_json::Map<String, Value>>,
}

impl ExceptionDetails {
Expand All @@ -333,35 +245,6 @@ impl ExceptionDetails {
}
}

/// <https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#type-StackTrace>
#[derive(Debug, Clone, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct StackTrace {
pub description: Option<String>,
pub call_frames: Vec<CallFrame>,
pub parent: Option<Box<StackTrace>>,
pub parent_id: Option<StackTraceId>,
}

/// <https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#type-CallFrame>
#[derive(Debug, Clone, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CallFrame {
pub function_name: String,
pub script_id: ScriptId,
pub url: String,
pub line_number: u64,
pub column_number: u64,
}

/// <https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#type-StackTraceId>
#[derive(Debug, Clone, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct StackTraceId {
pub id: String,
pub debugger_id: Option<UniqueDebuggerId>,
}

/// <https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#type-CallArgument>
#[derive(Debug, Clone, Serialize)]
#[serde(rename_all = "camelCase")]
Expand All @@ -384,38 +267,11 @@ impl From<&RemoteObject> for CallArgument {
}
}

/// <https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#type-InternalPropertyDescriptor>
/// <https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#type-PropertyDescriptor>
#[derive(Debug, Clone, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PropertyDescriptor {
pub name: String,
pub value: Option<RemoteObject>,
pub writable: Option<bool>,
pub get: Option<RemoteObject>,
pub set: Option<RemoteObject>,
pub configurable: bool,
pub enumerable: bool,
pub was_thrown: Option<bool>,
pub is_own: Option<bool>,
pub symbol: Option<RemoteObject>,
}

/// <https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#type-InternalPropertyDescriptor>
#[derive(Debug, Clone, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct InternalPropertyDescriptor {
pub name: String,
pub value: Option<RemoteObject>,
}

/// <https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#type-PrivatePropertyDescriptor>
#[derive(Debug, Clone, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PrivatePropertyDescriptor {
pub name: String,
pub value: Option<RemoteObject>,
pub get: Option<RemoteObject>,
pub set: Option<RemoteObject>,
}

/// <https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#type-RemoteObjectId>
Expand All @@ -433,9 +289,6 @@ pub type TimeDelta = u64;
/// <https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#type-UnserializableValue>
pub type UnserializableValue = String;

/// <https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#type-UniqueDebuggerId>
pub type UniqueDebuggerId = String;

/// <https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setScriptSource>
#[derive(Debug, Deserialize)]
pub struct SetScriptSourceResponse {
Expand Down Expand Up @@ -523,7 +376,6 @@ pub struct Notification {
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ExceptionThrown {
pub timestamp: f64,
pub exception_details: ExceptionDetails,
}

Expand All @@ -539,8 +391,5 @@ pub struct ExecutionContextCreated {
#[serde(rename_all = "camelCase")]
pub struct ExecutionContextDescription {
pub id: ExecutionContextId,
pub origin: String,
pub name: String,
pub unique_id: String,
pub aux_data: Value,
}
1 change: 0 additions & 1 deletion cli/factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,6 @@ impl CliFactory {
// integration.
skip_op_registration: self.options.sub_command().is_run(),
log_level: self.options.log_level().unwrap_or(log::Level::Info).into(),
coverage_dir: self.options.coverage_dir(),
enable_op_summary_metrics: self.options.enable_op_summary_metrics(),
enable_testing_features: self.options.enable_testing_features(),
has_node_modules_dir: self.options.has_node_modules_dir(),
Expand Down
2 changes: 1 addition & 1 deletion cli/lsp/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1780,7 +1780,7 @@ impl ConfigTree {
);
}
}
self.first_folder = settings.first_folder.clone();
self.first_folder.clone_from(&settings.first_folder);
self.scopes = Arc::new(scopes);
}

Expand Down
11 changes: 1 addition & 10 deletions cli/lsp/path_to_regex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -795,8 +795,6 @@ impl Compiler {

#[derive(Debug)]
pub struct MatchResult {
pub path: String,
pub index: usize,
pub params: HashMap<StringOrNumber, StringOrVec>,
}

Expand Down Expand Up @@ -824,9 +822,6 @@ impl Matcher {
/// Match a string path, optionally returning the match result.
pub fn matches(&self, path: &str) -> Option<MatchResult> {
let caps = self.re.captures(path).ok()??;
let m = caps.get(0)?;
let path = m.as_str().to_string();
let index = m.start();
let mut params = HashMap::new();
if let Some(keys) = &self.maybe_keys {
for (i, key) in keys.iter().enumerate() {
Expand All @@ -852,11 +847,7 @@ impl Matcher {
}
}

Some(MatchResult {
path,
index,
params,
})
Some(MatchResult { params })
}
}

Expand Down
2 changes: 1 addition & 1 deletion cli/lsp/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ impl RedirectResolver {
}
};
for (specifier, mut entry) in chain {
entry.destination = destination.clone();
entry.destination.clone_from(&destination);
self.entries.insert(specifier, Some(Arc::new(entry)));
}
destination
Expand Down
2 changes: 1 addition & 1 deletion cli/lsp/testing/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ impl TestRun {
test::TestEvent::Wait(id) => {
reporter.report_wait(tests.read().get(&id).unwrap());
}
test::TestEvent::Output(_, output) => {
test::TestEvent::Output(output) => {
reporter.report_output(&output);
}
test::TestEvent::Slow(id, elapsed) => {
Expand Down
Loading

0 comments on commit 0f48313

Please sign in to comment.