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/lsp/pylsp: propagatedBuildInputs -> dependencies #1893

Closed
wants to merge 1 commit into from
Closed

plugins/lsp/pylsp: propagatedBuildInputs -> dependencies #1893

wants to merge 1 commit into from

Conversation

PerchunPak
Copy link
Contributor

@PerchunPak PerchunPak commented Jul 19, 2024

See NixOS/nixpkgs#327630 (comment)

The only (patched) pylsp plugin that doesn't use dependencies yet is pylsp-rope, though it will change soon with NixOS/nixpkgs#328410 (pr-tracker).

MattSturgeon
MattSturgeon previously approved these changes Jul 19, 2024
Copy link
Member

@MattSturgeon MattSturgeon left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Does this fix anything or is it just updating to the new code style?

@GaetanLepage if you have time, can you also review?

@MattSturgeon MattSturgeon dismissed their stale review July 19, 2024 12:30

Missed issues

@MattSturgeon
Copy link
Member

MattSturgeon commented Jul 19, 2024

The build fails with:

error: attribute 'dependencies' missing

I guess we're using an old nixpkgs lock that doesn't have the new style on this package?

Maybe we should check if the dependencies and/or propagatedBuildInputs attrs are present?

@traxys
Copy link
Member

traxys commented Jul 19, 2024

I think @GaetanLepage said he'd deal with this himself using the update action

@MattSturgeon
Copy link
Member

This feels like another thing that'll break anyone who's nixpkgs lock is out of sync with outs...

@PerchunPak
Copy link
Contributor Author

Yeah, I actually created this PR because of the error described in #1894. In nixpkgs' master every plugin uses dependencies already, so feel free to merge this when NixOS/nixpkgs#328410 gets to unstable (this will fix the current evaluation error)

@MattSturgeon
Copy link
Member

I'm wondering if we should have a more graceful approach than handles either the old/new attr depending on which is actually present, at least for a short transition period?

@PerchunPak
Copy link
Contributor Author

Oh, yeah. I also just noticed that this rename probably won't be backported to 24.05

@MattSturgeon
Copy link
Member

Oh, yeah. I also just noticed that this rename probably won't be backported to 24.05

That's not an issue, since our main branch isn't intended to work on the stable channel.

Copy link
Member

@MattSturgeon MattSturgeon left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks!

I'll let @GaetanLepage have the final say since he's dealing with the lockfile update and the relevant upstream changes.

Comment on lines +547 to +554
# NOTE: Depending on the exact nixpkgs rev, we may have `dependencies` or `propagatedBuildInputs`
# See https://github.com/NixOS/nixpkgs/pull/327630#discussion_r1679253679
# TODO: Only filter `dependencies`
(lib.filter (n: old ? ${n}) [
"propagatedBuildInputs"
"dependencies"
])
(n: filterDependencies old.${n})
Copy link
Member

Choose a reason for hiding this comment

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

Since this is done gracefully I don't see why we can't merge now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you are talking about merging the PR, tests were failing. I just merged main to here and tests are green again

Copy link
Member

Choose a reason for hiding this comment

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

Our CI is currently disabled, so the only "test" running on GitHub is mergify (which doesn't actually test any code).

Or are you referring to tests run locally?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I referred to this test failure in 6066ff2, and local tests fail for me even on main with some huge and totally unrelated error.

Copy link
Member

@MattSturgeon MattSturgeon Jul 22, 2024

Choose a reason for hiding this comment

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

I referred to this test failure in 6066ff2,

The linked failure is #1878 (one of the reasons CI is currently disabled).

local tests fail for me even on main with some huge and totally unrelated error.

Strange. I've just run the test suite locally on other PRs and everything passes just fine...

Are you using the tests devshell command or just nix flake check? Are you trying to use --all-systems?

Copy link
Member

@MattSturgeon MattSturgeon Jul 22, 2024

Choose a reason for hiding this comment

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

Just ran tests on this branch, and everything passes for me (x86_64-linux).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used nix flake check --all-systems -v and got these logs:

logs.txt.gz
(too big for pastebin, so sending as a file)

Anyway, this doesn't really matter. If all tests are passing, why not merge this PR?

Copy link
Member

Choose a reason for hiding this comment

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

why not merge this PR?

As mentioned above, I'm delegating to @GaetanLepage here since he's dealing with these changes in nixpkgs.

@GaetanLepage
Copy link
Member

Thank you very much @PerchunPak for spinning up this fix so quickly.
I should have merged it earlier to fix it instead of waiting for the upstream fix to land on nixos-unstable.
Now that pylsp-rope also makes use of dependencies, I have directly used it in 9f9e202 and the problem should now be gone.

Please, feel free to report any eventual weird behavior.

@PerchunPak PerchunPak deleted the fix-python-lsp-plugins branch July 24, 2024 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants