purpleidea / mgmt

Next generation distributed, event-driven, parallel config management!
https://purpleidea.com/tags/mgmtconfig/
GNU General Public License v3.0
3.47k stars 308 forks source link

type unification regression #733

Open purpleidea opened 6 months ago

purpleidea commented 6 months ago

This simple code used to work. I think I broke it, and it fails at type unification. Add a simple test in TestAstFunc1 and bisect the regression! Bonus points if you have a fix, although please ask for help before digging too deeply into it.

http:server ":8080" {
    timeout => 60,      # XXX why is this breaking type unification?
}

Broken in 7777107d83ff21094392a637bb426e2a1bad5cf1 Worked some time not too long ago.

ollytom commented 6 months ago

Sounds like what I could do is add a new test in txtar format in lang/interpret_test/TestAstFunc1 then do something like:

git checkout master
cd lang
git bisect start HEAD 0.0.24 -- .

Then as I go, do go test -run TestAstFunc1 and see what pops up? I'm assuming the tag 0.0.24 is a "good" commit here, but I see there's been approx. 160 commits since...

Not sure yet what will go in the test mcl file but just wanted to see if this strategy is what you had in mind? What do you think?

purpleidea commented 6 months ago

Sounds perfect! Note that TestAstFunc1 has sub tests, so you can -run TestAstFunc1/test_#11_ (or whatever number it is) to just run the one test. If you run the test with -short, it will show you all the numbers. Keep in mind the number are unfortunately not stable between commits necessarily. So name it 000.txtar or something to ensure it's always first.

purpleidea commented 2 months ago

FYI: I have a large feature branch which is not yet finished, that totally rewrites type unification and solving, so this issue should probably be ignored for now, until that's merged. With any luck we'll have fixed the bug.