2xsaiko,
@2xsaiko@discuss.tchncs.de avatar

There’s two different ways of identifying a nix package: its attribute path in the package set, and the name it self-identifies as. Here’s an example where those differ, firefox-esr. Its attribute path is firefox-esr while the package name it reports is firefox.

It’s very fast to find a package by its attribute path since that’s essentially one or more map lookups. In contrary, the package name isn’t unique (for example, firefox and firefox-esr both have a package name of “firefox” because they are built from the same package file just with different sources) and also doesn’t have an index, so to find a package with a matching name you have to search through the entire package set and evaluate every package to get its name and check if it matches.

nix-env -i searches packages by their package name, which as a consequence makes it slow and also unreliable since you might not get the package you were looking for, but instead another with the same name. nix-env -iA somewhat fixes this by installing packages by their attribute path, but even if you use that you get the same issues with nix-env --upgrade since that always searches for packages to update by the installed packages’ names (it might even replace one package with a completely unrelated one which coincidentally has the same name!).

The new nix profile however stores the attribute paths a package was installed from so doesn’t have any of these problems.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • linux@lemmy.ml
  • localhost
  • All magazines
  • 200 @ entry_comment_voters
    HTTP status 200 OK
    Route name entry_comment_voters
    Has session yes
    Stateless Check no
    Time 980 ms
    Total time 980 ms
    Initialization time 237 ms
    Memory 12.0 MiB
    Peak memory usage 12.0 MiB
    PHP memory limit 128 MiB
    Logger 87
    Errors 0
    Warnings 0
    Deprecations 87
    Cache 26 in 188.77 ms
    Cache Calls 26
    Total time 188.77 ms
    Cache hits 31 / 38 (81.58%)
    Cache writes 2
    2
    Default locale en
    Missing messages 2
    Fallback messages 0
    Defined messages 118
    Security n/a
    Authenticated No
    Firewall name main
    Twig 296 ms
    Render Time 296 ms
    Template Calls 65
    Block Calls 16
    Macro Calls 6
    41 in 207 ms
    settings_row_switch 15
    user_settings_row_switch 4
    date 3
    user_inline 2
    settings_row_enum 2
    entry_comment 1
    date_edited 1
    user_avatar 1
    vote 1
    boost 1
    user_actions 1
    magazine_box 1
    magazine_sub 1
    related_magazines 1
    active_users 1
    related_categories 1
    related_posts 1
    related_entries 1
    support_us_block 1
    featured_magazines 1
    9 in 67.05 ms
    Database Queries 9
    Different statements 9
    Query time 67.05 ms
    Invalid entities 0
    Cache hits 23
    Cache misses 2
    Cache puts 2
    6.4.0
    Profiler token 33ec21
    Environment dev
    Debug enabled
    PHP version 8.2.26   View phpinfo()
    PHP Extensions Xdebug ✗ APCu ✓ OPcache ✓
    PHP SAPI apache2handler