-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[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
Conversation
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] { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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.
@dcci Thank you, I like this direction a lot! I think you might want to adjust this line so that the library name is
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. |
@dcci Just let me know if you want to merge this as is, and refactor later. |
Let's go for merging as is if you dont mind. I'll refactor immediately after the end of the christmas break. |
[stdlib] Initial FreeBSD port.
@dcci Merged, thank you! |
Enable --junit to run.py for PR's
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