nrobinson2000 / neopo

A lightweight solution for local Particle development.
https://neopo.xyz
MIT License
23 stars 6 forks source link

[BUG] Neopo Broken in Debian 10.8 WSL #13

Closed TrikkStar closed 3 years ago

TrikkStar commented 3 years ago

Describe the bug Neopo commands not working.

Error Output

$ neopo build Traceback (most recent call last): File "/usr/local/sbin/neopo", line 1026, in main commandsargs[1] File "/usr/local/sbin/neopo", line 741, in compile_command buildCommand("compile-user", 2, args) File "/usr/local/sbin/neopo", line 656, in buildCommand build(project, command, False, verbosity) File "/usr/local/sbin/neopo", line 589, in build devicePlatform, firmwareVersion = getSettings(projectPath) File "/usr/local/sbin/neopo", line 503, in getSettings data = json.loads(settings.read()) File "/usr/lib/python3.7/json/init.py", line 348, in loads return _default_decoder.decode(s) File "/usr/lib/python3.7/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.7/json/decoder.py", line 353, in raw_decode obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 10 column 1 (char 271) An unexpected error occurred! To report this error on GitHub, please open an issue: https://github.com/nrobinson2000/neopo/issues

$ neopo install Installing neopo... Finding Workbench extension URL... Downloading Workbench extension... Traceback (most recent call last): File "/usr/local/sbin/neopo", line 1026, in main commandsargs[1] File "/usr/local/sbin/neopo", line 753, in install_command installOrUpdate(True, force) File "/usr/local/sbin/neopo", line 313, in installOrUpdate data = getDeps() File "/usr/local/sbin/neopo", line 185, in getDeps manifest = getFile(extension, extensionFiles["manifest"]) File "/usr/local/sbin/neopo", line 131, in getFile return file.read(path) File "/usr/lib/python3.7/zipfile.py", line 1428, in read with self.open(name, "r", pwd) as fp: File "/usr/lib/python3.7/zipfile.py", line 1467, in open zinfo = self.getinfo(name) File "/usr/lib/python3.7/zipfile.py", line 1395, in getinfo 'There is no item named %r in the archive' % name) KeyError: "There is no item named 'extension/src/compiler/manifest.json' in the archive" An unexpected error occurred! To report this error on GitHub, please open an issue: https://github.com/nrobinson2000/neopo/issues

Desktop:

Additional context Neopo was working for me fine around a week ago, but I started experiencing this issue when I tried using it yesterday.

nrobinson2000 commented 3 years ago

In the latest release of Workbench, the location of manifest.json changed.

Please reinstall neopo with pip3 or use the install script.

You may need to uninstall neopo first:

sudo pip3 uninstall neopo
TrikkStar commented 3 years ago

No dice, uninstalling-reinstalling doesn't seem to have fixed the problem.

$ sudo pip3 uninstall neopo -y Uninstalling neopo-297.1feff3d: Successfully uninstalled neopo-297.1feff3d $ bash <(curl -sL neopo.xyz/install) Installing Linux dependencies... Hit:1 http://deb.debian.org/debian buster InRelease Hit:2 http://security.debian.org/debian-security buster/updates InRelease Hit:3 http://ftp.debian.org/debian buster-backports InRelease Hit:4 http://deb.debian.org/debian buster-updates InRelease Reading package lists... Done Building dependency tree Reading state information... Done All packages are up to date. Reading package lists... Done Building dependency tree Reading state information... Done git is already the newest version (1:2.20.1-2+deb10u3). libc6-i386 is already the newest version (2.28-10). libarchive-zip-perl is already the newest version (1.64-1). libncurses5 is already the newest version (6.1+20181013-2+deb10u2). python3-pip is already the newest version (18.1-5). python3-setuptools is already the newest version (40.8.0-1). python3 is already the newest version (3.7.3-1). vim is already the newest version (2:8.1.0875-5). libncurses5:i386 is already the newest version (6.1+20181013-2+deb10u2). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Cloning into '/tmp/tmp.EqktP9O8fZ/neopo'... remote: Enumerating objects: 98, done. remote: Counting objects: 100% (98/98), done. remote: Compressing objects: 100% (72/72), done. remote: Total 1564 (delta 42), reused 63 (delta 19), pack-reused 1466 Receiving objects: 100% (1564/1564), 3.17 MiB | 11.57 MiB/s, done. Resolving deltas: 100% (858/858), done. Processing /tmp/tmp.EqktP9O8fZ/neopo Building wheels for collected packages: neopo Running setup.py bdist_wheel for neopo ... done Stored in directory: /tmp/pip-ephem-wheel-cache-52yaxg_a/wheels/87/07/2b/80ec16931317eeea06974fadb5c7e529aad17706b8934dcd21 Successfully built neopo Installing collected packages: neopo Successfully installed neopo-297.1feff3d Installing neopo... Finding Workbench extension URL... Downloading Workbench extension... Traceback (most recent call last): File "/usr/local/sbin/neopo", line 1026, in main commandsargs[1] File "/usr/local/sbin/neopo", line 753, in install_command installOrUpdate(True, force) File "/usr/local/sbin/neopo", line 313, in installOrUpdate data = getDeps() File "/usr/local/sbin/neopo", line 185, in getDeps manifest = getFile(extension, extensionFiles["manifest"]) File "/usr/local/sbin/neopo", line 131, in getFile return file.read(path) File "/usr/lib/python3.7/zipfile.py", line 1428, in read with self.open(name, "r", pwd) as fp: File "/usr/lib/python3.7/zipfile.py", line 1467, in open zinfo = self.getinfo(name) File "/usr/lib/python3.7/zipfile.py", line 1395, in getinfo 'There is no item named %r in the archive' % name) KeyError: "There is no item named 'extension/src/compiler/manifest.json' in the archive" An unexpected error occurred! To report this error on GitHub, please open an issue: https://github.com/nrobinson2000/neopo/issues Failed to initialize libusb. The system is already configured. $ neopo build Traceback (most recent call last): File "/usr/local/sbin/neopo", line 1026, in main commandsargs[1] File "/usr/local/sbin/neopo", line 741, in compile_command buildCommand("compile-user", 2, args) File "/usr/local/sbin/neopo", line 656, in buildCommand build(project, command, False, verbosity) File "/usr/local/sbin/neopo", line 589, in build devicePlatform, firmwareVersion = getSettings(projectPath) File "/usr/local/sbin/neopo", line 503, in getSettings data = json.loads(settings.read()) File "/usr/lib/python3.7/json/init.py", line 348, in loads return _default_decoder.decode(s) File "/usr/lib/python3.7/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.7/json/decoder.py", line 353, in raw_decode obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 10 column 1 (char 271) An unexpected error occurred! To report this error on GitHub, please open an issue: https://github.com/nrobinson2000/neopo/issues

TrikkStar commented 3 years ago

Looks like the pip3 uninstall isn't fully working.

$ sudo pip3 uninstall neopo Skipping neopo as it is not installed. $ neopo


/ \/ \/ \/ \/ \ A lightweight solution for / / / / / // / // / // / local Particle development. // //_/__/ __/___/ // .xyz Copyright (c) 2020 Nathan Robinson Usage: neopo [OPTIONS] [PROJECT] [-v/q] Type neopo help to see a list of all options.

nrobinson2000 commented 3 years ago

The error is referencing /usr/local/sbin/neopo, which likely is leftover from the old installer before I switched to using pip3.

Could you delete /usr/local/sbin/neopo from your PATH?

sudo rm /usr/local/sbin/neopo
TrikkStar commented 3 years ago

Removed the sbin directory but now running the script doesn't seem to successfully install neopo.

$ bash <(curl -sL neopo.xyz/install) Installing Linux dependencies... Hit:1 http://security.debian.org/debian-security buster/updates InRelease Hit:2 http://deb.debian.org/debian buster InRelease Hit:3 http://deb.debian.org/debian buster-updates InRelease Hit:4 http://ftp.debian.org/debian buster-backports InRelease Reading package lists... Done Building dependency tree Reading state information... Done All packages are up to date. Reading package lists... Done Building dependency tree Reading state information... Done git is already the newest version (1:2.20.1-2+deb10u3). libc6-i386 is already the newest version (2.28-10). libarchive-zip-perl is already the newest version (1.64-1). libncurses5 is already the newest version (6.1+20181013-2+deb10u2). python3-pip is already the newest version (18.1-5). python3-setuptools is already the newest version (40.8.0-1). python3 is already the newest version (3.7.3-1). vim is already the newest version (2:8.1.0875-5). libncurses5:i386 is already the newest version (6.1+20181013-2+deb10u2). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Cloning into '/tmp/tmp.SHOugwZ69a/neopo'... remote: Enumerating objects: 98, done. remote: Counting objects: 100% (98/98), done. remote: Compressing objects: 100% (72/72), done. remote: Total 1564 (delta 42), reused 63 (delta 19), pack-reused 1466 Receiving objects: 100% (1564/1564), 3.17 MiB | 11.86 MiB/s, done. Resolving deltas: 100% (858/858), done. Processing /tmp/tmp.SHOugwZ69a/neopo Building wheels for collected packages: neopo Running setup.py bdist_wheel for neopo ... done Stored in directory: /tmp/pip-ephem-wheel-cache-e3oxdten/wheels/09/00/a7/22a227661776c6faf27fdb25c3985d06eff342b4bc77d81142 Successfully built neopo Installing collected packages: neopo Successfully installed neopo-297.1feff3d Installing neopo... Finding Workbench extension URL... Downloading Workbench extension...

