When a project is loaded there are no compiler validation checks done to ensure that the compilers in the project are valid and installed in C::B.
The code used to check for valid compilers and the pop up when selecting the build options on a project that has been loaded with invalid compilers should occur in the project loading.
Ticket 1125is also part of the complete solution to this issue as you do NOT want the user to be able to select invalid compilers in the dialog that pops up.
The code to resolve tickets 1125 & 1126 are available from the following github branch:
https://github.com/acotty/codeblocks_sf/commits/AC-ProjectLoadInvalidCompilerDetection
It is not a good idea to popup every time when a cross-platform project is loaded on Linux while it has Windows targets using msvc compiler.
Last edit: Dimitry Sibiryakov 2021-08-24
Patch attached.
Please be very careful here! It is perfectly OK to have (targets) with invalid compilers. This will be the case if you have a shared project files that contains targets for different platforms and/or you have specific compilers only available on certain PC's (e.g. nightly builds).
So any changes that would not reflect these possibilities should seriously be rejected.
Check your patch again against these use-cases, please and if it is obsolete, flag close it accordingly. Thank you!
Can you please supply a project for the use case so I can test and update it.
You can easily do it yourself:
- copy your compiler folder
- copy a compiler in C::B
- setup the compiler path to point to the copied compiler folder
- setup a taget to use the new compiler
- close project and c::b
- delete the copied compiler folder
- open c::b and the project
- the compiler is invalid but that is and shall be ok.
Thats what the message that will appear is for.
Your previous posts was about "shared project files that contains targets for different platforms and/or you have specific compilers only available on certain PC's (e.g. nightly builds"
I do not have such a complex project and was hoping you had one to save me setting up one that may not be as complex.
The steps you indicate will on pop up the following message, but I will need to change the detection code as it does not take into consideration the different platforms:
Btw, it is also perfectly ok to select an invalid compiler therefore. This is by design.
Looks like you have not looked at the latest patch from yesterday as the design has not changed and therefore I do not understand why you are so against letting an end user know that the project will not build when it is loaded due to invalid compiler being used in the project they have loaded.
The user already know. (S)he is not going to build this particular target in this particular environment. Your message will be simply annoying.
That ist my point. I don't want to see obvious messages for things I know. Your patch would cause this message to appear in 40 percent of the projects I do. And it is additionally to the non intrusive message I see when I try to compile. This and only this should trigger a message. And this is already implemented. There ist one golden rule: Never try to bei smarter than the developer. This will fail. Just report real errors.
In the projectloader on line 1792 the code uses "/environment/ignore_invalid_targets" , so I will modify the code to only pop up the dialog when this is set to false like if on line 1792 does.
My code around line 1792 is:
As requested before do you have a sample project for me to test with?
Morten as you assigned the ticket to yourself , does this mean that you will be making any code changes for the ticket? I do not know how the C::B ticket process works once a ticket has been assigned to someone as I am used to working with other systems where once a ticket/item is assigned to someone then they are in charge iof making any of the required changes.
No, it just means as we are in the discussion none of the other devs needs to take care. I was wondering what the latest version is though becasue after the last discussion there was on update on the patch.
And I don't foresee at the moment if applying this patch will cause annoying messages all over the place for people (like me) that do cross-compilation were it is perfectly normal that depending on what platform you are you will have invalid compiler settings on project or target level.
To sum up: What exactly are you trying to solve and is that interfering with anything we don't want to change? Based on the initial explanation of the patch it should be rejected because it would screw cross-compilation completely.
A general note: All changes / new features should be non-intrusive. So if a new function causes new messages that there must be a very good reason (=bug) or it must be explicitly enabled by the user and off by default. I also don't know if you can decide at loading time. When a user tries to compile an invalid target - this is worth a message. But that message we have already... these are my doubts here.
Generally: You get more flies with honey than with vinegar!!!!
Looks like no one who has responded has thought about giving feedback on using the AnnoyingDialog....
Attached is patch V3.
Stalled as usual.....