-
-
Notifications
You must be signed in to change notification settings - Fork 266
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
add a tutorial on packaging existing software #650
add a tutorial on packaging existing software #650
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to focus on the overall structure in this first pass.
The overall structure is great, and I see this becoming a very valuable piece of learning material. The two major conceptual issues I'd like to address first are:
- There are a few superfluous movements.
We should guide learners along the happy path with minimal friction, and only run them into problems where there is something to be learned for reuse (such as reading build errors – I very much like how you progress through the build dependencies). Just show them how to do the right thing immediately. Words of warning, highlighting common user error patterns, and lightweight explanations along with links to reference documentation are fine, but they should complement the text, not be an integral part of the narrative.
- The narrative style is a bit too verbose for the purpose here (although I find it hard to separate that requirement from my own taste, so take it with a grain of salt).
We're dumping a lot of new stuff on learners, and we should rather use words sparingly, only saying what's needed. Not everyone is fluent in English (in fact, most of the world's population), and a loose style, while it may seem easy-going for you or who you imagine your readers to be, will likely impose a significant cognitive overhead. This may sound like it's in conflict with sounding friendly or compassionate, but the real service we're providing here is to make the substance as easy to understand as possible. I'd rather take the risk of sounding cold or impersonal than hiding the essentials between semantically empty words.
If we skip the Nixpkgs contribution part, we definitely need a "next steps" section that would point to largely non-existent material. What we also should definitely add are pointers to ongoing discussion around package structure and coding conventions, to note that much of that stuff is still in flux. But would already be polish.
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-07-20-documentation-team-meeting-notes-65/30876/1 |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-07-31-documentation-team-meeting-notes-68/31127/1 |
|
||
One of Nix's primary use-cases is in addressing common difficulties encountered while packaging software, like *managing dependencies*. | ||
|
||
In the long term, Nix helps tremendously in alleviating that stress, but when *first* (re)packaging existing software with Nix, it's common to encounter missing dependencies preventing builds from succeeding. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good expectation management. Some thoughts
- Flaws also include downloading from the internet
- Discovering dependencies by letting the build fail may be a good practice. We don't want to add unused dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discovering dependencies by letting the build fail may be a good practice. We don't want to add unused dependencies.
We do this!
Flaws also include downloading from the internet
What do you mean by this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed together in the Learning journey meeting
Take a look at the notes in https://discourse.nixos.org/t/2023-07-20-learning-journey-working-group-meeting-notes-18/30926#reviewing-nixdev-650-3
@zmitchell: Wording can be more concise, a bit too conversational, can make sentences shorter.
@zmitchell: Take a look at https://nix.dev/contributing/style-guide#voice regarding "we" and "you"
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-08-03-learning-journey-working-group-meeting-notes-20/31251/1 |
In a previous Learning Journey Working Group meeting, we discussed (among other things) the following points, which are either addressed now or I would like clarification/further discussion on:
I cut this back a little bit, but I think there's little unnecessary prose here, especially after the latest changes.
How should it be done otherwise?
Why is this bad practice?
I find the |
27d5a0b
to
d010738
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks pretty good, nice work! I think we can merge this after the things I mention are addressed
source/tutorials/learning-journey/packaging-existing-software.md
Outdated
Show resolved
Hide resolved
source/tutorials/learning-journey/packaging-existing-software.md
Outdated
Show resolved
Hide resolved
source/tutorials/learning-journey/packaging-existing-software.md
Outdated
Show resolved
Hide resolved
source/tutorials/learning-journey/packaging-existing-software.md
Outdated
Show resolved
Hide resolved
source/tutorials/learning-journey/packaging-existing-software.md
Outdated
Show resolved
Hide resolved
source/tutorials/learning-journey/packaging-existing-software.md
Outdated
Show resolved
Hide resolved
source/tutorials/learning-journey/packaging-existing-software.md
Outdated
Show resolved
Hide resolved
source/tutorials/learning-journey/packaging-existing-software.md
Outdated
Show resolved
Hide resolved
source/tutorials/learning-journey/packaging-existing-software.md
Outdated
Show resolved
Hide resolved
source/tutorials/learning-journey/packaging-existing-software.md
Outdated
Show resolved
Hide resolved
5b5ed59
to
746e026
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made suggested edits where I thought they were warranted or made the prose flow better, but there's only one or two places where I think the actual content could be adjusted (using hello.nix
vs. default.nix
, for example).
Generally I would err on the side of too few words. It's much easier to add words later than it is to condense a paragraph.
source/tutorials/learning-journey/packaging-existing-software.md
Outdated
Show resolved
Hide resolved
source/tutorials/learning-journey/packaging-existing-software.md
Outdated
Show resolved
Hide resolved
source/tutorials/learning-journey/packaging-existing-software.md
Outdated
Show resolved
Hide resolved
source/tutorials/learning-journey/packaging-existing-software.md
Outdated
Show resolved
Hide resolved
source/tutorials/learning-journey/packaging-existing-software.md
Outdated
Show resolved
Hide resolved
source/tutorials/learning-journey/packaging-existing-software.md
Outdated
Show resolved
Hide resolved
source/tutorials/learning-journey/packaging-existing-software.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved pending one or two changes
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-08-10-learning-journey-meeting-notes-21/31556/1 |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-08-10-documentation-team-meeting-notes-71/31558/1 |
Needs a rebase after #671 |
Co-authored-by: Zach Mitchell, PhD <[email protected]>
Co-authored-by: Zach Mitchell, PhD <[email protected]>
Co-authored-by: Zach Mitchell, PhD <[email protected]>
Co-authored-by: Zach Mitchell, PhD <[email protected]>
Co-authored-by: Zach Mitchell, PhD <[email protected]>
Co-authored-by: Zach Mitchell, PhD <[email protected]>
Co-authored-by: Zach Mitchell, PhD <[email protected]>
Co-authored-by: Zach Mitchell, PhD <[email protected]>
Co-authored-by: Zach Mitchell, PhD <[email protected]>
Co-authored-by: Zach Mitchell, PhD <[email protected]>
Co-authored-by: Zach Mitchell, PhD <[email protected]>
Co-authored-by: Zach Mitchell, PhD <[email protected]>
Co-authored-by: Zach Mitchell, PhD <[email protected]>
Co-authored-by: Silvan Mosberger <[email protected]>
Co-authored-by: Zach Mitchell, PhD <[email protected]>
Co-authored-by: Zach Mitchell, PhD <[email protected]>
Co-authored-by: Zach Mitchell, PhD <[email protected]>
33f9366
to
6bd4567
Compare
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-08-14-documentation-team-meeting-notes-72/31722/1 |
Closes #601, or will eventually.
Following (part of) the requirement specification in that Issue, this tutorial currently focuses on the experience of encountering a few common build failures and their solution by passing different attributes to
mkDerivation
. This has the potential to grow substantially if we want to cover moremkDerivation
features in tutorial style rather than a how-to guide, but I think we should implement that elsewhere as a collection of disconnected (or at least narratively-unrelated) recipes, rather than in this tutorial.This tries to address most points raised in previous discussions in Documentation Team and Learning Journey Working Group meetings, in particular by
buildInputs
andnativeBuildInputs
),installPhase
(this project is actually organically "broken", in the sense that its Makefile does not include aninstall
target, which helpfully dispels some of the Nix magic), andicat
:I explain this choice to use this package in the prose by linking to that not-yet-merged tutorial, so this PR currently should not pass CI; we can remove that justification without harming anything
Anticipating one comment: the (current) final section where I walk through preparing our package for contribution to
nixpkgs
perhaps should be moved, but I chose to include it here because I believe we should always aim to help users of the configuration features (like the majority of NixOS users) build facility withmkDerivation
so they can competently use Nix to package their own stuff, as well as growing competent-packagers into contributors and maintainers.Concerns this doesn't yet address:
configure
&install
prefixes, andpkg-config
includeslib
,dev
, or other outputs for missing headers and development libraries (althoughxorg.libX11.dev
is one of the dependencies; maybe the part involving that can be expanded to discuss this briefly?)icat
package is too simple to have issues here, and builds fine on x86_64-linux (NixOS), aarch64-linux (NixOS), and aarch64-darwinIt turns out that the
icat
@infinisil uses in #645 is actually thekitty
feature by the same name; an entirely different project with equivalent functionality