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

msmtp: resholve queue scripts #185343

Merged
merged 2 commits into from
Aug 9, 2022
Merged

Conversation

peterhoeg
Copy link
Member

Description of changes

Previously, we were doing 3 things to the queueing scripts (msmtpq and
msmtp-queue):

  1. replacing binary invocations with @binary@ so we could use
    substituteInPlace and friends to set the proper full paths
  2. make queueing directory and log file overridable via environment variables
  3. add support to the logging function to log to systemd's journal

The handling of the queue scripts (item 1) was very brittle and didn't catch all
impurities (which for one), so instead use resholve to ensure all paths to
binaries are resolved to their proper paths. That also means less patching.

Item 2 - the connectivity test is now configurable via an environment variable
rather than being forced at build-time.

Items 3 isn't changed.

Additionally, the package has been split into 2 - 1 for binaries and one for
scripts to make it easier to change the scripts without having to rebuild
msmtp fully every time.

Fixes: #185164

Cc: @Jayman2000

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • 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/)
  • 22.11 Release Notes (or backporting 22.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
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

##
#EMAIL_CONN_NOTEST=y # deprecated ; use below var
#EMAIL_CONN_TEST={x| |p|P|n|s} # see settings above for EMAIL_CONN_TEST
-EMAIL_CONN_TEST=n
+EMAIL_CONN_TEST=@test@
+EMAIL_CONN_TEST=${MSMTP_CONN_TEST:-n}
Copy link
Contributor

Choose a reason for hiding this comment

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

I would just not set EMAIL_CONN_TEST at all. According to the connect_test() function, not setting EMAIL_CONN_TEST is supposed to be the same as setting EMAIL_CONN_TEST to p. The line that set it to n just recently got removed from the upstream repo.

Copy link
Member Author

Choose a reason for hiding this comment

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

With the recent upstream changes, that makes sense - also means patching less which is definitely a plus!

owner = "marlam";
repo = "msmtp-mirror";
rev = "msmtp-${version}";
hash = "sha256-RcQZ7Vm8UjJJoogkmUmZ+/2fz7C4AcVYY/kTOlfz7+I=";
Copy link
Contributor

Choose a reason for hiding this comment

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

Personally, I would prefer it if we stuck to using the tarballs. I haven’t checked, but I would guess that downloading the tarball is going to use less bandwidth than even a shallow clone. More importantly, it would be more decentralized which I think is important. That being said, GitHub is probably more reliable, so this isn’t that big of a deal.

Copy link
Member Author

Choose a reason for hiding this comment

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

fetchFromGitHub and friends are pretty efficient as they do fetch tarballs (or zips - don't recall) and with the upcoming changes to nix itself, it will support not having to actually unpack the archive but instead continue to work directly from the downloaded archive.

GH is less likely to be unavailable compared to $SOME_RANDOM_GUYS_OWN_SITE - that's really all.

@peterhoeg
Copy link
Member Author

@GrahamcOfBorg build msmtp

@peterhoeg
Copy link
Member Author

@Jayman2000 are your concerns addressed?

@Jayman2000
Copy link
Contributor

@Jayman2000 are your concerns addressed?

Yes.

@peterhoeg peterhoeg merged commit 70220e7 into NixOS:master Aug 9, 2022
@peterhoeg peterhoeg deleted the resholve_msmtp branch August 9, 2022 00:38
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.

msmtp/paths.patch doesn’t fully apply
2 participants