Well, this was as painful as expected.
Introducing a proper autotool-based tracy build. I don't think this is
the right approach, but hey, it works.
Tracy is not distributing any pkg-config file, so we had to fallback
to a more "manual" method to propagate the headers path. Instead of
having a plain enable/disable flag, we send the path to the tracy
/public subfolder (~= $out in the Tracy Nix derivation).
The flake Nixpkgs is currently pointing to 23.05. The tracy derivation
was only building the visualizer, not the client library back then. We
introduce a 23.11 Nixpkgs and build its Tracy derivation with the
23.05 toolchain to go around some glibc ABI incompatibilities.
Kudos to Mic92 for the help for the flake bit.
Co-authored-by: Jörg Thalheim <joerg@thalheim.io>
Tracing the primops with Tracy as well. Not sure it really worth the
overhead, but we still can revisit this decision later if we realize
primops are not that important perf-wise.
We're leveraging the ZoneTransientN macro to send dynamic strings
containing the expression type, file and position in that file of the
expression Nix is currently evaluating.
We had to add a new showExprType method to the Expr class to get a
const string containing the name of an expression.
This is a first quick-and-dirty way to get the tracy integration up
and running without losing my sanity trying to bend the autotools
setup to work with it.
Introducing a tracy submodule, injecting the required headers from
here, building the TracyClient.cpp file to get the actual tracy client
library.
Some tools which consume the "nix print-dev-env" rc script (such as
"nix-direnv") are sensitive to the use of unbound variables. They use
"set -u".
The "nix print-dev-env" rc script initially unsets "shellHook", then
loads variables from the derivation, and then evaluates "shellHook".
However, most derivations don't have a "shellHook" attribute.
So users get the error "shellHook: unbound variable". This can be
demonstrated with the command:
nix print-dev-env nixpkgs#hello | bash -u
This commit changes the rc script to provide an empty fallback value
for the "shellHook" variable.
Closes: #7951#8253
It is entirely possible for the path to be an empty string and many
unit tests actually pass it as an empty string (e.g. both_roundrip or
turnsEmptyPathIntoCWD). In this case, without this patch, absPath will
perform a one-byte out-of-bounds access.
This was discovered while enabling the nix test suite on Alpine where
we compile all software with `-D_GLIBCXX_ASSERTIONS=1`, thus resulting
in a test failure on Alpine.
As discussed in the maintainer meeting on 2024-01-29.
Mainly this is to avoid a situation where the name is parsed and
treated as a file name, mostly to protect users.
.-* and ..-* are also considered invalid because they might strip
on that separator to remove versions. Doesn't really work, but that's
what we decided, and I won't argue with it, because .-* probably
doesn't seem to have a real world application anyway.
We do still permit a 1-character name that's just "-", which still
poses a similar risk in such a situation. We can't start disallowing
trailing -, because a non-zero number of users will need it and we've
seen how annoying and painful such a change is.
What matters most is preventing a situation where . or .. can be
injected, and to just get this done.