Closed
Bug 1260066
Opened 9 years ago
Closed 9 years ago
Don't allow to use sandbox primitives from anywhere but global scope and templates
Categories
(Firefox Build System :: General, defect)
Firefox Build System
General
Tracking
(firefox48 fixed)
RESOLVED
FIXED
mozilla48
Tracking | Status | |
---|---|---|
firefox48 | --- | fixed |
People
(Reporter: glandium, Assigned: glandium)
References
(Blocks 2 open bugs)
Details
Attachments
(3 files)
No description provided.
Assignee | ||
Comment 1•9 years ago
|
||
We've done this for set_config, set_define, imply_option, and
add_old_configure_assignment. Do it for add_old_configure_arg as well.
Review commit: https://reviewboard.mozilla.org/r/42697/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/42697/
Attachment #8735320 -
Flags: review?(nalexander)
Attachment #8735321 -
Flags: review?(nalexander)
Attachment #8735322 -
Flags: review?(nalexander)
Assignee | ||
Comment 2•9 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/42699/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/42699/
Assignee | ||
Comment 3•9 years ago
|
||
The initial goal of templates was to provide a way to write shorter
constructs for some generic tasks during configure. But the limitations
of the sandbox and the properties of templates made them used for more
general functions.
Consequently, this led to templates having to be available from
anywhere, which, in turn, led to difficult to introspect constructs.
With bug 1257823, we've made almost everything use set_config and
similar functions from the global scope, but we don't enforce that
those primitives are only used at the global scope.
This change does that: it enforces that primitives are only used at
the global scope. Or in templates.
Now, since templates were used for other purposes than generic uses
of other primitives, we now allow non-template functions to be declared.
Those can be used everywhere, but don't have access to the sandbox
primitives.
Review commit: https://reviewboard.mozilla.org/r/42701/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/42701/
Assignee | ||
Updated•9 years ago
|
Blocks: pyconfigure-introspect
Comment 4•9 years ago
|
||
Comment on attachment 8735320 [details]
MozReview Request: Bug 1260066 - Move add_old_configure_arg to the global scope. r?nalexander
https://reviewboard.mozilla.org/r/42697/#review39341
Attachment #8735320 -
Flags: review?(nalexander) → review+
Comment 5•9 years ago
|
||
Comment on attachment 8735321 [details]
MozReview Request: Bug 1260066 - Move last uses of check_prog that weren't in the global scope to the global scope. r?nalexander
https://reviewboard.mozilla.org/r/42699/#review39343
::: moz.configure:159
(Diff revision 1)
> -@depends(target)
> + )
> -def linux_programs(target):
> if target.os == 'GNU' and target.kernel == 'Linux':
> - check_prog('RPMBUILD', ('rpmbuild',), allow_missing=True)
> + return namespace(RPMBUILD=('rpmbuild',))
> +
> +check_prog('DSYMUTIL', delayed_getattr(extra_programs, 'DSYMUTIL'),
How can this succeed? Suppose we're not on Darwin, so extra_programs returns a namespace not including 'DSYMUTIL'. Then the `delayed_getattr` returns `None`, and `check_prog` should fail: https://dxr.mozilla.org/mozilla-central/source/build/moz.configure/checks.configure#58.
What am I missing?
Attachment #8735321 -
Flags: review?(nalexander)
Updated•9 years ago
|
Attachment #8735322 -
Flags: review?(nalexander) → review+
Comment 6•9 years ago
|
||
Comment on attachment 8735322 [details]
MozReview Request: Bug 1260066 - Don't allow to use sandbox primitives from anywhere but global scope and templates. r?nalexander
https://reviewboard.mozilla.org/r/42701/#review39347
This looks okay to me, but help me understand the scope of declared functions. Suppose `a.configure` defines `f` and `b.configure` includes `a.configure`. Is `f` available in `b.configure`? I assume yes (there's an `exec_file` in there)?
Assignee | ||
Comment 7•9 years ago
|
||
(In reply to Nick Alexander :nalexander from comment #5)
> How can this succeed? Suppose we're not on Darwin, so extra_programs
> returns a namespace not including 'DSYMUTIL'. Then the `delayed_getattr`
> returns `None`, and `check_prog` should fail:
> https://dxr.mozilla.org/mozilla-central/source/build/moz.configure/checks.
> configure#58.
>
> What am I missing?
bug 1259960
Assignee | ||
Comment 8•9 years ago
|
||
(In reply to Nick Alexander :nalexander from comment #6)
> Comment on attachment 8735322 [details]
> MozReview Request: Bug 1260066 - Don't allow to use sandbox primitives from
> anywhere but global scope and templates. r?nalexander
>
> https://reviewboard.mozilla.org/r/42701/#review39347
>
> This looks okay to me, but help me understand the scope of declared
> functions. Suppose `a.configure` defines `f` and `b.configure` includes
> `a.configure`. Is `f` available in `b.configure`? I assume yes (there's an
> `exec_file` in there)?
Same as templates and depends, yes.
Assignee | ||
Comment 9•9 years ago
|
||
Comment on attachment 8735321 [details]
MozReview Request: Bug 1260066 - Move last uses of check_prog that weren't in the global scope to the global scope. r?nalexander
See comment 7
Attachment #8735321 -
Flags: review?(nalexander)
Comment 10•9 years ago
|
||
Comment on attachment 8735321 [details]
MozReview Request: Bug 1260066 - Move last uses of check_prog that weren't in the global scope to the global scope. r?nalexander
https://reviewboard.mozilla.org/r/42699/#review39389
Attachment #8735321 -
Flags: review?(nalexander) → review+
Comment 11•9 years ago
|
||
Comment 12•9 years ago
|
||
Comment 13•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/26a63e35fb25
https://hg.mozilla.org/mozilla-central/rev/7c1b33d35a5b
https://hg.mozilla.org/mozilla-central/rev/63338edce3ba
https://hg.mozilla.org/mozilla-central/rev/36e9b1eebcf2
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox48:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Updated•7 years ago
|
Product: Core → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•