Patch Content Requirements Blocker
Root cause: build-haks --archive ... was still collecting content requirements for the entire asset inventory before chunk filtering. So even when building sow_over_01, it demanded downloaded LFS objects from unrelated groups like appr.
This commit is contained in:
@@ -186,7 +186,7 @@ func planOrBuildHAKs(p *project.Project, progress ProgressFunc, writeArchives bo
|
|||||||
}
|
}
|
||||||
|
|
||||||
progressf(progress, "Collecting asset resources...")
|
progressf(progress, "Collecting asset resources...")
|
||||||
assetResources, err := collectAssetResources(p, writeArchives)
|
assetResources, err := collectAssetResources(p, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return BuildResult{}, err
|
return BuildResult{}, err
|
||||||
}
|
}
|
||||||
@@ -209,6 +209,12 @@ func planOrBuildHAKs(p *project.Project, progress ProgressFunc, writeArchives bo
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return BuildResult{}, err
|
return BuildResult{}, err
|
||||||
}
|
}
|
||||||
|
if writeArchives {
|
||||||
|
chunks, err = hydrateHAKChunks(p, chunks)
|
||||||
|
if err != nil {
|
||||||
|
return BuildResult{}, err
|
||||||
|
}
|
||||||
|
}
|
||||||
progressf(progress, "Resolving module HAK order...")
|
progressf(progress, "Resolving module HAK order...")
|
||||||
moduleHakOrder, err := resolveModuleHAKOrder(p, chunks)
|
moduleHakOrder, err := resolveModuleHAKOrder(p, chunks)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -338,6 +344,43 @@ func filterHAKChunksByName(chunks []hakChunk, archiveNames []string) ([]hakChunk
|
|||||||
return filtered, nil
|
return filtered, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func hydrateHAKChunks(p *project.Project, chunks []hakChunk) ([]hakChunk, error) {
|
||||||
|
if len(chunks) == 0 {
|
||||||
|
return chunks, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
lfsAssets, err := collectLFSAssetInfo(p)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
hydrated := make([]hakChunk, 0, len(chunks))
|
||||||
|
for _, chunk := range chunks {
|
||||||
|
nextChunk := chunk
|
||||||
|
nextChunk.Assets = make([]assetResource, 0, len(chunk.Assets))
|
||||||
|
for _, asset := range chunk.Assets {
|
||||||
|
if !strings.HasPrefix(asset.ContentID, "lfs:") {
|
||||||
|
nextChunk.Assets = append(nextChunk.Assets, asset)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
info, ok := lfsAssets[filepath.ToSlash(asset.Rel)]
|
||||||
|
if !ok {
|
||||||
|
return nil, fmt.Errorf("missing LFS metadata for %s", asset.Rel)
|
||||||
|
}
|
||||||
|
resource, err := lfsPathResource(filepath.Join(p.AssetsDir(), filepath.FromSlash(asset.Rel)), info, true)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
asset.Resource = resource
|
||||||
|
nextChunk.Assets = append(nextChunk.Assets, asset)
|
||||||
|
}
|
||||||
|
hydrated = append(hydrated, nextChunk)
|
||||||
|
}
|
||||||
|
|
||||||
|
return hydrated, nil
|
||||||
|
}
|
||||||
|
|
||||||
func progressf(progress ProgressFunc, message string) {
|
func progressf(progress ProgressFunc, message string) {
|
||||||
if progress != nil {
|
if progress != nil {
|
||||||
progress(message)
|
progress(message)
|
||||||
|
|||||||
Reference in New Issue
Block a user