Skip to content

Commit

Permalink
Absolutize binary lib path in all cases
Browse files Browse the repository at this point in the history
Otherwise causes spurious final manifest diffs
  • Loading branch information
rojer committed Aug 26, 2021
1 parent ea63b00 commit 991be5d
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions cli/manifest_parser/manifest_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,10 @@ func ReadManifestFinal(
}
variants = append(variants, manifest.Platform)
for _, variant := range variants {
bl := moscommon.GetBinaryLibFilePath(buildDirAbs, lcur.Lib.Name, variant, libVersion)
bl, err := filepath.Abs(moscommon.GetBinaryLibFilePath(buildDirAbs, lcur.Lib.Name, variant, libVersion))
if err != nil {
return nil, nil, errors.Trace(err)
}
fi, err := os.Stat(bl)
if err == nil {
// Local file exists, check it.
Expand All @@ -373,10 +376,6 @@ func ReadManifestFinal(
glog.V(1).Infof("%s is a tombstone, skipping", bl)
continue
}
bl, err := filepath.Abs(bl)
if err != nil {
return nil, nil, errors.Trace(err)
}
ourutil.Freportf(logWriter, "Prebuilt binary for %q already exists at %q", lcur.Lib.Name, bl)
binaryLib = bl
break
Expand Down Expand Up @@ -995,15 +994,15 @@ func prepareLib(
// `lib mos.yml' name; m.Name == libRefName || library location basename.
// After validation, m.Name will be the library `name to use' above.
if libManifest.Name != "" {
if libRefName != "" && libRefName != libManifest.Name { // (6, 8) above
if libRefName != "" && libRefName != libManifest.Name { // (6, 8) above
lpres <- libPrepareResult{
err: fmt.Errorf("Library %q at %q is referred to as %q from %q",
libManifest.Name, m.Location,
libRefName, manifest.Origin),
}
return
}
if libRefName == "" && m.Name != libManifest.Name { // (7) above
if libRefName == "" && m.Name != libManifest.Name { // (7) above
lpres <- libPrepareResult{
err: fmt.Errorf("Library %q at %q must be referred to as %q from %q",
libManifest.Name, m.Location,
Expand All @@ -1012,7 +1011,7 @@ func prepareLib(
return
}
}
if libRefName != "" && m.Name != libRefName { // (3, 9) above
if libRefName != "" && m.Name != libRefName { // (3, 9) above
m.Name = libRefName
}
name, err := m.GetName()
Expand Down

0 comments on commit 991be5d

Please sign in to comment.