A modern, delicious implementation of the Nix package manager, focused on correctness, usability, and growth — and committed to doing right by its community
Find a file
aszlig 0ad643ed5c
libexpr: Use int64_t for NixInt
Using a 64bit integer on 32bit systems will come with a bit of a
performance overhead, but given that Nix doesn't use a lot of integers
compared to other types, I think the overhead is negligible also
considering that 32bit systems are in decline.

The biggest advantage however is that when we use a consistent integer
size across all platforms it's less likely that we miss things that we
break due to that. One example would be:

https://github.com/NixOS/nixpkgs/pull/44233

On Hydra it will evaluate, because the evaluator runs on a 64bit
machine, but when evaluating the same on a 32bit machine it will fail,
so using 64bit integers should make that consistent.

While the change of the type in value.hh is rather easy to do, we have a
few more options available for doing the conversion in the lexer:

  * Via an #ifdef on the architecture and using strtol() or strtoll()
    accordingly depending on which architecture we are. For the #ifdef
    we would need another AX_COMPILE_CHECK_SIZEOF in configure.ac.
  * Using istringstream, which would involve copying the value.
  * As we're already using boost, lexical_cast might be a good idea.

Spoiler: I went for the latter, first of all because lexical_cast does
have an overload for const char* and second of all, because it doesn't
involve copying around the input string. Also, because istringstream
seems to come with a bigger overhead than boost::lexical_cast:

https://www.boost.org/doc/libs/release/doc/html/boost_lexical_cast/performance.html

The first method (still using strtol/strtoll) also wasn't something I
pursued further, because it is also locale-aware which I doubt is what
we want, given that the regex for int is [0-9]+.

Signed-off-by: aszlig <aszlig@nix.build>
Fixes: #2339
2018-08-29 01:05:52 +02:00
.github
config update config/config.{sub,guess} 2018-08-13 20:00:17 +00:00
corepkgs Make <nix/buildenv.nix> a builtin builder 2018-03-20 17:28:09 +01:00
doc/manual 2.1 release notes: Add note about s3-compatible stores 2018-08-03 11:09:31 -04:00
maintainers upload-release.pl: Copy the install script and sign everything 2018-05-31 11:58:10 +02:00
misc docker: move the docker file to https://github.com/NixOS/docker 2018-06-21 19:13:04 +02:00
mk Fix missing $DESTDIR when installing programs 2018-04-08 18:22:10 -07:00
perl Modularize config settings 2018-05-30 13:28:01 +02:00
scripts release.nix: Generate the installer script 2018-05-30 17:40:08 +02:00
src libexpr: Use int64_t for NixInt 2018-08-29 01:05:52 +02:00
tests FIx floating point evaluation 2018-08-19 11:59:49 +02:00
.dir-locals.el
.editorconfig
.gitignore Make <nix/buildenv.nix> a builtin builder 2018-03-20 17:28:09 +01:00
.travis.yml
bootstrap.sh
configure.ac Drop all references to --disable-init-state 2018-08-20 01:51:23 +03:00
COPYING
local.mk
Makefile Merge pull request #1997 from dtzWill/fix/cxx14-std-consistency 2018-03-20 18:29:05 +01:00
Makefile.config.in Require libbrotli 2018-08-06 14:06:54 +02:00
nix.spec.in Attempt to fix the RPM build 2018-07-31 14:03:19 +02:00
README.md
release-common.nix Drop all references to --disable-init-state 2018-08-20 01:51:23 +03:00
release.nix Merge pull request #2368 from dezgeg/drop-dead-code 2018-08-22 21:32:49 +02:00
shell.nix
version bump version to 2.1 2018-04-10 22:58:25 +02:00

Nix, the purely functional package manager

Nix is a new take on package management that is fairly unique. Because of its purity aspects, a lot of issues found in traditional package managers don't appear with Nix.

To find out more about the tool, usage and installation instructions, please read the manual, which is available on the Nix website at http://nixos.org/nix/manual.

Contributing

Take a look at the Hacking Section of the manual. It helps you to get started with building Nix from source.

License

Nix is released under the LGPL v2.1

This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit.