Skip to content

ags: 1.8.2 -> 2.2.1 - #373562

Merged
JohnRTitor merged 3 commits into
NixOS:masterfrom
PerchunPak:ags
Feb 4, 2025
Merged

JohnRTitor merged 3 commits into
NixOS:masterfrom
PerchunPak:ags

Conversation

@PerchunPak

@PerchunPak PerchunPak commented Jan 13, 2025 •

Copy link
Copy Markdown
Member

https://github.com/Aylur/ags: Scaffolding CLI for Astal+TypeScript

This is basically a complete rewrite (as upstream was rewritten in Go). It is required for #350324, I also built a completely functioning version of hyprpanel using this, so it totally works!

Also, it is almost 1 to 1 copy of the upstream Nix implementation, but this is much more versatile.

Closes #306446

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

CC @FliegendeWurst @foo-dogsquared @JohnRTitor


Add a 👍 reaction to pull requests you find important.

Comment thread pkgs/by-name/ag/ags/package.nix Outdated

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, because of this single line I wasted an entire day

@github-actions github-actions Bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Jan 13, 2025
@PerchunPak

This comment was marked as outdated.

Comment thread pkgs/by-name/ag/ags/bundle.nix Resolved

@JohnRTitor JohnRTitor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also add a release-notes, prompting users to switch to ags_1 if they want to retain compatibility with previous config.

As this is a backwards incompatible change, we should not backport it.

@PerchunPak
PerchunPak force-pushed the ags branch 2 times, most recently from 421966a to 83bd23a Compare January 14, 2025 07:08
@github-actions github-actions Bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: documentation This PR adds or changes documentation 8.has: changelog This PR adds or changes release notes labels Jan 14, 2025
@JohnRTitor
JohnRTitor dismissed their stale review January 14, 2025 08:15

Don't block

@github-actions github-actions Bot removed 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: documentation This PR adds or changes documentation 8.has: changelog This PR adds or changes release notes labels Jan 14, 2025
@PerchunPak PerchunPak changed the title ags: 1.8.2 -> 2.2.1 ags-cli: init at 2.2.1 Jan 14, 2025
@PerchunPak PerchunPak changed the title ags-cli: init at 2.2.1 ags: 1.8.2 -> 2.2.1 Jan 14, 2025
@github-actions github-actions Bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: documentation This PR adds or changes documentation 8.has: changelog This PR adds or changes release notes labels Jan 14, 2025
@JohnRTitor JohnRTitor self-assigned this Jan 14, 2025
@JohnRTitor

Copy link
Copy Markdown
Member

I'll get to reviewing Friday of next week.

(Will be busy for work for the next week till the weekend)

If anyone wants to review this and merge, they can go ahead.

Comment thread pkgs/by-name/ag/ags/package.nix Resolved
Comment thread pkgs/by-name/ag/ags/package.nix Outdated

@JohnRTitor JohnRTitor Jan 14, 2025 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per https://github.com/NixOS/nixpkgs/pull/373562/files#r1914975896

Something like "Typescript frontend of Widget system powered by Astal"

You can put more details/explain in longDescription

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find your description a bit difficult to follow without any background context. In comparison, the description from upstream seems a bit clearer in this regard.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know, "Scaffolding CLI for Astal", doesn't seem to explain its purpose. On a quick search if someone wants a widget system, ags won't appear.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Astal is the widget system, this is just a CLI for it

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to revise the description for astal and ags a bit more, check now

@PerchunPak
PerchunPak force-pushed the ags branch 2 times, most recently from 9b190b5 to f3a8a14 Compare January 14, 2025 17:45
@github-actions github-actions Bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. labels Jan 14, 2025

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You definitely should explain a bit here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it better now?

Comment thread pkgs/by-name/ag/ags/bundle.nix Resolved
Comment thread pkgs/by-name/ag/ags/package.nix Outdated
Comment on lines 24 to 31

@JohnRTitor JohnRTitor Jan 18, 2025 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I understand this, this just gets XDG_DATA_DIRS at build time and extracts the needed paths from there and puts it in the file?

So this depends on builder's XDG_DATA_DIRS info? Isn't that impure/not reproducible?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kind of. Environment variables are secured by Nix sandbox, but this hard-codes library paths to one that are used in build time. However, I am unsure how to get those directories in runtime, and this seems like a bug that should be handled by upstream.

@JohnRTitor JohnRTitor Jan 18, 2025 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am worried that some dirs/paths from builder/Hydra may not exist in local machine.

@Aylur .

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is very much a hack.
I could not find a way to reference the gir-1.0 paths at runtime so I ended up doing this. It is only polluted at build time with references to glib based libraries and even if something leaks into it from the outside environment it does not have any effect as this is only used to generate types for LSPs. It does not have an effect at runtime.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function that uses this variable is called in ags init and ags types, so it is pretty much a runtime thing

@Aylur

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Aylur, fmt.Println(os.Getenv("XDG_DATA_DIRS")) has /nix/store/g8lbqn7mw42pddh57bz9570sfc7fajkf-ags-2.2.1/share as a first item

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point I am tempted to @jtojnar for intel.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard to say what is the proper solution without knowing why does the program need access to GIR files at runtime. Typically, those are used at build time to generate bindings modules for static languages, and our gobject-introspection setup hook already populates XDG_DATA_DIRS at build time from dependencies:

if [ -d "$1/share/gir-1.0" ]; then
addToSearchPath XDG_DATA_DIRS $1/share
fi

As @PerchunPak says, this is not a problem with reproducibility thanks to the sandbox. The main issue would be that it might pick up GIR files pointing to typelibs for build platform when doing a cross-compilation but this software looks complex enough that cross-compilation will probably be broken in multiple different ways anyway so I would not worry about it. You can try strictDeps = true for peace of mind.

I also do not understand the reason for a custom environment variable rather than just using XDG_DATA_DIRS (following XDG basedir spec) + GI_GIR_PATH.

We might want to switch the setup hook to the latter to make GIR paths easier to pick up.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jtojnar, this is a build tool, so we need GIR files to generate types while user develops their application.

And it fails with strictDeps = true. But because ags.bundle (the thing that developer would use) causes a rebuild of ags, it should not be a problem (unless many edge-cases, of course).

So, there is no better solution than what we already have...

Comment thread pkgs/by-name/ag/ags/package.nix Resolved
@JohnRTitor

Copy link
Copy Markdown
Member

I like the upstream approach, perhaps we can use that? (Aylur/ags#673)

@JohnRTitor
JohnRTitor merged commit 098d23f into NixOS:master Feb 4, 2025
@PerchunPak
PerchunPak deleted the ags branch February 4, 2025 17:03
@nixpkgs-ci

nixpkgs-ci Bot commented Mar 18, 2025

Copy link
Copy Markdown
Contributor

Backport failed for release-24.11, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release-24.11
git worktree add -d .worktree/backport-373562-to-release-24.11 origin/release-24.11
cd .worktree/backport-373562-to-release-24.11
git switch --create backport-373562-to-release-24.11
git cherry-pick -x 5761b6fa1c513ca2249c92d28802053e7c4a129a f06ee37f84ab4967d73efdce9660c86b0224330c 7bd40e30edc20db988659ef4ec407ba3c65379a4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: changelog This PR adds or changes release notes 8.has: documentation This PR adds or changes documentation 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ags (unstable): systemtray service not working (missing packages)

6 participants