Closed Bug 901644 Opened 11 years ago Closed 11 years ago

Allow mach build paths to be specified relative to $srcdir

Categories

(Firefox Build System :: General, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla26

People

(Reporter: dcamp, Assigned: dcamp)

Details

(Whiteboard: [mach])

Attachments

(1 file, 1 obsolete file)

I'd like to be able to build what I'm working on from anywhere.  Maybe mach build /browser could be relative to srcdir?
That's a fair request.

Code for resolving a mach build argument/target into a make target lives at https://hg.mozilla.org/mozilla-central/file/default/python/mozbuild/mozbuild/util.py#l156.
Summary: Allow paths to be specified relative to $srcdir → Allow mach build paths to be specified relative to $srcdir
I feel like we discussed this but I can't find a record of it. Having "mach build /browser" build $topsrcdir/browser seems totally sane.
Attached patch mach-absolute.diff (obsolete) — Splinter Review
As simple as this?
Attachment #787135 - Flags: review?(gps)
Comment on attachment 787135 [details] [diff] [review]
mach-absolute.diff

Review of attachment 787135 [details] [diff] [review]:
-----------------------------------------------------------------

https://hg.mozilla.org/integration/mozilla-inbound/rev/a82f3a08ff3a

(with nits I fixed for you to make up for the review lag)

::: python/mozbuild/mozbuild/util.py
@@ +178,5 @@
>  
>      target = target.replace(os.sep, '/')
>  
> +    if target[0] == '/':
> +        target = target[1:]

target = target.lstrip('/')
Attachment #787135 - Flags: review?(gps) → review+
Component: mach → Build Config
Whiteboard: [mach]
Backed out in http://hg.mozilla.org/integration/mozilla-inbound/rev/a727146d85e2 since it turns out to have a test, which that failed.
Tests can be executed by running:

mach python-test python/mozbuild/mozbuild/test/
Attached patch v2Splinter Review
Attachment #795151 - Flags: review?(gps)
Attachment #787135 - Attachment is obsolete: true
Comment on attachment 795151 [details] [diff] [review]
v2

Review of attachment 795151 [details] [diff] [review]:
-----------------------------------------------------------------

::: python/mozbuild/mozbuild/test/test_util.py
@@ +123,5 @@
>  
> +    def test_root_path(self):
> +        self.assertResolve('/test-dir', ('test-dir', None))
> +        self.assertResolve('/test-dir/with', ('test-dir/with', None))
> +        self.assertResolve('/test-dir/with', ('test-dir/with', None))

Why the duplicate test?
Attachment #795151 - Flags: review?(gps) → review+
https://hg.mozilla.org/integration/fx-team/rev/05fe61b1a309
Assignee: nobody → dcamp
Whiteboard: [mach] → [mach][fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/05fe61b1a309
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [mach][fixed-in-fx-team] → [mach]
Target Milestone: --- → mozilla26
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: