Closed Bug 1649707 Opened 5 years ago Closed 5 years ago

"cargo build" for geckodriver fails with "error: environment variable `MOZ_TOPOBJDIR` not defined"

Categories

(Testing :: geckodriver, defect)

defect

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: whimboo, Unassigned)

References

()

Details

When I run cargo build (or another sub command like test) from within testing/geckodriver the build fails when trying to compile the static_prefs crate:

error: environment variable `MOZ_TOPOBJDIR` not defined
  --> modules/libpref/init/static_prefs/src/lib.rs:12:5
   |
12 |     env!("MOZ_TOPOBJDIR"),
   |     ^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

error: could not compile `static_prefs`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed

I haven't seen this before. Nicholas, how can this be fixed? Just adding the environment variable before the command doesn't help.

Flags: needinfo?(n.nethercote)

Oh, sorry. My fault. I had several terminals open, and by switching through those I actually run that command under the top source dir, and not testing/geckodriver.

Status: NEW → RESOLVED
Closed: 5 years ago
Flags: needinfo?(n.nethercote)
Resolution: --- → INVALID
Summary: "cargo build" fails when run in testing/geckodriver → "cargo build" for geckodriver fails with "error: environment variable `MOZ_TOPOBJDIR` not defined"
You need to log in before you can comment on or make changes to this bug.