Skip to content
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
27 changes: 0 additions & 27 deletions Cargo.lock

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

9 changes: 0 additions & 9 deletions src/analytics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,7 @@ path = "lib.rs"
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_core.workspace = true
bun_semver.workspace = true
bun_sys.workspace = true
thiserror.workspace = true
bun_errno.workspace = true
29 changes: 0 additions & 29 deletions src/analytics/error.rs

This file was deleted.

15 changes: 0 additions & 15 deletions src/analytics/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,17 +331,6 @@ pub(crate) const fn validate_feature_name(name: &[u8]) -> bool {

// ──────────────────────────────────────────────────────────────────────────

#[repr(u8)]
#[derive(Copy, Clone, PartialEq, Eq, strum::IntoStaticStr)]
#[allow(non_camel_case_types)]
pub enum EventName {
bundle_success,
bundle_fail,
bundle_start,
http_start,
http_build,
}

const PLATFORM_ARCH: analytics::Architecture = {
#[cfg(target_arch = "aarch64")]
{
Expand Down Expand Up @@ -603,7 +592,3 @@ pub mod generate_header {
pub use generate_header as GenerateHeader;

pub mod schema;
pub use schema::{BufReader, Reader, SchemaInt};

pub mod error;
pub use error::{Error, Result};
96 changes: 0 additions & 96 deletions src/analytics/schema.rs
Original file line number Diff line number Diff line change
@@ -1,99 +1,3 @@
// GENERATED: re-run the analytics schema generator (peechy) with .rs output
// Hand-ported subset — the remaining analytics::* types are unused at runtime
// and come back with the next peechy regen (see the `analytics` mod below).

use crate::Error;

// ──────────────────────────────────────────────────────────────────────────
// Reader / Writer
// ──────────────────────────────────────────────────────────────────────────
//
// The peechy codec protocol is the `Reader` trait below; `BufReader` is one
// concrete impl. Only the primitive-int / byte-slice surface is implemented;
// per-type `decode`/`encode` impls call the primitive methods directly
// (which is what the generated schema bodies already do).

#[inline]
pub(crate) fn eof() -> Error {
crate::Error::EOF
}

/// Primitive integers encodable in the peechy wire format (native-endian raw
/// bytes).
pub use bun_core::NativeEndianInt as SchemaInt;

/// Duck-typed reader protocol for peechy `decode` impls.
pub trait Reader {
/// Borrow `count` bytes, advancing the cursor. Errors with `EOF` if
/// fewer than `count` remain.
fn read(&mut self, count: usize) -> Result<&[u8], Error>;

#[inline]
fn read_byte(&mut self) -> Result<u8, Error> {
Ok(self.read(1)?[0])
}

#[inline]
fn read_bool(&mut self) -> Result<bool, Error> {
Ok(self.read_byte()? > 0)
}

#[inline]
fn read_int<T: SchemaInt>(&mut self) -> Result<T, Error> {
let b = self.read(T::SIZE)?;
Ok(T::from_ne_slice(b))
}

/// Primitive-int read; struct/enum cases are expressed as per-type
/// `decode(reader)` fns instead.
#[inline]
fn read_value<T: SchemaInt>(&mut self) -> Result<T, Error> {
self.read_int::<T>()
}

/// `u32` length prefix + raw bytes.
#[inline]
fn read_byte_array(&mut self) -> Result<&[u8], Error> {
let len = self.read_int::<u32>()? as usize;
if len == 0 {
return Ok(&[]);
}
self.read(len)
}
}

// peechy `Writer` lives in `bun_options_types::schema::Writer`. This crate
// keeps only the read side; encode users depend on options_types directly.

/// Concrete buffer-backed reader.
///
/// Callers that need owned sub-arrays allocate at the call site.
pub struct BufReader<'a> {
pub buf: &'a [u8],
pub remain: &'a [u8],
}

impl<'a> BufReader<'a> {
#[inline]
pub fn init(buf: &'a [u8]) -> Self {
Self { buf, remain: buf }
}
}

impl<'a> Reader for BufReader<'a> {
fn read(&mut self, count: usize) -> Result<&[u8], Error> {
let read_count = core::cmp::min(count, self.remain.len());
if read_count < count {
return Err(eof());
}
let (slice, rest) = self.remain.split_at(read_count);
self.remain = rest;
Ok(slice)
}
}

// ──────────────────────────────────────────────────────────────────────────

// Hand-ported subset of `analytics::*` needed by lib.rs (OperatingSystem,
// Architecture, Platform). The full encode/decode machinery and the rest of
// the schema (EventKind, EventListHeader, …) are unused at runtime today and
Expand Down
11 changes: 0 additions & 11 deletions src/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,6 @@ path = "lib.rs"
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_collections.workspace = true
bun_install_types.workspace = true
bun_options_types.workspace = true
bun_url.workspace = true

1 change: 0 additions & 1 deletion src/bun_core/env_var.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ platform_specific_new!(pub C_INCLUDE_PATH: string, posix = "C_INCLUDE_PATH", win
// Used by bun:ffi's TinyCC integration for systems like NixOS.
platform_specific_new!(pub LIBRARY_PATH: string, posix = "LIBRARY_PATH", windows = None, {});
new!(pub BUN_TMPDIR: string, "BUN_TMPDIR", {});
new!(pub BUN_TRACY_PATH: string, "BUN_TRACY_PATH", {});
new!(pub BUN_WATCHER_TRACE: string, "BUN_WATCHER_TRACE", {});
new!(pub CI: boolean, "CI", {});
new!(pub CI_COMMIT_SHA: string, "CI_COMMIT_SHA", {});
Expand Down
6 changes: 2 additions & 4 deletions src/bun_core/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3557,10 +3557,8 @@ impl_integer!(

/// Primitive integers transcodable as native-endian raw bytes.
///
/// Explicit trait
/// bound shared by the peechy wire codec (`bun_analytics::SchemaInt`) and the
/// MySQL protocol reader (`bun_sql::ReadableInt`), which re-export this under
/// their local names.
/// Explicit trait bound used by the MySQL protocol reader
/// (`bun_sql::ReadableInt`), which re-exports this under its local name.
pub trait NativeEndianInt: Copy + 'static {
const SIZE: usize;
/// Reinterpret `b[..SIZE]` as `Self` (native endian).
Expand Down
2 changes: 0 additions & 2 deletions src/bundler/bundle_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2689,8 +2689,6 @@ pub mod bv2_impl {
heap: &'a ThreadLocalArena,
) -> Result<Box<BundleV2<'a>>, Error> {
// The Box is heap-owned and dropped by the caller.
transpiler.env().load_tracy();

transpiler.options.mark_builtins_as_external =
transpiler.options.target.is_bun() || transpiler.options.target == Target::Node;
transpiler.resolver.opts.mark_builtins_as_external =
Expand Down
Loading
Loading