Support building on non-debian based distros.

44 views
Skip to first unread message

Alexander Ejbekov

unread,
May 15, 2021, 12:52:58 PM5/15/21
to discuss
Hi,

This probably touches a few different topics but they all boil down to the ffx tool. Specifically the preflight checks failed with:

  [✗] Some build dependencies are missing: curl, git, unzip


      To resolve, run: sudo apt-get install curl git unzip

Which caught me a bit off guard since I use all of those pretty much 365 days a year. After digging a bit into the source code I found this.

I never got this warning because I had alien installed in order to convert some deb packages to rpm and alien itself requires dpkg. dpkg -s however reads from /var/lib/dpkg/status, which in my case is empty(that would be the case for all non-debian based systems). So I guess my question is if there's a specific reason for using this as opposed to something like:

let (status, _stdout, __stderr) = (self.command_runner)(&vec!["which", *package]).with_context(|| format!("Package not installed: '{}'", package))?;

If which can't find the package, the status it returns would be 1 so it should, in theory, cover both cases. I don't see anything binding the to dpkg here(or debian-based distros for that matter, unless I'm missing something). It seems to work fine on openSuSe Leap 15.2  for instance, I recon it would be fine with all(most) modern distros.

Otherwise, off the top of my head, something like $ apropos "package manager" might be an alternative to check if the system is debian based?

Cheers,
Alex.

Shai Barack

unread,
May 15, 2021, 12:58:56 PM5/15/21
to Alexander Ejbekov, discuss
Hi Alexander,

We never tried building on a Linux distro that's not derived from Debian. If you can short circuit the preflight check and the rest works for you, great! In the latter case you're welcome to send a patch that would make the check more robust. 

--
All posts must follow the Fuchsia Code of Conduct https://fuchsia.dev/fuchsia-src/CODE_OF_CONDUCT or may be removed.
---
You received this message because you are subscribed to the Google Groups "discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss+u...@fuchsia.dev.
To view this discussion on the web visit https://groups.google.com/a/fuchsia.dev/d/msgid/discuss/339464fb-4995-40a9-8b46-bfb68c0482f1n%40fuchsia.dev.

Amit Uttamchandani

unread,
May 15, 2021, 1:24:37 PM5/15/21
to Shai Barack, Alexander Ejbekov, discuss
Thanks for reaching out Alexander. There is an internal bug tracking the issue.

Note that the build should work on a non-Debian distro. I have been able to build it on Arch for example.



Camden Bruce

unread,
May 20, 2021, 4:44:31 AM5/20/21
to discuss, Amit Uttamchandani, Alexander Ejbekov, discuss, Shai Barack
I can confirm that it also works on Fedora

fctorial

unread,
May 20, 2021, 10:57:43 AM5/20/21
to Camden Bruce, discuss, Amit Uttamchandani, Alexander Ejbekov, Shai Barack
On nixos, this environment can be used to work on fuchsia:

https://gist.github.com/fctorial/95ac823eab79fa514cf0e99a38b3b75c

How to use:

1. nix-shell <this file>

2. exec fuchsia-env

Guides on the fuchsia website can be followed after that. I haven't
found anything that doesn't work.


On 20/05/2021, Camden Bruce <camde...@gmail.com> wrote:
> I can confirm that it also works on Fedora
>
> On Sunday, 16 May 2021 at 05:24:37 UTC+12 Amit Uttamchandani wrote:
>
>> Thanks for reaching out Alexander. There is an internal bug tracking the
>> issue.
>>
>> Note that the build should work on a non-Debian distro. I have been able
>> to build it on Arch for example.
>>
>>
>>
>> On Sat, May 15, 2021 at 9:58 AM 'Shai Barack' via discuss <
>> dis...@fuchsia.dev> wrote:
>>
>>> Hi Alexander,
>>>
>>> We never tried building on a Linux distro that's not derived from Debian.
>>>
>>> If you can short circuit the preflight check and the rest works for you,
>>>
>>> great! In the latter case you're welcome to send a patch that would make
>>>
>>> the check more robust.
>>>
>>> On Sat, May 15, 2021, 9:52 AM Alexander Ejbekov <alex.hr...@gmail.com>
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> This probably touches a few different topics but they all boil down to
>>>> the ffx tool. Specifically the preflight checks failed with:
>>>>
>>>> * [✗] Some build dependencies are missing: curl, git, unzip*
>>>>
>>>>
>>>> * To resolve, run: sudo apt-get install curl git unzip*
>>>>
>>>> Which caught me a bit off guard since I use all of those pretty much 365
>>>>
>>>> days a year. After digging a bit into the source code I found this
>>>> <https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/src/developer/ffx/plugins/platform/preflight/src/check/build_prereqs.rs#36>
>>>> .
>>>>
>>>> I never got this warning because I had *alien* installed in order to
>>>> convert some *deb* packages to *rpm* and *alien* itself requires *dpkg*.
>>>>
>>>> *dpkg -s* however reads from* /var/lib/dpkg/status*, which in my case
>>>> is empty(that would be the case for all non-debian based systems). So I
>>>>
>>>> guess my question is if there's a specific reason for using this
>>>> <https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/src/developer/ffx/plugins/platform/preflight/src/check/build_prereqs.rs#45>
>>>> as
>>>> opposed to something like:
>>>>
>>>> *let (status, _stdout, __stderr) = (self.command_runner)(&vec!["which",
>>>>
>>>> *package]).with_context(|| format!("Package not installed: '{}'",
>>>> package))?;*
>>>>
>>>> If *which* can't find the package, the status it returns would be 1 so
>>>> it should, in theory, cover both cases. I don't see anything binding the
>>>> to
>>>> *dpkg* here(or debian-based distros for that matter, unless I'm missing
>>>>
>>>> something). It seems to work fine on openSuSe Leap 15.2 for instance, I
>>>>
>>>> recon it would be fine with all(most) modern distros.
>>>>
>>>> Otherwise, off the top of my head, something like *$ apropos "package
>>>> manager"* might be an alternative to check if the system is debian
>>>> based?
>>>>
>>>> Cheers,
>>>> Alex.
>>>>
>>>> --
>>>> All posts must follow the Fuchsia Code of Conduct
>>>> https://fuchsia.dev/fuchsia-src/CODE_OF_CONDUCT or may be removed.
>>>> ---
>>>> You received this message because you are subscribed to the Google
>>>> Groups "discuss" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to discuss+u...@fuchsia.dev.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/a/fuchsia.dev/d/msgid/discuss/339464fb-4995-40a9-8b46-bfb68c0482f1n%40fuchsia.dev
>>>>
>>>> <https://groups.google.com/a/fuchsia.dev/d/msgid/discuss/339464fb-4995-40a9-8b46-bfb68c0482f1n%40fuchsia.dev?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> --
>>> All posts must follow the Fuchsia Code of Conduct
>>> https://fuchsia.dev/fuchsia-src/CODE_OF_CONDUCT or may be removed.
>>> ---
>>> You received this message because you are subscribed to the Google Groups
>>>
>>> "discuss" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an
>>>
>>> email to discuss+u...@fuchsia.dev.
>>>
>> To view this discussion on the web visit
>>> https://groups.google.com/a/fuchsia.dev/d/msgid/discuss/CAK0PkCEJOWefBLW_KEKuABaHbbP4gtio05KFLaW2U1LLtyzTJQ%40mail.gmail.com
>>>
>>> <https://groups.google.com/a/fuchsia.dev/d/msgid/discuss/CAK0PkCEJOWefBLW_KEKuABaHbbP4gtio05KFLaW2U1LLtyzTJQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>
> --
> All posts must follow the Fuchsia Code of Conduct
> https://fuchsia.dev/fuchsia-src/CODE_OF_CONDUCT or may be removed.
> ---
> You received this message because you are subscribed to the Google Groups
> "discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to discuss+u...@fuchsia.dev.
> To view this discussion on the web visit
> https://groups.google.com/a/fuchsia.dev/d/msgid/discuss/ff8bfe2c-67cd-4517-911c-9653ea10ad4fn%40fuchsia.dev.
>
Reply all
Reply to author
Forward
0 new messages