problems with the new CIs

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
Roy_043
Veteran
Posts: 8551
Joined: Thu Dec 27, 2018 12:28 pm

Re: problems with the new CIs

Post by Roy_043 »

We can use a different workaround relying on document meta data. But there might still be a possibility that the active document gets deleted while the reapply_DiffuseColor_action code is running.

EDIT: Simpler solution: :mrgreen:
https://github.com/FreeCAD/FreeCAD/pull/8386

Code: Select all

def make_clone(obj, delta=None, forcedraft=False):
    # ...
    
    if App.GuiUp:
        # ...
        
        # Workaround to trigger update of DiffuseColor:
        # Note: only works if obj contains 1 object.
        reapply_DiffuseColor_store(cl, cl.ViewObject.DiffuseColor)
        ToDo.delay(reapply_DiffuseColor_action, [])
        gui_utils.select(cl)
    return cl

def reapply_DiffuseColor_store(obj, difcol):
    doc = App.ActiveDocument
    meta = doc.Meta
    meta["Draft_DiffuseColor_Workaround"] = str([obj.Name, difcol])
    doc.Meta = meta

def reapply_DiffuseColor_action():
    doc = App.ActiveDocument
    if doc is None:
        return
    meta = doc.Meta
    data = meta.get("Draft_DiffuseColor_Workaround")
    if data is None:
        return
    data = eval(data)
    name = data[0]
    difcol = data[1]
    obj = doc.getObject(name)
    if obj is None:
        return
    if not hasattr(obj, "ViewObject"):
        return
    vobj = obj.ViewObject
    if not vobj:
        return
    vobj.DiffuseColor = difcol
    del meta["Draft_DiffuseColor_Workaround"]
    doc.Meta = meta
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: problems with the new CIs

Post by openBrain »

wmayer wrote: Tue Feb 07, 2023 10:10 am But what's more weird is that the summary doesn't list any failed tests and instead claims everything is OK.
To be clear, this isn't a CI issue on this. Summary is consistent with tests that end with PASS status.
I plan to improve summary reporting because I already saw several problems like this.
Some tests are either designed in a failure-immune way (which isn't good) or aren't able to correctly report their failure (not good too). ;)
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: problems with the new CIs

Post by openBrain »

@chennes may you be able to take a look at this failure : https://github.com/FreeCAD/FreeCAD/acti ... ep:15:3758

It seems to involve WebEngineWidgets and IIRC it was introduced by AddonManager so maybe it could be linked.
It looks to me like it's not the main thread who is failing. :?
User avatar
chennes
Veteran
Posts: 3909
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: problems with the new CIs

Post by chennes »

Can anyone reproduce locally? It could be either AddonManager, Start, or Web. If it can be reproduced locally we can disable one by one and try to narrow it down.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
wmayer
Founder
Posts: 20308
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: problems with the new CIs

Post by wmayer »

To me this crash looks more related to the StartPage because Start is the default startup workbench. On my old system Xubuntu 18.04 I get regular crashes when using the nouveau driver. What fixed it for me is to set the option Software OpenGL.
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: problems with the new CIs

Post by openBrain »

wmayer wrote: Wed Feb 08, 2023 9:03 pm What fixed it for me is to set the option Software OpenGL.
From my understanding, using "swrast_dri.so" is already a software OpenGL solution (as its name denotes, and I don't think CI runner may actually display through a hardware solution).
Also searching the web, I found it to be linked to Qt and probably not to GFX drivers.
As I said, I never saw this error in 100+ runs that I did when fine-tuning the CI. So I may suspect it has been added recently. I will check changed in StartPage wherever I can.
Last clue is to me that this error only appears with Ubuntu 20.04 that comes with Qt 5.12.x and never (AFAIK) with Ubuntu 22.04 that comes with Qt 5.15.x. So also probably Qt did some bugfix.

Anyway, I can test switching FC to SW OpenGL. Is there a switch that can be passed at launch time, or do I need to do it through application-level parameter access ?
Thanks
wmayer
Founder
Posts: 20308
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: problems with the new CIs

Post by wmayer »

This line must be executed after start:

Code: Select all

FreeCAD.ParamGet("User parameter:BaseApp/Preferences/OpenGL").SetBool("UseSoftwareOpenGL", 1)
User avatar
adrianinsaval
Veteran
Posts: 5551
Joined: Thu Apr 05, 2018 5:15 pm

Re: problems with the new CIs

Post by adrianinsaval »

openBrain wrote: Sun Feb 12, 2023 4:07 pm Anyway, I can test switching FC to SW OpenGL. Is there a switch that can be passed at launch time, or do I need to do it through application-level parameter access ?
Thanks
you could add a cfg file that has the parameter set
User avatar
chennes
Veteran
Posts: 3909
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: problems with the new CIs

Post by chennes »

The linter is still kicking my butt here. I have a PR in where I am trying to shut it all the way up, and I've still got two errors that don't make any sense to me. This is PR 8466.

First:
Screenshot 2023-02-12 at 11.15.27 PM.png
Screenshot 2023-02-12 at 11.15.27 PM.png (61.5 KiB) Viewed 543 times
I am specifically asking clang-tidy to ignore the next line... and it is not. I can't figure this one out at all, why is it giving any error at all there?

Next up,
Screenshot 2023-02-12 at 11.15.39 PM.png
Screenshot 2023-02-12 at 11.15.39 PM.png (58.56 KiB) Viewed 543 times
This strikes me as simply being wrong: no initialization should be required, a std::ostringstream is in a perfectly valid state without any initializer statement at all, isn't it? Any idea how to get clang-tidy to stop complaining?
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: problems with the new CIs

Post by openBrain »

@chennes Sorry I have no answer. Just to be clear that these issues hasn't been introduced by new CI. Lint is roughly same as with previous CI. :)
Post Reply