Skip to content

Launcher is converting \ to \\\\ in arguments #525

@peakschris

Description

@peakschris

The binary launcher in rules_dotnet appears to be converting single backslashes in arguments to 4xbackslashes.

> bazel run //src/mybinary -- --output=D:\temp
INFO: Build completed successfully, 3 total actions
INFO: Running command line: bazel-bin/src/mybinary/mybinary/net8.0/mybinary.dll.bat '--output=D:\temp'
Arg: --output=D:\\\\temp

The program code is:

    static async Task Main(string[] args)
    {
        foreach (var arg in args)
        {
            Console.WriteLine("Arg: " + arg);
        }

I believe the issue is coming from this line:

set args=!args:\=\\\\!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions