-
Notifications
You must be signed in to change notification settings - Fork 93
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
Discuss how to package Rust/Cargo applications (and other non-standard build systems) #15
Comments
Oh, the build api just makes it easier to build with f-b, you can build whatever you want if you add a custom makefile. Alternatively we're making that not required by flatpak/flatpak#516 |
From @TingPing on February 6, 2017 18:49 The "Build API" should probably not be mentioned in the first place, it is extremely autotools specific and even already |
From @moosingin3space on February 6, 2017 18:59 So, regarding Rust/Cargo specifically, we need:
Is all this possible with I'm also interested in packaging Servo, which has a more complicated build system. The system in #516 will support this sort of packaging? |
Its not generally possible to run something outside the sandbox like that. The whole point of the build is that we have all the build dependencies inside the runtime, and don't rely on host side tooling. You can however, disable the network sandboxing for a particular module, so that you can run something that downloads dependencies. (At least unless you specify --sandbox to flatpak-builder.) Still, while this works, it doesn't really match how flatpak-builder normally works. Normally the json specifies the source up to sha256sums of every piece of sourcecode, and flatpak verifies that, so that the build is completely reproducible. |
From @lilianmoraru on February 15, 2017 11:47 I've also hit this issue today. |
From @daa84 on March 9, 2017 18:14 And how about build tools? If i want to download rustc/cargo for build how to do this? |
BTW I created a flatpak for an application that depends on a Rust binary by installing Rust inside the build sandbox. This manifest might be helpful to other people trying to flatpak Rust applications. |
This kind of functionality would also be very useful for packaging Electron apps inside a Flatpak. They mostly use npm or yarn to specify their dependencies and it'd be much more upstream developer friendly to be able to look inside the package.json and get the dependencies from there at the source download stage. Currently you can pretty easily build flatpak bundles as part of the electron tooling, but that just gives you an x86-64 file and doesn't really give a big advantage for the developer over something like appimage (other than the usual advantage of actually working). It just feels like language specific package managers (pip, nuget, cargo, npm etc. etc.) are 'a thing' that flatpak should think about a broad solution for (not necessarily just parsing npm manifests!) if we want to be the brain dead easy to implement answer to a lot of problems developers have. |
For the record, i made a rust SDK here: |
How about having an ability to run a script/command at download stage as a part of sources, but block its access to everything except for the download directory and network? |
I have one more idea for this, how about having a plugin for flatpak-builder to download the packages for each respective build mechanisms. Something like maintaining a script for example for each build mechanisms. This script is shipped with flatpak-builder and flatpak-builder triggers the script with respective files (packages.json/Cargo.toml) etc. The script downloads the packages for you and stores them in download dir. |
I am interested in improving Rust + Flatpak development and thus would like to revive this discussion. I know about the existence of flatpak-cargo-generator, but it's not the ideal solution since you need to maintain another file, which needs to be kept in sync with Meson also has support for Rust now (although things like |
@Ayush1325 In order for this to change I think EDIT: Turns out |
For future reference, this is what an entry in a [[package]]
name = "clap"
version = "3.2.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5"
dependencies = [
"atty",
"bitflags",
"clap_derive",
"clap_lex",
"indexmap",
"once_cell",
"strsim",
"termcolor",
"textwrap",
]
|
So I think a feature that:
Is pretty reasonable if somebody wants to work on that. The hard part is we don't have a toml parser. I guess |
Are there any updates on the proposed |
I've opened #564 to have a go at implementing this. I haven't worked on flatpak-builder before, so will gratefully accept any help :) |
From @moosingin3space on February 6, 2017 17:38
When I read the documentation for
flatpak-builder
, I see that it wants a project to support the Build API. Rust applications that build with Cargo don't fit as nicely into this mold. I'm curious what the expectation is for a non-standard build system. Should the build system be extended to produce Flatpaks itself, or shouldflatpak-builder
be extended to support arbitrary build systems, in a similar manner to Arch LinuxPKGBUILD
s?Copied from original issue: flatpak/flatpak#536
The text was updated successfully, but these errors were encountered: