Skip to content

Conversation

@letFunny
Copy link
Collaborator

@letFunny letFunny commented Oct 2, 2025

v3-essential is a new field present for Chisel formats "v2" and "v1". Note that this does not affect how Chisel does conflict resolution across dependencies, i.e. Chisel will not take into account architecture specifics to be smarter about conflicts.

BREAKING CHANGE: This commit changes how yaml is marshalled for tools such as chisel info. The values of essential and v3-essential are both marshaled into v3-essential.

  • Have you signed the CLA?

v3-essential is a new field present for Chisel formats "v2" and "v1".
Note that this does not affect how Chisel does conflict resolution
across dependencies, i.e. Chisel will not take into account architecture
specifics to be smarter about conflicts.

IMPORTANT: This commit changes how yaml is marshalled for tools such as
chisel info. The values of `essential` and `v3-essential` are both
marshaled into `v3-essential` to make it clear that is the expected
archive representation.
@letFunny letFunny added the Priority Look at me first label Oct 2, 2025
@letFunny letFunny requested a review from niemeyer October 2, 2025 10:50
@github-actions
Copy link

github-actions bot commented Oct 2, 2025

Command Mean [s] Min [s] Max [s] Relative
BASE 8.550 ± 0.024 8.514 8.602 1.00
HEAD 8.576 ± 0.040 8.541 8.663 1.00 ± 0.01

Copy link
Contributor

@niemeyer niemeyer left a comment

Choose a reason for hiding this comment

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

This is very good, Alberto, thank you.

Only some minors about the error message.

Also, a comment on this:

IMPORTANT: This commit changes how yaml is marshalled for tools such as chisel info. The values of essential and v3-essential are both marshaled into v3-essential to make it clear that is the expected archive representation.

This is actually a breaking change. It may well be that the likelyhood of breakage isn't worth the cost and complexity of doing anything else. But we should at least see it as it is: we're changing the format in an unsupported way, in a very particular place.

if _, ok := yamlPkg.V3Essential[refName]; ok {
// This check is only needed because the list format can contain
// duplicates. It should be removed when format "v2" is deprecated.
return nil, fmt.Errorf("package %s defined with redundant essential slice: %s", pkgName, refName)
Copy link
Contributor

Choose a reason for hiding this comment

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

s/%s/%q/, as the package name is naked and the word can mix confusingly in the message.

The message also feels unnecessarily vague. It could be straight on:

package %q repeats %s in both "essential" (compatibility) and "v3-essential" (arch support)

Copy link
Collaborator Author

@letFunny letFunny Oct 7, 2025

Choose a reason for hiding this comment

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

There are actually more cases where this error message is returned. Because essential is a list at the moment, it means that it can have duplicates on its own:

	summary: "Duplicated slice essentials",
	input: map[string]string{
		"slices/mydir/mypkg.yaml": `
			package: mypkg
			slices:
				slice1:
					essential:
						- mypkg_slice2
						- mypkg_slice2
				slice2:
		`,
	},

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I agree that the error message could be simpler so I changed it per your other suggestion to: slice mypkg_slice1 repeats mypkg_slice2 in essential fields for the test case above. We could be more specific, but I think the message is descriptive enough to cover all errors due to duplication in a unified way. Let me know what you think.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority Look at me first

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants