Mnaranjo/ignore circular dependencies in starlark#4
Open
manuelnaranjo wants to merge 6 commits intomainfrom
Open
Mnaranjo/ignore circular dependencies in starlark#4manuelnaranjo wants to merge 6 commits intomainfrom
manuelnaranjo wants to merge 6 commits intomainfrom
Conversation
RPM dependency tree is insane, it has cycles in it, for instance for bash depends on glibc which depends on glibc-common which depends on bash ( °-° ). Bazel wants DAGs as any decent build system, so the cycles need to be fixed. On the other hand consumers of bazeldnf don't care about glibc they want to add bash to their setups (or whatever they wanted to add which may or may not depend on something else and have a circular dependency), so we can flatten the dependencies and avoid the loops for them. To avoid the cycles we hack things a bit, we first register 1 repository per available rpm in the lock file without dependencies, we call this a blob repository. Then for each requested target (which most likely will become an rpmtree) we link that target to a list of blob repositories. When building the depset of the RpmInfo we will have cases where file will be defined in the case of blob entries or not be defined in the case of publicly facing RPM entries. Depsets are strict in terms of type if the first entry is a file then everything is a file, same if it's None so we need to hack things a little bit. Only the alias entry in the public repository will depend on the rpm target which will contain the dependency tree.
Now we should be able to pass the circular dependencies test
In the case there are duplicated entries in the alias mapping it doesn't necessarily mean a failure mode, it may be due to multiple lock files pointing to the same RPM given this RPM is unique this is not a problem, if it would then bazel would fail to register the repositories
If the same lock file is registered multiple times we reach a bug where blobs needs to be deduplicated
If the extension requests to make an rpmtree for a not known target in the lock file we need to fail with a meaninful error message and not just with a key not known error
Blobs are unique, there's a unique blob repository per rpm url we need to deduplicate blobs are having multiple lock files may lead to overlaping blobs otherwise
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.