-
Pl
chevron_right
Christian Hergert: Week 31 Status
news.movim.eu / PlanetGnome • 4 August • 7 minutes
Foundry
-
Added a new gutter renderer for diagnostics using the
FoundryOnTypeDiagnosticsdescribed last week. -
Write another new gutter renderer for “line changes”.
I’m really happy with how I can use fibers w/
GWeakRefto do worker loops but not keep the “owner object” alive. As long as you have a nice way to break out of the fiber loop when the object disposes (e.g. trigger aDexCancellable/DexPromise/etc) then writing this sort of widget is cleaner/simpler than before w/GAsyncReadyCallback. -
Added a
:show-overviewproperty to the line changes renderer which conveniently allows it to work as both a per-line change status and be placed in the right-side gutter as an overview of the whole document to see your place in it. Builder just recently got this feature implemented by Nokse and this is basically just a simplified version of that thanks to fibers. -
Abstract TTY auth input into a new
FoundryInputabstraction. This is currently used by the git subsystem to acquire credentials for SSH, krb, user, user/pass, etc depending on what the peer supports. However, it became pretty obvious to me that we can use it for more than just Git. It maps pretty well to at least two more features coming down the pipeline.Since the input mechanisms are used on a thread for TTY input (to avoid blocking main loops, fiber schedulers, etc), they needed to be thread-safe. Most things are immutable and a few well controlled places are mutable.
The concept of a validator is implemented externally as a
FoundryInputValidatorwhich allows for re-use and separating the mechanism from policy. Quite like how it turned out honestly.There are abstractions for text, switches, choices, files. You might notice they will map fairly well to
AdwPreferenceRowthings and that is by design, since in the apps I manage, that would be their intended display mechanism. -
Templates have finally landed in Foundry with the introduction of a
FoundryTemplateManager,FoundryTemplateProvider, andFoundryTemplate. They use the new generalizedFoundryInputabstractions that were discussed above.That allows for a
foundry template listcommand to list templates andfoundry template createto expand a certain template.The
FoundryInputof the templates are queried via the PTY just like username/password auth works viaFoundryInput. Questions are asked, input received, template expansion may continue.This will also allow for dynamic creation of the “Create Template” widgetry in Builder later on without sacrificing on design.
-
Meson templates from Builder have also been ported over which means that you can actually use those
foundry templatecommands above to replace your use of Builder if that is all you used it for.All the normal ones are there (GTK, Adwaita, library, cli, etc).
-
A new license abstraction was created so that libraries and tooling can get access to licenses/snippets in a simple form w/o duplication. That generally gets used for template expansion and file headers.
-
The
FoundryBuildPipelinegained a new vfunc forprepare_to_run(). We always had this in Builder but it never came over to Foundry until now.This is the core mechanism behind being able to run a command as if it were the target application (e.g. unit tests).
-
After doing the template work, I realized that we should probably just auto initialize the project so you don’t have to run
foundry initafterwards. Extracted the mechanism for setting up the initial.foundrydirectory state and made templates use that. -
One of the build pipeline mechanisms still missing from Builder is the ability to sit in the middle of a PTY and extract build diagnostics. This is how errors from GCC are extracted during the build (as well as for other languages).
So I brought over our “PTY intercept” which takes your consumer FD and creates a producer FD which is bridged to another consumer FD.
Then the JIT’d error extract regexes may be run over the middle and then create diagnostics as necessary.
To make this simple to consume in applications, a new
FoundryPtyDiagnosticsobject is created. You set the PTY to use for that and attach it’s intercept PTY to the build/run managers default PTY and then all theGActionwill wire up correctly. That object is also aGListModelmaking it easy to display in application UI. -
A
FoundryServiceis managed by theFoundryContext. They are just subsystems that combine to useful things in Foundry. One way they can be interacted with isGActionas the base class implementsGActionGroup.I did some cleanup to make this work well and now you can just attach the
FoundryContextsGActionGroupusingfoundry_context_dup_action_group()to aGtkWindowusinggtk_widget_insert_action_group(). At that point your buttons are basically just"context.build-manager.build"for theaction-nameproperty.All sorts of services export actions now for operations like build, run, clean, invalidate, purge, update dependencies, etc.
There is a test GTK app in
testsuite/tools/you can play with this all to get ideas and/or integrate into your own app. It also integrates the live diagnostics/PTY code to exemplify that. -
Fixed the
FoundryNoRuntool to connect to the proper PTY in the deployment/run phase. -
The purge operation now writes information about what files are being deleted to the default build PTY.
-
The new
FoundryTextSettingsabstraction has landed which is roughly similar toIdeFileSettingsin Builder. This time it is much cleaned up now that we haveDexFutureto work with.I’ve ported the
editorconfigsupport over to use this as well as a new implementation ofmodelinesupport which again, is a lot simpler now that we can use fibers/threadpools effectively.Plugins can set their text-settings priority in their
.pluginfile. That way settings can have a specific order such as user-overrides, modelines, editorconfig, gsettings overrides, language defaults, and what-not. -
The
FoundryVcsgained a newfoundry_vcs_query_file_status()API which allows querying for the, shocking, file status. That will give you bitflags to know in both the stage or working tree if a file is new/modified/deleted.To make this even more useful, you can use the
FoundryDirectoryListingclass (which is aGListModelofFoundryDirectoryItem) to includevcs::statusfile-attribute and yourGFileInfowill be populated with theuint32bitflags for a key under the same name.It’s also provided as a property on the
FoundryDirectoryItemto make writing those git “status icons” dead simple in file panels.
Boxes
-
Found an issue w/ trailing
\x00in paths when new Boxes is opening an ISO from disk on a system with older xdg portals. Sent a pointer on the issue tracker to what Text Editor had to do as well here.
Libpeas
-
GJS gained support for pkgconfig variables and we use that now to determine which mozjs version to link against. That is required to be able to use the proper JS API we need to setup the context.
Ptyxis
-
Merged some improves to the custom link support in Ptyxis. This is used to allow you to highlight custom URL regexes. So you can turn things like “RHEL-1234” into a link to the RHEL issue tracker.
-
Track down an issue filed about titles not updating tab/window titles. It was just an issue with
$PROMPT_COMMANDoverwriting what they had just changed.
Text Editor
-
A lot of the maintainership of this program is just directing people to the right place. Be that GtkSourceView, GTK, shared-mime-info, etc. Do more of that.
As an aside, I really wish people spent more time understanding how things work rather than fire-and-forget. The FOSS community used to take pride in ensuring the issue reports landed in the right place to avoid over burdening maintainers, and I’m sad that is been lost in the past decade or so. Probably just a sign of success.
Builder
-
Did a quick and dirty fix for a hang that could slow down startup due to the Manuals code going to the worker process to get the default architecture. Builder doesn’t link against Flatpak in the UI process hence why that did it. But it’s also super easy to put a couple line hard-coded
#ifdefand avoid the whole RPC.
Libdex
-
Released 0.11.1 for GNOME 49.beta. I’m strongly considering making the actual 49 release our 1.0. Things have really solidified over the past year with libdex and I’m happy enough to put my stamp of approval on that.
Libspelling
-
Fix an issue with discovery of the
no-spellcheck-tagwhich is used to avoid spellchecking things that are general syntax in language specifications. Helps a bunch when loading a large document and that can get out of sync/changed before the worker discovers it. -
Fixed a LSAN discovered leak in the testsuite. Still one more to go. Fought LSAN and CI a bit because I can’t seem to reproduce what the CI systems get.
Other
-
Told Chat-GPT to spit me out a throw away script that parses my status reports and converts them into something generally usable by WordPress. Obviously there is a lot of dislike/scrutiny/distrust of LLMs and their creators/operators, but I really don’t see the metaphorical cat going back in the bag when you enable people in a few seconds to scratch an itch. I certainly hope we continue to scrutinize and control scope though.