Skip to content

Skip irrelevant submodules when building on Arch #817

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

Merged
merged 11 commits into from
Mar 10, 2023

Conversation

Tea23
Copy link
Contributor

@Tea23 Tea23 commented Jan 23, 2023

Description

The ffmpeg submodules are quite large, so pulling them in when building on Arch adds some unnecessary extra time to the build. When building on Arch, we're only interested in ffpmeg-linux-x86_64 and the others are not used at all.

Arguably we could conditionally pull ffpmeg-linux-aarch64 instead of its x86_64 counterpart when building for / on aarch64, but because arch doesn't specify aarch64 as a valid architecture for this package, there's no real need.

Screenshot

N/A

Issues Fixed or Closed

N/A

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update (updates to dependencies)
  • Documentation update (changes to documentation)
  • Repository update (changes to repository files, e.g. .github/...)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

Branch Updates

LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.

  • I want maintainers to keep my branch updated

ReenigneArcher and others added 7 commits October 30, 2022 15:05
The ffmpeg submodules are quite large, so pulling them in when building on Arch adds some unnecessary extra time to the build. When building on Arch, we're only interested in `ffpmeg-linux-x86_64` and the others are not used at all.

Arguably we could conditionally pull `ffpmeg-linux-aarch64` instead of its x86_64 counterpart when building for / on aarch64, but because `arch` doesn't specify aarch64 as a valid architecture for this package, there's no real need.
@CLAassistant
Copy link

CLAassistant commented Jan 23, 2023

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot changed the base branch from master to nightly January 23, 2023 03:57
@github-actions
Copy link

Your PR was set to master, PRs should be sent to nightly.
The base branch of this PR has been automatically changed to nightly.
Please check that there are no merge conflicts

@ReenigneArcher
Copy link
Member

Thank you for your submission.

Arguably we could conditionally pull ffpmeg-linux-aarch64 instead of its x86_64 counterpart when building for / on aarch64, but because arch doesn't specify aarch64 as a valid architecture for this package, there's no real need.

I was planning to enable this for aarch64, but as far as I could find all the dependencies are not available for arm64. Perhaps I am searching wrong, but when I search for avahi for example, it just shows x86_64... https://archlinux.org/packages/?sort=&q=avahi&maintainer=&flagged=

In fact, arm64/aarch64 is not even listed as a possible architecture.
image

@Tea23
Copy link
Contributor Author

Tea23 commented Jan 23, 2023

Strictly speaking, Arch only supports x86_64 and so they don't list alternative architectures on the official AUR. The arch parameter in a PKGBUILD specifies which architectures the package maintainer deems it to be compatible with, but the upstream distro itself will only support/endorse/etc x86_64. aarch64 and i686 are supplied by separate projects (https://archlinuxarm.org/ and https://archlinux32.org/).

Nothing stops you from defining i686 and/or aarch64 in arch, you just forfeit any distro level support and have to take it on yourself. If we do want this package to build on aarch64, we'd need to adjust the prepare section to conditionally pull the appropriate submodule.

@ReenigneArcher
Copy link
Member

Strictly speaking, Arch only supports x86_64 and so they don't list alternative architectures on the official AUR. The arch parameter in a PKGBUILD specifies which architectures the package maintainer deems it to be compatible with, but the upstream distro itself will only support/endorse/etc x86_64. aarch64 and i686 are supplied by separate projects (https://archlinuxarm.org/ and https://archlinux32.org/).

Nothing stops you from defining i686 and/or aarch64 in arch, you just forfeit any distro level support and have to take it on yourself. If we do want this package to build on aarch64, we'd need to adjust the prepare section to conditionally pull the appropriate submodule.

Okay, would you mind making the adjustment, as well as adding aarch64 to the arch parameter?

@Tea23
Copy link
Contributor Author

Tea23 commented Jan 24, 2023

@ReenigneArcher Sure, although you may want to remove i686 altogether, there only seems to be x86_64 and aarch64 ffpmeg submodules so sunshine may not build in i686 at all.

Tea23 added 2 commits January 23, 2023 18:34
The default behaviour will pull all submodules, because honestly it'd be impressive if someone got that far at all!
@ReenigneArcher
Copy link
Member

you may want to remove i686 altogether

That's fine with me as well.

@ReenigneArcher ReenigneArcher merged commit bf4ed89 into LizardByte:nightly Mar 10, 2023
@KuleRucket
Copy link
Contributor

You have most commands in the if/else block repeating for every branch.

All of this could simply be outside the if block:

        git -c submodule."ffmpeg-macos-x86_64".update=none \
            -c submodule."ffmpeg-windows-x86_64".update=none \
            -c submodule."ffmpeg-macos-aarch64".update=none \
            submodule update --recursive --init

@ReenigneArcher
Copy link
Member

@KuleRucket then it would grab non architecture specific submodules in all cases.

@KuleRucket
Copy link
Contributor

KuleRucket commented Mar 10, 2023

The final commit is OK. I was looking at the one before that had the same in the else block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants