-
Notifications
You must be signed in to change notification settings - Fork 246
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
Enable gimli-symbolize to be used by libstd #328
Comments
One thing I should also mention though is that we likely want to let the gimli support bake on crates.io for some time before actually moving on this. There's undoubtedly various porting issues and/or bugs that will arise, and it'd be great to weed those out before we move into libstd. |
FWIW, option (2) seems like the best course of action to me, based on gut feeling. |
Taking the submodule route is actually surprisingly easy to get working. This is the change to this crate which can be summarized with:
This is the change to libstd which looks like:
With those two applied I was able to get everything working locally. I was thinking again about the impact of developers on this crate, and I'm actually less worried than I was before. You'll still have access to all of Given the level of ease to get this working, I'm pretty hesitant to use traits/duplication/vendoring code. This seems like it might be the way to go. It means updates are a bit more of a pain because it's a git submodule rather than a crates.io dependency, but code-wise it's quite light... |
The submodule method is also future-compatible with a possible (future) std/core unification. |
With the merge of #344 I've additionally worked to get two more crates working as part of a dependency of libstd:
My assumption is that we'll want to enable zlib decompression by default like libstd does today, so I think we'll need to merge these before including into rust-lang/rust. |
This commit is a preparation of this crate to be included as a submodule into the standard library. I'm not 100% sold on this yet but I'm somewhat convinced that this is going to happen this way. This is progress on #328 and a preview of what it might look like to implement this strategy. Currently I don't plan to merge this to the `master` branch unless it's decided to move forward with this integration strategy of the gimli feature of the backtrace crate.
This commit is a preparation of this crate to be included as a submodule into the standard library. I'm not 100% sold on this yet but I'm somewhat convinced that this is going to happen this way. This is progress on #328 and a preview of what it might look like to implement this strategy. Currently I don't plan to merge this to the `master` branch unless it's decided to move forward with this integration strategy of the gimli feature of the backtrace crate.
This commit is a preparation of this crate to be included as a submodule into the standard library. I'm not 100% sold on this yet but I'm somewhat convinced that this is going to happen this way. This is progress on #328 and a preview of what it might look like to implement this strategy. Currently I don't plan to merge this to the `master` branch unless it's decided to move forward with this integration strategy of the gimli feature of the backtrace crate.
This commit is a preparation of this crate to be included as a submodule into the standard library. I'm not 100% sold on this yet but I'm somewhat convinced that this is going to happen this way. This is progress on #328 and a preview of what it might look like to implement this strategy. Currently I don't plan to merge this to the `master` branch unless it's decided to move forward with this integration strategy of the gimli feature of the backtrace crate.
This commit is a preparation of this crate to be included as a submodule into the standard library. I'm not 100% sold on this yet but I'm somewhat convinced that this is going to happen this way. This is progress on #328 and a preview of what it might look like to implement this strategy. Currently I don't plan to merge this to the `master` branch unless it's decided to move forward with this integration strategy of the gimli feature of the backtrace crate.
* Prepare for this crate to go into libstd This commit is a preparation of this crate to be included as a submodule into the standard library. I'm not 100% sold on this yet but I'm somewhat convinced that this is going to happen this way. This is progress on #328 and a preview of what it might look like to implement this strategy. Currently I don't plan to merge this to the `master` branch unless it's decided to move forward with this integration strategy of the gimli feature of the backtrace crate. * Update as-if-std integration
Do you think this is a viable path for this crate and any others that libstd may want to include in the future, or do you think there would be value in exploring whether some set of language/library changes could make this easier to do? |
Personally, no, I don't think this is viable for many other crates to use. It's a real pain managing submodules and architecting the crate such that it may be included as a submodule but also builds as a standalone crate. I think that this strategy only really makes sense if it applies to a small handful of crates (e.g. 1 or 2). I think it seems reasonable to explore changes to make this more viable, but I don't really know what the best change would be. Everything is pretty large scale compared to the maintenance burden on one crate. |
This was done awhile back! |
Currently the
gimli-symbolize
feature also enables thestd
feature. This means that it's not suitable for inclusion into the standard library. This also means that now that we've switched this crate to using gimli by default the standard library may languish! All-in-all, let's put the final nail in the coffin of libbacktrace and switch to gimli by enabling libstd to use gimli.Some initial words have been said about this on #189, but the general state of the world is that the gimli implementation in this crate only uses a bunch of functions from
std
. This ranges from:std::env::current_exe()
- used to parse own debuginfostd::fs::*
- used to find, locate, and open debuginfo. Often the current executable, macOS is much more involved thoughstd::{path,ffi}::*
- manipulating paths to get passed around in various places, along with reading C strings on Linux.I don't think it is currently clear at this time how we're going to implement this. There's a few possible strategies that have been proposed so far:
std::env::current_exe()
is already significantly complicated to run on all platforms.sys
module out of libstd into a separate crate. Thebacktrace
crate would then un-stably depend on thissys
module. This is a huge change for libstd, however, and highly unlikely to happen.I'm definitely open to more ideas if folks have them :)
The text was updated successfully, but these errors were encountered: