-
-
Notifications
You must be signed in to change notification settings - Fork 15.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
workbench: init at 43.3 #208866
base: master
Are you sure you want to change the base?
workbench: init at 43.3 #208866
Conversation
89f4c85
to
8cc8964
Compare
Unfortunately I get following error when trying to compile workbench
There is no further output why this command is failing. Can someone familiar with packaging GTK Vala apps help out with this issue? @austinbutler @chuangzhu @hqurve |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also struggled me when I was packaging Tangram 2.0. gjspack
didn't print anything when its subprocesses failed. We definitely want to PR the upstream to make it verbose. But for now, I did a cd $(mktemp -d); nix-shell ~/code/nixpkgs -A workbench -c genericBuild
and edited the gjspack.js
embedded in ../troll/gjspack/bin/gjspack.src.gresource
to make it print failed commands (Hint: the transform
function), and this is what I got:
/nix/store/2p9zl4sz7ndvi5qm5fb760k8irnnwkn8-blueprint-compiler-0.6.0/bin/blueprint-compiler compile /tmp/tmp.k1H4QyMpRE/source/src/window.blp
/nix/store/2p9zl4sz7ndvi5qm5fb760k8irnnwkn8-blueprint-compiler-0.6.0/bin/blueprint-compiler compile /tmp/tmp.k1H4QyMpRE/source/src/widgets/CodeView.blp
And running them manually I can tell it's because you missed these two dependencies.
The app however fails to launch for the second time: (re.sonny.Workbench:1111316): Gjs-CRITICAL **: 18:14:49.509: JS ERROR: Gio.IOErrorEnum: Error opening file “/home/chuang/.local/share/re.sonny.Workbench/workbench.vala”: Permission denied And I think it's because the app tries to copy [chuang@hawthorn:~]$ ls .local/share/re.sonny.Workbench/workbench.vala -l
-r--r--r-- 1 chuang users 363 Jan 1 1970 .local/share/re.sonny.Workbench/workbench.vala |
Thank you @chuangzhu this looked more complicated than I thought. Maybe there are still some patches required to get it working correctly |
By searching the source for "workspace.vala", I determined that the file copy is performed at https://github.com/sonnyp/Workbench/blob/v43.3/src/langs/vala/vala.js#L13. By looking at the GIO api for the copy function, we can use the G_FILE_COPY_TARGET_DEFAULT_PERMS flag to "Leave target file with default perms, instead of setting the source file perms." I applied the following patch and rebuilt workbench. After clearing the ~/.local/share/re.sonnyp.Workbench directory, reopening worked
I assume that flags work using bits. Also, you probably want to reword the commit message. Also, by searching the code for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was the removal of the dependencies intentional?
api_file.copy( | ||
Gio.File.new_for_path(data_dir).get_child("workbench.vala"), | ||
- Gio.FileCopyFlags.OVERWRITE, | ||
+ Gio.FileCopyFlags.OVERWRITE | Gio.FileCopyFlags.TARGET_DEFAULT_PERMS, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to upstream this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created an upstream PR workbenchdev/Workbench#188
Going to use this as a patch for now
Yes I copied the Nix expression for the package from an other package, these dependencies weren't meant to be added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I added the patch by @hqurve from the upstream PR
But somehow I get
Patch was applied to the correct and latest version of Workbench :/ |
Workench author here. I appreciate people being interested in Workbench but I really don't think it's a good idea to package Workbench https://github.com/sonnyp/Workbench#packaging
There are 2 main issues
Maybe the warning isn't visible enough? Perhaps I should exit with an error if not running in a sandbox. WDYT? |
When I ran the build, I got a hash mismatch for the patch (you probably forgot to update the hash). Updating the hash caused the program to build. Updated hash: |
(Although I am not qualified to comment .... I still will.) At first I thought the app was an alternative to gnome builder. But after reading more, I realize it is more like a gtk version of https://jsfiddle.net which is made for sharing/testing ideas. Also, it runs locally.... After realizing this, I think there should be some sandbox around the application so that inexperienced people cannot accidentally run dangerous code that they found online. The same argument could probably be extended to other applications such as a terminal. But Workbench's case is special since the there is no need for it to access the whole system and application was designed with the idea of it being in a sandbox. Instead of not packaging it or packaging it without a sandbox, we could possibly package it with bubblewrap around it(?) |
The whole point is to have a very specific target env, so Flatpak + org.gnome.Sdk/org.gnome.Platform It might sandbox but things will still break. Portals and permissions will be expected to work. |
ninja | ||
pkg-config | ||
vala | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At minimum, you will want wrapGAppsHook4
. And probably whatever libraries are is in GNOME platform to make it more useful.
Hi @sonnyp, I'm the one that rejected your deletion request for the If running |
Thanks for the feedback – I will proceed with that and let users know of the risks.
I am aware of Workbench license and its conditions. This isn't a licensing issue. Who is "we"? Just like with aur - my request is directed at the packager.
If packagers don't – it's hard to assume users will. I won't insist further. Side note: Let's please not turn this into a drama/crusade 🙏 This is a very practical request that has the best interests of users in mind. I am hopeful packagers can see and share that. If anyone is willing to brainstorm/collaborate on making non-flatpak Workbench safe for all – you are welcome to file an issue. |
Flatpak = a packaging system + bubblewrap + xdg-dbus-proxy + xdg-desktop-portal. It's possible for us to do the exact same runtime isolation as Flatpak. There is, for example, an out-of-tree module called NixPak. Maybe we need to make a in-tree equivalent of that in Nixpkgs. |
"We" refers as ArchLinux trusted users (AUR moderators). AUR requests (deletion/merge/orphan) are directed to us for a review and an eventual acceptance. If you wish to contact the packager, you can do so by leaving a comment on the associated AUR page or sending them an email.
They are expected to though. For what it's worth, AUR packages are not officially supported by Arch and, most of the time, neither by upstream developers. As stated officially in the AUR' Arch wiki page, AUR users should be aware that they are using AUR packages at their own risks and are thus implicitly expected to read upstream documentation for such eventual warnings.
My sole intention here is to help regarding the current situation :) TLDR: People are expected to read upstream documentation before installing software so they should be aware of the potential risks of running EDIT: Sorry for going a bit off-topic with this MR... @sonnyp we can discuss this further somewhere else if you want to. |
Hi guys. I just decided to try running the latest version and see what happens. And I would like to start with my opinion on this situation. There are many ways in the world to destroy or infect your computer. Expecially in most linux distros you can simply run If we talk about the And even if we move away from this thought and keep the sandbox for greater security, as discussed above, the app lacks a warning feature to let you know it's not running in a sandbox. I decided to look at the source and saw this there: if (!Xdp.Portal.running_under_flatpak()) {
console.error(
"Flatpak required\nWorkbench is only meant to be run sandboxed in a specific target environment.\nBypassing this will exposes users to arbitrary code execution and breakage.",
);
exit(1);
} Is flatpak == sandboxing? This application is packed even without any specific patches in nix, and if you remove this limitation, then the application starts up and runs smoothly. Even if the execution of the code breaks because of the platform, this is already a problem for the packagers, not the application. In my opinion, there are no restrictions for running a Linux has always been about freedom and choice... Is there less choice now? |
Obviously the author doesn't want this program to run outside of flatpak (although the reason is far-fetched). We may not want to workaround this. |
Description of changes
Packaging Workbench, a Gnome software for prototyping GTK4 applications
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes