Commit graph

335 commits

Author SHA1 Message Date
Robert Scott 5fea611634 docs: mention promotion of stackclashprotection hardening flag to default enabled 2025-02-09 10:58:59 +00:00
K900 af55d5afc2 Merge remote-tracking branch 'origin/master' into staging-next 2025-02-05 09:44:25 +03:00
Pol Dellaiera 5b2753b035
doc/stdenv: fix typo in dependency propagation (#379300) 2025-02-05 06:41:33 +01:00
Lin Jian edda698276
doc/stdenv: fix typo in dependency propagation 2025-02-04 17:19:53 +08:00
K900 945d2e2a7a Merge remote-tracking branch 'origin/master' into staging-next 2025-02-03 18:00:08 +03:00
Lin Jian 9dde0e79a2
doc/stdenv: delete a confusing sentence for writableTmpDirAsHomeHook 2025-02-03 22:10:33 +08:00
Alyssa Ross dffcaaaa64
Merge remote-tracking branch 'origin/master' into staging-next
Conflicts:
	pkgs/applications/virtualization/crosvm/default.nix
	pkgs/by-name/as/ast-grep/package.nix
	pkgs/by-name/ca/cargo-mobile2/package.nix
	pkgs/by-name/cl/clang-tidy-sarif/package.nix
	pkgs/by-name/gg/gg-jj/package.nix
	pkgs/by-name/gi/git-warp-time/package.nix
	pkgs/by-name/je/jellyfin-rpc/package.nix
	pkgs/by-name/ne/netbox2netshot/package.nix
	pkgs/by-name/sy/sydbox/package.nix
	pkgs/by-name/te/television/package.nix
	pkgs/development/python-modules/tinytuya/default.nix
2025-01-31 10:23:31 +01:00
Pol Dellaiera f8110737ae build-support: add writableTmpDirAsHomeHook hook 2025-01-27 19:41:13 +01:00
Pol Dellaiera 87521c59b6 build-support: add addBinToPathHook hook 2025-01-27 19:41:13 +01:00
Connor Baker b2416f4485 no-broken-symlinks: restrict checks to symlinks pointing inside the store 2025-01-23 15:59:18 -08:00
Connor Baker 51b2764e9f no-broken-symlinks: provide only dontCheckForBrokenSymlinks and test against absolute symlinks 2025-01-22 11:05:13 -08:00
Connor Baker 4e8e175c7c doc: add stdenv entry for no-broken-symlinks.sh 2025-01-21 17:35:14 -08:00
nixpkgs-ci[bot] 0cae90809c
Merge master into staging-next 2025-01-18 18:04:10 +00:00
Arne Keller a3838482c1
doc/stdenv: accurately describe propagatedNativeBuildInputs (#354341) 2025-01-18 14:33:39 +01:00
nixpkgs-ci[bot] d4a1995529
Merge master into staging-next 2025-01-16 00:14:11 +00:00
Emily 54f484c80e doc/stdenv/platform-notes: fix typo 2025-01-15 02:04:39 +00:00
Wolfgang Walther cf127c9dc3
treewide: load structured attributes in all bash builders consistently
It's hard to put the sourcing of ./.attrs.sh into all builder
consistently - mistakes will happen. Thus, load structured attrs once in
make-derivation and then source the remaining builder on top.

This should fix quite a few builders with structured attributes in
principle. Most importantly it helps substitute / substituteAll, which
are required for bootstrap on some platforms.
2024-12-29 18:36:47 +01:00
Philip Taron 558c04a4dc
cc-wrapper, bintools-wrapper: Improve hooks that run before invocation (#366960) 2024-12-23 13:30:33 -08:00
Peter Waller 3fc1a00773 bintools-wrapper: introduce ld-wrapper-hook
The existing post-link-hook is in an unfortunate position since it does
not enable interposing the arguments of the compiler.

This is an RFC to add a hook which enables that.

Signed-off-by: Peter Waller <p@pwaller.net>
2024-12-20 23:53:25 +00:00
github-actions[bot] 9568438652
Merge staging-next into staging 2024-12-14 00:15:31 +00:00
github-actions[bot] fa3898acdb
Merge master into staging-next 2024-12-14 00:15:05 +00:00
Philip Taron e65ef57a0f
stdenv: fix documentation for stripAllFlags and stripDebugFlags (#352127) 2024-12-13 12:47:26 -08:00
Simon Žlender 4a61ef6376 release-cross: replace x86_64-darwin with aarch64-darwin 2024-12-03 19:37:34 +01:00
github-actions[bot] 56d0ebd983
Merge staging-next into staging 2024-11-21 18:05:12 +00:00
Kenichi Kamiya 2d4dfc04b4
doc/stdenv: fix a typo 2024-11-20 16:08:21 +09:00
Emily 0f9067f865 darwin: set the minimum version to macOS 11.3 2024-11-18 00:05:22 +00:00
Randy Eckenrode b8b4cdc903
doc: revise Darwin SDK documentation
Based on experience with other maintainers trying to update their
packages, the documentation has been updated for clarity. It is also no
longer recommended to propagate an SDK in most circumstances.
2024-11-08 15:14:12 -05:00
FliegendeWurst ae2d745af6 doc/stdenv: accurately describe propagatedNativeBuildInputs 2024-11-07 23:22:53 +01:00
Jared Baur d38743dce8
stdenv: fix documentation for stripAllFlags and stripDebugFlags
The documentation for the default flags used for both fields were incomplete.
2024-10-29 08:02:35 -07:00
Randy Eckenrode deabb1ff4d
doc: update platform documentation for the new Darwin SDK pattern 2024-10-25 21:12:34 -04:00
Artturin 2db8942790
doc/stdenv/cross-compilation: Add 'Using -static outside a isStatic platform' (#344985) 2024-10-20 22:34:36 +03:00
Artturin 3f144b1aa0 doc/stdenv/cross-compilation: Add 'Using -static outside a isStatic platform'
This issue often comes up when builds use `-static` in their own build
system

This may not be the correct location for this as it's not strictly a
cross issue, but it's the best one I can think of

Inspired by someone wanting to build a `riscv-busybox-initramfs` and just
adding `pkgsCross.riscv32.stdenv.cc` to `nativeBuildInputs`
2024-10-20 01:00:06 +03:00
Harry Askham 065da7698d doc: Cross-link mention of symlinkJoin in 'Multiple-output packages'
Per #36886, would have saved me some time today to have the trivial
builder more visible.
2024-10-18 20:02:03 +02:00
github-actions[bot] ca2d394166
Merge master into staging-next 2024-10-11 12:05:38 +00:00
Lin Jian 7e72cc4e38
doc: fix typo 2024-10-11 09:22:13 +08:00
K900 0717a4da77 Merge remote-tracking branch 'origin/master' into staging-next 2024-10-09 21:08:25 +03:00
Artturin 40799fc06d treewide: replace stdenv.is in non nix files
Continuing e0464e4788
2024-09-27 19:07:45 +03:00
github-actions[bot] 1c4acc409e
Merge staging-next into staging 2024-09-16 06:05:33 +00:00
Tomodachi94 066125b663
doc/stdenv/stdenv: document runHook function
Not quite satisfied with this, but it's better than nothing.
2024-09-14 21:28:09 -07:00
Philip Taron 4160ccc634
treewide: handle *Phases variables __structuredAttrs-agnostically (#339117) 2024-09-07 09:17:57 -07:00
seth 8bc8bbd1c9
doc/stdenv: fix typo in sourceRoot section 2024-09-04 14:43:23 -04:00
Yueh-Shun Li 5ec4f676b4 doc/stdenv: document the format of *Phases
Require the elements of *Phases not to contain spaces.

Require the *Phases attribute to be specified as Nix Language lists.
2024-09-03 05:56:17 +08:00
Robert Scott 745046d266 doc/stdenv: hardening flags: add section on pacret hardening flag 2024-07-28 19:27:21 +01:00
Emily 8a837af302
Merge pull request #326819 from risicle/ris-shadowstack
cc-wrapper: add support for `shadowstack` hardening flag
2024-07-28 19:07:52 +01:00
Robert Scott 5ce990eb57 doc/stdenv: add section on shadowstack hardening flag 2024-07-28 17:40:53 +01:00
Aleksana 40c6a068bd
Merge pull request #324687 from kini/add-sourceProvenance-subheading
doc/meta: Add sourceProvenance to "Standard meta-attributes" section
2024-07-26 11:07:05 +08:00
Alexis Hildebrandt ab42ca141a doc: Remove indefinite article and ending period from example meta.description
so that meta.description examples shown in the documentation
align with recommendations given in the "Meta attributes" section
in pkgs/README.md.

The changes were made with the following commands:
nix run nixpkgs#silver-searcher -- -l0 'description\s*=\s*"([Aa]n?|[Tt]he)\s' doc \
  | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee '/description/s/"([Aa]n?|[Tt]he)\s(.)/"\U\2/'
nix run nixpkgs#silver-searcher -- -l0 'description\s*=\s*".*\."' doc \
  | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee '/description/s/\."/"/'
2024-07-20 09:18:42 +02:00
John Ericson 000b58721f Merge remote-tracking branch 'upstream/master' into openbsd-static 2024-07-09 18:18:47 -04:00
John Ericson 676df1cf2d openbsd: Add static linking support
I've had better luck creating statically-linked binaries that work than
dynamically-linked ones, so this is needed quite practically.
2024-07-09 18:17:06 -04:00
Keshav Kini 89fcddbc8c doc/meta: Add sourceProvenance to "Standard meta-attributes" section
`meta.sourceProvenance` has its own level 2 heading at the bottom of the file,
but unlike the other meta-attributes it doesn't have a level 3 heading under the
"Standard meta-attributes" section.  Readers looking at the list of subheadings
directly under the "Standard meta-attributes" section header may not realize
that `meta.sourceProvenance` exists unless they scroll down to the bottom of the
page.

This commit adds a level 3 heading for sourceProvenance under "Standard
meta-attributes".
2024-07-04 14:58:25 -07:00
github-actions[bot] aba75819b6
Merge master into staging-next 2024-07-03 18:01:04 +00:00
aleksana 19bbe0b3eb doc/meta: make meta.description consistent with contributing document 2024-07-04 01:22:08 +08:00
github-actions[bot] d77a3adc09
Merge master into staging-next 2024-07-03 00:02:45 +00:00
Doron Behar f42d4debf0 doc: recommend versionCheckHook whenever relevant 2024-06-28 18:03:59 +03:00
Robert Scott f52a4c6810 doc/stdenv: hardening flags: add example error for trivialautovarinit 2024-06-22 01:11:27 +01:00
Rick van Schijndel 43ce0f9ee0
Merge pull request #318256 from risicle/ris-stack-clash-protection
cc-wrapper: add stack clash protection hardening flag
2024-06-19 19:54:30 +02:00
github-actions[bot] f9c7b930b4
Merge staging-next into staging 2024-06-11 12:01:44 +00:00
Travis A. Everett 9ff9bbdb34
doc: add stdenv passthru chapter (#315909)
* doc: add stdenv passthru chapter

Broad strokes:
- create the chapter
- move existing stdenv passthru coverage into it
- move out-of-place coverage of passthru.tests from the stdenv meta chapter into it
- (try to) apply 1-sentence-per-line to text I've touched
- add legacy anchors for everything moved
- update existing links to the new anchors
- add tentative motivating text
- make nixpkgs-internal links relative/branchless

razor: if it is only ever needed by contributors, which is likely if links
refer to the latest revision of the source code, then it's for
the contributor guide

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2024-06-11 10:51:03 +02:00
Robert Scott a3f5640dd7 doc/stdenv: hardening flags: add section on stackclashprotection 2024-06-07 20:24:46 +01:00
Robert Scott 932bf58e90 doc/stdenv: hardening flags: move zerocallusedregs into "enabled by default" section
following dd80ca4d00
2024-06-07 20:17:51 +01:00
Arnout Engelen eb83125aa3
Merge pull request #315616 from doronbehar/doc/installCheckPhase
doc/meta: Mention --version as a good usecase for installCheckPhase
2024-06-07 11:41:37 +02:00
Robert Scott 062f1fa52a doc/stdenv: hardening flags: add section on trivialautovarinit 2024-06-05 23:10:20 +01:00
Robert Scott 39f39b5568 doc/stdenv: hardening flags: add section on zerocallusedregs 2024-06-05 23:10:20 +01:00
Robert Scott 65cc6d3cf1 doc/stdenv: hardening flags: add section on fortify3 2024-06-05 23:10:19 +01:00
Robert Scott a8062e526c doc/stdenv: hardening flags: add note on conditional support for some flags 2024-06-05 23:10:12 +01:00
Doron Behar 0aa9043370 doc/meta: still mention testVersion near the installCheckPhase recommendation 2024-05-30 16:33:27 +03:00
Doron Behar 444c2b6dd0 doc/meta: Mention --version as a good usecase for installCheckPhase 2024-05-30 16:09:04 +03:00
Doron Behar f4e6f41b72 doc/meta: better explain an advantage or passthru.tests 2024-05-30 16:09:03 +03:00
Doron Behar f4e7ce7719 doc/meta: small link target shortenning
Shorten the path from the link to the to actual content about
passthru.tests - the content was moved into pkgs/README.md .
2024-05-30 16:09:03 +03:00
Doron Behar 2093ef28d9 doc/meta: mention how Hydra and other tools don't run passthru.tests 2024-05-30 16:09:03 +03:00
Alyssa Ross 20ca4f5529 doc: fix meta.badPlatforms example
error: attribute 'isStatic' missing
2024-05-13 10:24:25 +02:00
Aleksana fe0c92572f
doc/stdenv: document prefixKey more precisely (#302535)
* doc/stdenv: document prefixKey more precisely

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2024-04-08 14:07:40 +02:00
K900 59bccda153 Revert "stdenv: add meta.repository field"
This reverts commit 7e1443abbb.
2024-03-30 17:19:21 +03:00
a-n-n-a-l-e-e 2809c84cfb
Merge pull request #294347 from lolbinarycat/meta.repository
stdenv: add meta.repository field
2024-03-29 13:03:04 -07:00
binarycat 7e1443abbb stdenv: add meta.repository field 2024-03-29 14:34:09 -04:00
Janne Heß fcc95ff817 treewide: Fix all Nix ASTs in all markdown files
This allows for correct highlighting and maybe future automatic
formatting. The AST was verified to work with nixfmt only.
2024-03-28 09:28:12 +01:00
Janne Heß bc77c7a973 treewide: Mark Nix blocks in markdown as Nix
This should help us with highlighting and future formatting.
2024-03-28 09:28:12 +01:00
Anderson Torres e671d3bbbd Nix docs: remove with lib; from example code
Following [Best Practices](https://nix.dev/guides/best-practices#with-scopes),
`with` is a problematic language construction and should be avoided.

Usually it is employed like a "factorization": `[ X.A X.B X.C X.D ]` is written
`with X; [ A B C D ]`.

However, as shown in the link above, the syntatical rules of `with` are not so
intuitive, and this "distributive rule" is very selective, in the sense that
`with X; [ A B C D ]` is not equivalent to `[ X.A X.B X.C X.D ]`.

However, this factorization is still useful to "squeeze" some code, especially
in lists like `meta.maintainers`.

On the other hand, it becomes less justifiable in bigger scopes. This is
especially true in cases like `with lib;` in the top of expression and in sets
like `meta = with lib; { . . . }`.

That being said, this patch removes most of example code in the current
documentation.

The exceptions are, for now
- doc/functions/generators.section.md
- doc/languages-frameworks/coq.section.md

because, well, they are way more complicated, and I couldn't parse them
mentally - yet another reason why `with` should be avoided!
2024-03-06 11:40:09 -03:00
github-actions[bot] dc4a7c97b0
Merge master into staging-next 2024-01-18 18:00:55 +00:00
Peder Bergebakken Sundt e07a2fab7f stdenv: substituteStream: deprecate --replace in favor of --replace-{fail,warn,quiet} 2024-01-14 22:07:58 +01:00
Olivia Crain f6e6a6d80e
doc: replace pcre with pcre2 in example script
https://www.pcre.org/

The `pcre` library is "now at end of life, and is no longer being
maintained," according to the upstream maintainers. Accordingly, we
should replace uses of `pcre` with its actively maintained successor,
`pcre2`, wherever possible .
2024-01-03 11:36:03 -06:00
Silvan Mosberger 59a6f908b5
Merge pull request #271797 from bzm3r/master
doc: diagram explaining what it means for a dependency to be propagated
2023-12-21 17:14:30 +01:00
Brian Merchant b37adfc009 doc: Clarify dependency propagation 2023-12-21 17:11:47 +01:00
Silvan Mosberger 6afebb56f8
Merge pull request #271360 from mattpolzin/patch-1
doc: clarify stdenv phase flag attributes
2023-12-20 20:37:41 +01:00
Danila Danko ceb8e4efd9
doc: Update stdenv.chapter.md (#274706)
Extended genericBuild description
2023-12-16 13:32:15 +01:00
Mathew Polzin fb9e48c6b9 doc: clarify stdenv phase flag attributes 2023-11-30 22:28:58 -06:00
Ivan Mincik 57801428da doc/stdenv: update manual phases execution instructions
Update instructions for manual build phases execution via `nix-shell` to
cover all phases. There is no easy way of getting those commands, so it
makes a sense to have them all properly documented.
2023-11-20 00:06:11 +01:00
Arnout Engelen 97b0ae26f7
doc: avoid 'simply' (#266434)
While the word 'simply' is usually added to encourage readers, it often has the
opposite effect and may even appear condescending, especially when the reader
runs into trouble trying to apply the suggestions from the documentation. It is
almost always an improvement to simply drop the word from the sentence.

(there are more possible improvements like this, we can apply those in separate
PRs)
2023-11-09 21:48:05 +01:00
Yueh-Shun Li 9d6da5bd1e doc: rename sub-section Recursive attributes in stdenv -> Fixed-point arguments in stdenv
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2023-11-07 19:58:54 +00:00
Jade Lovelace 0504bc63e4
doc/stdenv: rewrite manual build procedure to be closer to an auto-build (#262137)
* doc/stdenv: rewrite manual build procedure to be closer to an auto-build

This is based on
<https://jade.fyi/blog/building-nix-derivations-manually/> plus some
more original research.

The previous version of this section did not work for your choice of
simple Haskell package, e.g. haskellPackages.hscolour, due to things
like `compileBuildDriverPhase` and other custom phases that it
does not address at all.

It seems more correct to use genericBuild in development to harmonize it
with what is actually done.

I feel a little bit like I am committing a sin by suggesting using the
experimental CLI in the manual (afaict I am the first to do this), but I
have given the old version of the command, and there are justifiable
reasons to do it:
* The noted limitations with env-vars are fixed. The one with the
  non-empty temp directory was one I ran into myself and oh boy was that
  not fun to debug.
* Additionally the outputs are set *before* sourcing `setup.sh`: there
  is an issue with nix-shell where the original version of `$out` winds
  up in `NIX_LDFLAGS` due to _addRpathPrefix, which means that resulting
  executables may not run properly.

It is sad that `nix develop` propagates a wrong value of `SHELL` to
builders, though. It is equally sad that `nix-shell` is essentially
abandoned upstream, with undocumented and not insignificant differences
from `nix develop`.

For the exact script differences:
17e6b85d05/src/nix-build/nix-build.cc (L516-L551)
db026103b1/src/nix/get-env.sh

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2023-10-23 01:53:23 +02:00
Alejandro Sánchez Medina cbd1748558
nixpkgs manual: add an alternative example in stdenv-separateDebugInfo (#257861)
* nixpkgs manual: add an alternative example in stdenv-separateDebugInfo

This change gets rid of the indirect reference to `nix-env -i` usage
and shows how to achieve the same goal with a shell expression.

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2023-09-29 10:23:22 +02:00
Felix Yan 8ac0795c1f doc: fix wrong flag in description of bindnow
`-z bindnow` doesn't exist. The actual flag added is `-z now`.
2023-09-27 09:59:56 -03:00
Valentin Gagarin 370097ce86
remove the misleading warning on using nix-env for split outputs (#255947)
The text was originally added [0] following an apparently incomplete
research on how everything plays together. In fact, Nix propagates
`outputs` to the corresponding nested derivations, and there is some
messy behavior in Nixpkgs that only seems to propagate
`meta.outputsToInstall` in `buildEnv`[1].

This change moves the hints on how to use NixOS specifics to NixOS
module documentation (which is hopefully easier to find through
search.nixos.org), describes the default behavior in Nixpkgs (updating
a the link to the source), and removes the confusing mention of
`nix-env`.

the last of them should not be there to begin with. we don't want
beginners to use `nix-env`, as this is known to run them into trouble
eventually.

[0]: https://github.com/NixOS/nixpkgs/pull/76794
[1]: 1774d07242/pkgs/build-support/buildenv/default.nix (L66)
2023-09-25 16:23:01 +02:00
Maciej Krüger 7b737acb4a
Merge pull request #254967 from nbraud/sha256-to-hash/top-level 2023-09-15 14:36:49 +02:00
asymmetric b414f942e0
doc: link, instead of just mentioning, Nix manual (#255126)
Instead of just telling the reader to go find the relevant section of the Nix
manual, let's just link to it. Yay hypertext!
2023-09-14 17:09:39 +02:00
Maximilian Ehlers a29cf4aece
Link to usage of pkg description instead of referring to nix-env (#255127)
* Updates meta.chapter.md with a reference link to the usage of the package description field instead of referring to nix-env

---------

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2023-09-14 16:59:20 +02:00
nicoo fe138d36c9 doc: Replace sha256 with hash where appropriate 2023-09-13 17:24:49 +00:00
Artturi 31c9deb4f7
Merge pull request #218783 from timbertson/stripExcludeExtensions 2023-09-05 00:37:17 +03:00
Tim Cuthbertson 0bffcc3f3c setup-hooks/strip: add stripExclude 2023-09-03 20:18:10 +03:00
Artturi ffc35fc054
Merge pull request #245583 from galenhuntington/doc-fix 2023-08-29 22:46:56 +03:00