Fork me on GitHub
#vscode
<
2021-08-27
>
Patrix01:08:54

(apologies for the repost from #emacs, I’m hoping for extra visibility, the topic concerns both editors anyway) Anybody using the emacs or vscode flatpak?  I’ve done some experimentation and managed to get clojure, doom and a few tools up and running, using the emacs flatpak + a few sdk extensions (openjdk11, rust-stable, node14) I’m sure I’m not the first one to use this or to manage this, so before I duplicate any existing work, I’d like to know if others have setup and documente this, or even worked on some clojure sdk extension for flatpak?

seancorfield02:08:47

Never heard of it. What is it? A link will do.

Patrix03:08:47

hmmm maybe multiple links at minimum lol flatpaks are the newish Linux application distribution format, intended to allow distributing a single package across many distributions, separate from the OS’s package manager.. they use containerization facilities from the kernel to isolate the apps and provide some semblance of a permission model to avoid duplication of libs/frameworks/etc they make use of layers called “runtimes” or “extensions”, so that e.g. all the apps built on gnome 40 share the same gnome 40 base (as opposed to, say, regular docker containers or appimage applications that need to package all dependencies within the package, leading to bloat)

Patrix03:08:55

but because of this isolation, IDEs don’t have access to tools installed on the host OS, not directly anyway so they’ve come up with the concept of SDK Extensions, similar to what I’ve mentioned just above but provide rust/jdk/node/etc as layers that get added to the IDE when running it, making the languages/SDKs available from within the flatpak at runtime

Patrix03:08:22

hope this explains it well enough, I was only vaguely familiar with all that until a few days ago, now looking into it more

Patrix03:08:47

link to the flatpak homepage… https://www.flatpak.org/

seancorfield05:08:59

Hmm, seems like the various Linux flavors are just trying to make packaging more complicated and hostile to the end user experience. Can you explain any benefits from this approach, from the p.o.v. of developers who are just trying to use Emacs/VSCode to write software? I can see how something like Gitpod (or GitHub CodeSpaces) are beneficial but having seem the whole "build everything from source" and now "let's isolate editors from files" I'm not seeing any benefits from this increasing "purity" in the Linux world 😞

Patrix05:08:24

@U04V70XH6 you'll get no argument from me about this making everything more complex... HOWEVER more and more distributions are going in this direction.. most notable example would be Fedora's Silverblue variant (immutable os-tree based root partition + containers and flatpaks for everything, which is an interesting workflow), ElementaryOS's recent release which refocused on flatpaks, GNOME being all-in.... soooo I've decided to experiment (once a year) to see how well this works.. and here we are

Patrix05:08:48

it does kinda sorta solve some issues though, for example: being on Debian stable, and not needing to compile or add third-party repos or PPAs to get the latest emacs. installing applications as a user without root privilege. things like that.

seancorfield05:08:06

Is this something the mainstream Linux variants like Ubuntu are doing?

Patrix05:08:20

it's supported on all mainstream distributions

Patrix05:08:27

but of course canonical favors their own Snap format...

seancorfield05:08:19

I'm just a lowly Ubuntu user -- how are we supposed to find out about this weird crap?

Patrix05:08:33

lol no idea

Patrix05:08:57

flatpaks have been a big topic here and there over the past 3-5 years, HN etc, lots of controversy

seancorfield05:08:20

I try to ignore the orange site, for the most part.

Patrix05:08:50

https://flatpak.org/setup/ flathub is the main repo of most flatpaks, but unlike Snap, flatpak is not dependent on a central distribution/authority

seancorfield05:08:45

I love how one of the driving premises of flatpak is so that you don't have to add custom repos and then the very first step is... to add a custom repo "Add the necessary repository..." 🙂

Patrix05:08:57

ahhahahaha

Patrix05:08:07

perhaps they mean don't need to add a custom deb/rpm/etc repo

Patrix05:08:12

bnut yeah the wording if not the concept is ironic

Patrix05:08:22

of course you can just download the flatpak directly and install it, no repo required

seancorfield05:08:56

Oh, and then the second thing you do (after rebooting your system -- WAT?) is... "The first thing we’re going to do is add the Flathub remote repository" 🙂

seancorfield05:08:09

Do these people not even read their own instructions?

😀 9
Patrix05:08:10

you ARE on the flathub site lol

seancorfield05:08:43

I assume at some point this will be baked into future Linux versions and you'll just go to the "store" and install apps -- like you've been able to do on macOS and Windows for years?

Patrix05:08:19

that's the way ElementaryOS is going, that's what Purism was planning on their phone, that's what Fedora wants as well, no idea about other distros plans

seancorfield05:08:20

I love Linux for development and deployment but this sort of stuff is why "Linux on the desktop" is just such a joke!

seancorfield05:08:43

It's serious Stockholm syndrome.

Patrix05:08:00

well in either case, I'm not here to argue for or against flatpaks but to experiment with it, and to see if anybody else had tried to do what I'm about to attempt

seancorfield05:08:44

Fair enough. If this is how all Linux distros are going to be in the future, we'll need a sane way to get Clojure running and an editor installed.

seancorfield05:08:19

I have to say, I like what Microsoft has done here: VS Code on Windows with a Remote extension to work with all your code and REPL on WSL2/Ubuntu.

Patrix05:08:07

no idea if they're ALL going like that -- but if they are, there are definitely a myriad of issues to fix before this is usable normally

Patrix05:08:10

we'll see how it goes lol

seancorfield05:08:30

And macOS has essentially had the same model ever since OS X appeared (and years before that I ran BSD unix with a Mach kernel on my old Macs to get essentially the same thing).

seancorfield05:08:43

(dating back nearly 30 years)

Patrix05:08:02

"essentially" aside from the app store apps...

Patrix05:08:24

imagine my surprise the other day when I deleted the simcity 4 app from the app store on my Mac and lost all my save files, just like on an iphone

Patrix05:08:32

oops 🙂 I half expected it and didn't care though

seancorfield05:08:03

True, there was no app store back then... and I'm not sure they're an improvement...

Patrix05:08:25

big improvement (for Apple's bottomline lol)

seancorfield06:08:12

Aye, one of many reasons I'm switching away from Apple these days (after being an Apple customer for 30 years).

Patrix06:08:47

yeah, same here, which brings me to my Linux experiments and figuring out if this flatpak thing is worth it and usable or not

9
Patrix06:08:20

alrighty, so I guess my little weekend project will be to figure out if there's any documentation about how to create flatpak "SDK extensions", or if I need to just read the source and figure things out on my own haha

Patrix06:08:05

and I will at least publish.. somewhere.. the steps I've taken to get clojure up and running in my experimental setup

Patrix08:09:32

Alrighty, I’m going to publish something this week, but I essentially managed to create a flatpak sdk extension that contains: • clojure • clj-kondo • bb • nbb • lein and load that up along with emacs, so that now when running emacs I have access to all those tools inside the flatpak. Would work the same with vscode. I’m not happy with the installation process for every one of these (lots of curls and running scripts that download arbitrary things, and npm install -g for nbb..), but it works, and can be refined over time 🙂