Fix: Cannot run 'filename' in 'debug' (Allow AutoCp run configurations to execute with CMake build targets)#150
Merged
Pushpavel merged 6 commits intoPushpavel:mainfrom Nov 30, 2025
Merged
Conversation
update the plugin.xml. Set run configuration producers to order="LAST" to prevent overriding default IDE run actions, so that fix shortcut conflict between AutoCp and default IDE "Run context configuration" action(Ctrl+Shift+R on Mac/Linux, Ctrl+Shift+F10 on Windows).
add some log and AutoCpProgramRunner.kt override and add some functions in /Users/zzy/Documents/GitHub/AutoCp/src/main/kotlin/com/github/pushpavel/autocp/config/AutoCpConfig.kt
This commit does not revert gradle.properties modification and delete some log. Fixes issue #3 ([https://github.com/Pushpavel/AutoCp/issues/145](https://github.com/Pushpavel/AutoCp/issues/145) [https://github.com/Pushpavel/AutoCp/issues/127](https://github.com/Pushpavel/AutoCp/issues/127))where AutoCp run configurations failed to execute in CLion when a CMake Debug/Release build target was active, showing error: "Cannot run 'filename' in 'debug'". Root cause: IntelliJ's ExecutionTargetManager.doCanRun() was rejecting AutoCp configurations because they were incompatible with CMake build targets (CMakeBuildProfileExecutionTarget). Solution implemented: 1. Created AutoCpExecutionTarget - a custom ExecutionTarget that declares AutoCp's independence from build system targets 2. Created AutoCpExecutionTargetProvider - provides the custom target for AutoCp configurations 3. Modified RunAutoCpAction and RunAutoCpStressAction to explicitly use AutoCpExecutionTarget when creating ExecutionEnvironment, bypassing the active CMake target 4. Implemented TargetEnvironmentAwareRunProfile in AutoCpConfig to declare that AutoCp doesn't require target environment preparation 5. Implemented doExecute() in AutoCpProgramRunner to properly handle execution flow per GenericProgramRunner contract 6. Registered executionTargetProvider extension point in plugin.xml Technical details: - AutoCpConfig.canRunOn() now always returns true, as AutoCp is ExecutionTarget-independent - ExecutionEnvironmentBuilder.target() is used to force AutoCpExecutionTarget - Added proper ExecutionException handling in doExecute() - All debug logging preserved for future troubleshooting Result: AutoCp can now execute successfully regardless of which CMake build configuration is currently active in CLion, while maintaining compatibility with all existing functionality.
…gProducer processing this modification is that after the last commit, in one file, clicking option+X with multiple times does not lead to run multiple times. - Enabled isAllowRunningInParallel in both AutoCpConfig and AutoCpConfigProducer With these modifications, the autoCp acts like before.
delete the log and revert gradle.properties plugin version modification The modification is tested. Everything goes well. I will use this version continuously to check and ensure the compatibility and strength.
Contributor
Author
|
When you have a moment, could you please take a quick look and let me know if anything needs to be adjusted? |
save-file-before-run-it
Owner
|
Hey @znzryb, my bad, I totally forgot about this one. Thanks for your patience. I'm jumping on this today. |
Contributor
Author
@Pushpavel That's okay. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The pull request is to solve these two issues( the same problem).
Fixes #145
Fixes #127
In detailed, the expectation is that the top is cmake application configuration (Debug), when we click option+X (or Alt+X on windows), we can run easily. Howerver, we wiil get an error currently.
the detailed log is stated below.
With this fix, the autocp will run like expecting.