Menu

#1395 Compilergcc

Next_Nightly
applied
None
Patch
2023-09-16
2023-05-23
LETARTARE
No

Following the forum discussion :
Plugin Compliergcc

1 Attachments

Discussion

  • Miguel Gimenez

    Miguel Gimenez - 2023-05-29
    • assigned_to: Miguel Gimenez
     
  • Miguel Gimenez

    Miguel Gimenez - 2023-05-29
    • status: open --> applied
     
  • Miguel Gimenez

    Miguel Gimenez - 2023-05-29

    Applied slightly modified patch in [r13278], thanks.

    Changes:
    - New method now begins with uppercase, following code style
    - Change Exe to Executable, EXE is meaningful only on MSW
    - Test target type first, avoid second (and slower) test if not relevant.
    - Use wxFileName::FileExists() instead of wxFileExists()

     

    Related

    Commit: [r13278]

  • LETARTARE

    LETARTARE - 2023-05-30

    Thanks.
    But then there's some code that will never be executed: the code corresponding to the 'Run' action!
    Shall I provide you with a new patch ?
    Or delete it directly ?

     
  • Miguel Gimenez

    Miguel Gimenez - 2023-05-30

    Sorry, I do not understand. Which code will not be executed?

     
  • LETARTARE

    LETARTARE - 2023-05-30

    In the 'int CompilerGcc::Run(ProjectBuildTarget * target)' method from line 2133 -> line 2155 : this code is no longer needed, as the executable will exist.

     
  • Miguel Gimenez

    Miguel Gimenez - 2023-05-30

    That code may look superfluous, but better safe than sorry:
    - Some antivirus may delete the executable as soon as it is created, leaving the button enabled
    - Some execution path may call Run() directly (a script?).

    I can add some comment, though.

     
  • LETARTARE

    LETARTARE - 2023-05-30

    Yes, that's not a problem.

     
  • ollydbg

    ollydbg - 2023-06-26

    Hi, I have one issue about this ticket. I see the code is already applied in the trunk. When I used the svn trunk HEAD C::B, I see that the "virtual" target is not allowed to "run". I mean for virtual target, the run bottom is disabled. Is that by design? For me, I have a virtual target, the virtual target has one host exe target and many dll targets. When I rebuild the virtual target, I have to switch to the host exe to run the application. Thanks.

     
  • Miguel Gimenez

    Miguel Gimenez - 2023-06-26

    This is a collateral damage. Feel free to modify or revert the commit, I have no time to do it right now and the release is around the corner.

     
  • Miguel Gimenez

    Miguel Gimenez - 2023-06-27

    Basically ExecutableExists() should return true if the target is virtual, but I do not know ATM how a virtual target can be identified.

     
  • Miguel Gimenez

    Miguel Gimenez - 2023-06-27

    @ollydbg, can you check if replacing ExecutableExists() with this code works for you?

    bool CompilerGCC::ExecutableExists(cbProject* prj)
    {
        if (!prj)
            return false;
    
        // Get target name
        const wxString activeTarget(prj->GetActiveBuildTarget());
    
        // Is a virtual target?
        if (prj->HasVirtualBuildTarget(activeTarget))
            return true;
    
        ProjectBuildTarget* pTarget = prj->GetBuildTarget(activeTarget);
        if (!pTarget)
            return false;
    
        if (pTarget->GetTargetType() == ttCommandsOnly)
            return true;
    
        // Check if the output filename exists
        wxString out = UnixFilename(pTarget->GetOutputFilename());
        Manager::Get()->GetMacrosManager()->ReplaceEnvVars(out);
        wxFileName file(out);
        file.MakeAbsolute(prj->GetBasePath());
        return file.FileExists();
    }
    
     
  • Miguel Gimenez

    Miguel Gimenez - 2023-06-28

    Fixed in [r13312].

     

    Related

    Commit: [r13312]

  • ollydbg

    ollydbg - 2023-06-28

    Hi, Miguel, thanks for the help.
    I was quite busy on my work in those days. I will build the svn head as soon as possible to test.

    Thanks.

     
    • ollydbg

      ollydbg - 2023-06-29

      I just tested it, and it works fine(The run button behaves the old way for the virtual target)

       
  • ollydbg

    ollydbg - 2023-09-16

    Hi, for some reasons, I can't run the command line only target, see this forum post here: I can't run a command only build target

    I think this ticket is related. Thanks.

     
  • Miguel Gimenez

    Miguel Gimenez - 2023-09-16

    [r13278] and [r13312] determine if the Run button must be enabled or disabled, they are not related to execution itself.

    At compilergcc.cpp:2109 we have

            // commands-only target?
            if (target->GetHostApplication().IsEmpty())
            {
                cbMessageBox(_("You must select a host application to \"run\" a commands-only target..."));
                m_pProject->SetCurrentlyCompilingTarget(0);
                return -1;
            }
    

    I have never used this "command only" targets, so I do not know if setting an executable should be enabled or the if() must be relaxed/removed.

     

    Related

    Commit: [r13278]
    Commit: [r13312]

    • ollydbg

      ollydbg - 2023-09-16

      I think I have made a mistake, sorry. I explain it here: Re: I can't run a command only build target

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.