Closed Bug 784910 Opened 12 years ago Closed 12 years ago

Pymake: adjust sys.path so that native commands can load other modules from their own directories

Categories

(Firefox Build System :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla18

People

(Reporter: rain1, Assigned: rain1)

References

Details

Attachments

(1 file, 1 obsolete file)

Attached patch patch v1 (obsolete) (deleted) — Splinter Review
Python scripts often have import statements referring to modules in the same directory. That doesn't work if they're converted to native commands, though. This fixes up sys.path during load_module. Note that this doesn't fix up sys.path during execution, so while static imports work, dynamic ones don't. I don't think that's an important case, though.
Attachment #654500 - Attachment is patch: true
Attachment #654500 - Flags: review?(ted.mielczarek)
Attached patch patch v1.01 (deleted) — Splinter Review
Fixed the comment in testmodule.py.
Attachment #654500 - Attachment is obsolete: true
Attachment #654500 - Flags: review?(ted.mielczarek)
Attachment #654501 - Flags: review?(ted.mielczarek)
This seems pretty reasonable. The other thing I was thinking about was a way to make Pymake builds reinvoke Pymake using the in-tree virtualenv Python so that native commands could then import anything from the virtualenv. That might be a nicer long-term fix.
Attachment #654501 - Flags: review?(ted.mielczarek) → review+
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla18
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: