Skip to content

Conversation

stunes-ms
Copy link
Contributor

I use Arch btw

This was mostly straightforward, thanks to previous work to add support for additional Linux distros. This change mostly changes a few places from building package/binary names from arch strings, to just giving the whole package/binary name explicitly.

@stunes-ms stunes-ms requested a review from a team as a code owner October 3, 2025 23:22
@stunes-ms stunes-ms requested review from Copilot and romank-msft and removed request for Copilot October 3, 2025 23:22
let pkg = match linux_distribution {
FlowPlatformLinuxDistro::Fedora => "gcc-x86_64-linux-gnu",
FlowPlatformLinuxDistro::Ubuntu => "gcc-x86-64-linux-gnu",
FlowPlatformLinuxDistro::Arch => "gcc",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there no x86-64 version of the symlink? Like what if we were cross compiling for x64 from arm?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. Arch is explicitly an x86-only distro (https://wiki.archlinux.org/title/Frequently_asked_questions#What_architectures_does_Arch_support?). There is Arch Linux ARM, but that's a separate project.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right. Maybe we should have some unreachables or something for cross compilation cases then instead of pretending it's supported?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also what paths would we end up going down if someone did try to run this code on Arch ARM?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just pushed a change with one possible fix: bail here if we see that we're on Arch and the host is ARM.

Another possibility would have been in pipeline.rs linux_distro: if we find Arch and the host is ARM, bail out there. It's less code, probably, but it's also action-at-a-distance to some extent, maybe?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, let's dedup

@mattkur
Copy link
Contributor

mattkur commented Oct 6, 2025

This is great, thank you for contributing! @jstarks brought this up in a different context, but the more complexity we have here then the more difficult it becomes to maintain quality in flowey. Do we need a flowey ci for ci that runs these flows across various architectures and distros?

Or, we document that we only officially support whatever is used in the GH runners (e.g. ubuntu 24 lts), and everything else is best/community effort?

@smalis-msft
Copy link
Contributor

I believe the latter is already the case, if not it's the unspoken case and we should document it.

@smalis-msft
Copy link
Contributor

Or rather, the policy is "We support what we run in CI (Ubuntu) and our guide's recommended local dev environment (WSL with Ubuntu)." Ideally those will always be the same.

@benhillis
Copy link
Member

benhillis commented Oct 6, 2025

As part of another workstream (reproducible builds) we are reconsidering the way that dependencies are installed. We will likely be switching to something Nix based.

@Copilot Copilot AI review requested due to automatic review settings October 6, 2025 23:49
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for Arch Linux to the Flowey build system. The main purpose is to extend the existing Linux distribution support to include Arch Linux alongside the already supported Fedora and Ubuntu distributions.

Key changes:

  • Added Arch Linux as a recognized Linux distribution in the platform detection system
  • Updated package management logic to handle pacman (Arch's package manager) commands
  • Modified cross-compilation toolchain setup to use Arch-specific package names and binaries

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
flowey/flowey_core/src/node.rs Added Arch variant to FlowPlatformLinuxDistro enum
flowey/flowey_core/src/pipeline.rs Added detection logic for Arch Linux in /etc/os-release
flowey/flowey_lib_common/src/install_dist_pkg.rs Added pacman package manager support for querying, updating, and installing packages
flowey/flowey_lib_common/src/download_azcopy.rs Added libarchive package mapping for Arch Linux
flowey/flowey_lib_common/src/_util/extract.rs Added libarchive package mapping for Arch Linux
flowey/flowey_lib_hvlite/src/build_openhcl_initrd.rs Added python package name mapping (python vs python3) for Arch Linux
flowey/flowey_lib_hvlite/src/init_cross_build.rs Updated cross-compilation toolchain setup with Arch-specific GCC package names
flowey/flowey_lib_hvlite/src/run_split_debug_info.rs Updated objcopy tool setup with Arch-specific binutils package names

Comment on lines 48 to 50
FlowArch::Aarch64 => {
anyhow::bail!("Arch Linux ARM is not supported")
}
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate error handling logic for unsupported Arch Linux ARM appears multiple times. Consider extracting this into a helper function or constant to reduce code duplication.

Copilot uses AI. Check for mistakes.

Comment on lines 68 to 70
FlowArch::Aarch64 => {
anyhow::bail!("Arch Linux ARM is not supported")
}
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the same error message and handling logic as in the previous file. Consider consolidating this repeated pattern into a shared utility function.

Copilot uses AI. Check for mistakes.

Comment on lines 92 to 94
FlowArch::Aarch64 => {
anyhow::bail!("Arch Linux ARM is not supported")
}
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the third occurrence of the same error handling pattern. The repeated logic should be extracted into a common helper function.

Copilot uses AI. Check for mistakes.

Copy link

github-actions bot commented Oct 7, 2025

@stunes-ms stunes-ms added the release-ci-required Add to a PR to trigger PR gates in release mode label Oct 8, 2025
@stunes-ms stunes-ms force-pushed the user/mikestunes/arch branch from 77137a8 to 24d27cc Compare October 8, 2025 00:52
Copy link

github-actions bot commented Oct 8, 2025

@stunes-ms stunes-ms force-pushed the user/mikestunes/arch branch from 24d27cc to 77c3aa4 Compare October 8, 2025 17:03
Copy link

github-actions bot commented Oct 8, 2025

@stunes-ms stunes-ms merged commit 4ca292e into microsoft:main Oct 8, 2025
50 of 52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-ci-required Add to a PR to trigger PR gates in release mode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants