microsoft / microsoft/vscode-java-debug
Setting shortenCommandLine "argfile" should not nest a user-passed argfile inside an argfile
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- TypeScript
- Star
- 591
- Fork
- 429
- Merge trung bình
- 1 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 19
Mô tả
When setting shortenCommandLine to argfile (or setting to auto and then triggering the argfile behavior with a long command), VS Code will always put any vmArgs inside an argfile, even if the only VM arg is another argfile. This breaks run configurations that pass a user-generated argfile that still trigger the automatic CLI shortening behavior such as a very long classpath, since argfiles cannot be nested.
Environment
- Operating System: Linux
- JDK version: 17
- Visual Studio Code version: 1.84.0-insider (
60182c7e1a666961ded4d0319c154f52d85daf30) - Java extension version: v0.25.15
- Java Debugger extension version: v0.54.0
Steps To Reproduce
- Create a trivial Java project ex. a Hello World main method
- Create an argfile
myargs - Create
launch.jsonwith a corresponding run configuration for the main method. SetshortenCommandLinetoargfileto force the argfile behavior (should be equivalent to settingautoand then loading a very long classpath).
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Hello",
"request": "launch",
"mainClass": "Hello",
"vmArgs": "@myargs",
"shortenCommandLine": "argfile"
}
]
}
- Attempt to run the main method - this should fail.
Sample project: test-argfile.tar.gz
Current Result
$ /usr/bin/env /path/to/jdk @/tmp/cp_7ifzraqswz8cni6w2z8m6nw3w.argfile Hello
Error: Could not find or load main class @myargs
Caused by: java.lang.ClassNotFoundException: @myargs
/tmp/cp_7ifzraqswz8cni6w2z8m6nw3w.argfile contents:
@myargs -XX:+ShowCodeDetailsInExceptionMessages -cp "/home/justinw/.vscode-server-insiders/data/User/workspaceStorage/-2d922411/redhat.java/jdt_ws/test-argfile_31bc6c61/bin"
Expected Result
Program should execute and argfiles should not be nested
Additional Informations
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với cấu hình khởi chạy Java bằng vmArgs, shortenCommandLine và tệp myargs do người dùng tạo, sau đó tái hiện lỗi bằng các bước Hello World được cung cấp. Theo dõi cách trình gỡ lỗi xây dựng argfile tạm thời; công việc được hoàn tất khi chương trình thực thi mà không lồng argfile do người dùng truyền vào.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- java, typescript, vscode
- Lĩnh vực
- devtools, tooling
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 42/100