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

metaprogramming and bootstrapping #42

Open
Ericson2314 opened this issue Sep 7, 2019 · 1 comment
Open

metaprogramming and bootstrapping #42

Ericson2314 opened this issue Sep 7, 2019 · 1 comment

Comments

@Ericson2314
Copy link

I think build.rs and procedural macros should be able to take advantage of std-aware cargo too. This is needed to get rid of the sysroot as a concept entirely. This is also needed to boostrap a working rust from a plain compiler without any libraries. This type of boostrapping is very advantageous of distros.

@gmorenz
Copy link

gmorenz commented May 24, 2024

I was poking around at trying to get a proc-macro to compile, dynamically link to, and call a inline-proc-macro (i.e. what this crate used to do). This is difficult right now because proc-macro (the crate) is statically linked and has important thread locals, but if I compile it by hand I can compile it to a dylib and share those with my inline-proc-macro, at which point things work.

This is absurdly niche and wouldn't even be stable behavior even if it worked, but it's sort of a use case that would be enabled by letting me say something like cargo build --build-std-host=proc-macro -Z target-applies-to-host -Z host-config --config host.rustflags="--crate-type=dylib -C prefer-dynamic".

I'm honestly not sure if this is an argument for or against this feature.

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

No branches or pull requests

2 participants