Skip to content

[RFC]: Export all fields in Lage Info #815

@dannyvv

Description

@dannyvv

This RFC is part of a larger work proposal: #814
PR: #836

Overview

Running lage info does not emit all information available in the build graph.
It should include inputs, outputs, 'weight' as well as the options field.
This can be 'fed' into the other build engines to do the proper scheduling. The 'options' field can be used for build engine specific fields.
For example in BuildXL you generally want to treat cache location either as 'temp' folders or if you trust the tools incrementality to ship your production bits as an 'untracked' directory. This might not be relevant to Lage itself or to other build engines so it makes sense to store in the 'options' field.

Current users of BuildXL + Lage currently declare this information in custom configuraiton files. Either in bxlconfig.json file that the custom integratoin picks up or in the buildxl config.dsc file. This feature will give it the opportunity to be declared in lage and used identically by all. It should also improve lages performance when users run it outside of buildxl since the inputs / outputs will be less than the defaults for targes.

Detailed Design

We'll extend the PackageTask interface in packages/cli/src/commands/info/action.ts
In generatePackageTask we'll copy the fields as-is from the Target object.

weight

This will add the 'weight' field only if the value is not 1.

inputs, outputs

This will emit inputs and outputs as an array of strings.

options

This object will be printed just as-is and support any types json supports

Test Plan

Create a new test class and write some tests.

Performance, Resilience, Monitoring

The output json will increase a bit in size, but this should not affect things too much.
It will also only affect perf if if these fields are declared. All the current users of BuildXL integration do not yet specify any of these fields, so it should have no impact

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions