Skip to content

[stdlib] Initial FreeBSD port. #713

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
Dec 25, 2015
Merged

[stdlib] Initial FreeBSD port. #713

merged 1 commit into from
Dec 25, 2015

Conversation

dcci
Copy link
Member

@dcci dcci commented Dec 21, 2015

Dmitri, All the duplication in the overlay code is now gone. Only the module map is duplicated but I'm not too worried about that (would like to hear your opinion). Also, for now, FreeBSD libc is not-entirely-correctly called Glibc -- but I think a renaming can be done later (maybe it should be called Libc?)

Thanks!

Davide

@dcci
Copy link
Member Author

dcci commented Dec 21, 2015

This continues the discussion in #664. I wasn't able to update that request which was closed. I'll try to improve my git foo in the future to avoid similar issues.

///
/// It's not named just FreeBSD libc so that it doesn't conflict in the event of a
/// future official FreeBSD libc modulemap.
module SwiftGlibc [system] {
Copy link
Contributor

Choose a reason for hiding this comment

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

SwiftGlibc?

I almost feel like this file should be generated with gyb for both platforms from the same source... Gyb supports substitutions for @GLIBC_INCLUDE_PATH@.

Do you think this would make sense?

Copy link
Contributor

Choose a reason for hiding this comment

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

Take a look at how we handle UnicodeExtendedGraphemeClusters.cpp.gyb as an example.

Copy link
Member Author

Choose a reason for hiding this comment

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

About the first question, yes, I kept the Glibc name around in the hope we can rename that to something more generic in the future -- Libc maybe? (but I preferred to limit the churn in this commit).
About the latter -- I think it definitely makes much more sense to have a machine generating it for us. I think it also makes sense to do that first -- what's your idea?

Copy link
Member Author

Choose a reason for hiding this comment

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

Is there any documentation available on gyb ?

Copy link
Contributor

Choose a reason for hiding this comment

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

There isn't documentation, but you can look at *.gyb files in the source to look up the syntax. As input, gyb accepts text files with Python code in special blocks (either %-lines or %{ ... }% blocks) and ${} substitution expressions.

I think it also makes sense to do that first -- what's your idea?

I'm OK with this happening in order that is easier for you, as long as we arrive at a maintainable codebase with low duplication :)

Copy link
Contributor

Choose a reason for hiding this comment

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

And of course there is ./utils/gyb.py --help, somehow forgot about that.

@gribozavr
Copy link
Contributor

@dcci Thank you, I like this direction a lot!

I think you might want to adjust this line so that the library name is libc on FreeBSD:

add_swift_library(swiftGlibc

Also, the module name is inferred from the first source file name. You might need to add some CMake plumbing to allow passing down an explicit module name.

@gribozavr
Copy link
Contributor

@dcci Just let me know if you want to merge this as is, and refactor later.

@gribozavr gribozavr self-assigned this Dec 25, 2015
@dcci
Copy link
Member Author

dcci commented Dec 25, 2015

Let's go for merging as is if you dont mind. I'll refactor immediately after the end of the christmas break.

gribozavr added a commit that referenced this pull request Dec 25, 2015
[stdlib] Initial FreeBSD port.
@gribozavr gribozavr merged commit a954ebe into swiftlang:master Dec 25, 2015
@gribozavr
Copy link
Contributor

@dcci Merged, thank you!

freak4pc pushed a commit to freak4pc/swift that referenced this pull request Sep 28, 2022
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