Closed
Bug 1319156
Opened 8 years ago
Closed 8 years ago
Allow specifying cargo features for Rust libraries from moz.build
Categories
(Firefox Build System :: General, defect)
Firefox Build System
General
Tracking
(firefox53 fixed)
RESOLVED
FIXED
mozilla53
Tracking | Status | |
---|---|---|
firefox53 | --- | fixed |
People
(Reporter: manishearth, Assigned: froydnj)
References
Details
Attachments
(3 files)
5.30 KB,
patch
|
chmanchester
:
review+
|
Details | Diff | Splinter Review |
2.50 KB,
patch
|
chmanchester
:
review+
|
Details | Diff | Splinter Review |
10.76 KB,
patch
|
chmanchester
:
review+
|
Details | Diff | Splinter Review |
It should be possible to set `RUST_LIBRARIES['foo'].features += ["random-feature"]` and have the contents passed to `--features` in `cargo build`
Assignee | ||
Comment 1•8 years ago
|
||
Ideally, people will just use the extra argument to RustLibrary to define features for their library.
Attachment #8815310 -
Flags: review?(cmanchester)
Assignee | ||
Comment 2•8 years ago
|
||
Attachment #8815312 -
Flags: review?(cmanchester)
Assignee | ||
Comment 3•8 years ago
|
||
This commit also adds an overdue test for plain Rust libraries in the recursivemake backend, but said test also serves to ensure that we don't emit features for a library if none were defined in moz.build.
Attachment #8815313 -
Flags: review?(cmanchester)
Updated•8 years ago
|
Attachment #8815310 -
Flags: review?(cmanchester) → review+
Updated•8 years ago
|
Attachment #8815312 -
Flags: review?(cmanchester) → review+
Comment 4•8 years ago
|
||
Comment on attachment 8815313 [details] [diff] [review] part 3 - tests for Rust library features, frontend and backend Review of attachment 8815313 [details] [diff] [review]: ----------------------------------------------------------------- ::: python/mozbuild/mozbuild/test/frontend/data/rust-library-features/moz.build @@ +15,5 @@ > + IS_RUST_LIBRARY = True > + RUST_LIBRARY_FEATURES = features > + > + > +RustLibrary('random-crate', ['musthave', 'cantlivewithout']) Do we get a nice error message is someone passes a string instead of a list for features?
Attachment #8815313 -
Flags: review?(cmanchester) → review+
Assignee | ||
Comment 5•8 years ago
|
||
(In reply to Chris Manchester (:chmanchester) from comment #4) > > +RustLibrary('random-crate', ['musthave', 'cantlivewithout']) > > Do we get a nice error message is someone passes a string instead of a list > for features? I believe we'll get an exception when the non-list thing is assigned to RUST_LIBRARY_FEATURES in the template. Is that sufficient, do you think, or should we try to provide a higher level error from the template itself? (Can templates even raise exceptions?)
Flags: needinfo?(cmanchester)
Comment 6•8 years ago
|
||
Maybe we could do an explicit check and call `error` in the template, but really, that sounds fine.
Flags: needinfo?(cmanchester)
Pushed by nfroyd@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/8276296cd505 part 1 - add features to RustLibrary objects and moz.build definitions; r=chmanchester https://hg.mozilla.org/integration/mozilla-inbound/rev/b5de6b777970 part 2 - handle Rust library features in the recursivemake backend; r=chmanchester https://hg.mozilla.org/integration/mozilla-inbound/rev/db686076ae29 part 3 - tests for Rust library features, frontend and backend; r=chmanchester
Pushed by nfroyd@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/a7ab3fbb933f followup - only assign RUST_LIBRARY_FEATURES when features are provided to RustLibrary; r=me
Comment 9•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/8276296cd505 https://hg.mozilla.org/mozilla-central/rev/b5de6b777970 https://hg.mozilla.org/mozilla-central/rev/db686076ae29 https://hg.mozilla.org/mozilla-central/rev/a7ab3fbb933f
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox53:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
Updated•6 years ago
|
Product: Core → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•