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

Bazel: Support local_path type in package metadata #8937

Closed
nnobelis opened this issue Jul 25, 2024 · 1 comment
Closed

Bazel: Support local_path type in package metadata #8937

nnobelis opened this issue Jul 25, 2024 · 1 comment
Assignees
Labels
analyzer About the analyzer tool enhancement Issues that are considered to be enhancements

Comments

@nnobelis
Copy link
Member

When a local registry is configured in a Bazel project (for instance https://github.com/oss-review-toolkit/ort/tree/main/plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/bazel-local-registry), the source code of some packages present in the local registry can be in the same repository.

Such packages have the following elements in their source.json:

{
  "type": "local_path",
  "path": "directory1"
}

If the bazel_registry.json file of the registry contains a module_base_path:

{
    "module_base_path": "../directory2/"
}

Then the source code of the aforementioned package is in directory2/directory1.

See https://bazel.build/versions/6.0.0/build/bzlmod#index-registry for the specs.

@haikoschol FYI

@nnobelis nnobelis added enhancement Issues that are considered to be enhancements to triage Issues that need triaging labels Jul 25, 2024
@sschuberth sschuberth added analyzer About the analyzer tool and removed to triage Issues that need triaging labels Aug 7, 2024
@nnobelis
Copy link
Member Author

I noticed that the link above was outdated and a more recent version is:
https://bazel.build/external/registry

It looks like the source.json can have 3 different types:

  • archive which is the default and looks implicit
  • git_repository
  • local_path

The three types seems to have nothing in common but the property type, but even the latter can be omitted in the archive type.

Once again it's some kind of polymorphism which I think will be an headache to deserialize.

nnobelis added a commit to boschglobal/oss-review-toolkit that referenced this issue Sep 20, 2024
When a module is present in a local registry, its source code could be
present in the same repository. To resolve the location of the source code,
the 'path' property of the 'source.json' needs to be correlated with the
'registry_path' and the 'module_base_path' of the registry (see [1]).
This commit adds the resolution of the VCS info for such modules. The extra
metadata is embedded into the `LocalRepositorySourceInfo`.

Fixes oss-review-toolkit#8937

[1]: https://bazel.build/external/registry

Signed-off-by: Nicolas Nobelis <[email protected]>
nnobelis added a commit to boschglobal/oss-review-toolkit that referenced this issue Sep 20, 2024
When a module is present in a local registry, its source code could be
present in the same repository. To resolve the location of the source code,
the 'path' property of the 'source.json' needs to be correlated with the
'registry_path' and the 'module_base_path' of the registry (see [1]).
This commit adds the resolution of the VCS info for such modules. The extra
metadata is embedded into the `LocalRepositorySourceInfo`.

Fixes oss-review-toolkit#8937

[1]: https://bazel.build/external/registry

Signed-off-by: Nicolas Nobelis <[email protected]>
nnobelis added a commit to boschglobal/oss-review-toolkit that referenced this issue Sep 20, 2024
When a module is present in a local registry, its source code could be
present in the same repository. To resolve the location of the source code,
the 'path' property of the 'source.json' needs to be correlated with the
'registry_path' and the 'module_base_path' of the registry (see [1]).
This commit adds the resolution of the VCS info for such modules. The extra
metadata is embedded into the `LocalRepositorySourceInfo`.

Fixes oss-review-toolkit#8937

[1]: https://bazel.build/external/registry

Signed-off-by: Nicolas Nobelis <[email protected]>
@nnobelis nnobelis self-assigned this Sep 20, 2024
nnobelis added a commit to boschglobal/oss-review-toolkit that referenced this issue Sep 20, 2024
When a module is present in a local registry, its source code could be
present in the same repository. To resolve the location of the source code,
the 'path' property of the 'source.json' needs to be correlated with the
'registry_path' and the 'module_base_path' of the registry (see [1]).
This commit adds the resolution of the VCS info for such modules. The extra
metadata is embedded into the `LocalRepositorySourceInfo`.

Fixes oss-review-toolkit#8937

[1]: https://bazel.build/external/registry

Signed-off-by: Nicolas Nobelis <[email protected]>
nnobelis added a commit to boschglobal/oss-review-toolkit that referenced this issue Sep 20, 2024
When a module is present in a local registry, its source code could be
present in the same repository. To resolve the location of the source code,
the 'path' property of the 'source.json' needs to be correlated with the
'registry_path' and the 'module_base_path' of the registry (see [1]).
This commit adds the resolution of the VCS info for such modules. The extra
metadata is embedded into the `LocalRepositorySourceInfo`.

Fixes oss-review-toolkit#8937

[1]: https://bazel.build/external/registry

Signed-off-by: Nicolas Nobelis <[email protected]>
nnobelis added a commit to boschglobal/oss-review-toolkit that referenced this issue Sep 20, 2024
When a module is present in a local registry, its source code could be
present in the same repository. To resolve the location of the source code,
the 'path' property of the 'source.json' needs to be correlated with the
'registry_path' and the 'module_base_path' of the registry (see [1]).
This commit adds the resolution of the VCS info for such modules. The extra
metadata is embedded into the `LocalRepositorySourceInfo`.

Fixes oss-review-toolkit#8937

[1]: https://bazel.build/external/registry

Signed-off-by: Nicolas Nobelis <[email protected]>
nnobelis added a commit to boschglobal/oss-review-toolkit that referenced this issue Sep 20, 2024
When a module is present in a local registry, its source code could be
present in the same repository. To resolve the location of the source code,
the 'path' property of the 'source.json' needs to be correlated with the
'registry_path' and the 'module_base_path' of the registry (see [1]).
This commit adds the resolution of the VCS info for such modules. The extra
metadata is embedded into the `LocalRepositorySourceInfo`.

Fixes oss-review-toolkit#8937

[1]: https://bazel.build/external/registry

Signed-off-by: Nicolas Nobelis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer About the analyzer tool enhancement Issues that are considered to be enhancements
Projects
None yet
Development

No branches or pull requests

2 participants