Say a build source only for the trunk's head, and hold what C, assembly and a new go.mod reach (hq ADR 0267, review)
A hand build of an older trunk commit said a closure lacking what was imported since, and the planner would have mapped the next merge onto it. C and assembly beside Go may include files below their directory, and a go.mod made above a package moves it out of its module: each is now held.
This commit is contained in:
@@ -61,11 +61,22 @@ type sourceInputs struct {
|
||||
// read is, per context (repository and ref), the build source read there; nil for one read whole.
|
||||
read map[string]map[string]bool
|
||||
readAs map[string]catalogue.ArtifactContext
|
||||
// contextsAtHead is false once a context was cloned at something other than its trunk's head: its
|
||||
// closure is not the one the next merge there meets, and the build says no build source.
|
||||
contextsAtHead bool
|
||||
}
|
||||
|
||||
// contextOffHead says a context was not its trunk's head.
|
||||
func (s *sourceInputs) contextOffHead() {
|
||||
if s != nil {
|
||||
s.contextsAtHead = false
|
||||
}
|
||||
}
|
||||
|
||||
func newSourceInputs(module string) *sourceInputs {
|
||||
return &sourceInputs{module: module, contexts: map[string]string{}, toolchains: map[string]string{},
|
||||
own: map[string]bool{}, read: map[string]map[string]bool{}, readAs: map[string]catalogue.ArtifactContext{}}
|
||||
own: map[string]bool{}, read: map[string]map[string]bool{}, readAs: map[string]catalogue.ArtifactContext{},
|
||||
contextsAtHead: true}
|
||||
}
|
||||
|
||||
// ownHas adds entries, relative to the module's directory, to its build source in its own repository.
|
||||
@@ -156,6 +167,15 @@ func (s *sourceInputs) buildSources() []BuildSource {
|
||||
|
||||
// withPrefix is an entry relative to the module's directory made relative to its repository's root.
|
||||
func withPrefix(prefix, entry string) string {
|
||||
switch {
|
||||
case entry == "." || entry == "./":
|
||||
entry = ""
|
||||
case entry == "**" || entry == "./**" || entry == "/**":
|
||||
if prefix == "" {
|
||||
return "**"
|
||||
}
|
||||
return prefix + "/**"
|
||||
}
|
||||
entry = strings.TrimPrefix(entry, "./")
|
||||
if prefix == "" {
|
||||
if entry == "" {
|
||||
|
||||
Reference in New Issue
Block a user