Skip to content

Relax dependencies #101

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

Closed
wants to merge 1 commit into from
Closed

Conversation

wolfgangwalther
Copy link
Contributor

Currently, postgres-websockets is marked as broken in nixpkgs, because it doesn't build. I am trying to unbreak it.

With the latest master branch and based on NixOS/nixpkgs#371032, I get the following failure:

       > Error: Setup: Encountered missing or private dependencies:
       > auto-update >=0.1.6 && <0.2,
       > bytestring >=0.11.5 && <0.12,
       > envparse >=0.5.0 && <0.6,
       > hasql >=1.7 && <1.8,
       > lens >=5.2.3 && <5.3,
       > network >=2.8.0.1 && <3.2,
       > postgresql-libpq >=0.10.0 && <0.11,
       > websockets >=0.12.7.0 && <0.13

All of them can be relaxed and the result builds and runs the tests fine.

I effectively tested this with:

  • auto-update 0.2.6 (latest)
  • bytestring 0.12.1.0 (GHC 9.8)
  • envparse 0.6 (latest)
  • hasql 1.8.1.4 (latest is 1.9.1.1)
  • lens 5.3.3 (latest is 5.3.4)
  • network 3.2.7.0 (latest)
  • postgresql-libpq 0.11.0.0 (latest)
  • websockets 0.13.0.0 (latest)

Do you think it would be possible to cut a new release with this and all the changes on the master branch? That would unbreak the package in nixpkgs :)

@diogob
Copy link
Owner

diogob commented Mar 19, 2025

@wolfgangwalther thanks for PR ☺️
I'll check what's up with the CI and cut the release.

@diogob diogob mentioned this pull request Mar 19, 2025
@diogob
Copy link
Owner

diogob commented Mar 19, 2025

merged in #103

@diogob diogob closed this Mar 19, 2025
@diogob
Copy link
Owner

diogob commented Mar 19, 2025

@wolfgangwalther published as 0.11.2.3

@wolfgangwalther wolfgangwalther deleted the bump-deps branch March 19, 2025 19:34
@wolfgangwalther
Copy link
Contributor Author

Thank you!

@wolfgangwalther
Copy link
Contributor Author

So this builds fine, runs the package tests fine, runs the NixOS integration test fine. But when I use it in my project, each websocket connection is immediately lost again and postgres-websockets shows this output:

thread blocked indefinitely in an MVar operation

In a loong debugging session I nailed this down to time-manager-0.1.2. 0.1.1 works fine, but 0.1.2 breaks it for us. Since you're not using that directly, I can only guess that it causes problems for code related to auto-update (?).

Maybe you have more insight, maybe you can reproduce, maybe you have any idea what's going on?

(the related change in that 0.1.1 -> 0.1.2 update was this PR: yesodweb/wai#1013)

@diogob
Copy link
Owner

diogob commented May 14, 2025

@wolfgangwalther thanks for putting in the time to narrow down the issue. I'll try to reproduce later today.

@diogob
Copy link
Owner

diogob commented May 14, 2025

@wolfgangwalther I cannot reproduce using the sample project and the README steps. My build plan, however, is resolving time-manager to 0.2.2 (through warp 3.4.7).

Could you retry your debugging session pinning the warp version to 3.4.7? BTW I have just checked and the 3.4.6 will still allow time-manager-0.1.3 (which could also work but I have not tested).

@wolfgangwalther
Copy link
Contributor Author

wolfgangwalther commented May 14, 2025

I have tested time-manager 0.1.2, 0.1.3 and also 0.2.2 (the latter is the default in nixpkgs right now, so that's where the failure started for me). All of them fail. Only 0.1.1 works.

Edit: And yes, that was with warp 3.4.7.

@diogob
Copy link
Owner

diogob commented May 14, 2025

And can you see the problem using the sample chat app?

@wolfgangwalther
Copy link
Contributor Author

Some more settings from my project. I varied those, they didn't make a difference, but you never know:

      "PGWS_DB_URI=postgres://[email protected]/postgres"
      "PGWS_JWT_SECRET=development_secret_at_least_32_chars"
      "PGWS_LISTEN_CHANNEL=websockets-listener"
      "PGWS_CHECK_LISTENER_INTERVAL=1000"
      "PGWS_HOST=127.0.0.1"
      "PGWS_PORT=3002"

Also we are requesting the URL without channel, and pass that in the channels claim in the JWT.

@wolfgangwalther
Copy link
Contributor Author

And can you see the problem using the sample chat app?

You mean https://github.com/diogob/postgres-websockets/tree/master/client-example, right?

I have never used it, will need to figure out how to use that with the nix-built executable.

@wolfgangwalther
Copy link
Contributor Author

In case it helps: I do get the same connection failure when connecting via websocat. I also see, that when I pass a wrong JWT, then I get a proper error message. But when I pass the correct JWT, then the connection hangs briefly - and after about 1 sec, it fails and the server shows that error message.

Given that it reproduces with websocat, I think it's unrelated to the client.

wolfgangwalther added a commit to wolfgangwalther/nixpkgs that referenced this pull request May 14, 2025
Reason for the failure is still unclear and it was not possible to
reproduce outside nixpkgs, yet.

diogob/postgres-websockets#101 (comment)
@diogob
Copy link
Owner

diogob commented May 14, 2025

on my end I'll try to reproduce using nix to build it. Let's continue this conversation on #105

wolfgangwalther added a commit to wolfgangwalther/nixpkgs that referenced this pull request May 14, 2025
Reason for the failure is still unclear and it was not possible to
reproduce outside nixpkgs, yet.

diogob/postgres-websockets#101 (comment)
wolfgangwalther added a commit to wolfgangwalther/nixpkgs that referenced this pull request May 16, 2025
Reason for the failure is still unclear and it was not possible to
reproduce outside nixpkgs, yet.

diogob/postgres-websockets#101 (comment)
nixpkgs-ci bot pushed a commit to NixOS/nixpkgs that referenced this pull request May 16, 2025
Reason for the failure is still unclear and it was not possible to
reproduce outside nixpkgs, yet.

diogob/postgres-websockets#101 (comment)
(cherry picked from commit 4e216d5)
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.

2 participants