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

Remove serde-derive dependency #259

Closed

Conversation

malbarbo
Copy link
Contributor

Musl target does not work with proc-macro.
See rust-lang/rust#40174

Removing serde-derive allows building tectonic for musl targets.

Musl target does not work with proc-macro.
See rust-lang/rust#40174

Removing serde-derive allows building tectonic for musl targets.
@pkgw
Copy link
Collaborator

pkgw commented Nov 16, 2018

Thanks for raising this up to a PR!

It would be really cool to be able to build on musl, but I also expect that there will be an increasing number of parts of Tectonic where using serde (or other proc-macros) would be very valuable.

So, how about adding a Cargo feature to allow this to be controlled at build time? My vision would be that the feature would enable serde-derive and that it would be a "default" feature, so that, well, by default it would be activated. But it could be deactivated for cases like this. Here is a simple example of how you can conditionally compile code based on Cargo feature activation.

When the feature is deactivated (i.e. the musl case), I see two possible ways to do things. Either emulate the derived Serde impl, as you've done here, or use some simpler replacement code that basically always yields a default PersistentConfig struct. I'm leaning towards thinking that the second approach might be better, because if we start adding more serializable structs to Tectonic, the manual impls are going to start getting really hairy.

If we use a feature gate, we should add some new documentation in the README to explain why the feature exists. I think the best approach would be to have a section labeled "Features" that would explain that this feature basically just exists to enable the creation of static binary. (If we end up using other proc-macro features in the future, I think it would be better for them to all have their own features, rather than one big grab-bag stuff-that-breaks-static-linking feature.)

How does that all sound?

@pkgw pkgw self-assigned this Nov 16, 2018
@malbarbo
Copy link
Contributor Author

I made a new PR.

@pkgw
Copy link
Collaborator

pkgw commented Nov 20, 2018

Superseded by #261.

@pkgw pkgw closed this Nov 20, 2018
@spl spl mentioned this pull request Mar 27, 2019
Mrmaxmeier pushed a commit to Mrmaxmeier/tectonic that referenced this pull request Jul 29, 2020
…_other

Xetex consts, functions & Option for pointers
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