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

The big 2018 cleanup #507

Closed
wants to merge 7 commits into from
Closed

The big 2018 cleanup #507

wants to merge 7 commits into from

Conversation

Lokathor
Copy link

Highlights:

  • GlobalGenerator and StructGenerator got a huge facelift. They now occupy half the space per function that they did before. They also will generally load faster because they pass the function name to look up directly in *const c_char form, so that loader function doesn't have to allocate a temporary string for every lookup.
  • GlobalGenerator and StructGenerator now have more options for how you build the bindings regarding trace support and error checking support. Also included is a Default impl if you don't want to think about it too hard (the default is to turn on all the extra support).
  • DebugStructGenerator is totally gone, use StructGenerator with the debug settings on.
  • StaticGenerator and StaticDebugGenerator are not gone but they are also not upgraded at all. They've been changed the minimum amount so that they build with 2018-edition and the changes to Registry.
  • The contents of the output is now designed to be a complete module file that you don't include directly into your project. In fact if you do you'll get a build error because you can't use inner attributes with an inline module because rust is a dumb butt.

So, because of that last point, basically every test fails to build, to the point where we can't even test that the output is still good or not.

So we need to decide what to do there. We could preserve the include! ability of the output, but then people would manually have to put all sorts of allow(foo) tags on whatever module does the include.

copy paste all the phosphorus stuff into gl_generator and probably break everything
@Lokathor
Copy link
Author

And just to be extra clear: this will at least slightly break nearly every user of the crate when they upgrade from 0.14 to 0.15, because the loader function is passing *const c_char instead of &str now, but it's for their own good.

/// thread, but there is a relaxed load when calling a function (which on
/// `x86`/`x86_64` is "basically free", but on other systems it might not
/// be).
pub use_atomics: bool,
Copy link
Owner

Choose a reason for hiding this comment

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

Wondering if we might want to make these private and use a builder-style thingy to save us from future grief with versioning?

gl_generator/generators/global_gen.rs Outdated Show resolved Hide resolved
gl_generator/generators/struct_gen.rs Outdated Show resolved Hide resolved
gl_generator/registry.rs Show resolved Hide resolved
@brendanzab
Copy link
Owner

This is looking good! Still need to look closer though, I've only done a cursory pass over it right now.

I'm also really interested in what people downstream have to say.

@brendanzab
Copy link
Owner

Re. ffe151e, I do see many people using the static stuff for the platform-specific extensions. For example ocl-interop and rust-glx. Should we be getting folks to use the loaders for these, or is this accepted as best-practice in this case?

gl_generator/lib.rs Outdated Show resolved Hide resolved
also move the registry doc generation up into the Registry module so that more generators can potentially use it.
if it can't be 0, it couldn't have been uninit anyway.
uses builder style
defaults to no trace, no debug, atomics on.
all crates on 2018 edition now
these tests are really getting out of control!
@Lokathor
Copy link
Author

As discussed on Discord, closing this until more time can be found to work on this repo.

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.

None yet

2 participants