ScenicFramework / scenic

Core Scenic library
Apache License 2.0
1.99k stars 137 forks source link

Dependencies not as documented (as far as I can find), additional libraries should be installed (ubuntu) #317

Open blasphemetheus opened 1 year ago

blasphemetheus commented 1 year ago

Checklist

Versions and Environment

Elixir:

# elixir -v
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [jit:ns]

Elixir 1.14.0 (compiled with Erlang/OTP 25)

Erlang:

# erl -v
Eshell V13.2.2  (abort with ^G)

Scenic:

# mix deps | grep scenic
 scenic (Hex package) (mix)
  locked at 0.11.1 (scenic) 86845290
* scenic_driver_local (Hex package) (mix)
  locked at 0.11.0 (scenic_driver_local) 77b27b82

OS:

$$$$$$ cat /etc/os-release
 PRETTY_NAME="Ubuntu 22.04.2 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.2 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian

$$$$$$$$ hostnamectl
 Static hostname: fv-az358-440
       Icon name: computer-vm
         Chassis: vm
      Machine ID: 980d79d44b294c72887e7b364dd74c3e
         Boot ID: cf81a7e83d0845728732475df3e9d731
  Virtualization: microsoft
Operating System: Ubuntu 22.04.2 LTS
          Kernel: Linux 5.15.0-1038-azure
    Architecture: x86-64
 Hardware Vendor: Microsoft Corporation
  Hardware Model: Virtual Machine

Steps to reproduce

Try to run the scenic new app and do mix scenic.run or mix deps.get && mix test. Do it on Ubuntu 22.04 LTSB.

Notice that the C library dependencies (I tried sudo apt-get install pkgconf libglfw3 libglfw3-dev libglew2.2 libglew-dev do not appear to work properly)

I also tried "libtommath1" because there was a reference to tommy in the error msg, but that didn't help.

Expected Behavior

The documented dependencies for scenic should compile on the current LTSB Ubuntu version. I'm not interested in downgrading an OS to run an app. I'd like to be able to use scenic. Apparently there are undocumented dependencies for scenic on Ubuntu. I also had trouble deploying to raspberry pi (older debian version), but I'm sure that's fixable by trying some combination of the documented old dependencies.

Oh actually, dependencies compiled with warnings. Then running scenic didn't work. Expected behavior is to apt-get documented C dependencies for all the reasonable versions in use, have a UI pop if doing mix scenic.run. Not error out.

==> scenic
mkdir -p /home/runner/work/gchess/gchess/_build/test/lib/scenic/ebin/../priv
mkdir -p /home/runner/work/gchess/gchess/_build/test/lib/scenic/ebin/../obj
cc -c -I/home/runner/work/_temp/.setup-beam/otp/usr/include -fPIC -o /home/runner/work/gchess/gchess/_build/test/lib/scenic/ebin/../obj/line.o c_src/line.c
cc /home/runner/work/gchess/gchess/_build/test/lib/scenic/ebin/../obj/line.o -L/home/runner/work/_temp/.setup-beam/otp/usr/lib -shared  -dynamiclib -o /home/runner/work/gchess/gchess/_build/test/lib/scenic/ebin/../priv/line.so
cc -c -I/home/runner/work/_temp/.setup-beam/otp/usr/include -fPIC -o /home/runner/work/gchess/gchess/_build/test/lib/scenic/ebin/../obj/matrix.o c_src/matrix.c
cc /home/runner/work/gchess/gchess/_build/test/lib/scenic/ebin/../obj/matrix.o -L/home/runner/work/_temp/.setup-beam/otp/usr/lib -shared  -dynamiclib -o /home/runner/work/gchess/gchess/_build/test/lib/scenic/ebin/../priv/matrix.so
cc -c -I/home/runner/work/_temp/.setup-beam/otp/usr/include -fPIC -o /home/runner/work/gchess/gchess/_build/test/lib/scenic/ebin/../obj/bitmap.o c_src/bitmap.c
cc /home/runner/work/gchess/gchess/_build/test/lib/scenic/ebin/../obj/bitmap.o -L/home/runner/work/_temp/.setup-beam/otp/usr/lib -shared  -dynamiclib -o /home/runner/work/gchess/gchess/_build/test/lib/scenic/ebin/../priv/bitmap.so
Compiling 84 files (.ex)
Generated scenic app
==> scenic_driver_local
Compiling 8 files (.ex)
warning: use Bitwise is deprecated. import Bitwise instead
Warning:   lib/to_port.ex:9: Scenic.Driver.Local.ToPort

Generated scenic_driver_local app
SCENIC_LOCAL_TARGET: glfw
mkdir -p /home/runner/work/gchess/gchess/_build/test/lib/scenic_driver_local/priv
cc -O3 -std=c99 `pkg-config --static --cflags glfw3 glew` -fPIC -o /home/runner/work/gchess/gchess/_build/test/lib/scenic_driver_local/priv/scenic_driver_local c_src/device/glfw.c c_src/main.c c_src/nanovg/nanovg.c c_src/comms.c c_src/unix_comms.c c_src/utils.c c_src/script.c c_src/image.c c_src/font.c c_src/tommyds/src/tommyhashlin.c c_src/tommyds/src/tommyhash.c `pkg-config --static --libs glfw3 glew` -lGL -lm -lrt
In file included from c_src/tommyds/src/tommyhash.h:35,
                 from c_src/tommyds/src/tommyhashlin.h:143,
                 from c_src/tommyds/src/tommyhashlin.c:28:
