Skip to content

Remove dead code around the Deadline Task Status record from the compatibility library #63652

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
Feb 15, 2023

Conversation

rokhinip
Copy link
Contributor

Remove dead code around the Deadline Task Status record from the compatibility library

Radar-Id: rdar://problem/88093007

@rokhinip rokhinip requested review from mikeash and etcwilde February 14, 2023 14:59
@rokhinip
Copy link
Contributor Author

@swift-ci please test

Copy link
Contributor

@mikeash mikeash left a comment

Choose a reason for hiding this comment

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

Yay, deleting code!

Copy link
Contributor

@mikeash mikeash left a comment

Choose a reason for hiding this comment

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

Yay, deleting code!

@@ -343,10 +343,6 @@ OVERRIDE_TASK_STATUS(task_escalate, JobPriority,
swift::, (AsyncTask *task, JobPriority newPriority),
(task, newPriority))

OVERRIDE_TASK_STATUS(task_getNearestDeadline, NearestTaskDeadline,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this might need to stay in order to maintain the layout of the overrides struct.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah cause we already have the override hook present even though it is not actually called/used anywhere?

Copy link
Contributor

Choose a reason for hiding this comment

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

Exactly. We magick up a struct containing a function pointer field for each of these things, and we want that struct to have the same definition in the compatibility library and in the runtime it applies to.

Copy link
Member

Choose a reason for hiding this comment

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

@rjmccall added really solid documentation on what we can and cannot do to the compatibility overrides here to avoid breaking the ABI; https://github.com/apple/swift/blob/main/stdlib/public/CompatibilityOverride/CompatibilityOverrideRuntime.def

compatibility library

Radar-Id: rdar://problem/88093007
@rokhinip rokhinip force-pushed the rokhinip/88093007-remove-dead-code-compatibility branch from 8a4663e to ee98c1c Compare February 14, 2023 22:11
@rokhinip
Copy link
Contributor Author

@swift-ci please test

@rokhinip rokhinip requested a review from mikeash February 14, 2023 22:12
Copy link
Member

@etcwilde etcwilde left a comment

Choose a reason for hiding this comment

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

I'm slightly on the fence about changing CompatibilityOverrideConcurrency.def. It shouldn't matter since we should never have to fix a function that wasn't used, but the change doesn't do anything. We would need a time-machine to remove it from the swift 5.5 and 5.6 runtimes, where it actually matters. Since the function is never used though, it's probably fine.

Removing TaskDeadline and NearestTaskDeadline is fine. Neither of those show up in the library and can be removed. There are no symbols associated with them.

I've run the tests on my macOS 10.15.6 box and it looks like the parts that matter are working.

@rokhinip
Copy link
Contributor Author

@swift-ci please test Windows platform

@mikeash
Copy link
Contributor

mikeash commented Feb 15, 2023

Since task_getNearestDeadline is never called, we'll never need to override it. As long as we keep the struct layout intact, we're good.

@rokhinip
Copy link
Contributor Author

@swift-ci please test macOS platform

@rokhinip rokhinip merged commit 1ccf48e into main Feb 15, 2023
@rokhinip rokhinip deleted the rokhinip/88093007-remove-dead-code-compatibility branch February 15, 2023 23:12
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.

3 participants