Menu

#277 C:B project variables not updated when changing workspace

Undefined
fixed
nobody
None
Bug_Report
2021-12-18
2015-12-28
No

When I close a workspace (workspace A) using "File->Close Workspace" and open another (workspace B), typically via the "Recent projects" links on the C::B front page, I find that my post build steps are sometimes not working properly. Below is an example specification of a post build step:

$cpde_usr -bin -xi -project=$(PROJECT_NAME) -root=$(PROJECT_DIR) -build=$(TARGET_NAME) -target=$(TARGET_OUTPUT_FILE) -usr=$(CPDE_USR)

The problem is that sometimes the $(PROJECT_NAME), $(PROJECT_DIR), $(TARGET_NAME) etc. variables of C::B keep their settings from the used-to-be-current project in the recently closed workspace A, i.e. they are NOT reassigned to the actually-current project in workspace B.

The work-around when this happens is to close/restart C::B and open workspace B, then all is fine in the build. Note that no changes have occurred in workspace B.

I am able to reproduce on my own workspaces like this:

  1. Open C:B
  2. Open Workspace A, Rebuild All
  3. File -> Close Workspace
  4. Open Workspace B by clicking link on front page
  5. Rebuild all. Post-build step fails here, indicating the $(PROJECT_NAME) is the used-to-be project in the previous workspace A

This problem has been observed on Windows and Linux:
Windows: Nightly build 09 November 2015 build (10561) (svn 10595)
Linux: svn 10621

Discussion

  • ollydbg

    ollydbg - 2016-01-03
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -9,7 +9,7 @@
     I am able to reproduce on my own workspaces like this:
    
     1. Open C:B
     2. Open Workspace A, Rebuild All
    -3. File -> Cose Workspace
    +3. File -> Close Workspace
     4. Open Workspace B by clicking link on front page
     5. Rebuild all. Post-build step fails here, indicating the $(PROJECT_NAME) is the used-to-be project in the previous workspace A
    
     
  • ollydbg

    ollydbg - 2016-01-03

    Where is the C::B forum links, I suggetted add the link here.

     
    • Carsten Arnholm

      Carsten Arnholm - 2016-01-03

      This is the C::B forum link where this was first reported
      http://forums.codeblocks.org/index.php/topic,20693.msg141913.html#msg141

      The problem is observed on different workspaces/computers/os'es.

       
  • Miguel Gimenez

    Miguel Gimenez - 2021-12-18
    • status: open --> fixed
     
  • Miguel Gimenez

    Miguel Gimenez - 2021-12-18

    Works on recent versions

     

Log in to post a comment.