Skip to content

Commit

Permalink
Bump version to the latest release candidate (101.0-2).
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier Tilloy committed May 29, 2022
1 parent d03cbfc commit 8d2815d
Show file tree
Hide file tree
Showing 7 changed files with 2,568 additions and 2,607 deletions.
6 changes: 0 additions & 6 deletions firefox.launcher
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@ if [ ! -d "$DOTMOZILLA" ]; then
fi
fi

# Strictly confined snaps have a private /tmp area, not shared with other
# applications. This is a workaround to enable opening files downloaded with
# Firefox with other apps installed on the host system.
# See https://forum.snapcraft.io/t/sharing-files-via-tmp/1613 for details.
export TMPDIR="$(xdg-user-dir DOWNLOAD)/firefox.tmp"

# Default to XWayland until native Wayland support is properly tested
# (see https://bugzilla.mozilla.org/show_bug.cgi?id=1725245)
[ -z "$MOZ_ENABLE_WAYLAND" ] && export MOZ_ENABLE_WAYLAND=0
Expand Down
1 change: 1 addition & 0 deletions mozconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ ac_add_options --enable-crashreporter
ac_add_options --enable-official-branding
ac_add_options --disable-updater
ac_add_options --disable-tests
ac_add_options --enable-geckodriver
ac_add_options --disable-debug-symbols
export MOZILLA_OFFICIAL=1
64 changes: 64 additions & 0 deletions patches/geckodriver-snap-binary.patch
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()
{
2 changes: 1 addition & 1 deletion patches/series
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
Loading

0 comments on commit 8d2815d

Please sign in to comment.