wasm-deps.sh error during docker build #887

Abierta
abierta hace 3 años por pwFoo · 11 comentarios
pwFoo comentado hace 3 años

Hi,
found that error during docker build. Maybe isn't really a problem, but should be solved?

./script/wasm-deps.sh: line 19: python: command not found
Detected arch: 
./script/wasm-deps.sh: line 23: [: too many arguments

Looks like just missing python and works fine for amd64 / x86_64.

You need to install python inside of the dockerfile?

Hi, found that error during docker build. Maybe isn't really a problem, but should be solved? ``` ./script/wasm-deps.sh: line 19: python: command not found Detected arch: ./script/wasm-deps.sh: line 23: [: too many arguments ``` Looks like just missing python and works fine for amd64 / x86_64. You need to install python inside of the dockerfile?
Propietario

Did the error occured in musl image? If so, I guess Debian image includes Python by default, though I didn't run script actually. If not, I need to investigate.

Did the error occured in musl image? If so, I guess Debian image includes Python by default, though I didn't run script actually. If not, I need to investigate.
pwFoo comentado hace 3 años
Autor

Wouldn't it be possible to remove the python dependecy to detect os arch?

Wouldn't it be possible to remove the python dependecy to detect os arch?
Propietario

It's possible. In fact it's better!

It's possible. In fact it's better!
pwFoo comentado hace 3 años
Autor

Should be possible by /proc/cpuinfo, lshw, uname -m

Maybe uname -m (type) and uname -p (processor) would be fine? Haven't tested it with other types than x86_64...

Should be possible by `/proc/cpuinfo`, `lshw`, `uname -m` * https://trisquel.info/en/forum/there-simple-command-find-out-your-architecture * https://stackoverflow.com/questions/48678152/how-to-detect-386-amd64-arm-or-arm64-os-architecture-via-shell-bash Maybe **uname -m (type)** and **uname -p (processor)** would be fine? Haven't tested it with other types than x86_64...
Propietario

I'm not familiar with CPU archtectures but I think it's okay if it is equivalent to what Python's platform module does. I will see the module when I have time, although it will be far from now...

I'm not familiar with CPU archtectures but I think it's okay if it is equivalent to what Python's `platform` module does. I will see the module when I have time, although it will be far from now...
Propietario
Note: * Python documentation: https://docs.python.org/3/library/platform.html * Source code: https://github.com/python/cpython/blob/3.9/Lib/platform.py
pwFoo comentado hace 3 años
Autor

Can't test with other hardware...

uname -m
x86_64

or lscpu

lscpu 
Architektur:                     x86_64
CPU Operationsmodus:             32-bit, 64-bit
Byte-Reihenfolge:                Little Endian
Adressgrößen:                    36 bits physical, 48 bits virtual
CPU(s):                          4
Liste der Online-CPU(s):         0-3
Thread(s) pro Kern:              2
Kern(e) pro Sockel:              2
Sockel:                          1
NUMA-Knoten:                     1
Anbieterkennung:                 GenuineIntel
Prozessorfamilie:                6
Modell:                          42
Modellname:                      Intel(R) Core(TM) i5-2410M CPU @ 2.30GHz
Stepping:                        7
CPU MHz:                         977.191
Maximale Taktfrequenz der CPU:   2900,0000
Minimale Taktfrequenz der CPU:   800,0000
BogoMIPS:                        4591.14
Virtualisierung:                 VT-x
L1d Cache:                       64 KiB
L1i Cache:                       64 KiB
L2 Cache:                        512 KiB
L3 Cache:                        3 MiB
NUMA-Knoten0 CPU(s):             0-3
Vulnerability Itlb multihit:     KVM: Mitigation: VMX disabled
Vulnerability L1tf:              Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
Vulnerability Mds:               Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Meltdown:          Mitigation; PTI
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:        Mitigation; Full generic retpoline, IBPB conditional, IBRS_FW, STIBP conditional, RSB filling
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Not affected
Markierungen:                    fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology non
                                 stop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm epb pti ssbd ibrs ibpb stibp tp
                                 r_shadow vnmi flexpriority ept vpid xsaveopt dtherm ida arat pln pts md_clear flush_l1d

https://www.cyberciti.biz/faq/linux-how-to-find-if-processor-is-64-bit-or-not/

dmidecode -t processor

# dmidecode 3.3
Getting SMBIOS data from sysfs.
SMBIOS 2.6 present.

Handle 0x0004, DMI type 4, 42 bytes
Processor Information
        Socket Designation: CPU 1
        Type: Central Processor
        Family: Core i5
        Manufacturer: Intel            
        ID: A7 06 02 00 FF FB EB BF
        Signature: Type 0, Family 6, Model 42, Stepping 7
        Flags:
                FPU (Floating-point unit on-chip)
                VME (Virtual mode extension)
                DE (Debugging extension)
                PSE (Page size extension)
                TSC (Time stamp counter)
                MSR (Model specific registers)
                PAE (Physical address extension)
                MCE (Machine check exception)
                CX8 (CMPXCHG8 instruction supported)
                APIC (On-chip APIC hardware supported)
                SEP (Fast system call)
                MTRR (Memory type range registers)
                PGE (Page global enable)
                MCA (Machine check architecture)
                CMOV (Conditional move instruction supported)
                PAT (Page attribute table)
                PSE-36 (36-bit page size extension)
                CLFSH (CLFLUSH instruction supported)
                DS (Debug store)
                ACPI (ACPI supported)
                MMX (MMX technology supported)
                FXSR (FXSAVE and FXSTOR instructions supported)
                SSE (Streaming SIMD extensions)
                SSE2 (Streaming SIMD extensions 2)
                SS (Self-snoop)
                HTT (Multi-threading)
                TM (Thermal monitor supported)
                PBE (Pending break enabled)
        Version: Intel(R) Core(TM) i5-2410M CPU @ 2.30GHz       
        Voltage: 1.1 V
        External Clock: 100 MHz
        Max Speed: 2300 MHz
        Current Speed: 2300 MHz
        Status: Populated, Enabled
        Upgrade: Other
        L1 Cache Handle: 0x0005
        L2 Cache Handle: 0x0006
        L3 Cache Handle: 0x0007
        Serial Number: To Be Filled By O.E.M.
        Asset Tag: To Be Filled By O.E.M.
        Part Number: To Be Filled By O.E.M.
        Core Count: 2
        Core Enabled: 1
        Thread Count: 2
        Characteristics:
                64-bit capable
Can't test with other hardware... ``` uname -m x86_64 ``` or `lscpu` ``` lscpu Architektur: x86_64 CPU Operationsmodus: 32-bit, 64-bit Byte-Reihenfolge: Little Endian Adressgrößen: 36 bits physical, 48 bits virtual CPU(s): 4 Liste der Online-CPU(s): 0-3 Thread(s) pro Kern: 2 Kern(e) pro Sockel: 2 Sockel: 1 NUMA-Knoten: 1 Anbieterkennung: GenuineIntel Prozessorfamilie: 6 Modell: 42 Modellname: Intel(R) Core(TM) i5-2410M CPU @ 2.30GHz Stepping: 7 CPU MHz: 977.191 Maximale Taktfrequenz der CPU: 2900,0000 Minimale Taktfrequenz der CPU: 800,0000 BogoMIPS: 4591.14 Virtualisierung: VT-x L1d Cache: 64 KiB L1i Cache: 64 KiB L2 Cache: 512 KiB L3 Cache: 3 MiB NUMA-Knoten0 CPU(s): 0-3 Vulnerability Itlb multihit: KVM: Mitigation: VMX disabled Vulnerability L1tf: Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable Vulnerability Mds: Mitigation; Clear CPU buffers; SMT vulnerable Vulnerability Meltdown: Mitigation; PTI Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization Vulnerability Spectre v2: Mitigation; Full generic retpoline, IBPB conditional, IBRS_FW, STIBP conditional, RSB filling Vulnerability Srbds: Not affected Vulnerability Tsx async abort: Not affected Markierungen: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology non stop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm epb pti ssbd ibrs ibpb stibp tp r_shadow vnmi flexpriority ept vpid xsaveopt dtherm ida arat pln pts md_clear flush_l1d ``` https://www.cyberciti.biz/faq/linux-how-to-find-if-processor-is-64-bit-or-not/ **dmidecode -t processor** ``` # dmidecode 3.3 Getting SMBIOS data from sysfs. SMBIOS 2.6 present. Handle 0x0004, DMI type 4, 42 bytes Processor Information Socket Designation: CPU 1 Type: Central Processor Family: Core i5 Manufacturer: Intel ID: A7 06 02 00 FF FB EB BF Signature: Type 0, Family 6, Model 42, Stepping 7 Flags: FPU (Floating-point unit on-chip) VME (Virtual mode extension) DE (Debugging extension) PSE (Page size extension) TSC (Time stamp counter) MSR (Model specific registers) PAE (Physical address extension) MCE (Machine check exception) CX8 (CMPXCHG8 instruction supported) APIC (On-chip APIC hardware supported) SEP (Fast system call) MTRR (Memory type range registers) PGE (Page global enable) MCA (Machine check architecture) CMOV (Conditional move instruction supported) PAT (Page attribute table) PSE-36 (36-bit page size extension) CLFSH (CLFLUSH instruction supported) DS (Debug store) ACPI (ACPI supported) MMX (MMX technology supported) FXSR (FXSAVE and FXSTOR instructions supported) SSE (Streaming SIMD extensions) SSE2 (Streaming SIMD extensions 2) SS (Self-snoop) HTT (Multi-threading) TM (Thermal monitor supported) PBE (Pending break enabled) Version: Intel(R) Core(TM) i5-2410M CPU @ 2.30GHz Voltage: 1.1 V External Clock: 100 MHz Max Speed: 2300 MHz Current Speed: 2300 MHz Status: Populated, Enabled Upgrade: Other L1 Cache Handle: 0x0005 L2 Cache Handle: 0x0006 L3 Cache Handle: 0x0007 Serial Number: To Be Filled By O.E.M. Asset Tag: To Be Filled By O.E.M. Part Number: To Be Filled By O.E.M. Core Count: 2 Core Enabled: 1 Thread Count: 2 Characteristics: 64-bit capable ```
pwFoo comentado hace 3 años
Autor

Maybe uname do the job?

~$ uname -m
x86_64

~$ uname -i
unknown

~$ uname -p
unknown

With my VM I get "unkown" for platform / processor, but maybe it works for arm and other types?

I'm surprised no one suggested uname -m. On my laptop, this gives armv7l, while uname -a gives me a monstrous 2 lines of text.

https://stackoverflow.com/a/31862755/3470092

Maybe uname do the job? ``` ~$ uname -m x86_64 ~$ uname -i unknown ~$ uname -p unknown ``` With my VM I get "unkown" for platform / processor, but maybe it works for arm and other types? > I'm surprised no one suggested uname -m. On my laptop, this gives armv7l, while uname -a gives me a monstrous 2 lines of text. https://stackoverflow.com/a/31862755/3470092
pwFoo comentado hace 3 años
Autor

Could that related to my error in web developer console?
First time a see a rust error in frontend, I still believe frontend errors have to be javascript... g

Error loading Rust wasm module 'plume_front': RuntimeError: unreachable
    at __rust_start_panic (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[5155]:0x156c47)
    at rust_panic (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[5150]:0x156a78)
    at _ZN3std9panicking20rust_panic_with_hook17hf5363eb24858966cE (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[5143]:0x15673d)
    at _ZN3std9panicking19begin_panic_handler28_$u7b$$u7b$closure$u7d$$u7d$17h99134a023967300aE (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[5130]:0x156180)
    at _ZN3std10sys_common9backtrace26__rust_end_short_backtrace17he43b85e8fd3a20a9E (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[5129]:0x1560ff)
    at rust_begin_unwind (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[5142]:0x15663a)
    at _ZN4core9panicking9panic_fmt17h125c8438143be5c3E (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[5217]:0x1582c9)
    at _ZN4core9panicking5panic17heade1ff345fea9eeE (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[5211]:0x157632)
    at _ZN154_$LT$stdweb..webcore..serialization..SerializedValue$u20$as$u20$core..convert..From$LT$stdweb..webcore..serialization..SerializedUntaggedReference$GT$$GT$4from17h80b0a2c815390be4E (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[4428]:0x12f27a)
    at _ZN50_$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$4into17ha56011f5f98fbe30E (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[4427]:0x12f1db)
plume-front.wasm:0x156c47 Uncaught (in promise) RuntimeError: unreachable
    at __rust_start_panic (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[5155]:0x156c47)
    at rust_panic (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[5150]:0x156a78)
    at _ZN3std9panicking20rust_panic_with_hook17hf5363eb24858966cE (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[5143]:0x15673d)
    at _ZN3std9panicking19begin_panic_handler28_$u7b$$u7b$closure$u7d$$u7d$17h99134a023967300aE (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[5130]:0x156180)
    at _ZN3std10sys_common9backtrace26__rust_end_short_backtrace17he43b85e8fd3a20a9E (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[5129]:0x1560ff)
    at rust_begin_unwind (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[5142]:0x15663a)
    at _ZN4core9panicking9panic_fmt17h125c8438143be5c3E (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[5217]:0x1582c9)
    at _ZN4core9panicking5panic17heade1ff345fea9eeE (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[5211]:0x157632)
    at _ZN154_$LT$stdweb..webcore..serialization..SerializedValue$u20$as$u20$core..convert..From$LT$stdweb..webcore..serialization..SerializedUntaggedReference$GT$$GT$4from17h80b0a2c815390be4E (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[4428]:0x12f27a)
    at _ZN50_$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$4into17ha56011f5f98fbe30E (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[4427]:0x12f1db)
Could that related to my error in web developer console? First time a see a rust error in frontend, I still believe frontend errors have to be javascript... *g* ``` Error loading Rust wasm module 'plume_front': RuntimeError: unreachable at __rust_start_panic (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[5155]:0x156c47) at rust_panic (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[5150]:0x156a78) at _ZN3std9panicking20rust_panic_with_hook17hf5363eb24858966cE (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[5143]:0x15673d) at _ZN3std9panicking19begin_panic_handler28_$u7b$$u7b$closure$u7d$$u7d$17h99134a023967300aE (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[5130]:0x156180) at _ZN3std10sys_common9backtrace26__rust_end_short_backtrace17he43b85e8fd3a20a9E (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[5129]:0x1560ff) at rust_begin_unwind (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[5142]:0x15663a) at _ZN4core9panicking9panic_fmt17h125c8438143be5c3E (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[5217]:0x1582c9) at _ZN4core9panicking5panic17heade1ff345fea9eeE (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[5211]:0x157632) at _ZN154_$LT$stdweb..webcore..serialization..SerializedValue$u20$as$u20$core..convert..From$LT$stdweb..webcore..serialization..SerializedUntaggedReference$GT$$GT$4from17h80b0a2c815390be4E (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[4428]:0x12f27a) at _ZN50_$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$4into17ha56011f5f98fbe30E (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[4427]:0x12f1db) plume-front.wasm:0x156c47 Uncaught (in promise) RuntimeError: unreachable at __rust_start_panic (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[5155]:0x156c47) at rust_panic (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[5150]:0x156a78) at _ZN3std9panicking20rust_panic_with_hook17hf5363eb24858966cE (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[5143]:0x15673d) at _ZN3std9panicking19begin_panic_handler28_$u7b$$u7b$closure$u7d$$u7d$17h99134a023967300aE (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[5130]:0x156180) at _ZN3std10sys_common9backtrace26__rust_end_short_backtrace17he43b85e8fd3a20a9E (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[5129]:0x1560ff) at rust_begin_unwind (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[5142]:0x15663a) at _ZN4core9panicking9panic_fmt17h125c8438143be5c3E (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[5217]:0x1582c9) at _ZN4core9panicking5panic17heade1ff345fea9eeE (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[5211]:0x157632) at _ZN154_$LT$stdweb..webcore..serialization..SerializedValue$u20$as$u20$core..convert..From$LT$stdweb..webcore..serialization..SerializedUntaggedReference$GT$$GT$4from17h80b0a2c815390be4E (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[4428]:0x12f27a) at _ZN50_$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$4into17ha56011f5f98fbe30E (https://example.com/static/cached/b5ad6c82/plume-front.wasm:wasm-function[4427]:0x12f1db) ```
pwFoo comentado hace 3 años
Autor

Easiest way with amd64 architecture was dpkg --print-architecture:

++ dpkg --print-architecture
+ ARCH=amd64
+ echo 'Detected arch: amd64'
Detected arch: amd64
+ '[' amd64 == aarch64 -o amd64 == armv71 ']'```


Just replaced the python part with:

ARCH=$(dpkg --print-architecture)


But need to be tested with other arch like armv71, aarch64, ...
Easiest way with amd64 architecture was `dpkg --print-architecture`: ```# bash -x ./script/wasm-deps.sh ++ dpkg --print-architecture + ARCH=amd64 + echo 'Detected arch: amd64' Detected arch: amd64 + '[' amd64 == aarch64 -o amd64 == armv71 ']'``` Just replaced the python part with: ``` ARCH=$(dpkg --print-architecture) ``` But need to be tested with other arch like armv71, aarch64, ...
pwFoo comentado hace 3 años
Autor

I test the easiest shell replacement on debian based systems.

dpkg --print-architecture

https://stackoverflow.com/a/65535310/3470092

Quick and dirty replacement inside of my Dockerfile removes the python dependency for amd64:

RUN     sed -i '/^ARCH/,/^EOF/d' script/plume-front.sh 
RUN     sed -i 's/^)$/ARCH=\$(dpkg --print-architecture)/' script/plume-front.sh

RUN     sed -i '/^ARCH/,/^EOF/d' script/wasm-deps.sh
RUN     sed -i 's/^)$/ARCH=\$(dpkg --print-architecture)/' script/wasm-deps.sh

Need to be tested with other arch systems...

I test the easiest shell replacement on debian based systems. ``` dpkg --print-architecture ``` https://stackoverflow.com/a/65535310/3470092 Quick and dirty replacement inside of my Dockerfile removes the python dependency for `amd64`: ``` RUN sed -i '/^ARCH/,/^EOF/d' script/plume-front.sh RUN sed -i 's/^)$/ARCH=\$(dpkg --print-architecture)/' script/plume-front.sh RUN sed -i '/^ARCH/,/^EOF/d' script/wasm-deps.sh RUN sed -i 's/^)$/ARCH=\$(dpkg --print-architecture)/' script/wasm-deps.sh ``` Need to be tested with other arch systems...
Inicie sesión para unirse a esta conversación.
Sin Milestone
No asignados
2 participantes
Notificaciones
Fecha de vencimiento
La fecha de vencimiento es inválida o está fuera de rango. Por favor utilice el formato 'aaaa-mm-dd'.

Sin fecha de vencimiento.

Dependencias

No se han establecido dependencias.

Referencia: Plume/Plume#887
Cargando…
Aún no existe contenido.