-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Large types cause linker failure #130729
Comments
This looks similar to #83060. How big are the rlibs in question? |
Funny to see you here |
I might be way off here (since I'm not currently compiling and checking anything) but I'd be curious if there are a bunch of monstrously large and monomorphized enums at play, @benwis |
Enums? I don't think so. But we do have those large types that contain a tuple that contains all the children |
4 GB would do it. You should be able to set |
If this is about exceeding the 4GB limit, the most-minimal reproduction will be unreasonable. Nonetheless, we would like it. |
I'm working on getting y'all a repro. There are potentially multiple issues here and I need to look at it |
This is entirely possible. Routing between different pages is handled by enums. A site that has, say, 16 pages, would have its view defined by something like I've reopened a branch over in our repo that uses type erasure instead of that enum, and asked people to test against it. It had not solved some of our other issues with overall compile time on some of those larger repos, but it's possible it helps with this particular linker issue. |
I’m also having linking issues on my side. |
@saethlin @workingjubilee I still don't have a postable reproduction, but I have more general questions and info I can provide.
Some people report that a --release build works, which I suspect is 2. And some people report nothing works, which seems like 1. Does that seem plausible? |
If this is the case, it should be possible to bisect to it with cargo-bisect-rustc. You'll probably want the --script argument. Bisecting might take a while if the build is slow but it's very set-and-forget.
If this is the case, a debug build with |
My predominant linker error with leptos 0.7 happens on both stable/nightly + debug/release, so both of these theories seem a little off at least for my case:
|
This comment has been minimized.
This comment has been minimized.
More people confirming that they are seeing the same problem does not help in debugging or fixing this, and dilutes the conversation in this issue because eventually GitHub will start collapsing comments which makes this issue much harder to navigate. A reproducer would help; as far as I can tell no reproducer has been shared. Please refrain from commenting that you are also running into this problem unless you are also delivering a reproducer. |
So I'm one of the maintainers of Leptos, and we're experimenting with a new static type system for our next release. The issue we're having is that for people porting existing websites/apps to the beta, experience a linker issue with link.exe, lld, mold, and ld. Our theory is that once the types reach a certain size, it will crash the linker.
In this version we're encoding the HTML tree into the type system by constructing
View<>
types that contain a tuple of it's descendants.You can see what that looks like in the below code, which does not crash.
So far we haven't nailed down a reasonable reproduction I can post, but I can reproduce the issue while trying to build one of our user's private projects. Running
cargo leptos build
, which runscargo build --no-default-features --features=ssr
, generates this error. I've put it in a gist because it is huge: https://gist.github.com/benwis/fe3a8010243c0f6b338f6aef0b0e7ad2I'm not quite sure how to debug this, we'd love to use this system as it offers a number of benefits, but if it's going to break compilation at larger app sizes we'll have to defer. Any thoughts?
The text was updated successfully, but these errors were encountered: