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

Fail on manifest duplicate packages #61

Conversation

ericlchen1
Copy link
Contributor

@ericlchen1 ericlchen1 commented Jul 5, 2024

Currently having duplicate packages in your manifest will cause bad behavior when actually using those packages.
Fail when duplicate packages are seen in the manifest file.

Ex: 2 dpkg packages in packagesand bazel run @bullseye//:lock

packages:
  - "dpkg"
  - "dpkg"

Without changes and duplicates, the lock passes, but will have duplicate dependencies which leads to errors when actually using the package "@bullseye//dpkg".

				{
					"key": "libcrypt1_1-4.4.18-4_amd64",
					"name": "libcrypt1",
					"version": "1:4.4.18-4"
				},
				...
				{
					"key": "libcrypt1_1-4.4.18-4_amd64",
					"name": "libcrypt1",
					"version": "1:4.4.18-4"
				},
ERROR: /home/eric/.cache/bazel/_bazel_eric/0dc37115db8d04cb9adf89231812a093/external/bullseye/dpkg/amd64/BUILD.bazel:18:10: Label '@bullseye//libcrypt1/amd64:amd64' is duplicated in the 'srcs' attribute of rule 'amd64'

With PR:

ERROR: An error occurred during the fetch of repository 'bullseye_resolution':
   Traceback (most recent call last):
        File "/home/eric/Documents/rules_distroless/apt/private/resolve.bzl", line 82, column 21, in _deb_resolve_impl
                fail("Duplicate package, {}. Please remove it from your manifest".format(dep_constraint))
Error in fail: Duplicate package, dpkg. Please remove it from your manifest
ERROR: /home/eric/Documents/rules_distroless/WORKSPACE.bazel:29:10: fetching deb_resolve rule //external:bullseye_resolution: Traceback (most recent call last):
        File "/home/eric/Documents/rules_distroless/apt/private/resolve.bzl", line 82, column 21, in _deb_resolve_impl
                fail("Duplicate package, {}. Please remove it from your manifest".format(dep_constraint))
Error in fail: Duplicate package, dpkg. Please remove it from your manifest

@thesayyn thesayyn merged commit 17c167f into GoogleContainerTools:main Jul 17, 2024
7 checks passed
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.

2 participants