bazelbuild / bazelbuild/bazel

feature "filelist" : an ordered list of files (vs "filegroup": an unordered list)

Open
#27,472 1 comment 0 reactions 0 assignees View on GitHub
team-Core type: feature request untriaged
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the feature request:

`filegroup` provides a way to reference a group of files (even though `srcs` is described to be list).

I need something that preserves the order. Could you consider adding something like `filelist` which maintains the order?

### Which category does this issue belong to?

Core

### What underlying problem are you trying to solve with this feature?

I have a python program that requires a list of files in order. Part of my `genrule` for running that program was to use a `filegroup` to provide the list to the program from another part of the project. I now have to kludge a workaround or refactor the approach. Thanks for your consideration.

### Which operating system are you running Bazel on?

Ubuntu 24.04.3

### What is the output of `bazel info release`?

release 8.4.2

### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.

N/A

### What's the output of `git remote get-url origin; git rev-parse HEAD` ?

N/A

### Have you found anything relevant by searching the web?

[issue 12047](https://github.com/bazelbuild/bazel/issues/12047)

### Any other information, logs, or outputs that you want to share?

I did put a print statement in my python code to verify order had changed.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the existing filegroup behavior used by the mentioned genrule and the related discussion in issue 12047. Determine how an ordered file collection should be represented and exposed, then verify that the Python program receives files in the declared order; done means the behavior and its tests are accepted.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.