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

[fs][nsfw] error starting on chromebook/termux #2085

Closed
jots opened this issue Jun 11, 2018 · 7 comments
Closed

[fs][nsfw] error starting on chromebook/termux #2085

jots opened this issue Jun 11, 2018 · 7 comments
Labels
chromebook issues related to the chromebook OS file-watchers issues related to filesystem watchers - nsfw question user / developer questions

Comments

@jots
Copy link

jots commented Jun 11, 2018

trying to run this in termux on chromebook and getting this error:

$ pwd
/data/data/com.termux/files/home/fromnet/theia/examples/browser
$ yarn run start
yarn run v1.7.0
$ theia start
Starting server worker...

Server worker has been started. [ID: 1 | PID: 8567]

/data/data/com.termux/files/home/fromnet/theia/packages/core/lib/node/cluster/main.js:49

    throw reason;
    ^

Error: Cannot find module '../../build/Release/nsfw.node'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/data/data/com.termux/files/home/fromnet/theia/node_modules/nsfw/lib/src/index.js:3:16)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)

Server worker has been disconnected. [ID: 1 | PID: 8567]

Server worker failed to start.

Server worker has been stopped. [ID: 1 | PID: 8567]

Done in 2.4

This is after running yarn run build in the main dir.
has anyone gotten this to run on chromebook/chromeos without crouton?
any ideas how to fix?

@kittaakos
Copy link
Contributor

@jots, what is your node version? There is a known issue with node 10. See here: #2009

@kittaakos kittaakos changed the title error starting on chromebook/termux [fs][nsfw] error starting on chromebook/termux Jun 11, 2018
@marcdumais-work
Copy link
Contributor

@jots AFAIK, you're the first one to report trying to build/run Theia on a chromebook - good/cool idea!

IIRC, nsfw has a native part, that is compiled at install time. Do you know if a chromebook comes with the required tools installed? e.g. a C++ compiler?

Can you try to create an empty node project and add the nsfw npm module to it? e.g.:

cd /tmp
mkdir test
cd test
npm init   #you can accept all proposed default values
npm i nsfw

@kittaakos
Copy link
Contributor

npm init #you can accept all proposed default values
npm i nsfw

npm init -y && npm i -S nsfw

@jots
Copy link
Author

jots commented Jun 12, 2018

Thanks. yes the problem is with nsfw. I get errors when trying to build it. Perhaps because termux only comes with clang and not gcc? If I get it figured out I'll post here.

> [email protected] install /data/data/com.termux/files/home/node_modules/nsfw
> node-gyp rebuild

make: Entering directory '/data/data/com.termux/files/home/node_modules/nsfw/build'
  CC(target) Release/obj.target/openpa/openpa/src/opa_primitives.o
  CC(target) Release/obj.target/openpa/openpa/src/opa_queue.o
In file included from ../openpa/src/opa_queue.c:9:
In file included from ../openpa/src/opa_queue.h:14:
../openpa/src/opa_primitives.h:122:2: error: no primitives implementation specified
#error no primitives implementation specified
 ^
In file included from ../openpa/src/opa_queue.c:9:
../openpa/src/opa_queue.h:60:5: error: unknown type name 'OPA_ptr_t'
    OPA_ptr_t offset;
    ^
../openpa/src/opa_queue.h:67:20: warning: implicit declaration of function 'OPA_load_ptr' is invalid in C99 [-Wimplicit-function-dec
laration]
    void *offset = OPA_load_ptr(&r.offset);
[....]

@marcdumais-work
Copy link
Contributor

@simark or @MarkZ3 maybe you would have ideas for this? Maybe clang would need different switches to compile this vs gcc?

Let's say we make nsfw successfully compile, do we expect that it would it work on a chromebook? AFAIK that uses a Linux kernel, but the user-space is different?

@simark
Copy link
Contributor

simark commented Jun 13, 2018

I am not sure I understand, is this Android or ChromeOS? Anyway, the important bit is this:

../openpa/src/opa_primitives.h:122:2: error: no primitives implementation specified
#error no primitives implementation specified

which corresponds to this: https://github.com/trevnorris/openpa/blob/master/src/opa_primitives.h#L97

So to get nsfw to work with that compiler and platform, somebody needs to port openpa to that first.

You could try to configure openpa with --with-atomic-primitives=no, to at least get past that point and see what's the next issue. Taken from openpa's README

opa_by_lock.h - Used when you specify "--with-atomic-primitives=no" or when
                auto-detecting the primitive implementation and lock-based fall
                back is selected.  This uses pthread mutexes to emulate the
                atomic behavior.  This option typically has dramatically slower
                performance on most platforms where native primitives are
                available.  You should usually only use it for testing or on
                platforms where pthreads are available but no native primitives
                are currently implemented.  The library initialization function
                *must* be called when using this primitives implementation.

Note the last sentence though, I assume they talk about this function here:
https://github.com/trevnorris/openpa/blob/master/src/opa_primitives.h#L125-L149

@vince-fugnitto vince-fugnitto added chromebook issues related to the chromebook OS file-watchers issues related to filesystem watchers - nsfw question user / developer questions labels Mar 5, 2021
@vince-fugnitto
Copy link
Member

Closing the issue since it is quite old, and inactive. I believe the question may have been answered with the latest comment.
If the issue persists it may be worthwhile to open an issue or investigate directly in nsfw if it is possible to get it to work with chromeOS:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chromebook issues related to the chromebook OS file-watchers issues related to filesystem watchers - nsfw question user / developer questions
Projects
None yet
Development

No branches or pull requests

5 participants