Skipped previously installed dependencies: deviceOS@3.0.0-rc.1, gcc-arm@9.2.1, buildtools@1.1.1, buildscripts@1.9.2, openocd@0.11.2-adhoc6ea4372.0

Failed to initialize libusb. The system is already configured. $ neopo -bash: /usr/local/sbin/neopo: No such file or directory

nrobinson2000 commented 3 years ago

Try opening a new shell. The new neopo script should be found in the PATH.

nrobinson2000 commented 3 years ago

@TrikkStar Did you get it working?

If you are interested in using neopo in Docker I have created an image:

$ docker pull nrobinson2000/neopo
$ docker run -it nrobinson2000/neopo
TrikkStar commented 3 years ago

I hadn't gotten it working yet no. I'm not at my computer now but I'll get back tomorrow with what issues I'm currently having.

TrikkStar commented 3 years ago

Uninstalled, removed /usr/local/sbin/neopo, reinstalled, started new shell

$ neopo build Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/neopo/command.py", line 221, in main commandsargs[1] File "/usr/local/lib/python3.7/dist-packages/neopo/build.py", line 155, in compile_command build_command("compile-user", 2, args) File "/usr/local/lib/python3.7/dist-packages/neopo/build.py", line 136, in build_command build_project(project, command, False, verbosity, export) File "/usr/local/lib/python3.7/dist-packages/neopo/build.py", line 66, in build_project device_platform, firmware_version = get_settings(project_path) File "/usr/local/lib/python3.7/dist-packages/neopo/project.py", line 98, in get_settings data = json.loads(settings.read()) File "/usr/lib/python3.7/json/init.py", line 348, in loads return _default_decoder.decode(s) File "/usr/lib/python3.7/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.7/json/decoder.py", line 353, in raw_decode obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 50 column 1 (char 1309) An unexpected error occurred! To report this error on GitHub, please open an issue:

nrobinson2000 commented 3 years ago

This sounds like there is something wrong with .vscode/settings.json in your project. If I willingly mangle the file in a test project I get the same error. I will add some code to handle this exception.

Could you post your .vscode/settings.json here, or validate it?

TrikkStar commented 3 years ago

That appears to be the root of the problem, for some reason I had an errant comma near the end of my file that mangled everything.

{ "particle.firmwareVersion": "2.0.1", "particle.targetPlatform": "p1", "cortex-debug.openocdPath": "${command:particle.getDebuggerOpenocdPath}", "files.associations": { "xiosbase": "cpp", "xlocale": "cpp", "xlocnum": "cpp", "bitset": "cpp", "cmath": "cpp", "cstddef": "cpp", "cstdint": "cpp", "cstdio": "cpp", "cstdlib": "cpp", "cstring": "cpp", "cwchar": "cpp", "deque": "cpp", "exception": "cpp", "initializer_list": "cpp", "ios": "cpp", "iosfwd": "cpp", "istream": "cpp", "iterator": "cpp", "limits": "cpp", "list": "cpp", "memory": "cpp", "new": "cpp", "ostream": "cpp", "set": "cpp", "stack": "cpp", "stdexcept": "cpp", "streambuf": "cpp", "string": "cpp", "system_error": "cpp", "tuple": "cpp", "type_traits": "cpp", "typeinfo": "cpp", "utility": "cpp", "vector": "cpp", "xfacet": "cpp", "xlocinfo": "cpp", "xmemory": "cpp", "xmemory0": "cpp", "xstddef": "cpp", "xstring": "cpp", "xtr1common": "cpp", "xtree": "cpp", "xutility": "cpp" }, }

TrikkStar commented 3 years ago

So that solution didn't seem to last. My settings.json is valid and I just decided to build with neopovs Visual Studio.

$ neopo configure p1 2.0.1 Configured project ***: (p1, 2.0.1) $ neopo build Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/neopo/command.py", line 221, in main commandsargs[1] File "/usr/local/lib/python3.7/dist-packages/neopo/build.py", line 155, in compile_command build_command("compile-user", 2, args) File "/usr/local/lib/python3.7/dist-packages/neopo/build.py", line 136, in build_command build_project(project, command, False, verbosity, export) File "/usr/local/lib/python3.7/dist-packages/neopo/build.py", line 72, in build_project if not check_libraries(project_path, False): File "/usr/local/lib/python3.7/dist-packages/neopo/project.py", line 148, in check_libraries os.path.join("lib", library, "library.properties")) File "/usr/local/lib/python3.7/dist-packages/neopo/project.py", line 118, in load_properties value = tokens[1].strip() IndexError: list index out of range An unexpected error occurred! To report this error on GitHub, please open an issue: https://github.com/nrobinson2000/neopo/issues

nrobinson2000 commented 3 years ago

It looks like it's getting tripped up on a library.properties in one of the libraries.

I can confirm the existence of any lines not following the key=value scheme will throw off neopo. I have just pushed a fix.

I greatly appreciate the bug reports and the feedback.