Skip to content
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

[SR-762] Don't emit private documentation #43374

Closed
drewcrawford opened this issue Feb 17, 2016 · 4 comments
Closed

[SR-762] Don't emit private documentation #43374

drewcrawford opened this issue Feb 17, 2016 · 4 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself good first issue Good for newcomers serialization Area → compiler: Serialization & deserialization

Comments

@drewcrawford
Copy link
Contributor

Previous ID SR-762
Radar None
Original Reporter @drewcrawford
Type Bug
Status Closed
Resolution Done
Environment

Linux x64
Also verified on OSX El Capitan
swift-DEVELOPMENT-SNAPSHOT-2016-02-08-a

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, Serialization, StarterBug
Assignee @drewcrawford
Priority Medium

md5: bc8ca941ae936747160cd8c3690edb38

Issue Description:

Let's say I am a good citizen and document my private symbols:

/** My TOP SECRET DOCUMENTATION */
private class Foo {
}

When I go to distribute the compiled binary, I find out my private documentation is distributed as well:

$ swiftc test.swift -emit-module -module-name "test"
$ strings test.swiftdoc
My TOP SECRET DOCUMENTATION
/** My TOP SECRET DOCUMENTATION */

If a client can't use a symbol (e.g. it's private [or internal and not -enable-testing]) don't emit the documentation for a symbol in the swiftdoc.

@drewcrawford
Copy link
Contributor Author

Maybe a condition could be added like this one?

// Skip the decl if it does not have a comment.

@belkadan
Copy link
Contributor

Eventually we shouldn't emit anything about non-public entities, but this is certainly an easy first start.

@drewcrawford
Copy link
Contributor Author

What else do we emit besides documentation?

I know we emit e.g. mangled names, but it's not clear to me what we can do about that, besides obfuscate them (and would have to be consistent across compilation units for internal). I don't know what else we might be leaking here.

@drewcrawford
Copy link
Contributor Author

This was merged into master.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself good first issue Good for newcomers serialization Area → compiler: Serialization & deserialization
Projects
None yet
Development

No branches or pull requests

2 participants