fishfolk / punchy

A 2.5D side-scroller beatemup, made in Bevy

Home Page:https://fishfolk.github.io/punchy/player/latest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Black window LC_CTYPE environment variable

virgilhuxley opened this issue · comments

Description

Problem

When performing a cargo run with env var LC_CTYPE set to an empty string, the window that spawns is blank.
No music plays.
Some Bevy systems still execute during this failure state.

Workaround

LC_CTYPE seems to be an environment variable that accompanies tmux terminal sessions.
Simply running unset LC_CTYPE is enough to get around this limitation

To Reproduce

run: LC_CTYPE="" cargo run

Expected Behavior

(Best guess): The logic that handles for LC_CTYPE when it is unset needs to account for a scenario where it is set, but set to an empty string.

Additional Context

System used

Linux, X11, gnome desktop, kernel 5.15.53-1-MANJARO

# System installed on ~2022-02 with latest x86 Manjaro
ID=manjaro
ID_LIKE=arch
BUILD_ID=rolling
PRETTY_NAME="Manjaro Linux"

rustup show (some information redacted)

Default host: x86_64-unknown-linux-gnu

installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu (default)
nightly-x86_64-unknown-linux-gnu
1.61-x86_64-unknown-linux-gnu

installed targets for active toolchain
--------------------------------------

wasm32-unknown-unknown
x86_64-unknown-linux-gnu

active toolchain
----------------

stable-x86_64-unknown-linux-gnu
rustc 1.62.1 (e092d0b6b 2022-07-16)

Log Messages

(Nothing too interesting)

$ cargo run
    Finished dev [optimized + debuginfo] target(s) in 0.14s
     Running `target/debug/punchy`
2022-07-21T05:36:21.782424Z  INFO winit::platform_impl::platform::x11::window: Guessed window scale factor: 1
2022-07-21T05:36:21.806092Z  INFO bevy_render::renderer: AdapterInfo { name: "AMD RADV VEGA10", vendor: 4098, device: 26751, device_type: DiscreteGpu, backend: Vulkan }
2022-07-21T05:36:21.881985Z  INFO gilrs_core::platform::platform::gamepad: Gamepad /dev/input/event7 (ASRock LED Controller) connected.
2022-07-21T05:36:21.884767Z  WARN bevy_asset::asset_server: encountered an error while loading an asset: Parser error: The given language subtag is invalid
2022-07-21T05:36:21.885567Z  INFO bevy_input::gamepad: Gamepad(0) Connected

The line
2022-07-21T05:36:21.884767Z WARN bevy_asset::asset_server: encountered an error while loading an asset: Parser error: The given language subtag is invalid
is not present when using the workaround.

It seems that ultimately, the error (warning) is raised from the unic-langid crate (a dependency of the bevy_fluent dependency). See here.

I haven't checked what actually causes that, though.

Interesting! Thanks for the report. Can you post the value of the LC_CTYPE environment variable?

I've got a fix for this in #162.