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

don't constrain cyclic deps to build version #411

Closed
wants to merge 1 commit into from

Conversation

jhheider
Copy link
Contributor

@jhheider jhheider commented Feb 27, 2023

requires #406 to pass checks

fixes #412

Basically if a dep requests the target (go.dev requires go.dev: '*'), this will prevent locked loop (build go.dev=1.20.1 trying to install go.dev=1.20.1)

@jhheider jhheider requested a review from mxcl February 27, 2023 20:30
@what-the-diff
Copy link

what-the-diff bot commented Feb 27, 2023

  • If the dependency is already in the graph, update its constraint to match that of
    this node. This ensures we don't end up with a situation where two nodes have different
    constraints for their dependencies (which can happen if one was installed from lockfile).

@jhheider
Copy link
Contributor Author

should also allow us to build specific llvm versions.

@@ -61,6 +61,10 @@ export default async function hydrate(

for (const dep of await get_deps(node.pkg, initial_set.has(node.project))) {
if (children.has(dep.project)) {
const self = graph[dep.project]
if (self.pkg.constraint === target.pkg.constraint) {
Copy link
Member

Choose a reason for hiding this comment

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

seems like you need to implement Range.eq, surely === will only work here if the object itself is the same object?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This seems to do exactly what I want, in testing. Replaces the build pkg with the dep so we don't require the version we want to build.

Copy link
Member

Choose a reason for hiding this comment

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

But it's a coincidence that === works. It would be trivial for some part of the code to create a new copy of the object at some prior step.

@mxcl
Copy link
Member

mxcl commented Feb 28, 2023

k, so changing this code is dangerous. We better get it right.

Can you highlight what part of the code is failing per your failure spec?

@mxcl mxcl force-pushed the hydrate-bootstrap branch from d49e1a8 to 6923330 Compare February 28, 2023 12:55
@jhheider
Copy link
Contributor Author

Can you highlight what part of the code is failing per your failure spec?

No patch:

$ ./libexec/deps.ts go.dev~1.20 --build
go.dev must be bootstrapped to build go.dev
curl.se/ca-certs
gnu.org/m4^1
tea.xyz/gx/cc^0.1
openssl.org^1
go.dev~1.20

Patched:

$ ./libexec/deps.ts go.dev~1.20 --build
go.dev must be bootstrapped to build go.dev
curl.se/ca-certs
gnu.org/m4^1
tea.xyz/gx/cc^0.1
openssl.org^1
go.dev

go.dev requires go.dev: '*' to build. But it shouldn't require the explicit version being built (that's madness). Same for llvm.org on linux, iirc. Likely the others that are self-requiring.

@mxcl
Copy link
Member

mxcl commented Mar 1, 2023

I think the actual solution for the this is to hydrate the deps of go rather than go itself.

So this is a regression in brewkit.

@jhheider
Copy link
Contributor Author

jhheider commented Mar 1, 2023

I think the actual solution for the this is to hydrate the deps of go rather than go itself.

So this is a regression in brewkit.

That sounds like the right answer. However, if you pass two packages and one depends on the other, it won't be "self-hydrating" via the other build. But that might be ok. We generally don't do multi-package builds (and source matching is currently broken due to re-ordering).

mxcl added a commit to pkgxdev/brewkit that referenced this pull request Mar 1, 2023
@jhheider jhheider deleted the hydrate-bootstrap branch March 1, 2023 09:50
mxcl added a commit to pkgxdev/brewkit that referenced this pull request Mar 1, 2023
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.

building cyclic deps still has issues
2 participants