c_src/tommyds/src/tommyhashlin.c: In function ‘tommy_hashlin_done’:
c_src/tommyds/src/tommytypes.h:102:20: warning: ‘free’ called on pointer ‘*(tommy_hashlin_node ***)((char *)hashlin+ ivtmp*8)’ with nonzero offset [512, 17179869184] [-Wfree-nonheap-object]
  102 | #define tommy_free free
c_src/tommyds/src/tommyhashlin.c:82:17: note: in expansion of macro ‘tommy_free’
   82 |                 tommy_free(&segment[((tommy_ptrdiff_t)1) << i]);
      |                 ^~~~~~~~~~
==> genomeur
Compiling 46 files (.ex)
... 
...
Generated genomeur app

14:19:36.404 [info] Scenic.Driver.Local: start: [name: :local, key_map: Scenic.KeyMap.USEnglish, cursor: false, position: [orientation: :normal, centered: false, scaled: false], calibration: [], antialias: true, debug: false, opacity: 255, layer: 0, limit_ms: 29, window: [resizeable: false, title: "scene"], on_close: :stop_system], pid: #PID<0.3407.0>
scenic_driver_local error: "Unable to initialize GLFW"
scenic_driver_local puts: "Failed to initilize the device"

Error: 14:19:36.430 [error] scenic_driver_local: "Unable to initialize GLFW"

14:19:36.431 [info] scenic_driver_local: "Failed to initilize the device"

Error: 14:19:36.431 [error] Scenic.Driver.Local dirty close

