Binary patching rust hot-reloading, sub-second rebuilds, independent server/client hot-reload (#3797)

Enable runtime rust hot patching.

* roll back wry to 0.45

* cleanup rustc

* wip

* wip: fix client/server

* get the subsecond cli thing working again

* back to list of builds but with accessors

* migrate some methods to workspace, clean up impl a bit

* pass mode through build context

* use a build context, similar to cargo/rustc

* merge BuildUpdate and HandleUpdate into BuilderUpdate

* Move more resolution of args into runner

* migrate some methods to runner

* hoist out fullstack

* fix build request resolver

* yay request is cleaned up

* fixup resolution a bit

* spawn off the build!

* re-wire android autodetection

* re-wire android autodetection

* wire back up a few more things

* re-wire tooling verification

* I think it's mostly in the right condition for regular app

* add depinfo parser

* yay okay works with regular apps again

* full rebuilds are back

* rewire file wtcher

* wire patch!

* yayyyyyy patching works and is really fast

* yay android works

* clean up stdout piping

* yayyy memap on android so we don't need root

* create a static wasm jump table

* wip: global offset table for wasm

* wip... thinking about making the patches relocatable

* wip: customized relocation

* YESSSSSS RELOCATABLE WASM

* clean up impl a bit

* lil bit more cleanup

* lil bit more

* lil bit more cleanup

* lil bit more cleanup, support 32 bit platforms

* sick, wasm is completely pic

* hmmmm not quite working yet

* woooo, patches loading from rust+wasm

* integrated into the cli 😎

* condense a bit

* cleaned up request a bit

* bust fingerprints

* Make the file diffing logic a bit more sensible

* still working through a few issues, server launches but is acting weird

* fix merge conflict

* more merge issues

* remove stuff we don't want anymore

* revert name change

* wip: server not working anymore :(

* split apart "dioxus fullstack" into "dioxus server" and "dioxus web"

* fixup a few more compile errors

* grrr opening server

* simultaneous frontend and backend patching

* use rustc wrapper

* wip: passing assets to jumptable

* migrate project-like examples

* patchy  patchy server fns!

* rollback some random changes

* unwind the js files

* rollback hash

* no need for patch

* more cleanups

* lil bit more cleanup, remove some old cruft

* allow patching when wasm webpage is closed

* tiny bit more robust

* lil bit of clean up

* clean up ws code

* bit more clean ups

* condense

* undo file moves

* move back other project

* move other project

* migrate out harness and janky CLI

* fix compile

* anonymize some files, heavily document others

* lots more documentation, for posterity!

* ton more docs

* clean up the cli a bit more

* more ws cleanup

* more cleanup

* migrate build id to cli-config

* add command file handling

* random small cleanups

* wip....

* wip....

* fix: use workspace for krate discovery

* fix panic logging on serve by placing it *after* the logs

* reorder logging to be sensible on success

* bring back swc

* ws cruft

* small patches to relocs in loader

* bump krates

* hoist main funcs into the ifunc table, fixing wasm

* fix tui output for long lines

* add more linker logging

* wow, incredible, we build fat binaries, holy heckkkkk

* fix args for frontend/backend

* small cleanups

* properly send along build IDs to clients

* fix workspace compiles

* clean up jump table work a bit

* clean up logging a bit

* open existing

* fixup some commands

* open existing browser integration

* wire up the new dx serve client/server syntax

* fixup `dx run` command

* bring back some old functionality

* fix serverfn feature sets

* remove toast animation and simplify its code a bit

* less intrusive toast

* dont change build status when patching on web

* add proper cache busting to vcomponent

* clean up the patch file a bit

* more lints/checks cleaned up

* go back to TargetArgs but a BuildTargets resolved struct

* clean up more nits

* use an atomicptr for jumptable

* fix interaction with initial web load + suspense

* don't run asset system on wasm/bindgen js in dev

* reduce blast radius of PR

* use profile to determine if we're in release

* cleanup prod html template

* cleanup profiles

* fix feature resolution of fullstack

* if fullstack is explicitly false, don't use it

* light cleanups

* drop carg config2

* pass along linker args properly

* make workspace examples compile with dx again

* fewer unwraps and better error loggign

* bit more error handlign

* small cleanup

* drive-by cleanups

* use queries instead of initialize for aslr stuff

* fix hotpatch with higher opt level

* fix aslr bug from multiple clients

* fix merge conflict

* fix typos

* clippy

* fix miscompile

* fix doctest

* properly rollback wry to 0.45

* fix markdown path issues, other test issues

* fix test in router

* fix release mode test

* fix some more tests, clean up a few more items

* use fnptr instead of typeid

* clean up memozation via subsecond in core

* use "main" as sentinel

* fix imports and re-exports

* get off __rust_alloc for aslr offset detection

* wip

* wip... fixing unoptimized web

* hmmmm mmmm

* close,ish, still missing the wasmbindgen dynaimc imports

* aha! full wasm works now

- disable externref when compilng patch modules
- manually link wasm instrinsics
- displace the __wbindgen_placeholder__ table with the synthesized wbg imports

what an awful pain.

There might be a few items missing, so will test against the docsite shortly

* remove failing test

* hmmmm things aren't perfect

* from what I can tell, relocatable wasm just doesn't work with wasm-bindgen

sad

https://github.com/rustwasm/wasm-bindgen/issues/1420

* AI IS LITERALLY THE WORST

* preserve wasm snippets across compiles

* IT HOTPATCHES THE DOCSITE, WE ARE LIVING IN THE FUTURE

* remove the macos cfg-out

* fix: need to allocate 1 more page

* fix url issue

* properly span props

* properly fill in extra symbols

* light cleanups and good docs

* delete cruft, better docs

* More cleanups and simplifications

* clippy, typos

* remove harnesses

* wasm-bindgen error logging

* clean up deps

* remove cruft

* proper priv/pub

* use ifuncs for all env imports

* cruft

* use par_iter, better output

* implement a cache for the base module

* delete custom sections

* cache the main native module too

* add par iter in a few more places

* clippy, map ident

* better logging and status bars

* wip: some small windows support

* wip more windowss

* fix weird regression

* implement windows jump table

* small fixes for windows

* better windows support

* windows support pt2

* rust lld is not msvc

* whole archive the rlibs

* ignore windows and sys crates

* logging

* ohhhhhh, pop out dlls

* dedupe

* thANK GOD FAT LINKING WORKS ON WINDOWS

* hoist caching

* implement patch based on cache

* fix location for pdb

* pass data symbols, correct object

* add all symbol for windows

* add log

* treat none rva as undefined

* whoops

* handle windows calling convention

* dont use relocated arm64 stub windows

* not all are text?

* WINDOWS FUNCTION PATCHING WORKS

but issue with statics?

* use our own entry

* handle windows imp symbols

* add log

* jump to the real symbol not the layout

* whoops

* hotpatching windows works completely holy heck yay

* drop linker args crate

* disable ssg playwright for now

* light cleanups

* some cleanups / preps:
- bump to serverfn 0.8.2
- fix playwright test
- fix clippy

* use fix from #4042

* bring in other fix for liveview

* hoist some configuration

* use __aslr_reference instead of aslr_reference

* add better errors to patcherror

* fix android

* panic if patching fails

* clean up tomls

* wip: fixing wasm compile for server

* fullstack wasm again

* fix cfg

* fixup feature detection

* fix issue with features

* fix playwright!

* add barebones template test harness

* fix compatibility between the two hotreload engines

* fix preldue of server

* fix check for wasm-opt

* small fixes
This commit is contained in:
Jonathan Kelley authored and GitHub committed 2025-05-06 23:08:59 -07:00
1 parent 71d85e6dd5
commit d976ca184a
142 files changed
+17982 -7156

No files matched your search

+426
View File
@@ -0,0 +1,426 @@
<!DOCTYPE html>
<html>
<head>
<title>Dioxus Build</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta charset="UTF-8" />
<link rel="icon" type="image/png" href="https://avatars.githubusercontent.com/u/79236386?s=200&v=4">
<style>
/* Fira Mono Font */
@import url('https://fonts.googleapis.com/css2?family=Fira+Mono:wght@400;500;700&display=swap');
body {
margin: 0;
padding: 0;
overflow-x: hidden;
font-family: "Fira Mono", monospace;
color: #313131;
background-repeat: repeat;
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6CAMAAAC/MqoPAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAABgUExURdXZ39ba4Nfb4dHV29vf5dre5Njc4tnd49TY3uDk6t3h59zg5uHl697i6NPX3dLW3M/T2ePn7d/j6dDU2uTo7uLm7M7S2OXp783R18zQ1uru9O3x98vP1ebq8Ont88rO1EIB0XMAAAAJcEhZcwAADsMAAA7DAcdvqGQAAIpzSURBVHheLf2LgqNIErZpAhIIgUCZREd1z+zM7v3f5T4v9fehKjNCQu7mZt/B3EHDME7T4zkP8zKMw+s1r6/X8z295mV7bdP42vd5fr2Wedq2afGnfZ4+y2d67s99ePnJuEzL8RrnfVle4zk9jmNctnN+7dP2mo7X/hzncfss2zofr+X1Gqbl8Xou32U+9y56zJ9lWOblGCYXe0/LOL1e0ziN83Lur++2jl7mn4Y3H/P+PJ/z/B5f4zKu8/hcp206jm336j/D3/01ncf3O72WpZ9c749BPpf9+RrHeTLRYVjHa3o1k+m5LMNzPrZlPbfXPK/fr0lsx3Ls1+s69mPc9ufxem3j/LPO1/6aX+Prmqfnc3w9n9dwDdtr2SZ/fy3frUE+T4N+PWdzN/tt85Nt3x7DMo7b+D6W5/B8nsP8NLTXf1bjm4TmtRrEax5e3/3YRWAq1vu6mMJyToth+Ov0cv3lc74+Ju2TT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a6/vK0zZSdHcKn6VShiQFqqFQPyykwageB/yfHPuS3fV1WdZSEAJcL1fauHEJk/ZqS/EuNFHIzL414XsNUPXuMl8V15fnOWqtRCEQfAJflFoQnGY/+GGl5PZweaiebnB09bIGRhYX2qWiezX9ubU8/U8/lW3uwnqWqk1gGNEvBVNlFkforHZ6MwQLBYG0kPJ2u5TPLvtCqylSk1aKQTLtT/QmIslfW2mLkNWfN6rgdyp8bI8Wm8RBX6Kau3v8qwtK1lEQvwgpEOLCEFqR2R2OGD94G5VPk5rCUPosc+0uTclT+F5JO4yOejkfC7PtIoDc3b1MmJwE+LjZMLlgKZ3mJqpGlOqb+VLoE+rscQt2WGr9M/QmR2q+rMH4/zFzxIYQAl+6SwgqMHD1RGepnmwnldkoZ1kssx+t/gYN5OqgMqHeMPIoBIZgb3D8MjWFYawqfJtS9aP0OJDUv20dt4QpFaKP2nZkp+IOtPeihfmGbBXmcYaNXH7/YIBHyUhDdDYE0XMoAGKhyXdYYqz/n8QUoLrylx19d7RlfBQAp7JSsknyhmnPAaVyg6jKO/knDiul7Xh2R1/V1qy+MKbbSiuJpykDroSEBZHOUx4azXISGC0+240KQAzj/riaRxErqgTJX5C8/KB2RMR0k/8M7bVHimgqhZC0ouSTO+E6Z8TYD5Gr+pD5kw7a83zzO84dnX+7M0frWd8w+uFK2kfXbXv38TaagEGSm312kgbA/0vu3qE6cKYC0Zos6cxfP1bSgQCQ+waohANFXArvJYRREus5VpnDsLDQS12s2v9iEotsp3Hj9Sma+P8dNBXkeSh4w1VK3w87OzXszRexxfBP44ffERM43/v1AEqEpzRLJbSBzLCn1Z0gc8UyfKJ5JJqIKim3EkIgwj3dJ/ZmiIaGf9PPYPaGTsrOjX7BEy4bK/n6p+NNz1HN9HUl/9G/C1AVQfLWegjX8DQ1cEPYMJH8qYLine truncated
}
.hidden {
display: none !important;
visibility: hidden;
}
/* Header */
#header {
display: flex;
align-items: center;
width: 80vw;
margin-left: auto;
margin-right: auto;
margin-top: 20px;
}
#header>#dioxus {
margin-left: 10px;
font-weight: 500;
font-size: 1.3rem;
}
#header>#project-info {
margin-left: auto;
font-weight: 500;
font-size: 1.1rem;
}
.content-container {
width: max-content;
margin-left: auto;
margin-right: auto;
margin-top: 10vh;
display: grid;
grid-template-columns: 1fr;
}
.content-header-text {
font-weight: 700;
font-size: 2rem;
}
/* Building proggres screen */
#building>h1 {
margin-bottom: 60px;
text-align: center;
}
#building>#progress-bar {
width: 100%;
height: 8px;
background-color: #BEC4D0;
border-radius: 5px;
}
#building>#progress-bar>div {
height: 100%;
background-color: #55A4FF;
border-radius: 10px;
}
#building>#text {
width: 100%;
display: flex;
flex-direction: row;
margin-top: 5px;
}
#building>#text>h4 {
margin-top: 0;
}
#building>#text>#build-message {
margin-right: auto;
font-weight: 500;
font-size: 1rem;
}
#building>#text>#build-progress-percent {
margin-left: auto;
font-weight: 700;
font-size: 1.1rem;
}
/* Error */
#error {
align-items: start;
}
#error>h1 {
margin-bottom: 20px;
text-align: left;
}
#error>#error-sub-text {
font-weight: 500;
}
#error>#error-block {
background-color: #BEC4D0;
border-radius: 5px;
padding: 20px;
font-weight: 500;
overflow-x: auto;
white-space: pre-wrap;
min-width: 640px;
}
/* Text coloring */
.err {
color: #d94545;
}
.info {
color: #3980d1;
}
.warn {
color: #CC7E00;
}
.text-theme {
color: #313131;
}
/* Footer */
#footer {
width: 100vw;
margin-top: 100px;
}
#footer>h4 {
text-align: center;
box-sizing: content-box;
font-size: 1.1rem;
font-weight: 500;
}
#footer>h4>a {
text-decoration: none;
color: #313131;
}
#footer>h4>a:hover {
text-decoration: underline;
}
@media (max-width: 725px) {
#header {
width: 95vw;
}
#building {
width: 95vw;
}
#building>h1 {
width: 100%;
}
}
@media (max-width: 780px) {
#header {
width: 95vw;
}
#error {
width: 95vw;
}
#error>h1 {
width: 100%;
}
#error>#error-block {
min-width: auto;
}
}
/* Dark Theme */
@media (prefers-color-scheme: dark) {
body {
color: #E2E5E9;
background-repeat: repeat;
background-image: url('data:image/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qWFXipaigE90Ualozf6Tjnt0wQM8IBEwEBr8NkPccXBiDxDyWqS+YFUwOHlFV6j6PZ9dKYhIUCzL86QhLpGuCdh3PVmTZPGZnVRyWR7r59zb/jlfrQpL8DE7MHztPH0GMAFUtrEQ4JIiR/LVoevqyY9XGQYuNbjrJsyr40mUh2y8T254F2EFVEobsxom5WPTix5hZALjrVnFi5V43knnoCTdu+fWNZtIUO/OGgiG/LUXp+OQbpZ+Ne6P1cvnheEAVovPLGaGVHwDKVVKB3oNbCXzxbdpoX6H7QKdoKCaIfruBxUD5Ms7EAYcNPs30vmPjZgBkg00cipoweEeZ8to4KBIVT/ZPdfIoS1E3EZIuQt9+7Hn9RxmN5Sb6q3i9o9NLsyjN//dguUpWlkNHjpjdFa9Krjg0G0A60NgsgAKbH39Bv+gMRhiUoVlQKP3ZpzULExe9cH49f937sb1fSvcqbRiHv9/E9L/P++DR/tdFKJqh/o3A3+0jElPo63wCGL28dTC2ys/zl44NwzSnQ1yNfd5uO8W0AT17kUJ37rzYpTrJUa6YNsc8u1P+BzbG/s1gQUPYyZ1j+8amxUpnD8Y/uY2QVZmvKKgm3Q+xNr92V0PTiCzPQ3jfEJdeNIFHpxq95+27L81TsE82oacWZ5XmYjCLine truncated
}
/* Text coloring */
.err {
color: #F04C4C;
}
.info {
color: #55A4FF;
}
.warn {
color: #FFCB51;
}
.text-theme {
color: #E2E5E9;
}
#building>#progress-bar,
#error>#error-block {
background-color: #111318;
}
#footer>h4>a {
color: #E2E5E9;
}
}
</style>
</head>
<body>
<!-- Header -->
<div id="header">
<!-- Dioxus Logo -->
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" xmlns:v="https://vecta.io/nano">
<path
d="M22.158 1.783c0 3.077-.851 5.482-2.215 7.377s-3.32 3.557-5.447 5.33-4.425 3.657-6.252 6.195-3.102 5.515-3.102 9.532h4.699c0-3.077.853-5.377 2.217-7.272s3.32-3.557 5.447-5.33 4.425-3.657 6.252-6.195 3.102-5.62 3.102-9.637z"
fill="#e96020" />
<path
d="M9.531 25.927c-.635 0-1.021.515-1.02 1.15s.385 1.151 1.02 1.15H22.47a1.151 1.151 0 1 0 0-2.301zm1.361-4.076c-.608 0-.954.558-.953 1.166s.346 1.035.953 1.035h10.217a1.101 1.101 0 1 0 0-2.201zm0-13.594a1.101 1.101 0 1 0 0 2.201h10.217c.607 0 .953-.598.953-1.205s-.345-.996-.953-.996zM9.531 4.021A1.15 1.15 0 0 0 8.38 5.17a1.15 1.15 0 0 0 1.15 1.15h12.94c.635 0 1.021-.498 1.02-1.133s-.386-1.166-1.02-1.166z"
fill="#2d323b" />
<path
d="M5.142 1.783c0 4.016 1.275 7.099 3.102 9.637s4.125 4.422 6.252 6.195 4.083 3.656 5.447 5.551 2.215 3.974 2.215 7.051h4.701c0-4.016-1.275-7.038-3.102-9.576s-4.125-4.422-6.252-6.195-4.083-3.435-5.447-5.33S9.841 4.86 9.841 1.783z"
fill="#00a8d6" />
</svg>
<h2 id="dioxus">Dioxus</h2>
<!-- Project platform and name -->
<h2 id="project-info">N/A | N/A</h2>
</div>
<!-- Building progress screen -->
<div class="content-container" id="building">
<h1 class="content-header-text">One sec! <br />We're building your app now.</h1>
<div id="progress-bar">
<div id="progress-bar-inner" style="width: 1%;"></div>
</div>
<div id="text">
<!-- Funny loading messages or something -->
<h4 id="build-message">Starting the build...</h4>
<!-- Progress % -->
<h4 id="build-progress-percent">0%</h4>
</div>
</div>
<!-- Building Error -->
<div class="content-container hidden" id="error">
<h1 class="content-header-text">Oops! The build failed.</h1>
<p id="error-sub-text"><span id="error-inner-sub-text" class="warn">compiling my-cool-project</span> encountered an
error:</p>
<div id="error-block">
<span class="err">error</span><span>: expected `;`, found `rsx`</span> <br />
<span class="info"> --></span><span> src/main.rs:21:6</span><br />
<span class="info"> |</span><br />
<span class="info">21 |</span><span> a</span><br />
<span class="info"> |</span><span class="err"> ^ help: add `;` here</span><br />
<span class="info">22 |</span><span> rsx! {</span><br />
<span class="info"> |</span><span class="info"> --- unexpected token</span><br />
<span class="err">error</span><span>: could not compile `my-cool-app` (bin "my-cool-app") due to 1 previous
error</span>
</div>
</div>
<!-- Footer Of Links -->
<div id="footer">
<h4>
<a href="https://docs.rs/dioxus/latest/dioxus/">docs</a>
|
<a href="https://dioxuslabs.com/learn">guides</a>
|
<a href="https://discord.gg/KrGKhBbU6s">help</a>
</h4>
</div>
<!-- Logic -->
<script>
let APPLICATION_NAME = "N/A";
// Wait for a "Ready" message from the server on the websocket served at /_dioxus/build_status
let protocol;
if (window.location.protocol === "https:") {
protocol = "wss:";
} else {
protocol = "ws:";
}
let url =
protocol + "//" + window.location.host + "/_dioxus/build_status";
let ws = new WebSocket(url);
// WS Message Handling
ws.onmessage = (event) => {
// Parse the message as json
let data = JSON.parse(event.data);
// If the message is "Ready", reload the page
if (data.type === "Ready") {
setTimeout(() => {
// Once we get a "Ready" message, reload the page
window.location.reload();
}, 500);
} else if (data.type === "ClientInit") {
// Get project info
APPLICATION_NAME = data.data.application_name;
const platform = data.data.platform;
// Set project info
let projectInfo = document.getElementById("project-info");
projectInfo.innerText = `${platform} | ${APPLICATION_NAME}`;
} else if (data.type === "BuildError") {
// If the message is "BuildError", display an error message
// Show correct view for message.
let errorContainer = document.getElementById("error");
errorContainer.className = "content-container";
let buildingContainer = document.getElementById("building");
buildingContainer.className = "content-container hidden";
let errorInnerSubText = document.getElementById("error-inner-sub-text");
errorInnerSubText.innerText = `compiling ${APPLICATION_NAME}`;
// Replace with our styling.
let color1 = data.data.error.replaceAll("style='color:#f55'", "class='err'");
let color2 = color1.replaceAll("style='color:#5ff'", "class='info'");
let color3 = color2.replaceAll("style='color:#fff'", "class='text-theme'");
let formatting1 = color3.replaceAll("<b>", "");
let formatting2 = formatting1.replaceAll("</b>", "");
let errorBlock = document.getElementById("error-block");
errorBlock.innerHTML = formatting2;
} else if (data.type === "Building") {
// Show correct view for message.
let errorContainer = document.getElementById("error");
errorContainer.className = "content-container hidden";
let buildingContainer = document.getElementById("building");
buildingContainer.className = "content-container";
// Get the current progress
const progress = data.data.progress;
const roundedProgress = Math.round(progress * 100);
// Update the loading indicator
let loadingPercent = document.getElementById("build-progress-percent");
let loadingBar = document.getElementById("progress-bar-inner");
const formattedProgress = `${roundedProgress}%`;
loadingPercent.innerHTML = formattedProgress;
loadingBar.style.width = formattedProgress;
// Show progress message
const message = data.data.build_message;
let buildMessage = document.getElementById("build-message");
buildMessage.innerText = message;
}
};
// WS Reconnect Logic
const POLL_INTERVAL_MIN = 250;
const POLL_INTERVAL_MAX = 4000;
const POLL_INTERVAL_SCALE_FACTOR = 2;
const reload_upon_connect = (event, poll_interval) => {
// Firefox will send a 1001 code when the connection is closed because the page is reloaded
// Only firefox will trigger the onclose event when the page is reloaded manually: https://stackoverflow.com/questions/10965720/should-websocket-onclose-be-triggered-by-user-navigation-or-refresh
// We should not reload the page in this case
if (event.code === 1001) {
return;
}
window.setTimeout(() => {
var ws = new WebSocket(url);
ws.onopen = () => window.location.reload();
ws.onclose = (event) => {
reload_upon_connect(
event,
Math.min(
POLL_INTERVAL_MAX,
poll_interval * POLL_INTERVAL_SCALE_FACTOR
)
);
};
}, poll_interval);
};
ws.onclose = (event) => reload_upon_connect(event, POLL_INTERVAL_MIN);
</script>
</body>
</html>