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

Core build launch configurations are not persistent. #167

Closed
ewaterlander opened this issue Nov 15, 2022 · 7 comments · Fixed by #314
Closed

Core build launch configurations are not persistent. #167

ewaterlander opened this issue Nov 15, 2022 · 7 comments · Fixed by #314

Comments

@ewaterlander
Copy link
Contributor

ewaterlander commented Nov 15, 2022

I noticed the following with core build cmake and make projects.

Create a Core Build Makefile project. Change Build Output Location to "Build in Project directory".
When I close the project and re-open it, the build settings are back to default. The Build Output Location goes back to "Build configuration in specific directory". Or in case of a Cmake project, the generator goes back from Makefile to Ninja.

When I close the project, exit Eclipse, open Eclipse, open the project, the launch configuration disappeared.

The core build launch configurations are only visible in in the launch bar, not in the Run/Debug Configurations dialogs.
The core build launch configurations are of launch-type "Auto C/C++ Local Application" (org.eclipse.cdt.debug.core.localCoreBuildLaunchConfigType). They are present in the .metadata folder, but they contain no build settings. I think that's why the build information is lost when you close the project.

One way to restore a disappeared launch configuration is to delete the project and recreate a new project op top of the old location. Another way is to exit Eclipse and open Eclipse, leaving the project open. New launch configurations will be created for the projects which don't have one.

I would expect that the core build launch configurations would keep their settings and would not disappear.

OS: Linux
CDT: 10.5

@ewaterlander
Copy link
Contributor Author

CDT 10.7.1 still has the problem.

@ewaterlander
Copy link
Contributor Author

Isn't a launch configuration a strange place to store build configuration settings (besides the fact that they are only in memory, not in the launch file)?
In a managed build project the build configuration settings are stored in the .cproject file.

@mbooth101
Copy link
Member

Core build was an initiative to simplify build mechanism especially in the case where the build system took care of most things internally (e.g. Makefile, CMake, Meson). These build systems are things that CDT must "launch", I don't think it's very strange to store configuration for things we must launch in launch configurations.

Documentation is a bit sparse, but here's one of Doug's old slide decks on the off-chance it is helpful: https://wiki.eclipse.org/images/e/e2/CDTCoreBuild2017.pdf

However you certainly found a bug here I think because when I change the build output location, the compiled binary artifact is not detected (there is no binaries container in the project explorer) and cannot be launched (I believe the dynamically created launch configurations rely on being able to detect the built binary artifact in order to avoid any additional user configuration).

@ewaterlander
Copy link
Contributor Author

I think this bug is related: https://bugs.eclipse.org/bugs/show_bug.cgi?id=552070

@ewaterlander
Copy link
Contributor Author

The fix for bug 552070 fixed the problem of the settings getting back to default after close and reopen of the project.
See PR #192

The problem that the launch configuration is gone after close project and restart Eclipse is still there.
Fixing this by restarting Eclipse while the project is open does get the proper settings back when the fix for bug 552070 is included.

@ewaterlander
Copy link
Contributor Author

Although the launch configuration keeps the correct settings after project closure or Eclipse restart, the actual building is not using the correct settings.

Create a Makefile Core Build project. Change Build Output Location to "Build in Project directory". Close and reopen the project, or restart Eclipse. Whatever the setting is for the Build Output Location, the build will always use "Build in configuration specific directory".

ewaterlander added a commit to ewaterlander/cdt that referenced this issue Mar 10, 2023
* Issue Issue eclipse-cdt#167 was partly solved by PR eclipse-cdt#192 (commit 7911ac8).
  This change fixes the problem that after closing and opening a
  Makefile project the wrong build output location was used for the
  default Run configuration.
  The cause was that StandardBuildConfiguration.buildContainer was
  null after opening the project.
* Changed the template application to Hello World.

Fixes eclipse-cdt#167
@ewaterlander
Copy link
Contributor Author

The last problem was only present for the Core Build Makefile project Run configuration, not for Debug.
The problem is fixed in PR #314 .

ewaterlander added a commit to ewaterlander/cdt that referenced this issue Mar 13, 2023
* Issue Issue eclipse-cdt#167 was partly solved by PR eclipse-cdt#192 (commit 7911ac8).
  This change fixes the problem that after closing and opening a
  Makefile project the wrong build output location was used for the
  default Run configuration.
  The cause was that StandardBuildConfiguration.buildContainer was
  null after opening the project.
* Fixed the problem that the output binary could not be found during
  launching when the user set the Build Output Location to "Build in
  project directory".
* Changed the template application to Hello World.

Fixes eclipse-cdt#167
jonahgraham pushed a commit to ewaterlander/cdt that referenced this issue Mar 16, 2023
* Issue Issue eclipse-cdt#167 was partly solved by PR eclipse-cdt#192 (commit 7911ac8).
  This change fixes the problem that after closing and opening a
  Makefile project the wrong build output location was used for the
  default Run configuration.
  The cause was that StandardBuildConfiguration.buildContainer was
  null after opening the project.
* Fixed the problem that the output binary could not be found during
  launching when the user set the Build Output Location to "Build in
  project directory".

Fixes eclipse-cdt#167
jonahgraham pushed a commit to jonahgraham/cdt that referenced this issue Mar 16, 2023
* Issue Issue eclipse-cdt#167 was partly solved by PR eclipse-cdt#192 (commit 7911ac8).
  This change fixes the problem that after closing and opening a
  Makefile project the wrong build output location was used for the
  default Run configuration.
  The cause was that StandardBuildConfiguration.buildContainer was
  null after opening the project.
* Fixed the problem that the output binary could not be found during
  launching when the user set the Build Output Location to "Build in
  project directory".

Fixes eclipse-cdt#167
ewaterlander added a commit to ewaterlander/cdt that referenced this issue Mar 17, 2023
* Issue Issue eclipse-cdt#167 was partly solved by PR eclipse-cdt#192 (commit 7911ac8).
  This change fixes the problem that after closing and opening a
  Makefile project the wrong build output location was used for the
  default Run configuration.
  The cause was that StandardBuildConfiguration.buildContainer was
  null after opening the project.

Fixes eclipse-cdt#167
ewaterlander added a commit to ewaterlander/cdt that referenced this issue Mar 17, 2023
* Issue Issue eclipse-cdt#167 was partly solved by PR eclipse-cdt#192 (commit 7911ac8).
  This change fixes the problem that after closing and opening a
  Makefile project the wrong build output location was used for the
  default Run configuration.
  The cause was that StandardBuildConfiguration.buildContainer was
  null after opening the project.
* Fixed the problem that the output binary could not be found during
  launching when the user set the Build Output Location to "Build in
  project directory".

Fixes eclipse-cdt#167
jonahgraham pushed a commit that referenced this issue Mar 17, 2023
* Issue Issue #167 was partly solved by PR #192 (commit 7911ac8).
  This change fixes the problem that after closing and opening a
  Makefile project the wrong build output location was used for the
  default Run configuration.
  The cause was that StandardBuildConfiguration.buildContainer was
  null after opening the project.

Fixes #167
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants