S001: first build compiles; fix 5 compile errors in place
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
49825b626e
commit
d2bb67f4ea
10 changed files with 37 additions and 17 deletions
|
|
@ -12,15 +12,15 @@ Make the never-compiled ~19.5k lines build: `nice cargo build --release -j 2` pr
|
|||
- Only the source files that compile errors point at; for Servo API questions read the crate sources in `~/.cargo/registry/src/*/servo-0.7.0/` and friends rather than guessing.
|
||||
|
||||
## Steps
|
||||
- [ ] Commit the pending work as is (`S001: commit self-test WIP and UI brief`) so fixes start from a clean tree
|
||||
- [ ] Check toolchain: `rustc --version` ≥ 1.88, `clang --version`; run `nice cargo build --release -j 2 --message-format short 2>&1 | tail -150` and save the full log to the scratchpad
|
||||
- [ ] Fix name-resolution / import / missing-item errors (`E0432`, `E0433`, `E0425`, `E0412`, `E0599` on wrong paths) across all modules; rebuild
|
||||
- [ ] Fix type and trait errors (mismatched types, missing trait impls, wrong Servo/egui/winit signatures) module by module; rebuild after each module group
|
||||
- [ ] Fix borrow-checker and lifetime errors (`E0499`, `E0502`, `E0505`, `E0597`) with the smallest local change (clone, scope, split borrow); rebuild
|
||||
- [ ] Build is clean of errors; then fix warnings that point at real bugs (unused results, unreachable code); leave style warnings
|
||||
- [ ] `target/release/nacre --help` (or `--version`) runs and exits 0 without opening a window; if it has no such flag, check `ldd target/release/nacre` resolves everything
|
||||
- [ ] Update `docs/HANDOFF.md` "State" (compiles now) and add anything surprising about Servo's API to `docs/DESIGN.md` cheat sheet
|
||||
- [ ] PROGRESS entry, INDEX line, commit `S001: …` and push
|
||||
- [x] Commit the pending work as is (`S001: commit self-test WIP and UI brief`) so fixes start from a clean tree
|
||||
- [x] Check toolchain: `rustc --version` ≥ 1.88, `clang --version`; run `nice cargo build --release -j 2 --message-format short 2>&1 | tail -150` and save the full log to the scratchpad
|
||||
- [x] Fix name-resolution / import / missing-item errors (`E0432`, `E0433`, `E0425`, `E0412`, `E0599` on wrong paths) across all modules; rebuild
|
||||
- [x] Fix type and trait errors (mismatched types, missing trait impls, wrong Servo/egui/winit signatures) module by module; rebuild after each module group
|
||||
- [x] Fix borrow-checker and lifetime errors (`E0499`, `E0502`, `E0505`, `E0597`) with the smallest local change (clone, scope, split borrow); rebuild
|
||||
- [x] Build is clean of errors; then fix warnings that point at real bugs (unused results, unreachable code); leave style warnings
|
||||
- [x] `target/release/nacre --help` (or `--version`) runs and exits 0 without opening a window; if it has no such flag, check `ldd target/release/nacre` resolves everything
|
||||
- [x] Update `docs/HANDOFF.md` "State" (compiles now) and add anything surprising about Servo's API to `docs/DESIGN.md` cheat sheet
|
||||
- [x] PROGRESS entry, INDEX line, commit `S001: …` and push
|
||||
|
||||
## End criteria
|
||||
- `nice cargo build --release -j 2` exits 0.
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ One session = one plan. Plans live in category folders `Plans/<NN Category>/SNNN
|
|||
Tracker: https://claude.ai/artifact/9AD7fPfwJ4ASFzVTJGKU4h
|
||||
|
||||
## 01 First build
|
||||
- [ ] [S001 — Compile to a binary](01%20First%20build/S001-compile.md) · Opus medium
|
||||
- [x] [S001 — Compile to a binary](01%20First%20build/S001-compile.md) · Opus medium
|
||||
- [ ] [S002 — Unit tests green](01%20First%20build/S002-unit-tests.md) · Sonnet high
|
||||
- [ ] [S003 — First launch and smoke harness](01%20First%20build/S003-first-launch.md) · Opus medium
|
||||
- [ ] [S004 — Phase 1 review with the user](01%20First%20build/S004-phase1-review.md) · Sonnet medium · 🧑
|
||||
|
|
|
|||
|
|
@ -119,6 +119,10 @@ Prefs worth knowing: user_agent, network_http_proxy_uri, network_https_proxy_uri
|
|||
Opts: config_dir (profile storage: cookies, local storage), temporary_storage, ignore_certificate_errors, multiprocess.
|
||||
```
|
||||
|
||||
egui 0.37 deprecates `Ui::id` (now `Ui::scope_id`) and `Id::new` (now `Id::unique` / `IdSalt::new`); the code still
|
||||
uses the old names, which build with warnings. The Servo 0.7 API above matched the crate: the first build had no
|
||||
Servo signature errors.
|
||||
|
||||
Not in Servo 0.7, so Nacre does it itself: downloads, find in page, private mode, SOCKS proxies, spell check,
|
||||
picture-in-picture, extensions, password capture, printing.
|
||||
|
||||
|
|
|
|||
|
|
@ -14,8 +14,10 @@ the test suite.
|
|||
- Review passes done without compiling: API signatures checked against the crate sources in ~/.cargo/registry,
|
||||
names cross-checked between modules (commands, UI state, shared fields, crate:: paths), every setting checked
|
||||
to be read by the code. Bugs found and fixed are in git history.
|
||||
- Never compiled. Expect a round of compile errors at the first build (type inference, borrow checker, small
|
||||
API mismatches); fix them in place, don't restructure.
|
||||
- Compiles (S001, 2026-11-11): `nice cargo build --release -j 2` exits 0 and produces `target/release/nacre`
|
||||
(~144 MB); `--help`/`--version` run headless. Only five errors at the first build (two missing imports, three
|
||||
borrow errors), fixed in place. 66 warnings left: egui 0.37 deprecations and dead code. Not run with a window
|
||||
yet, unit tests not run yet.
|
||||
|
||||
## First build checklist
|
||||
1. `nice cargo build --release -j 2` (first build takes hours: Servo, SpiderMonkey, WebRender).
|
||||
|
|
|
|||
|
|
@ -2,6 +2,18 @@
|
|||
|
||||
One entry per session, newest last, ≤ 15 lines: done, verified how, not done, later.
|
||||
|
||||
## S001 — Compile to a binary (2026-11-11)
|
||||
- Done: self-test WIP and UI brief committed; first build had 5 errors (missing `Read` import in instance.rs,
|
||||
missing `Speller` import in actions.rs, borrow errors in app.rs:796, store/scripts.rs:124,
|
||||
ui/pages/settings.rs:947), fixed in place; removed a no-op `drop(&mut)` in app.rs. No feature degraded.
|
||||
- Verified: `nice cargo build --release -j 2` exit 0; `target/release/nacre` (144 MB) `--help`/`--version` exit 0
|
||||
headless; `ldd` resolves everything. nacre crate alone rebuilds in ~1 min (Servo was already built).
|
||||
- Not done: unit tests, launching a window (later plans).
|
||||
- 66 warnings remain: egui 0.37 deprecations (`Ui::id`, `Id::new`) and dead code. Dead code that hints at unwired
|
||||
features: `History::autocomplete`/`top_sites` (omnibox inline completion, new-tab top sites?),
|
||||
`keys::conflicts` (shortcut conflict check), `Command::SpellReplace` (duplicate of `MenuAction::SpellReplace`),
|
||||
`tabs::Page::Error`, `Prompt::Info`. Worth a look in the gaps phase.
|
||||
|
||||
## Later
|
||||
- Reader mode, split view, translate, real gamepad rumble (D-002: not planned for now).
|
||||
- Packaging and first release (D-001: plan when the user asks).
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ use crate::app::{App, Launch, WindowRequest};
|
|||
use crate::inject::{self, PageMessage};
|
||||
use crate::keys::Action;
|
||||
use crate::net::download;
|
||||
use crate::spell::Speller;
|
||||
use crate::store::downloads::State as DlState;
|
||||
use crate::store::permissions::{Decision, Kind as Perm};
|
||||
use crate::tabs::{Dialog, Page, Prompt, Tab};
|
||||
|
|
|
|||
|
|
@ -793,7 +793,8 @@ impl App {
|
|||
}
|
||||
}
|
||||
// Mute state survives navigation.
|
||||
let muted = self.tab_mut(id).map(|t| t.muted || self.shared.settings.borrow().site_muted(&util::host_of_str(&t.url))).unwrap_or(false);
|
||||
let shared = self.shared.clone();
|
||||
let muted = self.tab_mut(id).map(|t| t.muted || shared.settings.borrow().site_muted(&util::host_of_str(&t.url))).unwrap_or(false);
|
||||
if muted && let Some(tab) = self.tab_mut(id) {
|
||||
tab.muted = true;
|
||||
if let Some(web) = &tab.web {
|
||||
|
|
@ -1799,7 +1800,6 @@ impl App {
|
|||
// Back/forward mouse buttons navigate.
|
||||
if *state == ElementState::Pressed && matches!(button, winit::event::MouseButton::Back | winit::event::MouseButton::Forward) {
|
||||
let back = *button == winit::event::MouseButton::Back;
|
||||
drop(win);
|
||||
self.run_in(window_id, if back { Command::Back } else { Command::Forward });
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
//! Single instance per profile: a running Nacre listens on a loopback port; a second launch
|
||||
//! hands its links to it and exits. The port and a random token are in the profile's data folder.
|
||||
|
||||
use std::io::{BufRead, BufReader, Write};
|
||||
use std::io::{BufRead, BufReader, Read, Write};
|
||||
use std::net::{TcpListener, TcpStream};
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use std::sync::mpsc::Sender;
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ pub fn pattern_to_regex(pattern: &str) -> String {
|
|||
}
|
||||
let mut out = String::from("^");
|
||||
let (scheme, rest) = pattern.split_once("://").unwrap_or(("*", pattern));
|
||||
out.push_str(if scheme == "*" { "https?" } else { &escape_regex(scheme) });
|
||||
out.push_str(&if scheme == "*" { "https?".to_owned() } else { escape_regex(scheme) });
|
||||
out.push_str(":\\/\\/");
|
||||
let (host, path) = match rest.find('/') {
|
||||
Some(i) => (&rest[..i], &rest[i..]),
|
||||
|
|
|
|||
|
|
@ -944,7 +944,8 @@ fn newtab(ui: &mut Ui, f: &mut Frame, s: &mut Settings) {
|
|||
}
|
||||
});
|
||||
switch_row(ui, "Follows the mouse", "", &mut s.ntp.bg_mouse);
|
||||
row(ui, "Image", if s.ntp.bg_image.is_empty() { "None" } else { &s.ntp.bg_image }, |ui| {
|
||||
let image = if s.ntp.bg_image.is_empty() { "None".to_owned() } else { s.ntp.bg_image.clone() };
|
||||
row(ui, "Image", &image, |ui| {
|
||||
if !s.ntp.bg_image.is_empty() && ui.button("Remove").clicked() {
|
||||
s.ntp.bg_image.clear();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue