Skip to content

Remove linux-specific code and enable tests that pass on linux #6

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 3 commits into from
Nov 4, 2021

Conversation

finagolfin
Copy link
Member

@finagolfin finagolfin commented Oct 15, 2021

Summary

These linuxisms were not needed on Fedora Core 33.

Dependencies

None

Testing

Steps:

  1. Apply this patch.
  2. Run ./bin/test on linux with Swift 5.5 installed.

Checklist

  • Added tests - sort of, since I'm enabling more tests
  • Ran the ./bin/test script and it succeeded
  • Updated documentation if necessary - nothing to mention

I noted that all these weren't needed on Android in #5, so I checked on Fedora Core 33 x86_64 and they weren't needed on linux either.

Note that I have not looked into why any of these conditional compilation checks for linux were originally added, I just know that they make no difference in getting the tests passing. If some of these should stay the same, just let me know.

Copy link
Contributor

@ethan-kusters ethan-kusters left a comment

Choose a reason for hiding this comment

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

Hi @buttaface! Thank you for opening this!

This looks generally ready-to-go. I just left a couple of comments inline for pieces I think we should consider splitting into separate PRs to reduce risk and get the majority of this merged as soon as possible.

And like with PR #5, we'll likely want to hold off on merging this until we initially land DocC in a trunk toolchain. But can definitely plan on can merging it immediately after.

let results: [(reference: ResolvedTopicReference, content: RenderReferenceStore.TopicContent)] = references.concurrentPerform { reference, results in
results.append((reference, renderContentFor(reference)))
}
for result in results {
topics[result.reference] = result.content
}

#elseif os(Linux)
Copy link
Contributor

Choose a reason for hiding this comment

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

I just filed https://bugs.swift.org/browse/SR-15385 to track this and the other places in DocC where we've explicitly disabled parallelization on Linux (and now Android).

If you're okay with splitting out this work, I'd prefer to address this in another PR. We've seen unusually high memory usage when converting large documentation catalogs in parallel on Linux which is why this is disabled. Definitely would like to enable parallelizing documentation conversion on Linux but I think we have more investigation to do before then.

Copy link
Member Author

Choose a reason for hiding this comment

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

Alright, reverted this.

@@ -700,12 +700,6 @@ class ConvertServiceTests: XCTestCase {
}

func testReturnsRenderReferenceStoreWhenRequestedForOnDiskBundleWithUncuratedArticles() throws {
#if os(Linux)
Copy link
Contributor

Choose a reason for hiding this comment

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

https://bugs.swift.org/browse/SR-15036 is still open so I think we should leave this disabled for now. I believe we were only seeing this issue on certain Linux distros like Ubuntu 18.04.

I'd be happy to file a bug blocked on SR-15036 to re-enable these once we resolve that issue.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, added these checks back.

Copy link
Contributor

@ethan-kusters ethan-kusters left a comment

Choose a reason for hiding this comment

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

Thank you @buttaface! This looks great.

As with #5, I’ll plan on running CI once https://bugs.swift.org/browse/SR-15362 lands in a toolchain.

I’ll then merge this PR once CI has passed and we’ve merged the integration of DocC in the Toolchain with swiftlang/swift#39723.

@ethan-kusters
Copy link
Contributor

@swift-ci please test

@ethan-kusters
Copy link
Contributor

@swift-ci please test

@ethan-kusters
Copy link
Contributor

@swift-ci please test

@ethan-kusters ethan-kusters merged commit 87263a1 into swiftlang:main Nov 4, 2021
@finagolfin finagolfin deleted the nux branch November 4, 2021 05:03
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