Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include the vinegar config in Info > Troubleshooting > Debug Information #526

Open
1 task done
westurner opened this issue Mar 2, 2025 · 4 comments
Open
1 task done
Assignees
Labels
enhancement New feature or request

Comments

@westurner
Copy link

Before Creating the Enhancement Request

  • I have confirmed that this should be classified as an enhancement rather than a bug/feature.

Is your feature request related to a problem?

Debugging information does not include the vinegar config

Describe the Solution you'd Like

Include the vinegar config in the debugging information

Describe Alternatives you've considered

Manually copy-paste the vinegar config after pasting the Debugging information

Additional context

No response

@westurner westurner added the enhancement New feature or request label Mar 2, 2025
@apprehensions
Copy link
Member

Make a pull request :)

@westurner
Copy link
Author

westurner commented Mar 2, 2025 via email

@westurner
Copy link
Author

  • type ui struct {
    app *adw.Application
    cfg *config.Config
    state *state.State
    pfx *wine.Prefix
    logFile *os.File
    }
  • vinegar/config/config.go

    Lines 19 to 94 in 87b4873

    type Studio struct {
    GameMode bool `toml:"gamemode"`
    WineRoot string `toml:"wineroot"`
    Launcher string `toml:"launcher"`
    Quiet bool `toml:"quiet"`
    DiscordRPC bool `toml:"discord_rpc"`
    ForcedVersion string `toml:"forced_version"`
    Channel string `toml:"channel"`
    Dxvk bool `toml:"dxvk"`
    DxvkVersion string `toml:"dxvk_version"`
    WebView string `toml:"webview"`
    ForcedGpu string `toml:"gpu"`
    Renderer string `toml:"renderer"`
    Env Environment `toml:"env"`
    FFlags rbxbin.FFlags `toml:"fflags"`
    }
    // Config is a representation of the Vinegar configuration.
    type Config struct {
    SanitizeEnv bool `toml:"sanitize_env"`
    Studio Studio `toml:"studio"`
    Env Environment `toml:"env"`
    }
    var (
    ErrNeedDXVKRenderer = errors.New("dxvk is only valid with d3d renderers")
    ErrWineRootAbs = errors.New("wine root path is not an absolute path")
    ErrWineRootInvalid = errors.New("no wine binary present in wine root")
    )
    // Load will load the configuration file; if it doesn't exist, it
    // will fallback to the default configuration.
    func Load() (*Config, error) {
    d := Default()
    if _, err := os.Stat(dirs.ConfigPath); errors.Is(err, os.ErrNotExist) {
    return d, d.Setup()
    }
    if _, err := toml.DecodeFile(dirs.ConfigPath, &d); err != nil {
    return d, err
    }
    return d, d.Setup()
    }
    // Default returns a default configuration.
    func Default() *Config {
    return &Config{
    Env: Environment{
    "WINEARCH": "win64",
    "WINEDEBUG": "fixme-all,err-kerberos,err-ntlm",
    "WINEESYNC": "1",
    "WINEDLLOVERRIDES": "dxdiagn,winemenubuilder.exe,mscoree,mshtml=",
    "DXVK_LOG_LEVEL": "warn",
    "DXVK_LOG_PATH": "none",
    "MESA_GL_VERSION_OVERRIDE": "4.4",
    "__GL_THREADED_OPTIMIZATIONS": "1",
    "VK_LOADER_LAYERS_ENABLE": "VK_LAYER_VINEGAR_VinegarLayer",
    },
    Studio: Studio{
    Dxvk: false,
    DxvkVersion: "2.5.3",
    // Runtime 109.0.1518.140 for X64.
    WebView: "322eb0af-cdbc-4a17-a8ca-f0ace4d4adc8",
    GameMode: true,
    ForcedGpu: "prime-discrete",
    Renderer: "Vulkan",
    Channel: "LIVE",
    DiscordRPC: true,
    FFlags: make(rbxbin.FFlags),
    Env: make(Environment),
    },
    }
    }
  • func (ui *ui) debugInfo() string {
    var revision string
    bi, _ := debug.ReadBuildInfo()
    for _, bs := range bi.Settings {
    if bs.Key == "vcs.revision" {
    revision = fmt.Sprintf("(%s)", bs.Value)
    }
    }
    var b strings.Builder
    inst := "source"
    if sysinfo.InFlatpak {
    inst = "flatpak"
    }
    info := `* Vinegar: %s %s
    * Distro: %s
    * Processor: %s
    * Kernel: %s
    * Wine: %s
    * Installation: %s
    `
  • https://github.com/BurntSushi/toml/blob/master/encode.go
  • https://github.com/BurntSushi/toml/blob/master/encode_test.go
  • toml encode ui.cfg.Studio iiuc and add it to the info string in debug.go

@apprehensions
Copy link
Member

apprehensions commented Mar 3, 2025

Just put the file contents into the debug information.

Alternatively, file to TOML to JSON to base64 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants