Open Bug 1776104 Opened 2 years ago Updated 2 months ago

Verify that the paths in ThirdPartyPaths.txt exist before adding them to ThirdPartyPaths.cpp

Categories

(Developer Infrastructure :: Source Code Analysis, enhancement)

enhancement

Tracking

(Not tracked)

People

(Reporter: RyanVM, Unassigned)

References

Details

Attachments

(2 obsolete files)

When looking at ThirdPartyPaths.txt recently, I noticed a least a couple paths which no longer exist. We should add a check somewhere which verifies the paths listed. Maybe with os.path.exists() in ThirdPartyPaths.py before it writes ThirdPartyPaths.cpp?

I have patches which mostly work (and correctly identified 16 paths which didn't actually exist), with one problem:

/home/ryanvm/repos/mozilla/obj-x86_64-pc-linux-gnu/dist/include/function2/function2.hpp:1595:30: error: bad implicit conversion constructor for 'function'

Somewhere along the way, function2 moved from topsrcdir to a sub-directory in third_party. I guess the previous (technically incorrect) entry was still enough to avoid the error from hitting in the exported header, but now that's not sufficient anymore. Any thoughts on how to handle this, glandium? I guess technically anything in third_party is susceptible to this kind of problem.

Flags: needinfo?(mh+mozilla)
Summary: Verifies that the paths in ThirdPartyPaths.txt exist → Verify that the paths in ThirdPartyPaths.txt exist before adding them to ThirdPartyPaths.cpp

Also refresh the list generated from ThirdPartyPaths.txt in
.clang-format-ignore.

Depends on D150069

Assignee: nobody → ryanvm

I finally got a working solution to the function2 problem brought up in comment 1. Basically, it requires providing a mechanism for special-case overrides of this check for situations that warrant it. I also created a third list type, Unvalidated.txt, to avoid issues with any other consumers of ThirdPartyPaths.txt. With this update, we effectively treat function2 exactly as it was prior to my patches and everything's green on Try.

Flags: needinfo?(mh+mozilla)
Attachment #9282496 - Attachment description: Bug 1776104 - Verify that the paths exist before writing ThirdPartyPaths.cpp. → Bug 1776104 - Verify that the paths exist before writing ThirdPartyPaths.cpp. r=andi
Attachment #9282497 - Attachment description: Bug 1776104 - Remove missing paths from Generated.txt and ThirdPartyPaths.txt. → Bug 1776104 - Remove missing paths from Generated.txt and ThirdPartyPaths.txt. r=andi
Pushed by rvandermeulen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/05da7d6fa999
Verify that the paths exist before writing ThirdPartyPaths.cpp. r=andi
https://hg.mozilla.org/integration/autoland/rev/c2f124ed65ec
Remove missing paths from Generated.txt and ThirdPartyPaths.txt. r=andi
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 104 Branch
Regressions: 1777527
Status: RESOLVED → REOPENED
Flags: needinfo?(bpostelnicu)
Resolution: FIXED → ---

We had to backout the patches because it caused clang-tidy to fail since it's built our of the tree.

Flags: needinfo?(bpostelnicu) → needinfo?(ryanvm)

Comment 8 doesn't leave me much to go off with respect to how to address the issue that led to the backout. Can you please elaborate?

Flags: needinfo?(ryanvm) → needinfo?(bpostelnicu)
Product: Firefox Build System → Developer Infrastructure

This would probably be better off handled as a new lint instead. Maybe bug 1879254 gives some ideas to build on for doing so.

Assignee: ryanvm → nobody
Status: REOPENED → NEW
Flags: needinfo?(bpostelnicu)
See Also: → 1879254
Target Milestone: 104 Branch → ---
Attachment #9282496 - Attachment is obsolete: true
Attachment #9282497 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: