Skip to content

Detect and/or reject case collisions #119

Closed

Description

@edolstra

Systems like Mac OS X use case-insensitive filesystems by default, so bad things happen when trying to import a closure that contains file names that only differ in case. For example, linux-headers contains files named ipt_ttl.h and ipt_TTL.h. This is a problem e.g. if you want to deploy Linux systems using NixOps from a Mac.

So maybe Nix should detect and warn about name collisions, and maybe even reject them.

Actual name collisions are rare. E.g. on my system:

$ find $(nix-store -qR /run/current-system) | uniq -Di
/nix/store/i99lwxcjhkycy71qj8dj2v7kkm4bjshl-linux-headers-3.7.1/include/linux/netfilter_ipv4/ipt_TTL.h
/nix/store/i99lwxcjhkycy71qj8dj2v7kkm4bjshl-linux-headers-3.7.1/include/linux/netfilter_ipv4/ipt_ttl.h
/nix/store/phpgw96cjvpmy2kjzjbd2rmnn6bsr6cc-iptables-1.4.16.2/lib/xtables/libxt_SET.so
/nix/store/phpgw96cjvpmy2kjzjbd2rmnn6bsr6cc-iptables-1.4.16.2/lib/xtables/libxt_set.so
/nix/store/ml128hlikbl14q4cwviafpaskskx1a3f-ncurses-5.9/share/terminfo/2/2621A
/nix/store/ml128hlikbl14q4cwviafpaskskx1a3f-ncurses-5.9/share/terminfo/2/2621a
/nix/store/1brk5lrxd56cnzn6dkp8c2fnkdh0rlnm-linux-3.9.2/lib/modules/3.9.2/build/include/uapi/linux/netfilter_ipv4/ipt_TTL.h
/nix/store/1brk5lrxd56cnzn6dkp8c2fnkdh0rlnm-linux-3.9.2/lib/modules/3.9.2/build/include/uapi/linux/netfilter_ipv4/ipt_ttl.h
/nix/store/8kjd7d1yk9j0vbxnlp6f729klxl9n1ga-linux-headers-3.7.1/include/linux/netfilter_ipv4/ipt_TTL.h
/nix/store/8kjd7d1yk9j0vbxnlp6f729klxl9n1ga-linux-headers-3.7.1/include/linux/netfilter_ipv4/ipt_ttl.h

The two ncurses files are identical (and probably not very useful anymore), but the iptables collisions seem trickier.

Activity

  1. mor1 commented on Jun 27, 2013

    @mor1

    fwiw the first that fails for me due to a file already existing when installing nixops is

    /nix/store/mcj4y7986mkb88hf8shwb7dr951n90i1-linux-headers-3.7.1/include/linux/netfilter/xt_connmark.h
    
  2. added a commit that references this issue on Jan 1, 2024
  3. added a commit that references this issue on Jul 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions