Skip to content

Conversation

@TheArcaneBrony
Copy link

@TheArcaneBrony TheArcaneBrony commented Nov 14, 2025

Summarised changes:

  • Update nix flake inputs
  • Updated devenv from 0.6.3 to 1.10
  • Bumped rust from 1.83 to 1.88 (needed to compile synapse)
  • Moved postgres to pg 17 (current nixpkgs stable default) at a non-default port (prevents conflicting when the dev machine already has postgres running)
  • Added a shorthand script in scripts-dev to run the tests with multithreading
  • Source the venv to stop poetry from wiping itself
  • Make cargo use git CLI for git modules (don't remember why this was needed)
  • Make sure pg_config is available if we need to build psychopg2 from source for some reason
  • Disabled diffs for flake.lock showing up by default via gitattributes (generated file)

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request includes a changelog file. The entry should:
    • Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from EventStore to EventWorkerStore.".
    • Use markdown where necessary, mostly for code blocks.
    • End with either a period (.) or an exclamation mark (!).
    • Start with a capital letter.
    • Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
  • Code style is correct (run the linters)

@TheArcaneBrony TheArcaneBrony requested a review from a team as a code owner November 14, 2025 13:46
@CLAassistant
Copy link

CLAassistant commented Nov 14, 2025

CLA assistant check
All committers have signed the CLA.

Signed-off-by: Rory& <[email protected]>
@TheArcaneBrony
Copy link
Author

Identified a missing piece: i'm unable to run the linter, not sure what all i'm missing or how to get that working, since the cargo thingy seems to throw a fit when i run lint.sh if i nix shell it

Copy link
Member

@anoadragon453 anoadragon453 left a comment

Choose a reason for hiding this comment

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

Thanks for taking the time to do this! A few notes below.

# NOTE: We currently need to set the Rust version unnecessarily high
# in order to work around https://github.com/matrix-org/synapse/issues/15939
(rust-bin.stable."1.82.0".default.override {
(rust-bin.stable."1.88.0".default.override {
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

Question: is there any risk in putting the version too high, or should it be kept at the minimum to ensure compatibility?

Copy link
Member

Choose a reason for hiding this comment

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

No risk. Typically the higher the better with Rust in the dev environment.

Copy link
Author

Choose a reason for hiding this comment

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

Might aswell bump it to 1.91.1 then, I suppose

Comment on lines +145 to +146
# Workaround to make cargo fetch git repositories with the git CLI
env.CARGO_NET_GIT_FETCH_WITH_CLI = "true";
Copy link
Member

Choose a reason for hiding this comment

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

It'd be ideal to justify why this is needed, in case it has unintended side-effects.

Comment on lines +186 to +187
# Ensure the venv is activated explicitly, in order not to confuse poetry
. .venv/bin/activate
Copy link
Member

Choose a reason for hiding this comment

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

What do you mean by "confuse poetry"? What happens if this isn't here?

Copy link
Author

Choose a reason for hiding this comment

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

I'd been doing this manually for ages - if I skip that step, for some reason, any poetry command causes the .venv to get cleared, causing synapse to fail to start due to missing dependencies.
I could probably clarify that in the comment

Copy link
Member

Choose a reason for hiding this comment

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

That would be useful to do so, yeah.

debian-devscripts # (`dch` for manipulating the Debian changelog)
libnotify # (the release script uses `notify-send` to tell you when CI jobs are done)

# For building psychopg2 from source, if needed
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# For building psychopg2 from source, if needed
# For building psycopg2 from source, if needed

lol

@@ -0,0 +1 @@
flake.lock -diff
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
flake.lock -diff
# flake.lock is only meant to be read by machines.
flake.lock -diff

@@ -0,0 +1,2 @@
#! /usr/bin/env sh
poetry run trial -j`nproc` tests
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if such a short command really justifies a script?

Copy link
Author

Choose a reason for hiding this comment

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

I keep forgetting and having to hunt it down in the documentation, so it's just there as an aid.
Can be dropped if you want :)

Copy link
Member

Choose a reason for hiding this comment

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

yeahhh, this just doesn't quite sit right with me.

If you like, you could add a single-line script to the nix flake instead? https://devenv.sh/scripts/

@anoadragon453 anoadragon453 changed the title Update devenv Modernise and fix the nix flake Nov 19, 2025
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.

3 participants