Uh oh!
There was an error while loading. Please reload this page.
Limit dylib symbols - #59752
Conversation
rust-highfive
commented
Apr 6, 2019
(rust_highfive has picked a reviewer for you, use r? to override) |
matthewjasper
commented
Apr 6, 2019
Zoxc
commented
Apr 6, 2019
michaelwoerister
commented
Apr 8, 2019
Note: This should fix issue #53014. Before I approve, I want to discuss the problem some more in that issue in order to make sure we know what exactly is going on. |
Zoxc
commented
Apr 8, 2019
@bors try |
bors
commented
Apr 8, 2019
⌛ Trying commit 2f948ea with merge d8873bfe3191043214a8a2630a01ac602be96a01... |
Zoxc
commented
Apr 8, 2019
@michaelwoerister That issue is for msvc, which isn't affected by this PR. |
I'm confused: This code only changes a method in Am I misunderstanding the relationship between the Update: Ah, @Zoxc pointed out the same detail. |
michaelwoerister
commented
Apr 8, 2019
Ah OK. So this is just a drive-by bug fix? |
Zoxc
commented
Apr 8, 2019
Ran into it when reviving #56987. |
michaelwoerister
commented
Apr 8, 2019
Well, I guess there's no harm in passing the list of exported symbols to the linker explicitly then. Although there's still the question why it makes a difference (as mentioned in #53014 (comment)). |
michaelwoerister
commented
Apr 8, 2019
And I wonder if we can also remove the early exit for proc-macros. IIRC, they should only export |
bors
commented
Apr 8, 2019
☀️ Try build successful - checks-travis |
Zoxc
commented
Apr 8, 2019
@rust-timer build d8873bfe3191043214a8a2630a01ac602be96a01 |
rust-timer
commented
Apr 8, 2019
Success: Queued d8873bfe3191043214a8a2630a01ac602be96a01 with parent 3750348, comparison URL. |
rust-timer
commented
Apr 8, 2019
Finished benchmarking try commit d8873bfe3191043214a8a2630a01ac602be96a01 |
michaelwoerister
commented
Apr 8, 2019
Looks pretty good! I know @alexcrichton already found in the past that dynamic linking can take up quite a bit of time when compiling small crates. You can r=me in the current state or try out things with proc-macro early exit also removed. |
rust-highfive
commented
Apr 8, 2019
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Zoxc
commented
Apr 8, 2019
I wasn't expecting that error, maybe we ignore a proc macro without the right symbols exported? Anyway, @bors r=michaelwoerister |
bors
commented
Apr 8, 2019
📌 Commit 2f948ea has been approved by |
Limit dylib symbols This makes `windows-gnu` match the behavior of `windows-msvc`. It probably doesn't make sense to export these symbols on other platforms either.
pnkfelix
commented
Jun 20, 2019
discussed in T-compiler meeting; accepting for beta backport. |
Centril
commented
Jun 25, 2019
Discussed at the T-release meeting. @Mark-Simulacrum would be happy to r+ a PR that adds a note to the "known issues" section of the relnotes. |
If I understand correctly this PR appears to be the cause of multiple dylib regressions introduced from 1.37.0 forcing people to pin to 1.36.0 if struck by these errors. Furthermore this issue has been present for a rather long time now, if there is no easy solution is it worth fielding the idea of reverting the change? 185dceb The still affected issues appear to be: #64340, #66265 and #65610 |
michaelwoerister
commented
Nov 18, 2019
Thanks for bringing that up, @alexkornitzer. Nominating for discussing in |
alexkornitzer
commented
Nov 28, 2019
Hi @michaelwoerister, did the compiler team manage to reach a consensus on this? I tried looking for the minutes from the last meeting but they don't appear to be online yet. |
michaelwoerister
commented
Dec 2, 2019
@alexkornitzer This has not been discussed yet, as far as I know. |
alexkornitzer
commented
Dec 2, 2019
@michaelwoerister that is disappointing but thank you for the update. |
michaelwoerister
commented
Dec 2, 2019
Zoxc
commented
Dec 2, 2019
#66265 seems like it should result in a linker error even if I haven't look closely at #64340, but it seems to have a problem linking Rust symbols now (not linking to C stuff), which might be a bug with dylibs in rustc. |
solb
commented
Dec 5, 2019
@Zoxc The reason there's no duplicate-definition error in #66265 is that the definitions of the |
solb
commented
Dec 5, 2019
@michaelwoerister I've been working with gritty details of shared libraries and the dynamic linker a lot recently, and would be happy to be involved in discussions of this and similar issues when they arise. Any idea when this will come up in triage? |
eddyb
commented
Dec 5, 2019
This is not entirely accurate, as the compiler does need to let the linker see the exports (which is why it doesn't work anymore after this PR was merged, IIUC the discussion here). I think @Zoxc's point is that we never advertised this as a feature, and so our official position could be that any situation where this worked previously, was merely coincidental and does not constitute "permission" to rely on shadowing. There could be several reasons to take this stance:
|
michaelwoerister
commented
Dec 6, 2019
@solb There is some discussion going on here: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/dylib.20linking.20breakage/near/182674053 |
pnkfelix
commented
Jun 3, 2020
Here is a link to the public archive of the discussion that @michaelwoerister linked above: https://zulip-archive.rust-lang.org/131828tcompiler/28755dyliblinkingbreakage.html I'm removing the nomination label from this now because I think that discussion essentially covered our thinking at that time, and I don't think much of the thinking has changed since then. Notably, that discussion did end with:
(That's all still true, but I don't think anyone has been actually tasked with creating such an RFC or similar public proposal.) |
This makes
windows-gnumatch the behavior ofwindows-msvc. It probably doesn't make sense to export these symbols on other platforms either.