Skip to content

Conversation

vog
Copy link
Contributor

@vog vog commented Jul 22, 2025

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. labels Jul 22, 2025
@nix-owners nix-owners bot requested review from talyz, leona-ya, ngerstle and NickCao July 22, 2025 19:11
vog added a commit to m-click/nixpkgs that referenced this pull request Jul 22, 2025
@nixpkgs-ci nixpkgs-ci bot added the 9.needs: reviewer This PR currently has no reviewers requested and needs attention. label Jul 22, 2025
@vog vog requested a review from Infinidoge July 22, 2025 19:18
@nixpkgs-ci nixpkgs-ci bot removed the 9.needs: reviewer This PR currently has no reviewers requested and needs attention. label Jul 22, 2025
@vog vog added the backport release-25.05 Backport PR automatically label Jul 22, 2025
vog added a commit to m-click/nixpkgs that referenced this pull request Jul 22, 2025
@NickCao
Copy link
Member

NickCao commented Jul 23, 2025

The new packages LGTM, but I don't know about maven packaging. And do we have to unconditionally link them into postgresql_jdbc and keycloak, or can users add these manually to nixos configurations such as services.keycloak.plugins?

@nixpkgs-ci nixpkgs-ci bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jul 24, 2025
@vog
Copy link
Contributor Author

vog commented Jul 31, 2025

The new packages LGTM, but I don't know about maven packaging. And do we have to unconditionally link them into postgresql_jdbc and keycloak, or can users add these manually to nixos configurations such as services.keycloak.plugins?

The rationale behind linking them to postgresql_jdbc is that this way, every Nix package that uses postgresql_jdbc gains automatically the capability of supporting PostgreSQL connection via Unix sockets. I discussed this in the Matrix channel (with @Infinidoge) where this idea was considered to be a good idea, as in Nix we generally make the default full-featured, if the additional requirements are small enough (and junixsocket is pretty small).

In keycloak, we have the problem that it does not use the postgresql_jdbc Nix package, but instead ships its own postgresql_jdbc version - and that it is not easy (or even feasible) to replace it.

But apart from that detail, the same rationale is applied here: Yes, we could leave junixsocket out, so everyone would have to add it via the plugins themselves. But I can't think of any sane setup (given that keycloak is a security-relevant application!) where you would run keycloak's database on a different machine than keycloak itself, and hence where you would want to connect it to its database via TCP/IP when you could connect it directly via Unix sockets.

But, both integrations into postgresql_jdbc and keycloak are just proposals, and hence separate commits. If those are perceived as "too controversial" rather than "sane defaults", we could of course leave them out.

@vog
Copy link
Contributor Author

vog commented Aug 13, 2025

@Infinidoge @NickCao Do you have any decision on that topic? Should I reduce my PR, or should we keep the out-of-the-box unix socket support for all postgresql-jdbc consumers and keycloak.

@NickCao
Copy link
Member

NickCao commented Aug 13, 2025

@Infinidoge @NickCao Do you have any decision on that topic? Should I reduce my PR, or should we keep the out-of-the-box unix socket support for all postgresql-jdbc consumers and keycloak.

I'd say let's leave the out-of-the-box unix socket support for later.

@vog vog force-pushed the junixsocket-2.10.1 branch from e6caa36 to 4e8b7b9 Compare August 14, 2025 11:35
@nixpkgs-ci nixpkgs-ci bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Aug 14, 2025
@vog
Copy link
Contributor Author

vog commented Aug 14, 2025

I'd say let's leave the out-of-the-box unix socket support for later.

@NickCao Done. Please review again.

vog added a commit to m-click/nixpkgs that referenced this pull request Aug 14, 2025
@msgilligan
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 427538
Commit: 4e8b7b9afbef7b9f9b18366cef2bce6493d988a4


aarch64-darwin

✅ 2 packages built:
  • junixsocket-common
  • junixsocket-native-common

@msgilligan
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 427538
Commit: 4e8b7b9afbef7b9f9b18366cef2bce6493d988a4


aarch64-linux

✅ 2 packages built:
  • junixsocket-common
  • junixsocket-native-common

Copy link
Contributor

@msgilligan msgilligan left a comment

Choose a reason for hiding this comment

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

Looks good!

I ran nixpkgs-review on both aarch64-darwin and aarch64-linux and posted the results above. I also ran:

