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

bun.lock: fix --frozen-lockfile and resolving extra dependencies #15748

Merged
merged 25 commits into from
Dec 14, 2024

Conversation

dylan-conway
Copy link
Member

@dylan-conway dylan-conway commented Dec 13, 2024

What does this PR do?

  • sorts trees (paths to node_modules) before printing text lockfile
  • fixes resolving dependencies from text lockfile
  • fixes wildcard hoisting
  • --frozen-lockfile added for text lockfile
  • fixes a few text lockfile validation bugs
  • package-lock.json migration saves as binary lockfile instead of text lockfile
  • appends workspaces to the dependencies array, fixing --frozen-lockfile
  • serialized git dependency resolution tags (.bun-tag)
  • fixes empty version for newly added dependencies through bun add

How did you verify your code works?

Added tests

@robobun
Copy link

robobun commented Dec 13, 2024

@dylan-conway, your commit 4e96ad8 has 11 failures in #7977:

  • test/regression/issue/09041.test.ts - 1 failing on 🐧 3.20 x64-baseline
  • test/cli/install/bun-run.test.ts - 1 failing on 🐧 3.20 x64
  • test/js/bun/css/doesnt_crash.test.ts - timeout on 🐧 22.04 aarch64
  • test/v8/v8.test.ts - 22 failing on 🐧 3.20 aarch64
  • test/v8/v8.test.ts - 22 failing on 🐧 3.20 x64
  • test/v8/v8.test.ts - 22 failing on 🐧 3.20 x64-baseline
  • test/integration/next-pages/test/next-build.test.ts - 1 failing on 🐧 3.20 aarch64
  • test/integration/next-pages/test/next-build.test.ts - 1 failing on 🐧 22.04 x64
  • test/integration/next-pages/test/next-build.test.ts - 1 failing on 🐧 3.20 x64-baseline
  • test/cli/install/registry/bun-install-registry.test.ts - 1 failing on 🐧 3.20 aarch64
  • test/cli/install/registry/bun-install-registry.test.ts - timeout on 🐧 22.04 aarch64
  • test/cli/install/registry/bun-install-registry.test.ts - timeout on 🐧 20.04 aarch64
  • test/cli/install/registry/bun-install-registry.test.ts - 1 failing on 🐧 3.20 x64-baseline
  • test/js/node/fs/fs.test.ts - timeout on 🪟 2019 x64
  • test/js/node/watch/fs.watchFile.test.ts - 1 failing on 🪟 2019 x64-baseline
  • test/js/bun/http/serve-body-leak.test.ts - 1 failing on 🪟 2019 x64
  • test/js/bun/http/serve.test.ts - 2 failing on 🍎 13 x64
  • test/js/bun/http/serve.test.ts - 2 failing on 🍎 14 x64
  • test/cli/run/require-cache.test.ts - 1 failing on 🍎 13 x64
  • test/cli/run/require-cache.test.ts - 1 failing on 🍎 14 x64
  • test/cli/run/require-cache.test.ts - 1 failing on 🐧 22.04 x64-baseline
  • test/cli/run/require-cache.test.ts - 1 failing on 🐧 24.04 x64-baseline
  • @dylan-conway dylan-conway marked this pull request as ready for review December 14, 2024 01:38
    var i: usize = 0;
    for (l.buffers.trees.items) |l_tree| {
    const rel_path, _ = Tree.relativePathAndDepth(l, l_tree.id, &path_buf, &depth_buf, .pkg_path);
    const tree_path = try allocator.dupe(u8, rel_path);
    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    potential memory leak

    i = 0;
    for (r.buffers.trees.items) |r_tree| {
    const rel_path, _ = Tree.relativePathAndDepth(r, r_tree.id, &path_buf, &depth_buf, .pkg_path);
    const tree_path = try allocator.dupe(u8, rel_path);
    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    potential memory leak

    @Jarred-Sumner Jarred-Sumner merged commit 3df39f4 into main Dec 14, 2024
    67 checks passed
    @Jarred-Sumner Jarred-Sumner deleted the dylan/fix-frozen-lockfile branch December 14, 2024 06:40
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    3 participants