Repository navigation
Conversation
|
Follow-up fix pushed (fcfe5aa) for a macOS DMG launch report on this branch's build ( Two mechanisms delivered that path, both now fixed:
A DMG launch now falls back to the per-user proposal ( |
|
I installed the msi program on windows, then launched the app. Traceback (most recent call last): |
PR #195 report: installed app dies at startup with ModuleNotFoundError: No module named '_socket' inside types.__getattr__ (CapsuleType) triggered by typing_extensions. Static audit of the MSI shows _socket.pyd IS shipped at the install root next to python313.zip — so this test installs the artifact and boots ProFiles.exe --help to determine whether the failure is deterministic (packaging) or machine-specific (e.g. antivirus). BRIEFCASE_DEBUG=1 logs the stub's PYTHONPATH for diagnosis.
|
Diagnosis: the MSI is healthy — this is machine-specific, almost certainly antivirus removing What the traceback actually saysThe import chain that dies is entirely third-party/runtime — nothing in this PR's code runs before the crash: Python 3.13's The artifact was audited and is intactI extracted the CI-built MSI (same commit as
CI can't reproduce itI added a smoke test to the Windows packaging dry-run workflow (0041ba2): it installs the freshly built MSI silently on a clean What to check on the machine that failed
Follow-ups (separate from this PR)
|
Fresh vite build (tsc -b && vite build) serving the Load-mode picker fix; regenerated PWA precache hashes. The minified bundle crossed the pre-commit large-file line (1 MB), so check-added-large-files now exempts the tracked dist/ build output — it is a generated artifact, not hand-edited source.
macOS user report on this branch: launching the packaged app from a mounted DMG proposed creating the configuration in /Volumes/ProFiles <version> — the DMG volume root leaked through as an informative launch folder. Two mechanisms deliver it, both fixed: - The macOS Finder probe mirrors the FRONT FINDER WINDOW, which for a GUI launch is often the folder the user launched FROM (the DMG folder, /Applications, a portable-apps folder). The probe result now passes the same uninformative-directory policy as a CWD before being trusted; a rejected probe falls back to the plain CWD. - is_uninformative_directory() gains two rules: volume mount points (device id differs from parent — a DMG, USB stick or network share top-level is never a project location, consistent with drive roots), and any directory hosting the running packaged app bundle (Something.app/Contents on macOS). Dev runs are exempt: plain-venv interpreter paths carry no .app/Contents component, so a repo hosting .venv stays a legitimate project folder. A DMG launch now falls back to the per-user proposal (~/.profiles/.profiles) and scans the home folder, matching the launcher rows of the issue #191 behaviour matrix.
Finder and Dock launches on macOS inherit no working directory, so ProFiles adopts the front Finder window's folder as the launch folder: a project window proposes its .profiles, while an unrelated ordinary window (e.g. the folder holding the DMG installer) is proposed instead. Documented the behavior and the practical escape hatches (close the window, or use the picker's Home button) in both configuration-profile guides, both installation guides, and both READMEs; the FR install guide also gains the per-user first-launch paragraph it was missing.
PR #195 report: installed app dies at startup with ModuleNotFoundError: No module named '_socket' inside types.__getattr__ (CapsuleType) triggered by typing_extensions. Static audit of the MSI shows _socket.pyd IS shipped at the install root next to python313.zip — so this test installs the artifact and boots ProFiles.exe --help to determine whether the failure is deterministic (packaging) or machine-specific (e.g. antivirus). BRIEFCASE_DEBUG=1 logs the stub's PYTHONPATH for diagnosis.
0041ba2 to
6326075
Compare
Summary
One PR closing two related configuration-startup issues:
.desktop, any process whose CWD is System32, the home folder, or an install/runtime directory) no longer propose creating.profilesin a system directory. The proposal targets~/.profiles/.profiles(next toprofiles.log), later launches load that per-user default automatically, and terminal/project launches keep their exact current behavior.Per-user config path policy (#191)
New
profiles.core.pathsmodule — single source of truth for user-level locations:user_data_dir()/user_config_path()~/.profilesand~/.profiles/.profiles;default_log_path()now delegates so logs and config can't driftfind_user_config().profiles,.profiles.yaml,.profiles.yml) at depth 0 in the data diris_uninformative_directory()None, drive roots, home itself,sys.prefix, the executable's dir,%SystemRoot%/%windir%/%ProgramFiles%when set (env-driven, so tests are portable)default_config_path(start)start/.profiles, unless that candidate is an existing directory (theCWD == homelog-dir collision)default_search_directory(start)Wiring:
launch/resolution.py: CWD tree search is skipped for uninformative directories (no walking System32 / the whole home profile); per-user config is the final fallback (behaviour matrix from the issue, incl. intentional row 6: terminal launch in a project without a project config loads the user default).app.py:_resolve_startup_config()returns the launch-default target too;_load_configuration()binds the defaultsAppConfigto it, so the UI pre-fills~/.profilesfor launcher starts with no server-specific override.core/config/loader.py:load_config()follows the same policy;propose_config_creation()targets the policy default (and creates the data dir first — a bug the new tests caught).launch/creation.py:propose_creation(target, search_dir=...)— creating inside~/.profilesdrafts a starter scanning the home folder, not the data dir.server/state.py:active_config_path()keeps the CWD probe, falls back todefault_config_path(), and never returns an existing directory as the config file.server/routes/config.py:/createpasses the session's search dir (or the policy default),/templateand the empty-config first-paint fallback usedefault_search_directory()instead of the raw CWD.STARTER_CONFIG_TEMPLATEDISCOVERY comment documents the new order.Config picker mode (#192)
App.tsxreplaces theshowConfigPickerboolean withconfigPickerMode: "load" | "create" | null(null = closed). The caller owns the intent:config_exists: false)LoadConfigModaltakes an explicitmodeprop (ConfigPickerMode) and stops inferring fromconfigExists; title, banner and primary button all follow it.onLoaded/onClosebehavior unchanged (editor reload key still bumps, issue #101). No server/API change.Verification
pytest1626 passed, 1 skipped; coverage 88.6% (≥ 85 gate);pylint9.88/10;ruff check+ruff format --checkclean.tests/core/test_paths.py(29 tests); extensions totests/launch/{test_context,test_resolution,test_creation}.py,tests/core/config/test_loader.py,tests/server/routes/test_config*.py,tests/test_app_launch_resolution.py— incl. the simulated Start-Menu repro (monkeypatch.chdirto a fake%SystemRoot%\System32,Path.home()→ temp): resolution proposes~/.profiles/.profiles, nothing is written under System32, relaunch loads the user config.vitest393 passed (32 files) — newLoadConfigModal.test.tsxunit suite (mode prop both ways, disabled-until-selected, create/load actions) + twoApp.configEditor.test.tsxintegration regressions (first-run Create → close → editor entry opens Load; FileList entry opens Load);tsc -bclean;npm run buildregenerateddist/(committed).Notes / decisions
check-added-large-filesline (1 MB), so the hook now exempts the trackedsrc/profiles/web/dist/build output (generated artifact, not hand-edited source).docs/configuration-profile.{en,fr}.md,docs/installation-guide.en.md(first-launch paragraph),README.md/README.fr.mdconfig sections,CHANGELOG.md, plus theAGENTS.md/core/AGENTS.md/tests/AGENTS.mdtrees for the new module.