Skip to content

Gate windows-sys dependencies on Windows targets and fix UTF-8 terminal output - #45

Closed
subhramit wants to merge 3 commits into
EpicGames:mainfrom
subhramit:windows-sys-platform-gate
Closed

Gate windows-sys dependencies on Windows targets and fix UTF-8 terminal output#45
subhramit wants to merge 3 commits into
EpicGames:mainfrom
subhramit:windows-sys-platform-gate

Conversation

@subhramit

@subhramit subhramit commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Part of cross-platform build portability.

Fixes #43
Fixes #30

  1. Four crates listed windows-sys under [dependencies] instead of [target.'cfg(target_family = "windows")'.dependencies], causing build failures on non-x86_64 Linux architectures. This moves them under the right (Windows) targets.
  2. The Windows console also defaulted to a legacy codepage on many configurations, causing non-ASCII characters to display as mojibake in pager-backed commands like lore history. So to fix that, this also adds a SetConsoleOutputCP(CP_UTF8) call at the CLI startup.

Four crates listed `windows-sys` under `[dependencies]`, causing build failures on non-x86_64 Linux architectures. Move them under `[target.'cfg(target_family = "windows")'.dependencies]`.

Fixes EpicGames#43

Signed-off-by: subhramit <subhramit.bb@live.in>

@mjansson mjansson left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me, looks good

@subhramit subhramit changed the title Move windows-sys dependency under Windows targets Move windows-sys dependencies under Windows targets Jun 24, 2026
`lore history` and other pager-backed commands produced mojibake for non-ASCII characters on Windows because the console codepage defaulted to a legacy encoding. Call `SetConsoleOutputCP(CP_UTF8)` at CLI startup under `#[cfg(target_family = "windows")]` so all output, including pager-spawned subprocesses, uses UTF-8 from the start.

Fixes EpicGames#30

Signed-off-by: subhramit <subhramit.bb@live.in>
@subhramit subhramit changed the title Move windows-sys dependencies under Windows targets Gate windows-sys on Windows targets and fix UTF-8 terminal output Jun 27, 2026
@subhramit
subhramit requested a review from mjansson June 27, 2026 21:25
@subhramit

subhramit commented Jun 27, 2026

Copy link
Copy Markdown
Contributor Author

Extended scope of the PR due to #77 (comment).
Let me know if the commits need to be squashed into one with a combined commit message instead of individual ones.

@subhramit subhramit changed the title Gate windows-sys on Windows targets and fix UTF-8 terminal output Gate windows-sys dependencies on Windows targets and fix UTF-8 terminal output Jun 27, 2026
@mjansson

mjansson commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

We'll get this merged once the intake and attribution process is in place, ideally early next week.

@subhramit

Copy link
Copy Markdown
Contributor Author

Some of the other/older PRs required the "ready-to-import" label. Is the same still valid, or is a new system of intake/attribution on the way, which you're referring to?

@subhramit

subhramit commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

Some of the other/older PRs required the "ready-to-import" label. Is the same still valid, or is a new system of intake/attribution on the way, which you're referring to?

@duncangrist / @ragnarula / @valentina2509

@ragnarula

Copy link
Copy Markdown
Collaborator

Some of the other/older PRs required the "ready-to-import" label. Is the same still valid, or is a new system of intake/attribution on the way, which you're referring to?

This is the intake system and the label can only be added by mainainers. We're getting close to having the first ones merged. Hang in there, many people working beind the scenes to get this up and running :)

@subhramit

Copy link
Copy Markdown
Contributor Author

Some of the other/older PRs required the "ready-to-import" label. Is the same still valid, or is a new system of intake/attribution on the way, which you're referring to?

This is the intake system and the label can only be added by mainainers. We're getting close to having the first ones merged. Hang in there, many people working beind the scenes to get this up and running :)

Cool, cool, thanks a lot for the heads up!

@ragnarula ragnarula added the ready-to-import Approved by Epic staff for import into Lore label Jul 16, 2026
@epic-lore-bot epic-lore-bot Bot added imported Imported into Lore for internal review and removed ready-to-import Approved by Epic staff for import into Lore labels Jul 16, 2026
@epic-lore-bot

epic-lore-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

Imported as Lore CR-220.

epic-lore-bot Bot pushed a commit that referenced this pull request Jul 20, 2026
…inal output

Part of [cross-platform build portability](#77).

Fixes #43
Fixes #30

1. Four crates listed `windows-sys` under `[dependencies]` instead of `[target.'cfg(target_family = "windows")'.dependencies]`, causing build failures on non-x86_64 Linux architectures. This moves them under the right (Windows) targets.
2. The Windows console also defaulted to a legacy codepage on many configurations, causing non-ASCII characters to display as mojibake in pager-backed commands like `lore history`. So to fix that, this also adds a `SetConsoleOutputCP(CP_UTF8)` call at the CLI startup.

```
Imported-PR: #45
Imported-From: cd4ee3c
Imported-Base: a00b1c4
Imported-Merge: 2a9be63
Imported-Author: subhramit (subhramit)
GH-URL: #45
```

Lore-RevId: 321
Lore-Signature: e3bb6d1e2ca4ef66c89089fe7841c8585807b524e0b9cf5d49e49ce4d64772a1
@epic-lore-bot

epic-lore-bot Bot commented Jul 20, 2026

Copy link
Copy Markdown

Closed by mirrored commit 80d8197.

@epic-lore-bot epic-lore-bot Bot closed this Jul 20, 2026
@epic-lore-bot epic-lore-bot Bot added the merged Merged into Lore codebase label Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

imported Imported into Lore for internal review merged Merged into Lore codebase

3 participants