Commit Graph

3483 Commits

Author SHA1 Message Date
Adam Joseph
7363eedd89
Merge pull request #244118 from amjoseph-nixpkgs/pr/fix/244045
lib.systems.extensions.sharedLibrary: do not `throw`
2023-07-20 07:43:12 +00:00
Robert Hensing
814f067760
Merge pull request #238013 from tweag/lib.path.removePrefix
`lib.path.removePrefix`: init
2023-07-19 17:28:05 +02:00
Robert Hensing
0665253b86
Merge pull request #244044 from tweag/lib-readme
Create a Readme in `lib`
2023-07-19 16:34:36 +02:00
Silvan Mosberger
fa503f4b92 lib.attrsets.mergeAttrsList: init
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-07-18 20:27:15 +02:00
Silvan Mosberger
581d7c88be lib/tests: Unify documentation of individual testable files 2023-07-18 17:22:45 +02:00
Silvan Mosberger
03431f1244 lib: Add README
Co-authored-by: Alexander Groleau <alex@proof.construction>
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-07-18 17:22:42 +02:00
Markus Theil
f6f0ccd6c9 lib.systems.bluefield2: init
Add support for Nvidia's Bluefield 2 plattform as a compilation
target. There exists a version with and without crypto support,
while the crypto supported version is the most common one.

Support for the non-crypto version can be easily added in the future,
if needed.

For a datasheet of the hardware, see:

https://www.nvidia.com/content/dam/en-zz/Solutions/Data-Center/documents/datasheet-nvidia-bluefield-2-dpu.pdf

Signed-off-by: Markus Theil <theil.markus@gmail.com>
2023-07-14 11:19:11 +02:00
Adam Joseph
218669e143
Merge pull request #238154 from amjoseph-nixpkgs/pr/gcc/crossStageStatic
gccCrossStageStatic: enable dynamic libraries, rename it
2023-07-12 23:30:43 +00:00
Robert Hensing
8014460c4d lib.mergeModules: Add context to error message 2023-07-11 13:03:52 +02:00
Robert Hensing
8f700580b9 lib/modules.nix: Format 2023-07-11 13:03:52 +02:00
Robert Hensing
4dd51a9ace lib/modules.nix: Inline single-use subtree bindings 2023-07-11 12:33:41 +02:00
Robert Hensing
6acc3114c3 lib/modules.nix: Make entire definition list strict in config check
This is a non-trivial refactor that slightly changes the semantics
of the internal definition lists.
Whereas previously only individual list items would trigger the exception,
now the error is promoted to the whole list.
This is mostly ok, because we compute the value, it is wrong to ignore a definition.
However, we don't always compute the value. For instance `readOnly`
only needs to count definitions. That won't be possible anymore when
the error is raised for one of the items. As a consequence, an error
will be raised for the errant definition instead of the number of
definitions.
2023-07-11 12:22:58 +02:00
Robert Hensing
c28dd7d921 lib/modules.nix: Rename defnsByName -> pushedDownDefinitionsByName 2023-07-11 12:22:58 +02:00
Robert Hensing
448b153f81 lib/modules.nix: Rename defnsByName' -> rawDefinitionsByName 2023-07-11 12:22:58 +02:00
Robert Hensing
fb988c6193 lib/modules.nix: Apply argument module of old f 2023-07-11 12:22:57 +02:00
Robert Hensing
eb410eab82 lib/modules.nix: Apply argument modules of old old old byName 2023-07-11 12:22:57 +02:00
Robert Hensing
65de18210d lib/modules.nix: Apply argument f of old old byName 2023-07-11 12:22:57 +02:00
Robert Hensing
c70a5e9223 lib/modules.nix: Apply argument attr of old byName 2023-07-11 12:22:08 +02:00
Robert Hensing
d1e18a369a lib/modules.nix: Inline byName
byName is not an abstraction. This is the first commit in a series
that refactors it away.
2023-07-11 11:37:56 +02:00
Silvan Mosberger
6626d8cc4d lib.path.removePrefix: init 2023-07-10 21:25:43 +02:00
Robert Hensing
aa1beb0ab5 doc: Render lib.fixedPoints 2023-07-08 18:46:08 +02:00
Ryan Burns
2964b720de
Merge pull request #240825 from r-burns/mips-embedded
lib.platforms.mips{,64}-embedded: init
2023-07-05 21:26:47 -07:00
Naïm Favier
aaddc08519
Merge pull request #241645 from ncfavier/lib-no-hashes
lib/tests: invalidate hashes
2023-07-05 12:07:36 +02:00
Naïm Favier
f66b401fa3
lib/tests: invalidate hashes
Having the current bash hash present in the nixpkgs tree makes Nix
detect bash as a runtime dependency of nixpkgs, which in turns messes up
`fetchFromGitHub` due to https://github.com/NixOS/nix/issues/6660
2023-07-05 11:31:58 +02:00
Artturi
359e1136a6
Merge pull request #239120 from LibreCybernetics/arch-stuff 2023-07-05 00:20:25 +03:00
Adam Joseph
d278fd78af lib.systems.extensions.sharedLibrary: do not throw
Because downstream code expects to use `==` on platform attrsets, we
are unfortunately not able to throw a useful error message when the
`sharedLibrary` attribute is accessed.

When users do a comparison like:

  stdenv.hostPlatform == pkgsStatic.stdenv.hostPlatform

... in a situation where `stdenv.hostPlatform.hasSharedLibraries`,
they expect this to return `false`.  Unfortunately Nix does a deep
equality comparison here, and ends up forcing the
`pkgsStatic.stdenv.hostPlatform.extensions.sharedLibrary` attribute,
which throws the error.

Rather than returning `null`, this commit instead simply omits the
`extensions.sharedLibrary` attribute.  This provides the user with a
more-useful error message: instead of waiting until the `null` is
used (and hoping that produces an error), the user will get an error
about the `extensions.sharedLibrary` attribute being missing, at the
position where it was referenced.

Big thanks to @trofi for his PR to add
`NIX_VALIDATE_EVAL_NONDETERMINISM` to Nix, which I am now using.  It
made tracking this down really easy!

Fixes #244045
2023-07-04 13:39:19 -07:00
Artturi
f73b89d2d3
Merge pull request #240555 from Artturin/iniglobsecneed 2023-07-04 22:48:06 +03:00
Martin Weinelt
c31bda504c
lib/trivial: Bump oldestSupportedReleaseto to 23.05 2023-07-04 14:17:58 +02:00
Pol Dellaiera
bf2dca1111
Merge pull request #237895 from emilytrau/tart
tart: init at 1.6.0
2023-07-02 11:37:49 +02:00
Adam Joseph
6980e6b35a lib.systems: introduce hasSharedLibraries
This commit adds `hasSharedLibraries` to `lib.systems`.

We need `plat.hasSharedLibraries` in order to know whether or not to
expect `gcc` (and many other tools) to emit shared libraries (like
`libgcc_s.so`).  Many of the GNU build scripts are smart enough that
if you configure them with `--enable-shared` on a platform (such as
`arm-none-eabi`) that doesn't support dynamic linking, they will
simply skip the shared libraries instead of aborting the
`configurePhase`.  Unfortunately the missing shared libraries in the
final build product cause very hard-to-troubleshoot problems later
on.

The alternative to introducing `hasSharedLibraries` would be to set
`isStatic` in these situations.  However doing so causes
`make-derivation.nix` to insert `-static` between the `pname` and
`hostPlatform` suffix, which is undesirable.

