Skip to content
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

Bug compiling using Agda when Unicode ⟨⟩ is in file system #172752

Open
guilhermehas opened this issue May 12, 2022 · 8 comments
Open

Bug compiling using Agda when Unicode ⟨⟩ is in file system #172752

guilhermehas opened this issue May 12, 2022 · 8 comments

Comments

@guilhermehas
Copy link
Contributor

guilhermehas commented May 12, 2022

Describe the bug

Agda can't compile files their names have Unicode ⟨⟩ on them.

Steps To Reproduce

Just run nix build in this file:

{
  description = "Agda bug";

  inputs.nixpkgs.url = github:NixOS/nixpkgs/nixos-21.11;

  outputs = { self, nixpkgs }:
    let system = "x86_64-linux";
        pkgs = import nixpkgs { inherit system; };
        unicode = "⟨⟩";
    in {
      defaultPackage.x86_64-linux = with pkgs;
        stdenv.mkDerivation {
          name = "Agda-bug";
          src = ./.;
          buildInputs = [ agda ];
          buildPhase = ''
            cat >> Everything.agda <<EOF
            import ${unicode}
            EOF
            touch ${unicode}.agda
            ls
            cat Everything.agda
            agda Everything.agda
          '';
          installPhase = ''touch $out && cat Everything.agda >> $out && ls >> $out'';
        };
    };
}

Expected behavior

It should compile like in this file:
https://github.com/agda/cubical/blob/master/Cubical/Syntax/%E2%9F%A8%E2%9F%A9.agda

Notify maintainers

@abbradar @Ericson2314 @turion @alexarice @neosimsim @Fuuzetsu @zimbatm @AndersonTorres @roberth @TilCreator @globin

[user@system:~]$ nix build
error: builder for '/nix/store/hqqf7c9lkjs0ip9ps1rd86i6xjc1bmxw-Agda-bug.drv' failed with exit code 42;
       last 10 log lines:
       > source root is 0c6bpyd78b0pgy7hm869jwdwk5jhd9si-source
       > patching sources
       > configuring
       > no configure script, doing nothing
       > building
       >  Everything.agda   flake.lock   flake.nix  ''$'\342\237\250\342\237\251''.agda'
       > import ⟨⟩
       > Checking Everything (/build/0c6bpyd78b0pgy7hm869jwdwk5jhd9si-source/Everything.agda).
       > /build/0c6bpyd78b0pgy7hm869jwdwk5jhd9si-source/Everything.agda:1,1-10
       > Failed to find source of module
       For full logs, run 'nix log /nix/store/hqqf7c9lkjs0ip9ps1rd86i6xjc1bmxw-Agda-bug.drv'.
@alexarice
Copy link
Contributor

Does this compile on a non nix agda?

@guilhermehas
Copy link
Contributor Author

Does this compile on a non nix agda?

It compiles like in this file:
https://github.com/agda/cubical/blob/master/Cubical/Syntax/%E2%9F%A8%E2%9F%A9.agda

@ncfavier
Copy link
Member

ncfavier commented May 12, 2022

Fix: export LANG=C.UTF-8. I wonder if that should be done by default somewhere.

@guilhermehas
Copy link
Contributor Author

Fix: export LANG=C.UTF-8. I wonder if that should be done by default somewhere.

It worked here, but I will let it open because it is already not fixed in Agda or in something inside nixpkgs (such as mkDerivation).

@alexarice
Copy link
Contributor

Out of interest, we already have this flag set for the cubical derivation


Perhaps it should be default for agda, would there be any downside to this?

@ncfavier
Copy link
Member

Opened agda/agda#5903

@AndersonTorres
Copy link
Member

Related: agda/agda#4678

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Nov 12, 2022
@iblech
Copy link
Contributor

iblech commented Jan 31, 2023

Perhaps it should be default for agda, would there be any downside to this?

I agree and will prepare a pull request. This comes up when updating to Agda 2.6.3, the stdlib doesn't compile without it.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jan 31, 2023
@iblech iblech mentioned this issue Feb 1, 2023
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants