Open Bug 998104 Opened 11 years ago Updated 2 years ago

Add mach command to make it easier to extract configure/environment information in scripts

Categories

(Firefox Build System :: General, defect)

defect

Tracking

(Not tracked)

People

(Reporter: nalexander, Unassigned)

References

Details

Attachments

(1 file)

|mach environment| is great for humans, but not very good for machines. I propose a |mach dump-environment KEY KEY KEY| command that just dumps configure defines/substs/whatever to the terminal for scripting, etc. I considered rolling this into |mach environment|, but that has a decent amount of conditional logic that I don't want to route around.
The idea is to make it easier to extract configure/environment information in local developer scripts. Most importantly, this makes easy to find the current topobjdir: |mach dump-environment topobjdir|. I really don't care if we roll this into |mach environment|. We just need something like |mach environment| that is easy to parse from the shell.
Attachment #8408647 - Flags: review?(gps)
Attachment #8408647 - Flags: feedback?
Attachment #8408647 - Flags: feedback? → feedback?(ted)
Argh, I see I called it dump-configure, not dump-environment. Somebody paint this shed!
how about adding an option to mach environment to output a machine-readable format, instead?
(In reply to Mike Hommey [:glandium] from comment #3) > how about adding an option to mach environment to output a machine-readable > format, instead? I wondered about that, dumping JSON or similar. Comments about how special the environment command are still apply. My case is really about shell, though -- almost any key/value dump is a pain to parse.
Comment on attachment 8408647 [details] [diff] [review] Add |mach dump-environment KEY| command. r=gps Review of attachment 8408647 [details] [diff] [review]: ----------------------------------------------------------------- I'd add a flag to mach environment.
Attachment #8408647 - Flags: review?(gps)
Depends on: 762358
With bug 762358, mach environment has a new --format option that allows different kinds of output, one of which is json. If that's enough for you, then we can call that bug fixed. Note that this json output is also stored in $objdir/.mozconfig.json.
Oh, and mach environment --format=json --verbose outputs a json with even more info.
Comment on attachment 8408647 [details] [diff] [review] Add |mach dump-environment KEY| command. r=gps Oops, I left this sitting. I defer to gps. It sounds like glandium has you sorted, though.
Attachment #8408647 - Flags: feedback?(ted)
Product: Core → Firefox Build System
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: