Skip to content

Commit 2a3e0f4

Browse files
authored
Fixes for new agent release (#186)
* bump version * patch: browoseros_server path and copy * patch: fix: browoser_server cmdline bug * update browseros_server binaries * update browseros_server binaries * tmp: disable valiation of binary * fix: arch copy fixed * fix: windows executable path * update binaries * bump version * update codex binary * update browseros_server binaries * browseros_server: pass resources_dir as arg * update browseros_server binaries * bump version * binary test * updated binaries * bump version * update browseros_server binaries * keep browosos extensions alive patch * bump version * fix: browseros_server windows path * fix: codex windows binary * package_windows: rebuild with setup too * revert: windows visual element fix * browseros execution-dir creation * update binaries * bump version * update browseros_server binaries * package linux file * updates to package.linux * browseros_server: file locking - only one instance running * browseros_server: kill on terminate of browser * bump version * browseros_server terminate fixes * browseros_server: support restart through pref * update browseros_server binaries * browseros_server: restart pref and missing files * extension ota: force setup udpate url
1 parent b9b2391 commit 2a3e0f4

32 files changed

+654
-234
lines changed

packages/browseros/build/build.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,12 +307,16 @@ def build_main(
307307
ctx, interactive=patch_interactive, commit_each=patch_commit
308308
)
309309

310-
# Copy resources
310+
if slack_notifications:
311+
notify_build_step("Completed applying patches")
312+
313+
# Copy resources for each architecture (YAML filters by arch)
314+
if apply_patches_flag:
311315
copy_resources(ctx, commit_each=patch_commit)
312316

313317
if slack_notifications:
314318
notify_build_step(
315-
"Completed applying patches and copying resources"
319+
f"Completed copying resources for {arch_name}"
316320
)
317321

318322
# Build for this architecture
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
69
1+
78
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# BrowserOS Linux Release Build Configuration
2+
build:
3+
type: release
4+
architecture: x64 # Linux x64 only
5+
# architectures: [x64] # Single architecture for Linux
6+
universal: false # Linux doesn't support universal binaries
7+
8+
gn_flags:
9+
file: build/config/gn/flags.linux.release.gn
10+
11+
steps:
12+
clean: false
13+
git_setup: false
14+
apply_patches: false
15+
build: false
16+
sign: false # Linux doesn't require code signing
17+
package: true
18+
19+
paths:
20+
root_dir: .
21+
# chromium_src: ../chromium-src
22+
23+
# Environment-specific settings
24+
env:
25+
PYTHONPATH: scripts
26+
27+
# Linux-specific settings
28+
linux:
29+
appimage:
30+
compression: gzip # Compression type for AppImage
31+
architecture: x86_64 # AppImage architecture designation
32+
33+
# Notification settings
34+
notifications:
35+
slack: true # Enable Slack notifications for release builds

packages/browseros/build/modules/package_windows.py

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
def get_browseros_server_binary_paths(build_output_dir: Path) -> List[Path]:
3333
"""Return absolute paths to BrowserOS Server binaries for signing."""
34-
server_dir = build_output_dir / "BrowserOSServer" / "default"
34+
server_dir = build_output_dir / "BrowserOSServer" / "default" / "resources" / "bin"
3535
return [server_dir / binary for binary in BROWSEROS_SERVER_BINARIES]
3636

3737

@@ -69,12 +69,18 @@ def build_mini_installer(ctx: BuildContext) -> bool:
6969
# Get paths
7070
build_output_dir = join_paths(ctx.chromium_src, ctx.out_dir)
7171
mini_installer_path = build_output_dir / "mini_installer.exe"
72+
setup_exe_path = build_output_dir / "setup.exe"
7273

73-
if mini_installer_path.exists():
74-
log_info("mini_installer.exe already exists")
75-
return True
74+
if mini_installer_path.exists() and setup_exe_path.exists():
75+
log_info(
76+
"mini_installer.exe and setup.exe already exist; rebuilding to ensure freshness"
77+
)
78+
elif setup_exe_path.exists() and not mini_installer_path.exists():
79+
log_info("setup.exe exists but mini_installer.exe missing")
80+
elif mini_installer_path.exists() and not setup_exe_path.exists():
81+
log_info("mini_installer.exe exists but setup.exe missing")
7682

77-
log_info("Building mini_installer target...")
83+
log_info("Building setup and mini_installer targets...")
7884

7985
# Build mini_installer using autoninja
8086
try:
@@ -86,6 +92,7 @@ def build_mini_installer(ctx: BuildContext) -> bool:
8692
autoninja_cmd,
8793
"-C",
8894
ctx.out_dir, # Use relative path like in compile.py
95+
"setup",
8996
"mini_installer",
9097
]
9198

@@ -101,15 +108,24 @@ def build_mini_installer(ctx: BuildContext) -> bool:
101108
os.chdir(old_cwd)
102109

103110
# Verify the file was created
104-
if mini_installer_path.exists():
105-
log_success("mini_installer built successfully")
111+
missing_artifacts = []
112+
if not setup_exe_path.exists():
113+
missing_artifacts.append("setup.exe")
114+
if not mini_installer_path.exists():
115+
missing_artifacts.append("mini_installer.exe")
116+
117+
if not missing_artifacts:
118+
log_success("mini_installer and setup built successfully")
106119
return True
107-
else:
108-
log_error("mini_installer build completed but file not found")
109-
return False
120+
121+
log_error(
122+
"Build completed but missing artifacts: "
123+
+ ", ".join(missing_artifacts)
124+
)
125+
return False
110126

111127
except Exception as e:
112-
log_error(f"Failed to build mini_installer: {e}")
128+
log_error(f"Failed to build setup/mini_installer: {e}")
113129
return False
114130

115131

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
diff --git a/base/threading/thread_restrictions.h b/base/threading/thread_restrictions.h
2+
index 59d6e6e4d899f..9f2737ff17c6f 100644
3+
--- a/base/threading/thread_restrictions.h
4+
+++ b/base/threading/thread_restrictions.h
5+
@@ -200,6 +200,9 @@ namespace scheduler {
6+
class NonMainThreadImpl;
7+
}
8+
} // namespace blink
9+
+namespace browseros {
10+
+class BrowserOSServerManager;
11+
+} // namespace browseros
12+
namespace cc {
13+
class CategorizedWorkerPoolJob;
14+
class CategorizedWorkerPool;
15+
@@ -595,6 +598,7 @@ class BASE_EXPORT ScopedAllowBlocking {
16+
friend class base::subtle::PlatformSharedMemoryRegion;
17+
friend class base::win::ScopedAllowBlockingForUserAccountControl;
18+
friend class blink::DiskDataAllocator;
19+
+ friend class browseros::BrowserOSServerManager;
20+
friend class chromecast::CrashUtil;
21+
friend class content::BrowserProcessIOThread;
22+
friend class content::DWriteFontProxyImpl;
23+
@@ -743,6 +747,7 @@ class BASE_EXPORT ScopedAllowBaseSyncPrimitives {
24+
friend class base::SimpleThread;
25+
friend class base::internal::GetAppOutputScopedAllowBaseSyncPrimitives;
26+
friend class blink::SourceStream;
27+
+ friend class browseros::BrowserOSServerManager;
28+
friend class blink::VideoTrackRecorderImplContextProvider;
29+
friend class blink::WorkerThread;
30+
friend class blink::scheduler::NonMainThreadImpl;

packages/browseros/chromium_patches/chrome/BUILD.gn

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
2-
index 97f843f8133c4..b7af2f2d94579 100644
2+
index 97f843f8133c4..0acbe29f11806 100644
33
--- a/chrome/BUILD.gn
44
+++ b/chrome/BUILD.gn
55
@@ -18,6 +18,7 @@ import("//build/config/win/manifest.gni")
@@ -37,11 +37,3 @@ index 97f843f8133c4..b7af2f2d94579 100644
3737
configs += [ ":chrome_dll_symbol_order" ]
3838
if (!is_component_build && !using_sanitizer) {
3939
configs += [ ":chrome_dll_symbol_exports" ]
40-
@@ -1493,6 +1500,7 @@ copy("visual_elements_resources") {
41-
"//chrome/app/theme/$branding_path_component/win/tiles/Logo.png",
42-
"//chrome/app/theme/$branding_path_component/win/tiles/SmallLogo.png",
43-
"app/visual_elements_resources/chrome.VisualElementsManifest.xml",
44-
+ "app/visual_elements_resources/browseros.VisualElementsManifest.xml",
45-
]
46-
47-
if (is_chrome_branded) {

packages/browseros/chromium_patches/chrome/app/visual_elements_resources/browseros.VisualElementsManifest.xml

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
diff --git a/chrome/browser/browseros_server/.gitignore b/chrome/browser/browseros_server/.gitignore
2+
new file mode 100644
3+
index 0000000000000..cb76b31565a77
4+
--- /dev/null
5+
+++ b/chrome/browser/browseros_server/.gitignore
6+
@@ -0,0 +1 @@
7+
+resources/
Lines changed: 29 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,28 @@
11
diff --git a/chrome/browser/browseros_server/BUILD.gn b/chrome/browser/browseros_server/BUILD.gn
22
new file mode 100644
3-
index 0000000000000..7165c4459db08
3+
index 0000000000000..ddbdf0b78c0a3
44
--- /dev/null
55
+++ b/chrome/browser/browseros_server/BUILD.gn
6-
@@ -0,0 +1,74 @@
6+
@@ -0,0 +1,66 @@
77
+# Copyright 2024 The Chromium Authors
88
+# Use of this source code is governed by a BSD-style license that can be
99
+# found in the LICENSE file.
1010
+
1111
+import("//build/config/chrome_build.gni")
1212
+
13+
+# Validate that required resources exist at build time
14+
+# GN will fail at generation time if resources/bin/browseros_server is missing
15+
+_browseros_binary_name = "browseros_server"
16+
+if (is_win) {
17+
+ _browseros_binary_name += ".exe"
18+
+}
19+
+
20+
+action("validate_browseros_resources") {
21+
+ script = "validate_resources.py"
22+
+ inputs = [ "resources/bin/${_browseros_binary_name}" ]
23+
+ outputs = [ "$target_gen_dir/browseros_resources_validated" ]
24+
+}
25+
+
1326
+source_set("browseros_server") {
1427
+ sources = [
1528
+ "browseros_server_manager.cc",
@@ -28,53 +41,32 @@ index 0000000000000..7165c4459db08
2841
+ ]
2942
+}
3043
+
31-
+# Determine OS name for binary selection
32-
+if (is_mac) {
33-
+ _browseros_os = "darwin"
34-
+} else if (is_win) {
35-
+ _browseros_os = "windows"
36-
+} else if (is_linux) {
37-
+ _browseros_os = "linux"
38-
+}
39-
+
40-
+# Construct source binary filename based on target OS and architecture
41-
+_browseros_binary_name = "browseros-server-${_browseros_os}-${target_cpu}"
42-
+if (is_win) {
43-
+ _browseros_binary_name += ".exe"
44-
+}
45-
+
46-
+# Source binary path (architecture-specific)
47-
+_browseros_source_binary = "binaries/${_browseros_binary_name}"
48-
+
49-
+# Output filename (standardized)
50-
+_browseros_output_name = "browseros_server"
51-
+if (is_win) {
52-
+ _browseros_output_name += ".exe"
53-
+}
54-
+
5544
+if (is_mac) {
5645
+ import("//build/config/apple/symbols.gni")
5746
+ import("//build/config/mac/mac_sdk.gni")
5847
+
59-
+ # Bundle data for macOS - packages to Resources/BrowserOSServer/default/
60-
+ bundle_data("browseros_server_bundle_data") {
61-
+ sources = [ _browseros_source_binary ]
62-
+ outputs =
63-
+ [ "{{bundle_resources_dir}}/BrowserOSServer/default/${_browseros_output_name}" ]
48+
+ # Bundle data for macOS - recursively packages resources/ to Resources/BrowserOSServer/default/
49+
+ bundle_data("browseros_resources_bundle") {
50+
+ sources = [ "resources" ]
51+
+ outputs = [ "{{bundle_resources_dir}}/BrowserOSServer/default/{{source_file_part}}" ]
52+
+ # TODO: Re-enable validation when resources/bin/browseros_server is available
53+
+ # deps = [ ":validate_browseros_resources" ]
6454
+ }
6555
+} else {
66-
+ # Copy for Windows/Linux - packages to <exe_dir>/BrowserOSServer/default/
67-
+ copy("browseros_server_binary") {
68-
+ sources = [ _browseros_source_binary ]
69-
+ outputs = [ "$root_out_dir/BrowserOSServer/default/${_browseros_output_name}" ]
56+
+ # Copy for Windows/Linux - recursively packages resources/ to <exe_dir>/BrowserOSServer/default/
57+
+ copy("browseros_resources_copy") {
58+
+ sources = [ "resources" ]
59+
+ outputs = [ "$root_out_dir/BrowserOSServer/default/{{source_file_part}}" ]
60+
+ # TODO: Re-enable validation when resources/bin/browseros_server is available
61+
+ # deps = [ ":validate_browseros_resources" ]
7062
+ }
7163
+}
7264
+
7365
+# Group for all BrowserOS server resources
7466
+group("browseros_server_resources") {
7567
+ if (is_mac) {
76-
+ deps = [ ":browseros_server_bundle_data" ]
68+
+ deps = [ ":browseros_resources_bundle" ]
7769
+ } else {
78-
+ deps = [ ":browseros_server_binary" ]
70+
+ deps = [ ":browseros_resources_copy" ]
7971
+ }
8072
+}

0 commit comments

Comments
 (0)