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

Incremental compilation + multiple codegen units #16

Closed
theduke opened this Issue Dec 12, 2017 · 5 comments

Comments

Projects
None yet
2 participants
@theduke

theduke commented Dec 12, 2017

I asked this on reddit, but since I'm not sure that you'll read it:

I've scanned the code and noticed that to make the sql! macro work, you are storing table and column information in global statics inside the tql_macros crate.

Wouldn't this break with conditional compilation, and also potentially with multiple codegen units?
Or does custom derive / proc macro expansion happen each time and so the state is always there?

Also I guess this means that tql can only be used within one crate, namely the one that defines the tables?

@antoyo

This comment has been minimized.

Owner

antoyo commented Dec 12, 2017

Thanks for pointing out this issue.
I tested with incremental compilation and it seemed to work.
However, it does not work with multiple crates.

So, I will remove the internal state of the proc-macro to solve this issue.

@antoyo antoyo added bug medium labels Dec 12, 2017

@theduke

This comment has been minimized.

theduke commented Dec 12, 2017

Isn't the global state required though? Where else are you going to get the type information from?

@antoyo

This comment has been minimized.

Owner

antoyo commented Dec 12, 2017

We can do without. I'll use the same trick I used to type-check the arguments (variables).

@antoyo

This comment has been minimized.

Owner

antoyo commented Jan 19, 2018

It should be fixed by PR #23.

@antoyo antoyo closed this Jan 19, 2018

@theduke

This comment has been minimized.

theduke commented Jan 19, 2018

Just out of curiosity, how did you implement it now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment