Using the "--profile" argument in "moz:firefoxOptions['args']" generates two profile entries in the geckoview config file
Categories
(Testing :: geckodriver, defect, P3)
Tracking
(firefox-esr91 unaffected, firefox96 wontfix, firefox97 wontfix, firefox98 wontfix, firefox99 wontfix, firefox100 affected)
People
(Reporter: whimboo, Unassigned)
References
(Blocks 1 open bug, Regression)
Details
(Keywords: regression)
Attachments
(2 files)
Specifying a Firefox profile via moz:firefoxOptions["args"] causes the geckoview config file on the Android device to contain two entries for--profile` like:
1642709641495 geckodriver::android DEBUG Content of generated GeckoView config file:
## GeckoView configuration YAML
##
## Auto-generated by geckodriver.
## See https://mozilla.github.io/geckoview/consumer/docs/automation.
---
env:
MOZ_CRASHREPORTER: "1"
MOZ_CRASHREPORTER_NO_REPORT: "1"
MOZ_CRASHREPORTER_SHUTDOWN: "1"
args:
- "--marionette"
- "--remote-debugging-port"
- "--profile"
- /sdcard/Android/data/org.mozilla.geckoview.test_runner/files/test_root/org.mozilla.geckoview.test_runner-geckodriver-profile
- "--profile"
- /Users/henrik/code/gecko/_test-profile/
Note that the first entry is what we want. But the second entry is the source profile from the host.
This is a regression in geckodriver 0.30.0.
| Reporter | ||
Comment 1•3 years ago
|
||
This is a regression from bug 1721447 since we use the application arguments from moz:firefoxOptions to start Firefox on Android.
To fix this we will have to ignore the --profile argument and the immediate successor.
Comment 2•3 years ago
|
||
Set release status flags based on info from the regressing bug 1721447
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
| Reporter | ||
Comment 3•3 years ago
|
||
It's not a blocking issue and the GeckoView application is only considering the first profile as passed in. So it's not a regression we have to immediately work on. If time permits we could still try to get it into the 0.31.0 release.
| Reporter | ||
Comment 4•3 years ago
|
||
We should be safe to let this slip to the next 0.32.0 release.
| Reporter | ||
Comment 5•3 years ago
|
||
There was no time for the 0.32.0 release. Lets keep it on the radar for 0.33.0.
Comment 6•1 year ago
|
||
:whimboo I'm looking at tackling this bug. I have the android emulator up and running with firefox but when I try to run geckodriver ./mach geckodriver I get the following error:
0:00.59 E ERROR: Binary expected at /home/james/git-projects/mozilla-firefox/mozilla-unified/obj-x86_64-unknown-linux-android/dist/bin/fennec does not exist.
0:00.59 It looks like your program isn't built. You can run |./mach build| to build it.
I suspect that i'm missing an option to build fennec, as that was the case with geckodriver initially, but I'm not sure what to add to my mozconfig
# Build GeckoView/Firefox for Android:
ac_add_options --enable-project=mobile/android
ac_add_options --enable-geckodriver
# Targeting the following architecture.
# For regular phones, no --target is needed.
# For x86 emulators (and x86 devices, which are uncommon):
# ac_add_options --target=i686
# For newer phones or Apple silicon
# ac_add_options --target=aarch64
# For x86_64 emulators (and x86_64 devices, which are even less common):
# ac_add_options --target=x86_64
Do you know what I need to do in order to reproduce the output that you showed originally?
Updated•1 year ago
|
| Reporter | ||
Comment 7•1 year ago
|
||
The mozconfig that I have for GeckoView is the following:
mk_add_options MOZ_OBJDIR=/Users/henrik/code/gecko-obj/mobile
mk_add_options AUTOCLOBBER=1
ac_add_options --enable-application=mobile/android
ac_add_options --target=aarch64-linux-android
ac_add_options --enable-artifact-builds
ac_add_options --disable-debug
# workaround for bug 1748626 (crash for missing packages)
ac_add_options --enable-crashreporter
# Write build artifacts to:
Note that artifact builds are enough here as well given that we do not change any core (C++/rust) code of Gecko. I would suggest you to install the mozconfigwrapper package to easily switch between build environments. Further use a different MOZ_OBJDIR per mozconfig so that your other build doesn't get overridden.
mach geckodriver is not needed. Just go into testing/geckodriver and run cargo build as usual. That will place a debug binary of geckodriver into target/debug/geckodriver which ./mach wpt can pick up by specifying the path via --webdriver-binary. Let me know if that helped to build GeckoView.
| Reporter | ||
Comment 8•1 year ago
|
||
Hi James, I want to check back if the above mentioned mozconfig was helpful and you got your own build for Android running. Please let me know when you have the time to check. Thanks.
Comment 9•1 year ago
|
||
Apologies for the slow reply I did get it working but then got stuck. Hopefully with your help I can continue
Thanks to your help I was able to build android and run:
./mach wpt --webdriver-binary=target/debug/geckodriver --webdriver-arg=-v
Which results in logging the generated geckoview config file:
5:08.68 pid:55883 1722068237261 geckodriver::android DEBUG Content of generated GeckoView config file:
5:08.68 pid:55883 ## GeckoView configuration YAML
5:08.68 pid:55883 ##
5:08.68 pid:55883 ## Auto-generated by geckodriver.
5:08.68 pid:55883 ## See https ... "--profile"
5:08.68 pid:55883 - /tmp/tmppehrx0pl.mozrunner
5:08.68 pid:55883 - "--remote-debugging-port"
5:08.68 pid:55883 - "9222"
5:08.68 pid:55883 - "--remote-allow-hosts"
5:08.68 pid:55883 - localhost
5:08.68 pid:55883 1722068237261 geckodriver::android DEBUG Pushing GeckoView configuration file to /data/local/tmp/org.mozilla.geckoview.test_runner-geckoview-config.yaml
But i'm not sure which web-platform tests I should be running to see the extra --profile argument (or how to introduce the extra --profile argument)
| Reporter | ||
Comment 10•1 year ago
|
||
You cannot actually just run a web-platform test to reproduce this issue. Instead you have to run a command manually like via curl. Here the steps:
- Start the emulator
- Start geckodriver
- Run
curl -H 'Content-Type: application/json' -d '{"capabilities": {"alwaysMatch": {"moz:firefoxOptions": {"args": ["--profile", "some_path"], "androidPackage": "org.mozilla.firefox", "androidActivity": ".App", "androidIntentArguments": ["-a", "android.intent.action.VIEW", "-d", "about:blank"]}}' http://localhost:4444/session
With those steps you should see the 2nd --profile line(s) in the YAML configuration.
Comment 11•1 year ago
|
||
Comment 12•1 year ago
|
||
Comment 13•1 year ago
|
||
I am now able to reproduce the issue and see the generated config file with two --profile entries using the following:
Data to send with curl (Make sure the directory exists):
{"capabilities": {"alwaysMatch": {"moz:firefoxOptions": {"args": ["--profile", "/home/james/Downloads/test_profile/"], "androidPackage": "org.mozilla.geckoview_example", "androidActivity": ".GeckoViewActivity", "androidIntentArguments": ["-a", "android.intent.action.VIEW", "-d", "about:blank"]}}}}
Output before changes:
## GeckoView configuration YAML
##
## Auto-generated by geckodriver.
## See https://mozilla.github.io/geckoview/consumer/docs/automation.
---
env:
MOZ_CRASHREPORTER: "1"
MOZ_CRASHREPORTER_NO_REPORT: "1"
MOZ_CRASHREPORTER_SHUTDOWN: "1"
args:
- "--marionette"
- "--profile"
- /sdcard/Android/data/org.mozilla.geckoview_example/files/test_root/org.mozilla.geckoview_example-geckodriver-profile
- "--profile"
- /home/james/Downloads/test_profile
After changes:
I've made it so it ignores the --profile and logs a warning:
1723650818220 geckodriver::android WARN Ignoring --profile argument
1723650818220 geckodriver::android DEBUG Content of generated GeckoView config file:
## GeckoView configuration YAML
##
## Auto-generated by geckodriver.
## See https://mozilla.github.io/geckoview/consumer/docs/automation.
---
env:
MOZ_CRASHREPORTER: "1"
MOZ_CRASHREPORTER_NO_REPORT: "1"
MOZ_CRASHREPORTER_SHUTDOWN: "1"
args:
- "--marionette"
- "--profile"
- /sdcard/Android/data/org.mozilla.geckoview_example/files/test_root/org.mozilla.geckoview_example-geckodriver-profile
Comment 14•8 months ago
|
||
The bug assignee is inactive on Bugzilla, so the assignee is being reset.
Description
•