Skip to content

packages using Kino.JS built using deps_nix fail with a permissions error #21

@codyps

Description

@codyps

Hi, I have a project I'm trying to use deps_nix to build. I've run into a case where kino_db, kino_slack, kino_vega_lite attempt to create a directory via expanding Kino.JS.__before_compile/1 and get a permissions denied error:

kino_db, on macos:

 nix log /nix/store/bl2snsz17c5b1dp18qkmjz90m5gnsimi-kino_db-0.3.0.drv | 
cat
Running phase: unpackPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking source archive /nix/store/9x5nkyaiaaas3ghc5iajx006ri89qc25-kino_db-0.3.0
source root is kino_db-0.3.0
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: configurePhase
@nix { "action": "setPhase", "phase": "configurePhase" }
Running phase: buildPhase
@nix { "action": "setPhase", "phase": "buildPhase" }
Compiling 4 files (.ex)

== Compilation error in file lib/kino_db/sql_cell.ex ==
** (File.Error) could not make directory (with -p) "/private/tmp/nix-build-kino_db-0.3.0.drv-0/kino_db-0.3.0/_build/prod/lib/kino/priv/assets/KinoDB_SQLCell": permission denied
    (elixir 1.18.4) lib/file.ex:346: File.mkdir_p!/1
    (kino 0.14.2) expanding macro: Kino.JS.__before_compile__/1
    lib/kino_db/sql_cell.ex:1: KinoDB.SQLCell (module)

kino_vega_lite, on linux:

 nix log /nix/store/ci2kn2lwsknhm85g2z794nh3562jcccg-kino_vega_lite-0.1.13.drv | cat
Running phase: unpackPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking source archive /nix/store/85fn43fmps0qy08crq453v1hry1blrjl-kino_vega_lite-0.1.13
source root is kino_vega_lite-0.1.13
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: configurePhase
@nix { "action": "setPhase", "phase": "configurePhase" }
Running phase: buildPhase
@nix { "action": "setPhase", "phase": "buildPhase" }
Compiling 4 files (.ex)

== Compilation error in file lib/kino/vega_lite.ex ==
** (File.Error) could not make directory (with -p) "/build/kino_vega_lite-0.1.13/_build/prod/lib/kino/priv/assets/Kino_VegaLite": permission denied
    (elixir 1.18.4) lib/file.ex:346: File.mkdir_p!/1
    (kino 0.14.2) expanding macro: Kino.JS.__before_compile__/1
    lib/kino/vega_lite.ex:1: Kino.VegaLite (module)

It appears the permissions issue here is that it's trying to write into a shared asserts directory under the kino dependency from within the kino_vega_lite (or other Kino.JS using) dependency. The directory _build/prod/lib/kino is actually symlinks to the nix store though (built when we build the kino package itself), so kino_vega_lite's build can't write to them and thus gets the permissions error.

I'm not 100% sure what Kino.JS intends to happen here, or it's architecture, but I'm curious if other folks have ideas about how I might workaround this issue.

Perhaps changing Kino.JS to use another directory in some way might work? Thanks.

Edit: for now I've dropped these dependencies, but I'd be interested in what tricks folks know of that might get them working with deps_nix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions