Skip to content

use-case-hack is a property of a store, not a global setting (except for libnixfile-level commands) #9318

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
roberth opened this issue Nov 7, 2023 · 3 comments
Labels
bug settings Settings, global flags, nix.conf store Issues and pull requests concerning the Nix store

Comments

@roberth
Copy link
Member

roberth commented Nov 7, 2023

Describe the bug

$ nix copy --from ~/tmp-store-normal --to ~/tmp-store-hacked?use-case-hack=true /nix/store/6hypxafvp2fcadphppjcxszx0qcahqbz-dummy
warning: unknown setting 'use-case-hack'

I shouldn't have to apply the case hack (unhack) to the --from store.

Steps To Reproduce

See above.

Expected behavior

nix-env --version output

Additional context

Priorities

Add 👍 to issues you find important.

@roberth roberth added bug macos Nix on macOS, aka OS X, aka darwin settings Settings, global flags, nix.conf labels Nov 7, 2023
@roberth roberth added store Issues and pull requests concerning the Nix store and removed macos Nix on macOS, aka OS X, aka darwin labels Nov 7, 2023
@edolstra
Copy link
Member

edolstra commented Nov 8, 2023

Do we even need the case hack anymore? IIRC it was added once upon a time to support NixOps on macOS, where we ran into Linux kernel headers having case conflicts.

Also, since our installer creates a volume for the Nix store these days, I guess we can just enable case sensitivity?

@roberth
Copy link
Member Author

roberth commented Nov 10, 2023

Having a case sensitive store on macOS sounds nice, but it's not free of side effects.

  • Build impurity: this difference will be observable in the sandbox, and outputs will differ.
  • It doesn't remove the problem, but rather moves it from the remote store <-> local store boundary to the local store <-> rest of system boundary, which seems like a larger surface area in practical use.

If we make such a change we better be sure that it's not a regression in terms of actual use, so I wouldn't block improvements to the case hack functionality on this decision. Note also that we'll have to support the case hack until everyone's had a good chance to migrate, and macOS doesn't have a monopoly on case insensitive file systems.

@j-baker
Copy link

j-baker commented Mar 3, 2024

I don't believe this hack can be removed. Among other things, the Nix installer on MacOS creates the Nix store on a case-insensitive volume.

bltavares added a commit to bltavares/nixpkgs-upstream that referenced this issue Mar 28, 2024
This commit backports a commit introduced on Perl 5.39.2 to allow
`pkgs.pkgsStatic.perl` to compile without raising errors about duplicate
symbols being defined during the linking process.

This fixes NixOS#295608

| Tested on | Status |
| --- | --- |
| M1 Mac (aarch64-darwin) | Failed due to other issues* |
| NixOS VM (x86_64-linux) | Compiled |
| Nix (aarch64-linux) | Compiled |

**Test method**:

```sh
nix repl -I nixpkgs=$PWD
nix repl> pkgs = import <nixpkgs> {}
nix repl> :b pkgs.perl
nix repl> :b pkgs.pkgsStatic.perl
```

Despite the upstream commit being scoped to all environments, we are only
applying this patch only on the `pkgsStatic` context to avoid rebuilding all of
NixOS packages by changing Perl.

It includes an additional build flag [also used upstream](Perl/perl5#22052)
for configuring static builds.

*MacOS: `pkgsStatic.perl` still fails to compile after this change due to MacOS
case-insensitiviness affecting the build recipe under /tmp, as
`perl-cross/configure` is copied over `perl/Configure` file, as well as not
finding `readelf` for the `configurePhase`.

NixOS#113985 (comment)
NixOS/nix#1446
NixOS/nix#9318
NixOS/nix#8995
bltavares added a commit to bltavares/nixpkgs-upstream that referenced this issue Apr 1, 2024
This commit backports a commit introduced on Perl 5.39.2 to allow
`pkgs.pkgsStatic.perl` to compile without raising errors about duplicate
symbols being defined during the linking process.

This fixes NixOS#295608

| Tested on | Status |
| --- | --- |
| M1 Mac (aarch64-darwin) | Failed due to other issues* |
| NixOS VM (x86_64-linux) | Compiled |
| Nix (aarch64-linux) | Compiled |

**Test method**:

```sh
nix repl -I nixpkgs=$PWD
nix repl> pkgs = import <nixpkgs> {}
nix repl> :b pkgs.perl
nix repl> :b pkgs.pkgsStatic.perl
```

Despite the upstream commit being scoped to all environments, we are only
applying this patch only on the `pkgsStatic` context to avoid rebuilding all of
NixOS packages by changing Perl.

It includes an additional build flag [also used upstream](Perl/perl5#22052)
for configuring static builds.

*MacOS: `pkgsStatic.perl` still fails to compile after this change due to MacOS
case-insensitiviness affecting the build recipe under /tmp, as
`perl-cross/configure` is copied over `perl/Configure` file, as well as not
finding `readelf` for the `configurePhase`.

NixOS#113985 (comment)
NixOS/nix#1446
NixOS/nix#9318
NixOS/nix#8995
@roberth roberth mentioned this issue Sep 20, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug settings Settings, global flags, nix.conf store Issues and pull requests concerning the Nix store
Projects
None yet
Development

No branches or pull requests

3 participants