-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Rename libstd.so to libruststd.so #999
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
Comments
I admit this is a bit of hackish, but it seems works. :) Please suggest if there is a better way to handle it with keeping the crate name unchanged. |
Hi lht. Thanks for investigating this. I agree that is hackish. The obstacle here is that we're interpreting the filename as crate metadata; in other words, when looking for a crate named 'foo', we expect it to be in a file named 'libfoo.so'. In all other respects we treat the crate metadata as actual metadata. I think what we should try is to completely separate these two concepts, so the crate metadata is independent of the library name. So in find_library_crate_aux the first sanity check we do is look for a library containing the crate_name. Instead I think this function should just verify that the file looks like a library, e.g. lib*.so on linux, etc. then inspect the metadata to check the crate name. The thing you are going to run into is that the current code handles the case where the 'use' statement doesn't specify any metadata. In find_library_crate, when it's building the crate_name it uses either the 'name' meta-item, as in To remedy this we'll need to implicitly create a "name"=val meta-item when the use statement doesn't provide one and match the library metadata against that. This approach does pose a performance risk since we will end up opening every library on the search path. I suspect that this won't be an immediate problem since our default search paths are in rustc-specific directories; we're not searching /usr/lib. Nonetheless, we should probably time a full run of 'make check' both before and after this change to make sure there isn't a serious regression. I checked in some additional logging to creader that might help debugging. I hope that all made sense. |
Hi, Brian! Thanks a lot of such a thorough explanation! And I learnt using log fmt to help understand the code. Very useful! :) $ git log --oneline -n 2 I see some slow down after the commit. I wonder is there a simple way to just compile tests but not running them? |
Looks good! I compared the time for a full 'make check' before and after your patch and don't see a regression, so that's ok. Merging this is going to require some temporary makefile tweaks and a new snapshot since the stage0 compiler is still using the old rules to find libstd.so (try doing a make clean then building and you'll see the stage0 compiler can't find the standard library with the new name). I will work on that and try to get this merged on Monday. Which OS are you running on? None of the bots show those build failures. There's no way currently to compile the tests without running them. |
I found there is actually a "/?" file exists. That's because I forgot to change owner of the root directory to "root" after migrating data from Btrfs to Ext4 months ago. Fix it and now all cases are passed. Sorry for the false alarm! |
Oh. Those tests are pretty bad then, since they will fail when running as root. |
OK. This is integrated. Thanks, lht. |
Revert rust-lang#999 commit 16dad84 Issue rust-lang#1157
This is a file we will be installing in /usr/lib. Simply calling it 'std' is not very nice. The crate can still be named 'std' - it will just have a friendlier file name.
The text was updated successfully, but these errors were encountered: