Commit Graph

1854 Commits

Author SHA1 Message Date
John Ericson
db4f96b3cb lib/systems: Fix eval for iphone32* examples
Whoops messed up 9a845de873 slightly.
2018-05-01 13:04:57 -04:00
John Ericson
9a845de873 lib/systems: Update iOS examples
The commented-out configs are @shlevy's old known-good ones. I changed
them as needed to play nice with lib.systems.parse but did not test so
leaving them as comments for now.
2018-05-01 01:16:27 -04:00
John Ericson
af55a0c300
Merge pull request #39788 from obsidiansystems/aarch32-for-master
lib: Improve deprecation message for `isArm`
2018-04-30 23:28:45 -04:00
John Ericson
57723e947a Merge remote-tracking branch 'upstream/master' into aarch32 2018-04-30 23:06:59 -04:00
Maximilian Bosch
9274ea3903
treewide: rename version attributes
As suggested in https://github.com/NixOS/nixpkgs/pull/39416#discussion_r183845745
the versioning attributes in `lib` should be consistent to
`nixos/version` which implicates the following changes:

* `lib.trivial.version` -> `lib.trivial.release`
* `lib.trivial.suffix` -> `lib.trivial.versionSuffix`
* `lib.nixpkgsVersion` -> `lib.version`

As `lib.nixpkgsVersion` is referenced several times in `NixOS/nixpkgs`,
`NixOS/nix` and probably several user's setups. As the rename will cause
a notable impact it's better to keep `lib.nixpkgsVersion` as alias with
a warning yielded by `builtins.trace`.
2018-04-28 14:23:53 +02:00
Maximilian Bosch
39909289f4
lib: deduplicate version/suffix references
The logic regarding the generated `.version-suffix` file is already
defined in `lib/trivial.nix` and shouldn't be duplicated in
`nixos/version`.
2018-04-28 14:23:13 +02:00
Profpatsch
900cec79a0 lib/debug: add replacement instructions & release notes
for every deprecated function.
2018-04-27 18:59:39 +02:00
Profpatsch
5012c49fc0 lib/debug: document module & functions, prune imports 2018-04-27 18:59:39 +02:00
Profpatsch
e49f40e1ca lib/debug: deprecate traceCallXml
Incompletely documented, and a FIXME/bug that has been there for years.
2018-04-27 18:59:39 +02:00
Profpatsch
fd54a946ca lib/debug: deprecate addErrorContextToAttrs
The function isn’t used anywhere and `addErrorContext` is an undocumented
builtin.
The builtin is explicitely qualified at its two uses in the module system.
2018-04-27 18:59:39 +02:00
Profpatsch
562286aa56 lib/debug: deprecate traceValIfNot
The function is only used in exactly one module and overly specific (`c` must be
a true predicate for `x`, if not, a specific trace is called).
2018-04-27 18:59:39 +02:00
Profpatsch
7365671fb2 lib/debug: deprecate attrNamesToStr, traceXMLVal(Marked)
`attrNamesToStr` is very specific (and pretty trivial), so it doesn’t make sense
to have it in the library.
`traceXMLVal(Marked)` are just a builtin and `trace` and not very useful in
general (trace output should not be parsed anyway).
2018-04-27 18:59:39 +02:00
Profpatsch
a7fdd10bf3 lib/debug: deprecate & modernize showVal
The code is re-implemented in terms of `generators.toPretty`, but is strictly
less general than `traceValSeqN`, so we deprecate it.
2018-04-27 18:59:39 +02:00
Profpatsch
a455637d28 lib/debug: remove the deprecated strict function
The grace period was long enough.
2018-04-27 18:59:39 +02:00
Profpatsch
a5f6cdfd7e lib/debug: add traceValFn, traceValSeqFn, traceValSeqNFn
Being able to modify the value on-the-fly before printing is very useful in
practice.
2018-04-27 18:59:39 +02:00
John Ericson
b9acfb4ecf treewide: isArm -> isAarch32
Following legacy packing conventions, `isArm` was defined just for
32-bit ARM instruction set. This is confusing to non packagers though,
because Aarch64 is an ARM instruction set.

The official ARM overview for ARMv8[1] is surprisingly not confusing,
given the overall state of affairs for ARM naming conventions, and
offers us a solution. It divides the nomenclature into three levels:

```
ISA:             ARMv8   {-A, -R, -M}
                 /    \
Mode:     Aarch32     Aarch64
             |         /   \
Encoding:   A64      A32   T32
```

At the top is the overall v8 instruction set archicture. Second are the
two modes, defined by bitwidth but differing in other semantics too, and
buttom are the encodings, (hopefully?) isomorphic if they encode the
same mode.

The 32 bit encodings are mostly backwards compatible with previous
non-Thumb and Thumb encodings, and if so we can pun the mode names to
instead mean "sets of compatable or isomorphic encodings", and then
voilà we have nice names for 32-bit and 64-bit arm instruction sets
which do not use the word ARM so as to not confused either laymen or
experienced ARM packages.

[1]: https://developer.arm.com/products/architecture/a-profile

(cherry picked from commit ba52ae5048)
2018-04-25 15:50:41 -04:00
John Ericson
ba52ae5048 treewide: isArm -> isAarch32
Following legacy packing conventions, `isArm` was defined just for
32-bit ARM instruction set. This is confusing to non packagers though,
because Aarch64 is an ARM instruction set.

The official ARM overview for ARMv8[1] is surprisingly not confusing,
given the overall state of affairs for ARM naming conventions, and
offers us a solution. It divides the nomenclature into three levels:

```
ISA:             ARMv8   {-A, -R, -M}
                 /    \
Mode:     Aarch32     Aarch64
             |         /   \
Encoding:   A64      A32   T32
```

At the top is the overall v8 instruction set archicture. Second are the
two modes, defined by bitwidth but differing in other semantics too, and
buttom are the encodings, (hopefully?) isomorphic if they encode the
same mode.

The 32 bit encodings are mostly backwards compatible with previous
non-Thumb and Thumb encodings, and if so we can pun the mode names to
instead mean "sets of compatable or isomorphic encodings", and then
voilà we have nice names for 32-bit and 64-bit arm instruction sets
which do not use the word ARM so as to not confused either laymen or
experienced ARM packages.

[1]: https://developer.arm.com/products/architecture/a-profile
2018-04-25 15:28:55 -04:00
Profpatsch
c84dad316a lib/generators: print paths without quotes & move function down 2018-04-25 15:31:17 +02:00
John Ericson
cf0dd1dbd2
Merge pull request #39172 from obsidiansystems/ios-cross
ios-sdk-pkgs: Init from iOS SDK from XCode
2018-04-19 17:00:05 -04:00
Ken Micklas
ef3db7d14c ios-sdk-pkgs: Init from iOS SDK from XCode 2018-04-19 16:09:30 -04:00
John Ericson
53686e8995
Merge pull request #38485 from obsidiansystems/nixos-nixpkgs-options
nixpkgs module: Clean up platform options
2018-04-19 14:59:58 -04:00
John Wiegley
4cfdcedb71 Fix a typo: types.openSignifiantByte -> types.openSignificantByte 2018-04-13 18:41:53 -07:00
Jörg Thalheim
0fe11dbedd
Merge pull request #38611 from volth/nat-sort
lib: add naturalSort
2018-04-08 22:44:15 +01:00
volth
3f8c9106ea
lib: add naturalSort (move the example IPs to private space) 2018-04-08 13:54:39 +00:00
volth
25c2fd80b1 lib: add naturalSort 2018-04-08 13:18:13 +00:00
Silvan Mosberger
e1dee4efcb lib: make extensible
This allows the lib fixed point to be extended with

  myLib = lib.extend (self: super: {
    foo = "foo";
  })

With this it's possible to have the new modified lib attrset available to all
modules when using evalModules

  myLib.evalModules {
    modules = [ ({ lib, ... }: {
      options.bar = lib.mkOption {
	default = lib.foo;
      };
    }) ];
  }

  => { config = { bar = "foo"; ... }; options = ...; }
2018-04-07 13:21:49 -04:00
John Ericson
c6f7d43678 nixpkgs module: Clean up platform options
- `localSystem` is added, it strictly supercedes system

 - `crossSystem`'s description mentions `localSystem` (and vice versa).

 - No more weird special casing I don't even understand

TEMP
2018-04-06 12:41:44 -04:00
Profpatsch
fa71407f36 lib/generators: introduce a sane default for mkValueString
So far, `mkValueString` defaulted to `toString`,
which is a bad match for most configuration file formats,
especially because how booleans are formatted.
This also improves error messages for unsupported types.

Add a test to codify the formatting.
2018-03-29 16:53:06 +02:00
Profpatsch
a7e45fdd8e lib/generators: improve documentation a bit 2018-03-29 16:53:06 +02:00
Profpatsch
219ba583b2 lib/generators: improve toPretty
* properly escape strings
* remove one check for booleans
* improve error message
2018-03-29 16:53:06 +02:00
Franz Pletz
e6f4614e85
lib/modules: fix typo 2018-03-28 02:28:15 +02:00
Shea Levy
26e8d58cb5
libseccomp: Disable only on RISC-V if Linux.
The isSeccomputable flag treated Linux without seccomp as just a
normal variant, when it really should be treated as a special case
incurring complexity debt to support.
2018-03-27 08:16:24 -04:00
Shea Levy
cdf9a78a3e
kexectools: Disable only on RISC-V if Linux.
The isKexecable flag treated Linux without kexec as just a normal
variant, when it really should be treated as a special case incurring
complexity debt to support.
2018-03-27 08:15:07 -04:00
Matthew Justin Bauer
8f3091939b
Merge pull request #37752 from ryantm/fix-urls
treewide: use more HTTPS URLs
2018-03-25 00:40:17 -05:00
Ryan Mulligan
b189247ba0 treewide: use more HTTPS URLs
Uses the HTTPS url for cases where the existing URL has a permanent
redirect. For each domain, at least one fixed derivation URL was
downloaded to test the domain is properly serving downloads.

Also fixes jbake source URL, which was broken.
2018-03-24 22:04:25 -07:00
Shea Levy
20f51922c0
riscv-pk: Set platforms properly 2018-03-24 08:44:26 -04:00
Eelco Dolstra
7db841512a
Remove obsolete /nix/var/nix/{manifests,channel-cache} 2018-03-20 18:26:13 +01:00
John Ericson
d9a1800239 lib: Add lib.platforms.windows 2018-03-20 12:47:45 -04:00
John Ericson
3c8ae01a45 lib: Make platforms.all actually match all platforms
Otherwise obscure cross-compilations are hampered. `all` breaks all but
the initial derivation (which we can't even write yet) in an open world
setting however, so we really shouldn't have it.
2018-03-20 12:46:19 -04:00
John Ericson
175d4ab1db lib: Make platform predicates greppable
Should have commited on here and on merged master to begin with, but I
didn't, so instead I cherry-pick.

(cherry picked from commit 88c04a8b6b)
2018-03-20 12:35:20 -04:00
John Ericson
88c04a8b6b lib: Make platform predicates greppable 2018-03-19 22:20:48 -04:00
John Ericson
3c331bff5b
Merge pull request #37395 from obsidiansystems/lib-meta-platform
lib: Factor in tiny bit of `meta.platform` checking
2018-03-19 20:12:50 -04:00
John Ericson
e547bd0dc4 lib: Factor in tiny bit of meta.platform checking
I need it in stdenv and release-lib, so that seems motivation enough.
2018-03-19 19:29:16 -04:00
John Ericson
c22e2f86c7
Merge pull request #37359 from obsidiansystems/lib-darwin-reorg
lib: Split Darwin into macOS and iOS
2018-03-19 15:08:06 -04:00
John Ericson
bbfa2f9701 lib: Split Darwin into macOS and iOS
I noticed LLVM accepts `ios` as its own OS in platform triples; a
recent change as far as I know. I see it also accepts `macos*` for macOS
(formerly OS X). If it's now customary to distinguish iOS like so
(rather than guessing from the aarch, lets add both so our OSes are
still disjoint, and make Darwin a family instead.

But changing the config everywhere would probably be a mass rebuild, and
I'm not sure how well other software supports OSes besides "darwin", so
I'm keeping that the default name for macOS for now.
2018-03-19 12:02:49 -04:00
Moritz Küttel
d17e6f2c3e add the CPAL-1.0 license
The 'Common Public Attribution License 1.0' is used
for projectlibre and required for packaging it into nixpkgs.
2018-03-18 19:30:50 +00:00
John Ericson
2fa2197a96
Merge pull request #34444 from obsidiansystems/meta-check
lib: Fix #30902
2018-03-18 13:51:03 -04:00
John Ericson
c26252af3e lib, stdenv: Check meta.platforms against host platform and be open world
First, we need check against the host platform, not the build platform.
That's simple enough.

Second, we move away from exahustive finite case analysis (i.e.
exhaustively listing all platforms the package builds on). That only
work in a closed-world setting, where we know all platforms we might
build one. But with cross compilation, we may be building for arbitrary
platforms, So we need fancier filters. This is the closed world to open
world change.

The solution is instead of having a list of systems (strings in the form
"foo-bar"), we have a list of of systems or "patterns", i.e. attributes
that partially match the output of the parsers in `lib.systems.parse`.
The "check meta" logic treats the systems strings as an exact whitelist
just as before, but treats the patterns as a fuzzy whitelist,
intersecting the actual `hostPlatform` with the pattern and then
checking for equality. (This is done using `matchAttrs`).

The default convenience lists for `meta.platforms` are now changed to be
lists of patterns (usually a single pattern) in
`lib/systems/for-meta.nix` for maximum flexibility under this new
system.

Fixes #30902
2018-03-15 00:44:34 -04:00
John Ericson
2e87550ace
Merge pull request #36985 from obsidiansystems/no-allBut
treewide: get rid of platforms.allBut
2018-03-14 18:57:28 -04:00
John Ericson
f79f80dbf2 treewide: get rid of platforms.allBut
Negative reasoning like `allBut` is a bad idea with an open world of
platforms. Concretely, if we add a new, quite different sort of
platform, existing packages with `allBut` will claim they work on it
even though they probably won't.
2018-03-14 18:44:42 -04:00