Error: 14:19:36.461 [error] GenServer :local terminating
** (ArgumentError) argument error
    :erlang.port_command(#Port<0.13>, [<<64, 0, 0, 0>>, <<43, 0, 0, 0>>, <<80, 141, 0, 0>>, "85FMX5UxpxdyY8Vf7yilQ_3KKnUQxifa7Ejbll7DuyE", <<0, 1, 0, 0, 0, 18, 1, 0, 0, 4, 0, 32, 71, 68, 69, 70, 5, 141, 5, 188, 0, 0, 126, 12, 0, 0, 0, 100, 71, 80, 79, 83, 206, 15, 244, 169, 0, 0, 126, 112, 0, 0, 12, 228, 71, ...>>])
    (scenic_driver_local 0.11.0) lib/callbacks.ex:226: anonymous fn/3 in Scenic.Driver.Local.Calbacks.ensure_fonts/2
    (elixir 1.14.0) lib/enum.ex:2468: Enum."-reduce/3-lists^foldl/2-0-"/3
    (scenic_driver_local 0.11.0) lib/callbacks.ex:221: Scenic.Driver.Local.Calbacks.ensure_fonts/2
    (scenic_driver_local 0.11.0) lib/callbacks.ex:210: Scenic.Driver.Local.Calbacks.ensure_media/2
    (scenic_driver_local 0.11.0) lib/callbacks.ex:193: anonymous fn/4 in Scenic.Driver.Local.Calbacks.do_put_scripts/2
    (elixir 1.14.0) lib/enum.ex:2468: Enum."-reduce/3-lists^foldl/2-0-"/3
    (scenic_driver_local 0.11.0) lib/callbacks.ex:129: Scenic.Driver.Local.Calbacks.do_update_scene/2
    (scenic 0.11.1) lib/scenic/driver.ex:488: Scenic.Driver.do_update/1
    (scenic 0.11.1) lib/scenic/driver.ex:861: Scenic.Driver.do_gate_complete/1
    (stdlib 4.3.1) gen_server.erl:1123: :gen_server.try_dispatch/4
    (stdlib 4.3.1) gen_server.erl:1200: :gen_server.handle_msg/6
    (stdlib 4.3.1) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Last message: :_gate_complete_
State: %Scenic.Driver{viewport: %Scenic.ViewPort{name: :main_viewport, pid: #PID<0.3404.0>, script_table: #Reference<0.3431211653.1345191937.60076>, size: {950, 1600}}, pid: #PID<0.3407.0>, module: Scenic.Driver.Local, limit_ms: 29, dirty_ids: [["ZzZ4nHAaEyTe56zY4tYu0A"], ["tFJ9T1iEqTHsgQjJaSDwMw"], ["AlZ6nXgyOFayDOF--7EKxA"], ["ise7GBuxslY1uvaDJyDmFA"], ["75tuMbKZCf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: true, input_limited: false, input_buffer: %{}, busy: false, requested_inputs: [:cursor_button], assigns: %{auto_cursor: false, busy: true, calibration: [], closing: false, cursor: :touch_spot, cursor_pos: {0, 0}, cursor_showing: false, cursor_update: false, dirty_streams: [], input_debounce: [], input_state: %{}, inv_rel_tx: <<0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 63, 0, 0, 0, ...>>, inv_tx: <<0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 63, 0, 0, ...>>, key_map: Scenic.KeyMap.USEnglish, keys: %{}, last_cursor: nil, logical_size: {950, 1600}, mapper_state: nil, media: %{fonts: []}, on_close: :stop_system, port: #Port<0.13>, position: [orientation: :normal, centered: false, scaled: false], rel_tx: <<0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...>>, rel_x: 0, rel_y: 0, screen_factor: 1.0, tx: <<0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 0, 0, ...>>, window_size: {950, 1600}}, update_requested: true, update_ready: true, clear_color: {:color_rgba, {0, 0, 0, 255}}}

Actual Behavior

Stack Trace

cenic mkdir -p /home/runner/work/gchess/gchess/_build/test/lib/scenic/ebin/../priv mkdir -p /home/runner/work/gchess/gchess/_build/test/lib/scenic/ebin/../obj cc -c -I/home/runner/work/_temp/.setup-beam/otp/usr/include -fPIC -o /home/runner/work/gchess/gchess/_build/test/lib/scenic/ebin/../obj/line.o c_src/line.c cc /home/runner/work/gchess/gchess/_build/test/lib/scenic/ebin/../obj/line.o -L/home/runner/work/_temp/.setup-beam/otp/usr/lib -shared -dynamiclib -o /home/runner/work/gchess/gchess/_build/test/lib/scenic/ebin/../priv/line.so cc -c -I/home/runner/work/_temp/.setup-beam/otp/usr/include -fPIC -o /home/runner/work/gchess/gchess/_build/test/lib/scenic/ebin/../obj/matrix.o c_src/matrix.c cc /home/runner/work/gchess/gchess/_build/test/lib/scenic/ebin/../obj/matrix.o -L/home/runner/work/_temp/.setup-beam/otp/usr/lib -shared -dynamiclib -o /home/runner/work/gchess/gchess/_build/test/lib/scenic/ebin/../priv/matrix.so cc -c -I/home/runner/work/_temp/.setup-beam/otp/usr/include -fPIC -o /home/runner/work/gchess/gchess/_build/test/lib/scenic/ebin/../obj/bitmap.o c_src/bitmap.c cc /home/runner/work/gchess/gchess/_build/test/lib/scenic/ebin/../obj/bitmap.o -L/home/runner/work/_temp/.setup-beam/otp/usr/lib -shared -dynamiclib -o /home/runner/work/gchess/gchess/_build/test/lib/scenic/ebin/../priv/bitmap.so Compiling 84 files (.ex) Generated scenic app ==> scenic_driver_local Compiling 8 files (.ex) warning: use Bitwise is deprecated. import Bitwise instead Warning: lib/to_port.ex:9: Scenic.Driver.Local.ToPort

Generated scenic_driver_local app SCENIC_LOCAL_TARGET: glfw mkdir -p /home/runner/work/gchess/gchess/_build/test/lib/scenic_driver_local/priv cc -O3 -std=c99 pkg-config --static --cflags glfw3 glew -fPIC -o /home/runner/work/gchess/gchess/_build/test/lib/scenic_driver_local/priv/scenic_driver_local c_src/device/glfw.c c_src/main.c c_src/nanovg/nanovg.c c_src/comms.c c_src/unix_comms.c c_src/utils.c c_src/script.c c_src/image.c c_src/font.c c_src/tommyds/src/tommyhashlin.c c_src/tommyds/src/tommyhash.c pkg-config --static --libs glfw3 glew -lGL -lm -lrt In file included from c_src/tommyds/src/tommyhash.h:35, from c_src/tommyds/src/tommyhashlin.h:143, from c_src/tommyds/src/tommyhashlin.c:28: c_src/tommyds/src/tommyhashlin.c: In function ‘tommy_hashlin_done’: c_src/tommyds/src/tommytypes.h:102:20: warning: ‘free’ called on pointer ‘*(tommy_hashlin_node **)((char )hashlin+ ivtmp*8)’ with nonzero offset [512, 17179869184] [-Wfree-nonheap-object] 102 | #define tommy_free free c_src/tommyds/src/tommyhashlin.c:82:17: note: in expansion of macro ‘tommy_free’ 82 | tommy_free(&segment[((tommy_ptrdiff_t)1) << i]); | ^~~~~~ ==> genomeur Compiling 46 files (.ex)

```bash ```

Additional Comments

Scenic is Great. Just need documentation of it's out of elixir-scope dependencies. C Libraries I think. It's not useful if it break for opaque reasons on random OS's.

blasphemetheus commented 1 year ago

https://github.com/blasphemetheus/gchess/actions/runs/5148659826/jobs/9270657949

This is an example run of a github action using a yaml file (link to yaml file) https://github.com/blasphemetheus/gchess/blob/main/.github/workflows/elixir.yml

crertel commented 11 months ago

@blasphemetheus is this still an issue for you?