Skip to content

Resolve the native Windows std directory when HOME is absent #492

Description

@LunaStev

Confirmed failure after native linking succeeds

PR #486 head 6fb6ed7 resolves the missing xml2s.lib dependency far enough to build the native Windows ARM64 release compiler, pass Clippy and run all three native unit tests. The next target-object smoke step fails with:

HOME env not set; cannot locate std at ~/.wave/lib/wave/std

Native build job

The native ARM64 cases job also has ten cases reporting this exact error. Its other 113 access violations are tracked in #493 as a separate failure and must not be attributed to HOME without evidence.

Cause

The PowerShell workflow installs std under $HOME, which is a PowerShell automatic variable. Rust's std::env::var("HOME") reads an environment variable, which need not be set on native Windows even when $HOME and USERPROFILE are available.

front/parser/src/import.rs::std_root_dir and src/std.rs::resolve_std_install_dir currently require the HOME environment variable. Installation and discovery must agree on the same Windows user directory.

Bounded contribution

Implement and document a consistent platform-aware user-directory policy for std installation and lookup. Keep an explicitly supplied HOME working; use the appropriate Windows home-directory fallback when it is absent. Audit the native build/cases/release setup so they install to the path the compiler will actually use. Avoid a CI-only workaround that leaves native users unable to import std.

Acceptance

  • A native Windows process with HOME absent and a valid Windows user profile resolves the same .wave/lib/wave/std directory for installation and imports.
  • Existing HOME-based Unix and explicit override behavior is preserved.
  • Add focused tests for precedence, missing values and consistent installation/import paths; do not mutate the global environment concurrently in tests.
  • The native ARM64 target-object smoke reaches object generation and the ten HOME-related case failures are eliminated.
  • Do not claim this fixes the separate access violations or all native cases.

Start in front/parser/src/import.rs, src/std.rs, .github/workflows/rust.yml, .github/workflows/cases.yml and .github/workflows/release.yml. Related: #482, #486, #292. The directory-resolution change is small enough for a first contribution; native CI supplies the platform verification.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA problem that causes incorrect behavior or crashes.cross-platformIssues related to making Wave work seamlessly across multiple operating systems.good first issueIssues that are good for newcomers or first-time contributors.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions