joshmarinacci/ElectronIDE

linux path support

Closed this issue · 10 comments

On linux it appears you must have arduino-core installed. Then you will get the avr compilers. They are not in the usual Arduino path structure, however. They will be installed in the regular /usr/bin/ directory. Also, the avrdude.conf path is slightly different. We should detect if on linux and use alternate paths.

https://packages.debian.org/sid/all/arduino-core/filelist

Just pushed back new platform code that makes it work on linux, at least for compiling.

trying a compile now, not working, but i'm not sure if it's related.

last output is:
scanned for included libs Arduino
sending event { type: 'compile',
message: 'scanned for included libs Arduino' }
compliation error [TypeError: Cannot call method 'getStandardLibraryPath' of undefined]

I added a console.log(options) and it doens't have a platform entry.

My fault. new breakage. Just fixed it. Please try again. txh.

Dies it work for you now?

that part seems to work, now I need to find time to move to distro packaged arduino. ElectronIDE should get rid of all the reasons I was using a portable system.

Yes. Eventually I will fetch the gcc toolchain from repos rather than relying on the OS having the standard IDE and tools installed, but I don't think that will be for version 0.1. Perhaps 0.2

compile works with distro packages.

upload does not. changed this in platform.js

    this.getAvrDudeConf = function(device) {
        if(this.os == 'linux') {
            return this.root + '/hardware/tools/avrdude.conf';
        } else {
            return this.root + '/hardware/tools/avr/etc/avrdude.conf';
        }
    }

a failed upload also provides no feedback in the GUI, only stdout/stderr

I've updated it to download the compiler toolchain and libs automatically to a scratch dir. You don't need arduino-core installed anymore.

Please check out the code, npm install, set the exports.repos variable in settings.js (exports.root no longer matters), then run 'node test_compile.js' to test compiling a sketch.

It should download the toolchain the first time you run it, then compile the sketch. It should work on Mac and Linux. I haven't tried Windows yet. I'm still uncertain about 32bit vs 64bit on linux, so I really need testing on those variants.

You no longer need to set anything in the settings.js file. It will all be calculated correctly for the current platform. Please do a fresh checkout to use the new stuff.