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

nixos/doc/manual: init chapter on fhs binaries #264433

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SomeoneSerge
Copy link
Contributor

@SomeoneSerge SomeoneSerge commented Oct 30, 2023

This is a work in progress!

I know I'm not a writer, and I'm probably using language and tone inappropriate to the manual, but I am convinced this chapter has to be written and included in the manual. The purpose is specifically to address concerns of the potential and existing NixOS users that require integration with external distributions, including language-specific package managers.

Description of changes

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/)
  • 23.11 Release Notes (or backporting 23.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.

CC also @NixOS/cuda-maintainers @Mic92

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: documentation This PR adds or changes documentation labels Oct 30, 2023
@SomeoneSerge SomeoneSerge added 6.topic: cuda Parallel computing platform and API 6.topic: python labels Oct 30, 2023

Dynamically linked native programs built for "FHS" environments expect to find
the so-called "dynamic linker" in a fixed location, e.g.
`/lib64/ld-linux-x86-64.so.2` depending on the platform. They might also expect
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it might make sense to describe that nix-built binaries have something like /nix/store/00000000000000000000000000000000-glibc-2.xx-xx/lib/ld-linux-x86-64.so.2 set as dynamic linker.

nixos/doc/manual/configuration/fhs.chapter.md Outdated Show resolved Hide resolved
$ micromamba install ...
$ pip install ...
```

Copy link
Member

Choose a reason for hiding this comment

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

One notable limitation where nix-ld won't work, is however if you have try to use a library in a scripting language like python, where the interpreter comes from nixpkgs and hence NIX_LIBRARY_PATH is not effective: https://github.com/Mic92/nix-ld/tree/main#my-pythonnodejsrubyinterpreter-libraries-do-not-find-the-libraries-configured-by-nix-ld

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Oct 30, 2023
Copy link
Member

@samuela samuela left a comment

Choose a reason for hiding this comment

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

woohoo!

nixos/doc/manual/configuration/fhs.chapter.md Outdated Show resolved Hide resolved
nixos/doc/manual/configuration/fhs.chapter.md Show resolved Hide resolved
@delroth delroth added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Oct 31, 2023
Copy link
Contributor

@fricklerhandwerk fricklerhandwerk left a comment

Choose a reason for hiding this comment

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

It's a very important topic, and on the technical level this is very thoroughly covered, but I fear in the current state the addition won't alleviate confusion by far as much as it could (and should).

The main problem I see is that the change is trying to do many things at once, and that it doesn't provide enough context for the complex examples. That's generally a problem with the Nixpkgs manual: authors are often so deep into their subject that they find it hard to pick up readers from where they are. And it is work to do that.

Since now a lot of comments have piled up, instead of burdening you with change requests I propose to split out just the problem statement into a PR against the Nixpkgs manual to open a new section. Then we'll have something that can be iterated on with less hassle and merged quickly.

nixos/doc/manual/configuration/fhs.chapter.md Outdated Show resolved Hide resolved
programs.nix-ld.enable = true;
```

...packages from conda can be used as follows:
Copy link
Contributor

Choose a reason for hiding this comment

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

Starting here it gets a bit confusing and repetitive. The confusing part is that the examples assume system state. It's repetitive because all that changes is that each example works in one case but not the other. I think it's enough to point to the option and say it's required to run FHS programs, as they won't work otherwise.

nixos/doc/manual/configuration/fhs.chapter.md Show resolved Hide resolved
nixos/doc/manual/configuration/fhs.chapter.md Show resolved Hide resolved
nixos/doc/manual/configuration/fhs.chapter.md Outdated Show resolved Hide resolved
@Mic92 Mic92 mentioned this pull request Nov 25, 2023
13 tasks
In an effort to address concerns of the users that require integration
with other distributions, including language-specific package managers

Update nixos/doc/manual/configuration/fhs.chapter.md

Co-authored-by: Samuel Ainsworth <[email protected]>

Update nixos/doc/manual/configuration/fhs.chapter.md

Update nixos/doc/manual/configuration/fhs.chapter.md

nixos/doc/fhs: mention how nixpkgs executables are linked
@Mic92 Mic92 force-pushed the feat/2023-10/hpc-docs branch from b900b21 to 48dbb2a Compare November 25, 2023 09:38
@tejing1
Copy link
Contributor

tejing1 commented Nov 25, 2023

I'm considering whether to link here in the error message from #269551 to make it much shorter... and I'm not sure. This is written more as an in-depth education on the infrastructure, and solutions aimed more at developers. The message I'm writing will often be seen by quite inexperienced users, and I don't want to throw too big a wall of text at them.

Thoughts?

@SomeoneSerge
Copy link
Contributor Author

Just to stay in sync: I read and am grateful for all of the feedback. I'll be rewriting this script, hopefully next week. Been occupied elsewhere so far

@Mic92
Copy link
Member

Mic92 commented Nov 29, 2023

I'm considering whether to link here in the error message from #269551 to make it much shorter... and I'm not sure. This is written more as an in-depth education on the infrastructure, and solutions aimed more at developers. The message I'm writing will often be seen by quite inexperienced users, and I don't want to throw too big a wall of text at them.

Thoughts?

I think its fair to have a smaller document just for stub-ld that maybe also link to this one here.

@Mic92
Copy link
Member

Mic92 commented Nov 29, 2023

Just to stay in sync: I read and am grateful for all of the feedback. I'll be rewriting this script, hopefully next week. Been occupied elsewhere so far

I think if you simplify the example as @fricklerhandwerk said in #264433 (comment) than this is good to go.

@wegank wegank removed the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Mar 8, 2024
@wegank wegank added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 4, 2024
@FliegendeWurst FliegendeWurst added the awaiting_changes (old Marvin label, do not use) label Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: cuda Parallel computing platform and API 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: documentation This PR adds or changes documentation 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 awaiting_changes (old Marvin label, do not use)
Projects
Status: New
Development

Successfully merging this pull request may close these issues.

10 participants