nix build .#junixsocket-common .#junixsocket-native-common
sha1sum result*/share/java/*

and verified the SHA-1 sums match Maven Central.

I did not build or run anything dependent on the JARs (but as they are new, we know nothing will be broken by them -- nixpkgs-review also verified this.)

@nixpkgs-ci nixpkgs-ci bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Aug 14, 2025
@NickCao NickCao changed the title Add junixsocket 2.10.1 junixsocket{,-native}-common: init at 2.10.1 Aug 14, 2025
@NickCao
Copy link
Member

NickCao commented Aug 14, 2025

One more nitpick: for some reason the meta attributes are not passed to the final derivation:

nix-repl> :p junixsocket-common.meta
{
  available = true;
  broken = false;
  insecure = false;
  maintainers = [ ];
  name = "com_kohlschutter_junixsocket_junixsocket-common-2.10.1";
  outputsToInstall = [ "out" ];
  position = "/home/nickcao/Projects/nixpkgs/pkgs/build-support/fetchmavenartifact/default.nix:82";
  unfree = false;
  unsupported = false;
}

@msgilligan
Copy link
Contributor

for some reason the meta attributes are not passed to the final derivation

Is this because fetchMavenArtifact is top-level and not wrapped in stdenv.mkDerivation?

@NickCao
Copy link
Member

NickCao commented Aug 14, 2025

for some reason the meta attributes are not passed to the final derivation

Is this because fetchMavenArtifact is top-level and not wrapped in stdenv.mkDerivation?

Yeah, but I expected fetchMavenArtifact to do it.

@msgilligan
Copy link
Contributor

I made another pr (PR #433781) based on this PR because I was inspired by the brevity of top-level fetchMavenArtifact, but I rewrote it to use src = fetchMavenArtifact { ... }insidestdenv.mkDerivation`.

@vog: you might want to try the same modification, see: https://github.com/NixOS/nixpkgs/compare/cb87cf22932de66cdb347958037d05f0c5bdafe6..2e37e33388ef62b367448285bb97fd559e9709cd

@vog
Copy link
Contributor Author

vog commented Aug 15, 2025

I made another pr (PR #433781) based on this PR because I was inspired by the brevity of top-level fetchMavenArtifact, but I rewrote it to use src = fetchMavenArtifact { ... }insidestdenv.mkDerivation`.

@vog: you might want to try the same modification, see: https://github.com/NixOS/nixpkgs/compare/cb87cf22932de66cdb347958037d05f0c5bdafe6..2e37e33388ef62b367448285bb97fd559e9709cd

I'm not sure if we should really go that route.

Wouldn't it make more sense to instead fix fetchMavenArtifact to pass the metadata?

@msgilligan
Copy link
Contributor

I made another pr (PR #433781) based on this PR because I was inspired by the brevity of top-level fetchMavenArtifact, but I rewrote it to use src = fetchMavenArtifact { ... }insidestdenv.mkDerivation`.
@vog: you might want to try the same modification, see: https://github.com/NixOS/nixpkgs/compare/cb87cf22932de66cdb347958037d05f0c5bdafe6..2e37e33388ef62b367448285bb97fd559e9709cd

I'm not sure if we should really go that route.

What are your reservations?

Wouldn't it make more sense to instead fix fetchMavenArtifact to pass the metadata?

I don't really know which is the best way. But I don't see any packages in nixpkgs that are doing it that way, nor can I find any documentation that definitively says what is the best thing to do in this case.

If you think you can make it work and get approved by people with more experience and authority than me, go for it. I'm curious what that would look like, so if you think it can be done I'd say it's worth doing just as an experiment.

@vog
Copy link
Contributor Author

vog commented Aug 15, 2025

I made another pr (PR #433781) based on this PR because I was inspired by the brevity of top-level fetchMavenArtifact, but I rewrote it to use src = fetchMavenArtifact { ... }insidestdenv.mkDerivation`.
@vog: you might want to try the same modification, see: https://github.com/NixOS/nixpkgs/compare/cb87cf22932de66cdb347958037d05f0c5bdafe6..2e37e33388ef62b367448285bb97fd559e9709cd

I'm not sure if we should really go that route.

What are your reservations?

This simply doesn't make any sense to me. It is cumbersome and wasteful.

fetchMavenArtifact already creates a derivation that contains exactly the files we want, in the structure we want, with the naming we want. Just the metadata is missing.

But instead of improving that function to just pass down the missing metadata, more code is written, to create another derivation, into which all binary files are copied, so now they are twice in the store, at least until the next "gc" or "optimize" action. And all that extra machinery just because the original derivation is missing an attribute.

To me, that current way requires justification. Why the hell people are doing that? It is cumbersome and wasteful. Do I overlook something?

Wouldn't it make more sense to instead fix fetchMavenArtifact to pass the metadata?

I don't really know which is the best way. But I don't see any packages in nixpkgs that are doing it that way, nor can I find any documentation that definitively says what is the best thing to do in this case.

Yes, that's what I found confusing, too. But the missing metadata explains this at least to some level.

If you think you can make it work and get approved by people with more experience and authority than me, go for it. I'm curious what that would look like, so if you think it can be done I'd say it's worth doing just as an experiment.

Indeed, I'll go ahead and try to fix that in another PR, then let's see if this is acceptable, or if anyone raises valid concerns that I may have overlooked.

@vog
Copy link
Contributor Author

vog commented Aug 15, 2025

Indeed, I'll go ahead and try to fix that in another PR, then let's see if this is acceptable, or if anyone raises valid concerns that I may have overlooked.

@NickCao @msgilligan

Done! See PR #433975.

@vog vog requested a review from msgilligan August 15, 2025 12:56
@msgilligan
Copy link
Contributor

To me, [the] current way requires justification. Why the hell people are doing that? It is cumbersome and wasteful. Do I overlook something?

Yes, that's what I found confusing, too.

I'm just looking to learn the current state-of-the-Nix-art, you're looking to push it forward. Awesome!

(Eventually, of course, I would like to see more of these Maven artifacts being built from source, but having a simple mechanism to bring in binaries is nice, too -- and an important stepping stone.)

I'll take a look at PR #433975.

@vog vog force-pushed the junixsocket-2.10.1 branch from 4e8b7b9 to 1838087 Compare August 20, 2025 15:18
@vog
Copy link
Contributor Author

vog commented Aug 20, 2025

I'm just looking to learn the current state-of-the-Nix-art, you're looking to push it forward. Awesome!

(Eventually, of course, I would like to see more of these Maven artifacts being built from source, but having a simple mechanism to bring in binaries is nice, too -- and an important stepping stone.)

I'll take a look at PR #433975.

Ok, it's done!

PR #433975 has been accepted, a I rebased this one onto the latest master.

@msgilligan @NickCao Is there anything else to be done for this PR?

@msgilligan
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 427538
Commit: 1838087f6899480b2d52a6e9c819a3cdb5d96ea8


aarch64-darwin

✅ 2 packages built:
  • junixsocket-common
  • junixsocket-native-common

@msgilligan
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 427538
Commit: 1838087f6899480b2d52a6e9c819a3cdb5d96ea8


aarch64-linux

✅ 2 packages built:
  • junixsocket-common
  • junixsocket-native-common

Copy link
Contributor

@msgilligan msgilligan left a comment

Choose a reason for hiding this comment

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

A minor request: add a unique description to junixsocket-native-common.

@vog vog force-pushed the junixsocket-2.10.1 branch from 1838087 to 72427e2 Compare August 20, 2025 23:02
@vog vog requested a review from msgilligan August 20, 2025 23:02
@vog
Copy link
Contributor Author

vog commented Aug 20, 2025

A minor request: add a unique description to junixsocket-native-common.

@msgilligan Ok, done! Please review again.

vog added a commit to m-click/nixpkgs that referenced this pull request Aug 20, 2025
@msgilligan
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 427538
Commit: 72427e253359bfcd4474fbcb0b5d725c5d61555c


aarch64-darwin

✅ 2 packages built:
  • junixsocket-common
  • junixsocket-native-common

@msgilligan
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 427538
Commit: 72427e253359bfcd4474fbcb0b5d725c5d61555c


aarch64-linux

✅ 2 packages built:
  • junixsocket-common
  • junixsocket-native-common

Copy link
Contributor

@msgilligan msgilligan left a comment

Choose a reason for hiding this comment

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

Looks good!

vog added a commit to m-click/nixpkgs that referenced this pull request Aug 27, 2025
vog added a commit to m-click/nixpkgs that referenced this pull request Aug 27, 2025
@SuperSandro2000 SuperSandro2000 merged commit 55e09e1 into NixOS:master Aug 31, 2025
26 of 27 checks passed
@nixpkgs-ci
Copy link
Contributor

nixpkgs-ci bot commented Aug 31, 2025

Successfully created backport PR for release-25.05:

@github-actions github-actions bot added the 8.has: port to stable This PR already has a backport to the stable release. label Aug 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: port to stable This PR already has a backport to the stable release. 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. 12.approvals: 1 This PR was reviewed and approved by one person. backport release-25.05 Backport PR automatically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants