Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

haskellPackages.hasql-migration unbroken #93943

Closed
wants to merge 306 commits into from
Closed

haskellPackages.hasql-migration unbroken #93943

wants to merge 306 commits into from

Conversation

piq9117
Copy link
Contributor

@piq9117 piq9117 commented Jul 27, 2020

Motivation for this change

Built hasql-migration with the command below, no errors found.

nix-build --no-out-link -A haskellPackages.hasql-migration --arg config '{ allowBroken = true; }'
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

r-ryantm and others added 30 commits July 10, 2020 07:03
This permits using method_set_hostname but still denies
method_set_static_hostname. As a result DHCP clients can now always set
the transient hostname via the SetHostname method of the D-Bus interface
of systemd-hostnamed (org.freedesktop.hostname1.set-hostname).
If the NixOS option networking.hostName is set to an empty string (or
"localhost") the static hostname (kernel.hostname but NOT /etc/hostname)
will additionally be updated (this is intended).

From "man hostnamectl": The transient hostname is a fallback value
received from network configuration. If a static hostname is set, and is
valid (something other than localhost), then the transient hostname is
not used.

Fix #74847.

Note: It's possible to restrict access to the org.freedesktop.hostname1
interface using Polkit rules.
Falling back to unversioned `/etc/fonts/conf.d` when versioned one does not exist
is problematic since it only occurs on non-NixOS systems and those are likely
to have a different version of fontconfig. When those versions use incompatible
elements in the config, apps using fontconfig will crash.

Instead, we are now falling back to the in-package `fonts.conf` file that loads
both the versioned global `conf.d` directory and the in-package `conf.d` since using
upstream settings on non-NixOS is preferable to not being able to use apps there.

In fact, we would not even need to link `fonts.conf`, as the in-package `fonts.conf`
will be always used unless someone creates the global one manually (the option is still
retained if one wants to write a custom NixOS module and to avoid unnecessary stat call on NixOS).

Additionally, since the `fonts.conf` will always load `conf.d` from the package, we no longer
need to install them to sytem `/etc` in the module. This needed some mucking with `50-user.conf`
which disables configs in user directories (a good thing IMO, NixOS module will turn it back on)
but otherwise, it is cleaner. The files are still prioritized by their name, regardless of their location.

See #73795 (comment) for more information.
With previous patch, we no longer load non-versioned fonts.conf file to avoid incompatibilities
but this also means fontconfig will not load system-wide installed fonts on non-NixOS systems.

As a compromise, let's hardcode the FHS font paths to the built-in config so that the system
fonts work there. Unlike with the system config we do not need to worry about compatibility as
incompatible font files will be simply ignored.

Of course there will still be disparity if the system install fonts to some other location than
these two but I am afraid this is the best we can do.

See #73795 (comment) for discussion.
ITS rules are used for extracting translatable strings and they have
been moved to external files in 2.13.92 so they are not needed in
the config files themselves.

Removing them also cuts down on errors/warnings produced when using
older versions of fontconfig (< 2.12.92). Now it will only complain
about the description element but that is fortunately just a warning,
not errors like the ones caused by the its attributes.

Thanks to this, we can change the config version in NixOS module
back to 2.11 allowing us to re-use the 2.13/2.14 configs for apps
built against 2.12 fontconfig.
systemd: Allow setting the transient hostname via DHCP
 - use installTargets again ("install", and
   "install_systemd_{generators,units,configuration}" when udev is not
   null)
 - The call to the blkid binary in lvm2's 13-dm-disk.rules file
   disappeared (so we don't need to patch in blkid anymore).
   lvm seems to rely on udev's internal blkid functionality.
 - Call /run/current-system/systemd/bin/udevadm instead
   of ${systemd}/bin/udevadm in the lvm activation generator.
   This is not necessary to break the dependency cycle (as we don't use
   that file when building without udev), but a good idea anyways -
   We want to trigger the udevadm of the current system, not the one
   that lvm was built with.
Otherwise, we end up in a dependency cycle:

systemd -> cryptsetup -> lvm -> fetchgit -> git -> openssh -> libfido2 -> hidapi -> libusb -> udev=systemd
This seems to be mostly used to simplify LV management tasks from a web
interface
(https://www.redhat.com/archives/linux-lvm/2008-September/msg00029.html),
and is as fat as the `lvm` binary itself
Introduce a pkgs.lvm2_dmeventd that contains dmeventd support, and
enable if services.lvm.dmeventd.enable is true.
This is already handled by the lvm module, which now properly adds the
lvm systemd generators.

Initially introduced in c0fd887.
Also, add some sleep statements in between, which seems to at least feel
like it causes

> WARNING: Device /dev/vda* not initialized in udev database even after waiting 10000000 microseconds.

To occur less frequently.

This eventually still succeeds after some amount of waiting, I suspect
some racyness in the way lvm's udev-triggered scripts trigger other
units.
Make this more consistent with how these flags look like in the rest of
nixpkgs.
@piq9117
Copy link
Contributor Author

piq9117 commented Jul 27, 2020

Thanks for the prompt response. Sure thing! I'll do that right now

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

Successfully merging this pull request may close these issues.

None yet