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

[plugins] flakes should be in own dir #1626

Merged
merged 2 commits into from
Nov 15, 2023
Merged

[plugins] flakes should be in own dir #1626

merged 2 commits into from
Nov 15, 2023

Conversation

mikeland73
Copy link
Contributor

Summary

What this fixes:
When plugins create flake in a directory shared with other files, nix search can break. (We use nix search to determine output path). For example in the mysql plugin the flake would live side-by-side with the run directory which has a sock file. nix search would recurse in that directory and try to search for nix expressions and break because the file had an unexpected format.

How it was surfaced:
This issue was previously hidden because we don't call nix search if a package has already been installed. The bug fixed in #1625 was causing us to needlessly call nix search on stuff that was already

Solution:
The partial solution in this PR is to always create the flake in its own dir. This is a bit fragile, e.g. someone can forget if writing their own plugin. Longer term, we need a better way to extract the output path from a custom flake. (I think nix flake show could do it without causing the issues surfaced by search)

How was it tested?

CICD tests all plugins with exampels.

@mikeland73 mikeland73 requested review from savil and Lagoja November 14, 2023 20:07
@Lagoja
Copy link
Contributor

Lagoja commented Nov 14, 2023

This makes sense, should I move the flakes in the Github plugins to a subfolder as well? Nevermind, none of those have flakes

@mikeland73 mikeland73 merged commit 33ea788 into main Nov 15, 2023
19 checks passed
@mikeland73 mikeland73 deleted the landau/fix-plugins branch November 15, 2023 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants