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

ocamlPackages.tls-eio: init at 1.0.4, and remove incorrect optimization from mdx #364047

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

vog
Copy link
Contributor

@vog vog commented Dec 10, 2024

Add the missing variant ocamlPackages.tls-eio of the ocamlPackages.tls-* packages.

This requires the removal of an incorrect optimization from the mdx package, which is explained in the commit message:

The original purpose of this optimization was described by its author as follows:

Strip optional dependencies from logs to make the closure smaller as this
package contains a binary

However, that optimization is incorrect because it affects not only the command line tool (output "mdx.bin") but also the mdx library (output "mdx").

Pull request #290291 recognized this issue, but merely moved this optimization from development/ocaml-modules/mdx/default.nix to top-level/ocaml-packages.nix, so everyone affected can help themselves via attribute overriding. As such, it didn't fix the original problem, i.e. that this optimization is simply incorrect. Moreover, that doesn't help if we ever want an affected library, such as "tls-eio", to be officially included in nixpkgs.

This commit fixes the root of the problem by removing the incorrect optimization.

Please note that this commit is not intended to discourage the re-introduction of such an optimization. However, a new variant of this optimization should only be included if it is correct, i.e. reduces just "mdx.bin" without making "mdx" incompatible with every package that directly or indirectly depends on the "logs" library.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

checkInputs = [
crowbar
eio_main
mdx
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
mdx
(mdx.override { inherit logs; })

Instead of the (controversial) first commit, you can simply locally override the mdx library to use the version of logs of your liking.

@vog vog force-pushed the tls-eio-init branch 2 times, most recently from f1f827d to 8ce80cf Compare December 11, 2024 09:43
@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux and removed 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 labels Dec 11, 2024
@vog
Copy link
Contributor Author

vog commented Dec 11, 2024

@vbgl I followed your advice and force-pushed a variant that doesn't contain any controversial changes.

Instead of the (controversial) first commit, you can simply locally override the mdx library to use the version of logs of your liking.

While I still believe that we should somehow limit the effects of the overriding logs to mdx.bin, while binding the mdx library to the unmodified logs as that would simplify everything downstream, I have no idea how to do that, and I don't want that to block the inclusion of ocamlPackages.tls-eio.

@vbgl vbgl merged commit 37dc568 into NixOS:master Dec 11, 2024
19 of 20 checks passed
@vbgl vbgl added the backport release-24.11 Backport PR automatically label Dec 11, 2024
@nix-backports
Copy link

nix-backports bot commented Dec 11, 2024

@nix-backports
Copy link

nix-backports bot commented Dec 11, 2024

Git push to origin failed for release-24.11 with exitcode 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: ocaml 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux backport release-24.11 Backport PR automatically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants