magenta-studio icon indicating copy to clipboard operation
magenta-studio copied to clipboard

Linux support

Open zanieb opened this issue 5 years ago • 18 comments

Hi! I just found this project and am curious what the barriers are to building on linux?

Happy to help contribute to make this work.

Thanks! Michael

zanieb avatar Feb 17 '19 20:02 zanieb

Also I don't understand why standalone version for Windows still isn't available.

UnknownLocation avatar Feb 19 '19 09:02 UnknownLocation

Re: Linux, this should be easy but I haven't looked into it. @teropa did you have a look at this? Re: Windows, we have limited limited cycles right now, and we haven't prioritized it yet. I am looking into it this week, but there are some difficulties around dealing with DLLs etc. Also none if us use Windows so there is a learning curve :)

adarob avatar Feb 19 '19 17:02 adarob

So I actually just cloned the code and built on linux successfully.

The following was necessary:

  1. I had to install some dependencies manually
  2. I added linux to the output options and nameToPlatform in build.js
  3. I printed the temporary build directory since linux binaries are extensionless and not found by the regex, also I stopped the temp directory from being deleted so I could test the build

It looks like the app works too, I just opened a couple and then tested generate since I didn't need midi files to train it with.

zanieb avatar Feb 19 '19 20:02 zanieb

@mikeza would you might contributing back changes you made to get this working?

adarob avatar Feb 20 '19 17:02 adarob

Yeah I'd be interested in working on this, let me figure out what's up with the dependency installation.

zanieb avatar Feb 21 '19 02:02 zanieb

I just tried building for linux on my mac, and the resulting build seems to work on a linux machine. However, I am not sure how to package it with an installer since the executable seems to need to live in the same folder as all of the resources.

adarob avatar Feb 22 '19 19:02 adarob

With #16, you should be able to build the standalones with npm run --output=linux-standalone. I'll leave this open until I have a chance to add actual packages.

adarob avatar Feb 22 '19 23:02 adarob

I just tried building for linux on my mac, and the resulting build seems to work on a linux machine. However, I am not sure how to package it with an installer since the executable seems to need to live in the same folder as all of the resources.

Maybe consider referring to https://github.com/electron-userland/electron-packager for best practice packaging the resources and executable (or could just use the project).

zanieb avatar Feb 23 '19 21:02 zanieb

I have successfully built this in February on Debian Stretch following instructions that a member of the Facebook Linux Musicians posted, as follows:

  1. git clone https://github.com/tensorflow/magenta-studio
  2. follow the install instructions to get the npm node modules installed
  3. In ./electron/build.js add linux: 'linux' to the hash nameToPlatform and comment out
windows : 'win32',
macOS : 'darwin'
  1. in moveFiles, comment out the await fs.remove(buildDir)
  2. The temp build directory is in the /tmp/, and the electron apps for each working application is there separately.

tank-trax avatar Apr 01 '19 20:04 tank-trax

Is it worth also making the Linux build downloadable, in addition to the sourcecode? Snap might be one way. Flatpak and Appimages are possible other ways.

bkmgit avatar Dec 06 '19 05:12 bkmgit

For me on Archlinux, the app does not function correctly and renders as a gray box. I built using yarn install && yarn build linux-standalone. I also had to manually install gconf dependency.

Sidenote: User flying-sheep comments on the AUR gconf package that gconf typically is no longer a dependency of Electron apps. Is that the case here as well?

han-so1omon avatar Mar 25 '20 18:03 han-so1omon