pymakr will not update in atom 1.60.0 on Ubuntu 20.04



  • Hi all,

    I have been a bit baffled by a failure to update the Pymakr plugin in atom 1.60.0 on Ubuntu 20.04 for a while.
    It seems that something can't find npm.

    Failed to activate the pymakr package
    
    Command failed: npm install serialport
    /bin/sh: 1: npm: not found
    

    I don't have npm installed in my rootfs, and I don't think I ever have. It doesn't seem to be listed as a package dependency for atom, which is installed from the repo. But, a seemingly functional npm and related stuff does seem to exist at and around:

    /usr/share/atom/resources/app/apm/bin/npm

    so the issue seems to be caused by atom, or some part of the Pymakr plugin installation mechanism, perhaps, not knowing the path to these bits of npm related gubbins.

    Has anyone got any tips? There are a bunch of issues on github that seem vaguely related spread out over various platforms over a fairly long while, yet none seems obviously related to this issue.

    Edit: corrected title to refer to Ubuntu 20.04, due to typo



  • @Jakob-Rosenberg-0
    Good news. Given the content of the EOL announcement email sent out recently, specifically the focus on the platform as a service I did begin to wonder whether the Pymakr plugin would continue to be maintained. I really hope it is. I have no desire to switch to using Pybytes whatsoever.



  • @g0hww No problem. Sorry for the late reply. I had an extended weekend.

    We're working on adding Pymakr to the openvsx store. If all goes well, we should have a release very soon.



  • Oh, sorry for the spam but I have made some progress.
    Apparently the Pymakr plugin can be installed from a .vsix file that I obtained from here:
    https://www.vsixhub.com/vsix/6484/
    It does seem to have installed OK.
    That seems like a win.
    At the moment though, I don't have any of my Pycom gadgets to hand, as I am in the middle of moving house, so I have really just been trying to solve the Atom problem such that the gadgets can be modified to support the new network in the new house.
    So, the answer for me may well be to use VSCodium instead of Atom. Perhaps Pycom would consider pushing their plugin into the VSCodium repo so user's don't have to jump through so many hoops.



  • Hmm. I have installed VSCodium but the PyMakr plugin doesn't seem to be installable from the Extensions page.
    It would be nice if it could somehow be made to work with VSCodium, otherwise it seems that I will be abandoning the Pycom platform entirely in the near future.



  • Oh, it seems that the word on the streets is that development of atom has effectively ceased. I suppose there is no mileage in following up on this.

    Regarding my problem with using Microsoft products, I have just learned that a thing called VSCodium exists, basically a sanitised VSCode. I wonder if the Pymakr plugin works in that?



  • @Jakob-Rosenberg-0 said in pymakr will not update in atom 1.60.0 on Ubuntu 20.01:

    I'm hoping Atom will soon upgrade its internal Node to ^v12.17.0 so we can provide a solution that doesn't require us to draw outside the lines.

    Have you raised an issue against Atom describing the problem and your hopes for a solution?



  • @Jakob-Rosenberg-0
    The blocking issue for me, with regard to using vscode, is using anything written by Microsoft. There is a reason I use Linux, and that is it.



  • Hi @g0hww

    I fear we might have to make Node a hard dependency for Pymakr for Atom.

    The problem is that for Atom to communicate with the serial port, the serialport package needs bindings for the specific runtime environment.

    There are two simple solutions and neither work with Atom.

    • One is to upgrade to the latest version of serialport which uses universal N-API bindings, but Atom uses an old end-of-life version of Node that's not supported by newer versions of serialport.
    • The other is to use an older version of serialport which automatically downloads the correct bindings when the package is installed. Unfortunately Atom provides the terminal environment and not the runtime Electron environment when installing packages, so serialport downloads the wrong bindings.

    TLDR; Atom doesn't work with universal (N-API) bindings and it provides the wrong info at install time for packages to download correct bindings.

    This means that in order to get working bindings we have to detect the runtime environment inside Atom at runtime and then download or build the bindings from the provided information. For this we need npm / node.

    There are also other solutions, but they don't get prettier.

    I'm hoping Atom will soon upgrade its internal Node to ^v12.17.0 so we can provide a solution that doesn't require us to draw outside the lines. When that or some other tangible solution appears, I'll be happy to pursue it.

    For what it's worth, we've released a new Pymakr for VSC. Development is fast and if you have any blocking issues that prevents you from using it, just let me know and I'll look into it.



  • I tried hand bodging /home/darren/.atom/packages/pymakr/lib/main.js to provide a fully qualified path to npm, but the file is overwritten when I attempt to reinstall pymakr. Gah!

    Anyway, looking at the Pymakr changelog, it seems that there has been much faffing around with this stuff in recent point releases.

    2.3.7 (2022-04-06)
    Bug Fixes
    npm couldn't install serialport at runtime (501380e)
    2.3.6 (2022-04-06)
    Bug Fixes
    removed serialport from dependencies (6e3d64e)
    2.3.5 (2022-04-06)
    Bug Fixes
    install serialport from runtime code (9c62cad)
    2.3.4 (2022-04-06)
    Bug Fixes
    use postinstall to install bindings with npm (ff6635d)
    2.3.3 (2022-04-05)
    Bug Fixes
    could not install dependencies on Unix (aeeb5f4)
    2.3.2 (2022-03-30)
    Bug Fixes
    disable fixbind (for now) (6680eb8)
    Serialport API changed (00ddc65)
    2.3.1 (2022-03-30)
    Bug Fixes
    update serialport package (4181f10)
    update serialport to v10 (beat) (34780fe)
    2.3.0 (2022-02-21)
    Features
    make max scrollback configurable (f8cdbd5)
    


Pycom on Twitter