If at some point in the future we eliminate the `-static` suffix,
then `hasSharedLibraries` can be made equal to `!isStatic`.
2023-07-01 13:12:22 -07:00
figsoda
0fda9628c3
Merge pull request #239255 from figsoda/string 2023-06-30 22:14:10 -04:00
Ryan Burns
c8ae88d97b lib.platforms.mips{,64}-embedded: init 2023-06-30 18:19:00 -07:00
Adam Joseph
4cb579b536 lib.systems: add gnuabin32 to isGnu
The `isGnu` predicate was missing `gnuabin32`.  This commit corrects
that by adding it.
2023-06-29 12:26:12 -07:00
Artturin
ce54db6fe1 lib.generators.toINIWithGlobalSection: give sections a default
often sections aren't needed when using globalSection

currently one has to `sections = { }` when using only globalSection

```
lib.generators.toINIWithGlobalSection { } {
  globalSection = {
    background_color = "1d202199";
  };
  sections = { };
};
````
2023-06-29 18:41:34 +03:00
Naïm Favier
3ef988ce97
Merge pull request #237259 from ncfavier/extraDependencies-path
nixos/top-level: change extraDependencies from packages to paths
2023-06-27 11:59:06 +02:00
Naïm Favier
4bdff8cbbb
lib/tests: remove experimental-features
Now that the lib is tested with Nix 2.3, this isn't needed any more and
causes warnings.
2023-06-27 11:48:53 +02:00
Robert Hensing
18111335ed
lib/tests/modules.sh: Test types.pathInStore
Add missing test cases. I think the .links case should be rejected
even though it's technically a path in the store.
2023-06-27 11:48:53 +02:00
Naïm Favier
14d3e5685a
lib/types: add pathInStore 2023-06-27 11:48:08 +02:00
apfelkuchen6
ba6c229037
texlive: fix licensing information for doc-only-packages (#239528)
* licenses: add opubl

* texlive: fix license for npp-for-context and lshort-german

This unbreaks evaluation for `texlive.combine { inherit (texlive) scheme-full;
pkgFilter = (_: true) }`. The problem doesn't manifest for the default pkgFilter
as `npp-for-context` is a doc-only-package (that by the way has recently been
removed from texlive).
2023-06-26 20:31:28 +02:00
Robert Hensing
e17f4dae6f lib/path/tests/prop.sh: Add --show-trace 2023-06-26 12:25:36 +02:00
Robert Hensing
050e7e29aa lib/path/tests: Add --show-trace
This should help troubleshoot errors.
Fyi --eval is just a flag, not an option with a value.
2023-06-26 12:12:34 +02:00
Hugh O'Brien
636db898eb
lib.licenses: add Sustainable Use License (#239455) 2023-06-25 07:07:49 +00:00
Fabián Heredia Montiel
79dfc50bb8 lib.systems.architectures: add microarchitecture levels
Variation on:
- https://github.com/NixOS/nixpkgs/pull/208398
- https://github.com/NixOS/nixpkgs/pull/224978

Co-authored-by: Sandro Jäckel <sandro.jaeckel@gmail.com>
Co-authored-by: Shawn8901 <shawn8901@googlemail.com>
Co-authored-by: AveryanAlex <alex@averyan.ru>
2023-06-24 00:50:40 -06:00
Robert Hensing
b1ad9cd27d
Merge pull request #238136 from hercules-ci/nixos-nixpkgs-dont-check-when-_module.args.pkgs-is-set
`nixos/nixpkgs`: Don't check when `_module.args.pkgs` is set
2023-06-23 19:17:36 +02:00
Artturi
e360d8541a
Merge pull request #239233 from Artturin/finishremovals1 2023-06-23 20:09:54 +03:00
Robert Hensing
895ac17634
lib/modules.nix: Clean up mergeAttrDefinitionsWithPrio impl 2023-06-23 18:10:49 +02:00
figsoda
8283d3d8d1 lib/types: remove unused rec 2023-06-23 09:41:04 +00:00
figsoda
1b8df7c8d7 lib/sources: remove unused let bindings 2023-06-23 09:41:04 +00:00
figsoda
8a1a028694 lib/modules: remove unused let bindings 2023-06-23 09:41:04 +00:00
figsoda
c783b54650 lib/licenses: remove unused rec 2023-06-23 09:41:04 +00:00