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

[install] assorted fixes & improvements #2011

Merged
merged 1 commit into from
Feb 8, 2023

Conversation

alexlamsl
Copy link
Contributor

@alexlamsl alexlamsl commented Feb 8, 2023

  • take peerDependencies into account during package placement
  • do not recursively resolve workspaces (matches npm)
  • link binaries to non-root packages correctly
  • prune empty nodes during dependency tree construction
  • support non-standard workspace: specifier

- take `peerDependencies` into account during package placement
- do not recursively resolve `workspaces` (matches `npm`)
- link binaries to non-root packages correctly
- prune empty nodes during dependency tree construction
- support non-standard `workspace:` specifier
// verilog.tar.gz
// verilog/repo
'v' => {
if (isTarball(dependency)) return .tarball;
if (isGitHubRepoPath(dependency)) return .github;
return .npm;
if (dependency.len == 1) return .dist_tag;
Copy link
Collaborator

Choose a reason for hiding this comment

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

nice

} else {
if (this.global_bin_dir.fd >= std.math.maxInt(std.os.fd_t)) {
this.err = error.MissingGlobalBinDir;
return;
}

@memcpy(&target_buf, this.global_bin_path.ptr, this.global_bin_path.len);
std.mem.copy(u8, &target_buf, this.global_bin_path);
Copy link
Collaborator

Choose a reason for hiding this comment

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

std.mem.copy is slower than memcpy

but memcpy musn't overlap

we probably should have a wrapper that makes this stuff safer honestly

like a

bun.concat(dest, &.{"a", "b", "c", "d"})

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah okay, I was just going for consistency for all usages within this function - will try and make that helper function now.

@Jarred-Sumner Jarred-Sumner merged commit 18807ce into oven-sh:main Feb 8, 2023
@alexlamsl alexlamsl deleted the peer-deps branch February 8, 2023 22:37
@Jarred-Sumner
Copy link
Collaborator

Thank you

Electroid pushed a commit that referenced this pull request Feb 17, 2023
- take `peerDependencies` into account during package placement
- do not recursively resolve `workspaces` (matches `npm`)
- link binaries to non-root packages correctly
- prune empty nodes during dependency tree construction
- support non-standard `workspace:` specifier
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.

None yet

2 participants