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

lmdb: build static and dynamic libs separately #79810

Closed
wants to merge 1 commit into from

Conversation

vcunat
Copy link
Member

@vcunat vcunat commented Feb 11, 2020

and halve closure as a result (the dynamic case is interesting there).

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • N/A Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev 5314c69"
    8 build failures (22 transitively), all clearly unrelated.
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • N/A Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

and halve closure as a result (the dynamic case is interesting there).
@thoughtpolice
Copy link
Member

Is the only reason to do this to shave off 100kb?

@thoughtpolice
Copy link
Member

thoughtpolice commented Feb 11, 2020

To be clear, "half closure size" is nice, but means something very different at 200kb and 200mb. Adding flags makes the feature discoverability of most expressions much more poor in my experience because now I have to go ruffle through the source code, and have to start adding overrides to everything to make the changes apply. That's not the end of the world but it is what it is.

Frankly, I don't think this is actually important at all -- and is mostly an annoying obstacle in the way of using lmdb statically in my cases. Anyone who simply passes -llmdb should (IIRC) get the dynamically linked version. Other users can link statically by referencing liblmdb.a directly (e.g. LMDB_LIB_DIR=${lmdb.lib} in your expression and go from there).

@thoughtpolice
Copy link
Member

(I'm not willing to give a strong -1 on this because it isn't that important, and I could live with this being merged. But it is quite annoying, IMO.)

@vcunat
Copy link
Member Author

vcunat commented Feb 11, 2020

:-) it's right that 100KB is very little. I got a bit carried away by the general concept, thinking about its applicability to a wider range of libraries... so this is more of a guinea pig to me.

The complications might depend on your build system... when nix passes only one library version, there's only one way to link and that's what usage through pkg-config will do, I think. When you have both, you have to choose somehow inside the build system.

@vcunat
Copy link
Member Author

vcunat commented Feb 11, 2020

I wonder if the divison could make more sense in future when pkgsStatic might be adding -flto, though perhaps that would be sufficiently useful even for building dynamic libs.

@vcunat
Copy link
Member Author

vcunat commented Feb 11, 2020

Anyway, I don't think this particular PR should be merged now if that would cause (you) practical complications. (Which is exactly why I created the PR.)

@thoughtpolice
Copy link
Member

On second thought it might just be better to vendor lmdb's code myself honestly for my use case. Will come back to this thought shortly....

@FRidh FRidh added this to Needs review in Static builds Mar 29, 2020
@stale
Copy link

stale bot commented Aug 9, 2020

Hello, I'm a bot and I thank you in the name of the community for your contributions.

Nixpkgs is a busy repository, and unfortunately sometimes PRs get left behind for too long. Nevertheless, we'd like to help committers reach the PRs that are still important. This PR has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human.

If this is still important to you and you'd like to remove the stale label, we ask that you leave a comment. Your comment can be as simple as "still important to me". But there's a bit more you can do:

If you received an approval by an unprivileged maintainer and you are just waiting for a merge, you can @ mention someone with merge permissions and ask them to help. You might be able to find someone relevant by using Git blame on the relevant files, or via GitHub's web interface. You can see if someone's a member of the nixpkgs-committers team, by hovering with the mouse over their username on the web interface, or by searching them directly on the list.

If your PR wasn't reviewed at all, it might help to find someone who's perhaps a user of the package or module you are changing, or alternatively, ask once more for a review by the maintainer of the package/module this is about. If you don't know any, you can use Git blame on the relevant files, or GitHub's web interface to find someone who touched the relevant files in the past.

If your PR has had reviews and nevertheless got stale, make sure you've responded to all of the reviewer's requests / questions. Usually when PR authors show responsibility and dedication, reviewers (privileged or not) show dedication as well. If you've pushed a change, it's possible the reviewer wasn't notified about your push via email, so you can always officially request them for a review, or just @ mention them and say you've addressed their comments.

Lastly, you can always ask for help at our Discourse Forum, or more specifically, at this thread or at #nixos' IRC channel.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Aug 9, 2020
@Artturin
Copy link
Member

Artturin commented Feb 3, 2023

Reopen and rebase if there's still interest

@Artturin Artturin closed this Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Static builds
Needs review
Development

Successfully merging this pull request may close these issues.

None yet

5 participants