Closed PhilippMDoerner closed 8 months ago
Shouldn't we be able to just compile for adw 1.4? I mean, adwaita is present in the install, though I don't know if 22.04 contains adwaita 1.4 I would assume so (?)
At least according to https://packages.ubuntu.com/jammy/libadwaita-1-0, its only version 1.1.0 (although the package is confusingly named 1-0
)
Ooooooooooooooffff. Hmm... strictly speaking the examples aren't run, they are just compiled, which I think is still feasible even if you don't have the lib installed, is it?
The main worry I have about that then is that this kinda is doing the statement "This will work on Ubuntu 22.04" which would be a lie if 22.04 is lagging behind over 4 minor versions =/
I added a very crude mechanism that I'd copy paste into all other branches that need it and deal with merge conflicts from it as they arise.
Basically I added a check "are you running nimble examples
on github?" and if so I explicitly ignore certain examples as defined in a seq.
The goal is to extend that seq as needed.
I also added that if you're not on github you automatically get -d:adwminor=4 added so that you don't miss potential breakages in widgets that require higher adwaita versions
This is the new nimble task:
task examples, "Build examples":
when defined(github):
let uncompileable: seq[string] = @["widgets/adw/banner.nim"] # Can not compile because they rely on an adwaita version higher than available in test-image of CI pipeline
let adwaitaFlag = ""
else:
let uncompileable: seq[string] = @[] # You should be able to run any example locally assuming you have an up-to-date system.
let adwaitaFlag = "-d:adwminor=4"
withDir "examples":
for file in findExamples("."):
if file in uncompileable:
continue
let compileCommand = fmt"nim c --hints:off --path:.. --verbosity:0 {adwaitaFlag} {file}"
echo "INFO: Compile " & file
echo compileCommand
exec compileCommand
echo "INFO: OK"
echo "================================================================================"
I'd wait with further pull requests of higher adwaita version widget until we've agreed on the mechanism.
Looks good! I think the mechanism is fine, the most important thing is that it works :smile:
CI fails because the example is compiled without adwaita 1.3. I think we currently don't have a proper solution for this. Maybe just exclude the example from
nimble examples
if the adwaita version flag is not set as required?