-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump version to the latest release candidate (101.0-2).
- Loading branch information
Olivier Tilloy
committed
May 29, 2022
1 parent
d03cbfc
commit 8d2815d
Showing
7 changed files
with
2,568 additions
and
2,607 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# HG changeset patch | ||
# User Olivier Tilloy <olivier@tilloy.net> | ||
# Date 1652448789 -7200 | ||
# Fri May 13 15:33:09 2022 +0200 | ||
# Node ID 7cc4bae5c24b7ff49a8c446f8cd3d7f855e2d25b | ||
# Parent 150d9a179926637ee79ab07da46965fbd5e817eb | ||
Bug 1766125 - Rewrite the firefox binary path when geckodriver is used from within snap confinement | ||
|
||
Differential Revision: https://phabricator.services.mozilla.com/D146303 | ||
|
||
diff --git a/testing/geckodriver/src/capabilities.rs b/testing/geckodriver/src/capabilities.rs | ||
--- a/testing/geckodriver/src/capabilities.rs | ||
+++ b/testing/geckodriver/src/capabilities.rs | ||
@@ -15,6 +15,7 @@ use regex::bytes::Regex; | ||
use serde_json::{Map, Value}; | ||
use std::collections::BTreeMap; | ||
use std::default::Default; | ||
+use std::env; | ||
use std::ffi::OsString; | ||
use std::fmt::{self, Display}; | ||
use std::fs; | ||
@@ -26,6 +27,18 @@ use std::str::{self, FromStr}; | ||
use webdriver::capabilities::{BrowserCapabilities, Capabilities}; | ||
use webdriver::error::{ErrorStatus, WebDriverError, WebDriverResult}; | ||
|
||
+const SNAP_LAUNCHER: &str = "/snap/firefox/current/firefox.launcher"; | ||
+ | ||
+fn running_as_snap() -> bool { | ||
+ let instance_name = env::var("SNAP_INSTANCE_NAME").unwrap_or(String::new()); | ||
+ if !instance_name.is_empty() { | ||
+ return true; | ||
+ } | ||
+ // Compatibility for snapd <= 2.35: | ||
+ let snap_name = env::var("SNAP_NAME").unwrap_or(String::new()); | ||
+ return !snap_name.is_empty(); | ||
+} | ||
+ | ||
#[derive(Clone, Debug)] | ||
enum VersionError { | ||
VersionError(mozversion::Error), | ||
@@ -76,6 +89,10 @@ impl<'a> FirefoxCapabilities<'a> { | ||
} | ||
|
||
fn set_binary(&mut self, capabilities: &Map<String, Value>) { | ||
+ if running_as_snap() { | ||
+ self.chosen_binary = Some(PathBuf::from(SNAP_LAUNCHER)); | ||
+ return; | ||
+ } | ||
self.chosen_binary = capabilities | ||
.get("moz:firefoxOptions") | ||
.and_then(|x| x.get("binary")) | ||
@@ -222,7 +239,11 @@ impl<'a> BrowserCapabilities for Firefox | ||
} | ||
} | ||
"binary" => { | ||
- if let Some(binary) = value.as_str() { | ||
+ if let Some(mut binary) = value.as_str() { | ||
+ if running_as_snap() { | ||
+ debug!("Ignoring custom Firefox binary location, overriding it with '{}'", SNAP_LAUNCHER); | ||
+ binary = SNAP_LAUNCHER; | ||
+ } | ||
if !data.contains_key("androidPackage") | ||
&& self.version(Some(Path::new(binary))).is_err() | ||
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
angle-add-missing-cmath-include.patch | ||
upstream-D134738.diff | ||
upstream-D142373.patch | ||
upstream-D144030.diff | ||
geckodriver-snap-binary.patch |
Oops, something went wrong.