Skip to content

nixos/parsedmarc: Fix build and runtime - #280940

Merged
SuperSandro2000 merged 6 commits into
NixOS:masterfrom
e1mo:fix-parsedmarc-smtp-to
May 2, 2024
Merged

SuperSandro2000 merged 6 commits into
NixOS:masterfrom
e1mo:fix-parsedmarc-smtp-to

Conversation

@e1mo

@e1mo e1mo commented Jan 14, 2024 •

Copy link
Copy Markdown
Member

Description of changes

Currently the parsedmarc Module is not working. This is due to:

  1. smtp.to having defaults causing evaluation errors.
  2. The default settings.elasticsearch.hosts (if elasticsearch is to be provisioned) not being a valid URL, causing errors.
  3. python311Packages.parsedmarc not building successfully due to missing dependencies / incompatible versions of some dependencies.

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/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 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.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions Bot added 6.topic: python Python is a high-level, general-purpose programming language. 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Jan 14, 2024
@e1mo
e1mo requested review from desiderius, mweinelt and talyz January 14, 2024 14:26

@mweinelt mweinelt 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 update the attribute for the python-module changes to be prefixed with python311Packages, since pythonPackages is a reference for python2.pkgs.

@e1mo
e1mo force-pushed the fix-parsedmarc-smtp-to branch from ad6b6fe to c395896 Compare January 14, 2024 15:07
@e1mo
e1mo requested a review from mweinelt January 14, 2024 15:07
@ofborg ofborg Bot added 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 501-1000 This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 1001-2500 This PR causes many rebuilds on Linux and should target the staging branches. labels Jan 14, 2024
@mweinelt

mweinelt commented Jan 14, 2024 •

Copy link
Copy Markdown
Member

~1400 rebuilds on each -linux, ~600 on each -darwin. Likely a result from touching the elasticsearch module.

But going through a staging cycle to get the propagation fixed on master seems unreasonable.

@delroth delroth added the 12.approvals: 1 This PR was reviewed and approved by one person. label Jan 14, 2024
@mweinelt

Copy link
Copy Markdown
Member

Are the package changes also required for release-23.11? If not, could we only backport the module fixes, since they cause no rebuild?

@e1mo

e1mo commented Jan 14, 2024

Copy link
Copy Markdown
Member Author

The backporting of the package fix is needed indeed :/

Parsedmarc tests on release-23.11 do also fail with ModuleNotFoundError: No module named 'elastic_transport'.

@e1mo
e1mo requested a review from mweinelt January 14, 2024 23:31
@delroth delroth removed the 12.approvals: 1 This PR was reviewed and approved by one person. label Jan 14, 2024
@Janik-Haag

Janik-Haag commented Jan 14, 2024 •

Copy link
Copy Markdown
Member

more or less a duplicate of #279068
(not the runtime fixes but the module one and at least related)

@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Mar 20, 2024
@e1mo
e1mo force-pushed the fix-parsedmarc-smtp-to branch 2 times, most recently from 5fa0d86 to 594dd55 Compare March 28, 2024 18:44
@e1mo

e1mo commented Mar 28, 2024

Copy link
Copy Markdown
Member Author

I did bring this PR up to the current state of the module & package.
The latest update introduced opensearch-py new dependency which was not accounted for (but now is). The msgraph-core version is now pinned to 0.2.2, thus parsedmarc is building again.

Since I would kinda like to have a working parsedmarc package and module again, I've kept the smtp.to patches that are a duplicate of #279068, as mentioned by @Janik-Haag.
Because those fixes on their own would not fix the broken build (and thus not fix broken deployments), I would prefer to go with this PR fixing all of breaking issues at once.

And maybe #285840 could get some fresh momentum to help get parsedmarc out of the persistent state of breakage?

@e1mo e1mo removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Mar 28, 2024
@ofborg ofborg Bot removed 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 501-1000 This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 1001-2500 This PR causes many rebuilds on Linux and should target the staging branches. labels Mar 28, 2024
@mweinelt

Copy link
Copy Markdown
Member

Unfortunately overrides of libraries aren't possible within the python package set. That would only be possible if parsedmarc was built with buildPythonApplication outside python3Packages.

The reason is that libraries propagate their dependencies, and they ultimately all end up in a single PYTHONPATH that only supports exactly one version of a python module. With overrides in libraries it would be too easy to end up with multiple different propagated module versions, which would make the package set unmaintainable.

@e1mo

e1mo commented Mar 28, 2024

Copy link
Copy Markdown
Member Author

Thanks for the explanation! I got kinda fooled by all tests passing (since we're not testing anything msgraph this makes sense tho) :/

Do you have any concerns regarding the changes introduced in #283337 (especially edf2411)? If not, I'd use them here too.

@mweinelt

Copy link
Copy Markdown
Member

Yeah, that looks plausible.

@e1mo
e1mo force-pushed the fix-parsedmarc-smtp-to branch from 594dd55 to 51b0665 Compare March 28, 2024 19:42
@e1mo
e1mo requested review from dotlambda and fabaff April 19, 2024 10:57
e1mo and others added 6 commits April 27, 2024 04:55
Previously evaluaton would fail if `smtp.to` was not set, since the
default case was not handled.

With the current versions of the python elasticsearch libraries, any
configuration containing the modules default would fail since it's not a
valid URL.

The issue adressed in NixOS#279068 is also adressed, thuse closes NixOS#279068.
@wegank
wegank force-pushed the fix-parsedmarc-smtp-to branch from 51b0665 to 896919d Compare April 27, 2024 02:56

@SuperSandro2000 SuperSandro2000 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.

LGTM

@SuperSandro2000

Copy link
Copy Markdown
Member

I've skimmed over the comments and I think everything got resolved, or did I miss something?

@e1mo

e1mo commented Apr 30, 2024

Copy link
Copy Markdown
Member Author

I can't come up with anything that is still left open.
I also re-ran both parsedmarc test locally with the recent rebase and am happy to report that they're still passing :D

@SuperSandro2000
SuperSandro2000 merged commit 4a2f53b into NixOS:master May 2, 2024
@github-actions

github-actions Bot commented May 2, 2024

Copy link
Copy Markdown
Contributor

Backport failed for release-23.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-23.11
git worktree add -d .worktree/backport-280940-to-release-23.11 origin/release-23.11
cd .worktree/backport-280940-to-release-23.11
git switch --create backport-280940-to-release-23.11
git cherry-pick -x 928146bc296cbda5615de5fb1d581299d10d1aa0 21ed8adb5e6eb46008a331884d856dd077aa7997 471a8ed428b1734b2ca95358285e8803438d2d76 1f670eeed324218d7a9e6431aa9bfc244f27ff13 e82299570ee4385cb711267b3daa164116081646 896919ded57b9c8fbccc88f2e69cf44a8fe3e356

AndrewKvalheim added a commit to AndrewKvalheim/nixpkgs that referenced this pull request Mar 8, 2026
python3Packages.parsedmarc was broken by updating msgraph-core from
major version 0 to 1 in NixOS#294305. A workaround was subsequently applied
to the parsedmarc application in NixOS#280940 but the module remained broken.
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 6.topic: python Python is a high-level, general-purpose programming language. 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages 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.

7 participants