Skip to content

Add paths from compiler arguments spelled with = to the diagnose bundle #1365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2024

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented May 28, 2024

Eg. if the crash contained -fmodule-map-file=/path/to/module.modulemap, we weren’t including /path/to/module.modulemap in the diagnose bundle.

@ahoppen ahoppen requested review from bnbarham and hamishknight May 28, 2024 21:36
@ahoppen ahoppen requested a review from benlangmuir as a code owner May 28, 2024 21:36
@ahoppen
Copy link
Member Author

ahoppen commented May 28, 2024

@swift-ci Please test

Comment on lines 61 to 68
if compilerArg.hasPrefix("/") {
copyPathToBundleIfNecessary(compilerArg, bundlePath: bundlePath)
} else if let firstEqual = compilerArg.firstIndex(of: "=") {
// Copy files from eg. `-fmodule-map-file=/path/to/module.modulemap`
let possiblePath = String(compilerArg[compilerArg.index(after: firstEqual)...])
if possiblePath.hasPrefix("/") {
copyPathToBundleIfNecessary(possiblePath, bundlePath: bundlePath)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we care about cases like -I/foo/bar?

Copy link
Member Author

Choose a reason for hiding this comment

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

Let’s just look for the first / to start the path. Eventually I’ll need to think about how this should work on Windows as well but right now the entire diagnose bundle pretty heavily relies on oslog scraping, which is only applicable for macOS anyway.

@ahoppen ahoppen force-pushed the modulemap-in-diagnose-bundle branch from 9967641 to fccf1eb Compare May 29, 2024 16:52
…ndle

Eg. if the crash contained `-fmodule-map-file=/path/to/module.modulemap`, we weren’t including `/path/to/module.modulemap` in the diagnose bundle.
@ahoppen ahoppen force-pushed the modulemap-in-diagnose-bundle branch from fccf1eb to 9677a00 Compare May 29, 2024 16:53
@ahoppen
Copy link
Member Author

ahoppen commented May 29, 2024

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented May 29, 2024

@swift-ci Please test Windows

@ahoppen ahoppen merged commit b7b225c into swiftlang:main May 30, 2024
3 checks passed
@ahoppen ahoppen deleted the modulemap-in-diagnose-bundle branch May 30, 2024 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants