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

D8 invocation doesn't use response files #9515

Open
jpobst opened this issue Nov 14, 2024 · 1 comment · May be fixed by #9546
Open

D8 invocation doesn't use response files #9515

jpobst opened this issue Nov 14, 2024 · 1 comment · May be fixed by #9546
Assignees
Labels
Area: App+Library Build Issues when building Library projects or Application projects. bug Component does not function as intended.

Comments

@jpobst
Copy link
Contributor

jpobst commented Nov 14, 2024

If you reference enough of our library bindings NuGet packages, the command line to d8/java gets too long and throws an error:

Command 'build -c Release -bl' failed with exit code 1.
Errors:
MSB6003: The specified task executable "java.exe" could not be run. System.ComponentModel.Win32Exception (206): An error occurred trying to start process 'C:\Program Files (x86)\Android\openjdk\jdk-17.0.8.101-hotspot\bin\java.exe' with working directory 'D:\a_work\1\s\output\tests\allpackages\android\AllPackagesTest'. The filename or extension is too long. [D:\a_work\1\s\output\tests\allpackages\android\AllPackagesTest\AllPackagesTest.csproj]
MSB6003: at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) [D:\a_work\1\s\output\tests\allpackages\android\AllPackagesTest\AllPackagesTest.csproj]
MSB6003: at Microsoft.Build.Utilities.ToolTask.StartToolProcess(Process proc) [D:\a_work\1\s\output\tests\allpackages\android\AllPackagesTest\AllPackagesTest.csproj]
MSB6003: at Microsoft.Build.Utilities.ToolTask.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [D:\a_work\1\s\output\tests\allpackages\android\AllPackagesTest\AllPackagesTest.csproj]
MSB6003: at Microsoft.Build.Utilities.ToolTask.Execute() [D:\a_work\1\s\output\tests\allpackages\android\AllPackagesTest\AllPackagesTest.csproj]
Warnings:
APT2000: warn: removing resource com.companyname.AllPackagesTest:string/action_bar_expand_collapse_button without required default value. [D:\a_work\1\s\output\tests\allpackages\android\AllPackagesTest\AllPackagesTest.csproj]
APT2000: warn: removing resource com.companyname.AllPackagesTest:string/action_bar_expand_collapse_button without required default value. [D:\a_work\1\s\output\tests\allpackages\android\AllPackagesTest\AllPackagesTest.csproj]
MSB6002: The command-line for the "D8" task is too long. Command-lines longer than 32000 characters are likely to fail. Try reducing the length of the command-line by breaking down the call to "D8" into multiple calls with fewer parameters per call. [D:\a_work\1\s\output\tests\allpackages\android\AllPackagesTest\AllPackagesTest.csproj]

Does java support response files to get around this issue?

@jpobst jpobst added Area: App+Library Build Issues when building Library projects or Application projects. bug Component does not function as intended. labels Nov 14, 2024
@dotnet-policy-service dotnet-policy-service bot added the needs-triage Issues that need to be assigned. label Nov 14, 2024
@jpobst jpobst removed the needs-triage Issues that need to be assigned. label Nov 14, 2024
@jonpryor
Copy link
Member

Yes, r8.jar supports response files:

% echo ' --help' > r.rsp
% java -jar /usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/35.0.7/tools/r8.jar @r.rsp
…
  --startup-profile <file>
                          # Startup profile <file> to use for dex layout.
  --version               # Print the version of r8.
  --help                  # Print this message.

r8.jar @r.rsp whenr.rsp contains --help shows output equivalent to r8.jar --help.

@jpobst jpobst linked a pull request Nov 22, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: App+Library Build Issues when building Library projects or Application projects. bug Component does not function as intended.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants