Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
12 changes: 0 additions & 12 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion src/bundler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ bun_md.workspace = true
bun_options_types.workspace = true
bun_paths.workspace = true
bun_perf.workspace = true
bun_router.workspace = true
bun_sourcemap.workspace = true
bun_sys.workspace = true
bun_threading.workspace = true
Expand Down
3 changes: 0 additions & 3 deletions src/css/crate_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ pub enum Error {
InvalidCharacter,
#[error("UnsupportedCSSTarget")]
UnsupportedCSSTarget,
#[error("CSSPrintError")]
CSSPrintError,
}

impl Error {
Expand All @@ -17,7 +15,6 @@ impl Error {
Self::Overflow => "Overflow",
Self::InvalidCharacter => "InvalidCharacter",
Self::UnsupportedCSSTarget => "UnsupportedCSSTarget",
Self::CSSPrintError => "CSSPrintError",
}
}
}
Expand Down
21 changes: 0 additions & 21 deletions src/css/selectors/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1620,19 +1620,6 @@ impl<Impl: BunSelectorImpl> GenericSelectorList<Impl> {
unreachable!("use serializer::serialize_selector_list()");
}

pub fn parse_with_options(input: &mut CssParser, options: &ParserOptions) -> CResult<Self> {
let mut parser = SelectorParser {
options,
is_nesting_allowed: true,
};
Self::parse(
&mut parser,
input,
ParseErrorRecovery::DiscardList,
NestingRequirement::None,
)
}

pub fn parse(
parser: &mut SelectorParser,
input: &mut CssParser,
Expand Down Expand Up @@ -1927,14 +1914,6 @@ impl<Impl: BunSelectorImpl> GenericSelector<Impl> {
self.specificity_and_flags.specificity
}

pub fn parse_with_options(input: &mut CssParser, options: &ParserOptions) -> CResult<Self> {
let mut selector_parser = SelectorParser {
is_nesting_allowed: true,
options,
};
Self::parse(&mut selector_parser, input)
}

pub(crate) fn iter_raw_match_order(&self) -> RawMatchOrderIterator<'_, Impl> {
RawMatchOrderIterator {
slice: &self.components,
Expand Down
6 changes: 0 additions & 6 deletions src/glob/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ workspace = true
[dependencies]
strum.workspace = true
bstr.workspace = true
scopeguard.workspace = true
const_format.workspace = true
enum-map.workspace = true
enumset.workspace = true
libc.workspace = true
bitflags.workspace = true
bun_alloc.workspace = true
bun_core.workspace = true
bun_collections.workspace = true
Expand Down
5 changes: 0 additions & 5 deletions src/http_jsc/websocket_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2045,26 +2045,21 @@
Closed = 14,
FailedToWrite = 15,
FailedToConnect = 16,
HeadersTooLarge = 17,
Ended = 18,
FailedToAllocateMemory = 19,
ControlFrameIsFragmented = 20,
InvalidControlFrame = 21,
CompressionUnsupported = 22,
InvalidCompressedData = 23,
CompressionFailed = 24,
UnexpectedMaskFromServer = 25,
ExpectedControlFrame = 26,
UnsupportedControlFrame = 27,
UnexpectedOpcode = 28,
InvalidUtf8 = 29,
TlsHandshakeFailed = 30,
MessageTooBig = 31,
ProtocolError = 32,
// Proxy error codes
ProxyConnectFailed = 33,
ProxyAuthenticationRequired = 34,

Check warning on line 2062 in src/http_jsc/websocket_client.rs

View check run for this annotation

Claude / Claude Code Review

C++ WebSocketErrorCode mirror entries not pruned alongside Rust ErrorCode variants

The C++ mirror of this enum still declares the five removed variants: `WebSocketErrorCode.h:24,31,33,39,43` (`headers_too_large`, `compression_failed`, `expected_control_frame`, `protocol_error`, `proxy_connection_refused`) and their switch arms in `WebSocket.cpp:1587,1616,1646,1650,1666`. Per REVIEW.md "Fix the whole class in the same PR" — the cross-FFI mirror is the same class, and the PR already touches C++ (`KeyObject.cpp`). Nothing breaks (discriminants are explicit), but the two sides are
Comment thread
robobun marked this conversation as resolved.
ProxyConnectionRefused = 35,
ProxyTunnelFailed = 36,
UnexpectedRsv1 = 37,
}
Expand Down
83 changes: 34 additions & 49 deletions src/install/PackageInstall.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ pub struct PackageInstall<'a> {
pub(crate) package_version: &'a [u8],
pub(crate) patch: Option<Patch>,

// TODO: this is never read
pub(crate) file_count: u32,
pub(crate) node_modules: &'a NodeModulesFolder,
pub lockfile: &'a Lockfile,
}
Expand Down Expand Up @@ -226,25 +224,20 @@ impl InstallResult {
#[repr(u8)]
#[derive(Copy, Clone, PartialEq, Eq)]
pub enum Step {
Copyfile,
OpeningCacheDir,
OpeningDestDir,
CopyingFiles,
Linking,
LinkingDependency,
Patching,
}

impl Step {
/// "error: failed {s} for package"
pub(crate) fn name(self) -> &'static [u8] {
match self {
Step::Copyfile | Step::CopyingFiles => b"copying files from cache to destination",
Step::CopyingFiles => b"copying files from cache to destination",
Step::OpeningCacheDir => b"opening cache/package/version dir",
Step::OpeningDestDir => b"opening node_modules/package dir",
Step::Linking => b"linking bins",
Step::LinkingDependency => b"linking dependency/workspace to node_modules",
Step::Patching => b"patching dependency",
}
}
}
Expand Down Expand Up @@ -1103,10 +1096,9 @@ impl<'a> PackageInstall<'a> {
Ok(d) => d,
Err(err) => return Ok(InstallResult::fail(err.into(), Step::OpeningDestDir, None)),
};
self.file_count = match copy(&subdir, &mut walker_) {
Ok(n) => n,
Err(err) => return Ok(InstallResult::fail(err, Step::CopyingFiles, None)),
};
if let Err(err) = copy(&subdir, &mut walker_) {
return Ok(InstallResult::fail(err, Step::CopyingFiles, None));
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.

Ok(InstallResult::Success)
}
Expand Down Expand Up @@ -1558,10 +1550,9 @@ impl<'a> PackageInstall<'a> {
(),
);

self.file_count = match result {
Ok(n) => n,
Err(err) => return InstallResult::fail(err, Step::CopyingFiles, None),
};
if let Err(err) = result {
return InstallResult::fail(err, Step::CopyingFiles, None);
}

InstallResult::Success
}
Expand Down Expand Up @@ -1744,27 +1735,24 @@ impl<'a> PackageInstall<'a> {
(),
);

self.file_count = match result {
Ok(n) => n,
Err(err) => {
#[cfg(windows)]
{
if err == crate::Error::FailedToCopyFile {
return Ok(InstallResult::fail(err, Step::CopyingFiles, None));
}
if let Err(err) = result {
#[cfg(windows)]
{
if err == crate::Error::FailedToCopyFile {
return Ok(InstallResult::fail(err, Step::CopyingFiles, None));
}
#[cfg(not(windows))]
}
#[cfg(not(windows))]
{
if err == crate::Error::NotSameFileSystem
|| err == crate::Error::Sys(bun_errno::SystemErrno::ENXIO)
{
if err == crate::Error::NotSameFileSystem
|| err == crate::Error::Sys(bun_errno::SystemErrno::ENXIO)
{
return Err(err);
}
return Err(err);
}

return Ok(InstallResult::fail(err, Step::CopyingFiles, None));
}
};

return Ok(InstallResult::fail(err, Step::CopyingFiles, None));
}

Ok(InstallResult::Success)
}
Expand Down Expand Up @@ -1954,26 +1942,23 @@ impl<'a> PackageInstall<'a> {
&mut buf2[..],
);

self.file_count = match result {
Ok(n) => n,
Err(err) => {
#[cfg(windows)]
{
if err == crate::Error::FailedToCopyFile {
return Ok(InstallResult::fail(err, Step::CopyingFiles, None));
}
if let Err(err) = result {
#[cfg(windows)]
{
if err == crate::Error::FailedToCopyFile {
return Ok(InstallResult::fail(err, Step::CopyingFiles, None));
}
#[cfg(not(windows))]
}
#[cfg(not(windows))]
{
if err == crate::Error::NotSameFileSystem
|| err == crate::Error::Sys(bun_errno::SystemErrno::ENXIO)
{
if err == crate::Error::NotSameFileSystem
|| err == crate::Error::Sys(bun_errno::SystemErrno::ENXIO)
{
return Err(err);
}
return Err(err);
}
return Ok(InstallResult::fail(err, Step::CopyingFiles, None));
}
};
return Ok(InstallResult::fail(err, Step::CopyingFiles, None));
}

Ok(InstallResult::Success)
}
Expand Down
1 change: 0 additions & 1 deletion src/install/PackageInstaller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1414,7 +1414,6 @@ impl<'a> PackageInstaller<'a> {
// site stays safe.
lockfile: self.lockfile(),
cache_dir_subpath: ZStr::EMPTY,
file_count: 0,
};
bun_output::scoped_log!(
PackageInstaller,
Expand Down
11 changes: 1 addition & 10 deletions src/install/PackageManager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,7 @@ pub use enqueue::{
};

use self::package_manager_lifecycle as lifecycle;
pub use lifecycle::{
LifecycleScriptTimeLog, LifecycleScriptTimeLogEntry, determine_preinstall_state,
get_preinstall_state, set_preinstall_state,
};
pub use lifecycle::{determine_preinstall_state, get_preinstall_state, set_preinstall_state};

use self::package_manager_resolution as resolution;
pub use resolution::{assign_root_resolution, resolve_from_disk_cache};
Expand Down Expand Up @@ -349,9 +346,6 @@ pub struct PackageManager {
pub(crate) preallocated_network_tasks: PreallocatedNetworkTasks,
pub(crate) preallocated_resolve_tasks: PreallocatedTaskStore,

/// items are only inserted into this if they took more than 500ms
pub(crate) lifecycle_script_time_log: LifecycleScriptTimeLog,

pub pending_lifecycle_script_tasks: AtomicU32,
pub(crate) finished_installing: AtomicBool,
pub(crate) total_scripts: usize,
Expand Down Expand Up @@ -455,7 +449,6 @@ pub enum Subcommand {
Audit,
Info,
Why,
Scan,
// bin,
// hash,
// @"hash-print",
Expand Down Expand Up @@ -1924,7 +1917,6 @@ pub fn init(
wr!(pending_pre_calc_hashes, AtomicU32::new(0));
wr!(pending_tasks, AtomicU32::new(0));
wr!(total_tasks, 0);
wr!(lifecycle_script_time_log, LifecycleScriptTimeLog::default());
wr!(pending_lifecycle_script_tasks, AtomicU32::new(0));
wr!(finished_installing, AtomicBool::new(false));
wr!(total_scripts, 0);
Expand Down Expand Up @@ -2357,7 +2349,6 @@ fn init_with_runtime_once(
wr!(pending_pre_calc_hashes, AtomicU32::new(0));
wr!(pending_tasks, AtomicU32::new(0));
wr!(total_tasks, 0);
wr!(lifecycle_script_time_log, LifecycleScriptTimeLog::default());
wr!(pending_lifecycle_script_tasks, AtomicU32::new(0));
wr!(finished_installing, AtomicBool::new(false));
wr!(total_scripts, 0);
Expand Down
26 changes: 0 additions & 26 deletions src/install/PackageManager/CommandLineArguments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -936,31 +936,6 @@ Full documentation is available at <magenta>https://bun.com/docs/cli/why<r>.
pretty_help(outro_text);
Output::flush();
}
Subcommand::Scan => {
let intro_text = r"
<b>Usage<r>: <b><green>bun pm scan<r> <cyan>[flags]<r>

Scan all packages in lockfile for security vulnerabilities.

<b>Flags:<r>";

let outro_text = r"

<b>Examples:<r>
<d>Scan all packages for vulnerabilities<r>
<b><green>bun pm scan<r>

<d>Output results as JSON<r>
<b><green>bun pm scan<r> <cyan>--json<r>

Full documentation is available at <magenta>https://bun.com/docs/cli/pm#scan<r>.
";

pretty_help(intro_text);
clap::simple_help(PM_PARAMS);
pretty_help(outro_text);
Output::flush();
}
}
}

Expand All @@ -986,7 +961,6 @@ Full documentation is available at <magenta>https://bun.com/docs/cli/pm#scan<r>.
// are not included in the help text
Subcommand::Audit => AUDIT_PARAMS_FULL,
Subcommand::Info => INFO_PARAMS,
Subcommand::Scan => PM_PARAMS, // scan uses the same params as pm command
};

let mut diag = clap::Diagnostic::default();
Expand Down
Loading
Loading