Package Details: swayhide 0.2.1-1

Git Clone URL: https://aur.archlinux.org/swayhide.git (read-only, click to copy)
Package Base: swayhide
Description: Window swallower for sway
Upstream URL: https://github.com/NomisIV/swayhide
Keywords: swayipc swaywm
Licenses: GPL3
Submitter: whynothugo
Maintainer: eclairevoyant
Last Packager: eclairevoyant
Votes: 1
Popularity: 0.004106
First Submitted: 2021-09-15 10:49 (UTC)
Last Updated: 2023-04-24 04:16 (UTC)

Latest Comments

eclairevoyant commented on 2023-04-24 18:43 (UTC)

@whynothugo Again, that's an assumption that's incorrect, see this comment from a makepkg developer, Eli Schwartz, who's also a TU:

You may consider this to be my advice that the recommended way to write a PKGBUILD is to declare your variables in every function that needs them, or alternatively in the global scope.

See more details there, but essentially you cannot make the assumption that prepare() is run before build() or check().

And a different thread here, but this is on an AUR helper developed by a TU, @Morganamilo - https://github.com/Morganamilo/paru/issues/948:

Assuming the env will be preserved is a mistake a lot of people often make and it should be fixed in the pkgbuild.

If I ever get around to it I'll be forcing makepkg to reset the env between functions.

So, again, if this is going to be changed/enforced in makepkg in the future then yours is a wrong assumption to make.

This whole point is moot for packages in the repositories because they don't usually declare RUSTUP_TOOLCHAIN nor do they necessarily need to. They're building in a clean chroot so it's a non-issue; the whole point of exporting the toolchain version in AUR PKGBUILDs is to prevent issues with AUR users who don't bother to build in a clean chroot and come in the comments complaining the package is broken.

Also I would not trust the community repositories as some sort of indication of packaging quality, since there's stuff like this that doesn't even declare RUSTUP_TOOLCHAIN in the prepare() function but does so elsewhere.

whynothugo commented on 2023-04-24 18:17 (UTC) (edited on 2023-04-24 18:17 (UTC) by whynothugo)

it seems a bad idea to assume that makepkg will automatically pass env vars through functions

Passing variables into these functions is a fundamental part of pacman's design. You'll notice that an enormous amount of package from the official repos wouldn't work if this weren't the case.

eclairevoyant commented on 2023-04-24 04:18 (UTC)

@whynothugo after some other discussions it seems a bad idea to assume that makepkg will automatically pass env vars through functions. instead it should be explicitly specified at the start of each function if needed or globally in the PKGBUILD. I've therefore update this package accordingly.

I suggest if any of your PKGBUILDs make this assumption that you update those as well

eclairevoyant commented on 2023-02-16 14:10 (UTC)

@whynothugo Good point, thanks. Updated

whynothugo commented on 2023-02-16 13:49 (UTC)

export RUSTUP_TOOLCHAIN=stable is in PKGBUILD but it's in the wrong place. It should be before prepare() (so that it applies to both the prepare and build function).

rstacruz commented on 2021-11-30 05:08 (UTC)

==> Entering fakeroot environment...
==> Starting package()...
error: `--no-track` flag is unstable, pass `-Z install-upgrade` to enable it
==> ERROR: A failure occurred in package().
    Aborting...

If you encounter an error like this, install rustup, and ensure you have a recent version of rust installed:

rustup upgrade

Tested to be working on these versions:

› rustup --version
rustup 1.24.3 (2021-11-09)

› rustc --version
rustc 1.56.1 (59eed8a2a 2021-11-01)