Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Github action to Test Browser Build #253

Merged
merged 85 commits into from
Feb 6, 2025
Merged

Conversation

tmbrbr
Copy link
Contributor

@tmbrbr tmbrbr commented Jan 27, 2025

We had a Github action to build the full browser a while ago, but it was fairly flakey due to memory limitations.

Trying again to see if there is more stability now.

One advantage now is that there are also windows and mac runners, which could eventually lead to automated builds for those targets.

Note: this needs to be tested as an open pull request, as I think the SAP action runners have slightly different configurations compared to my personal account.

Successful build targets so far:

  • Ubuntu
  • Windows
  • MacOS 14 (M1 silicon)
  • MacOS 13 (Intel Silicon)

@tmbrbr tmbrbr added build Issues related to building Foxhound build.sh Issues with the provided build tooling github Anything related to github actions labels Jan 27, 2025
@tmbrbr tmbrbr self-assigned this Jan 27, 2025
@tmbrbr
Copy link
Contributor Author

tmbrbr commented Jan 27, 2025

Current iteration passes the build step, but packaging fails with:

System.IO.IOException: No space left on device

@tmbrbr
Copy link
Contributor Author

tmbrbr commented Jan 27, 2025

Some disk usage statistics, before build (ie after the checkout):

Filesystem      Size  Used Avail Use% Mounted on
/dev/root        73G   56G   17G  77% /
tmpfs           7.9G  172K  7.9G   1% /dev/shm
tmpfs           3.2G  1.1M  3.2G   1% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
/dev/sdb15      105M  6.1M   99M   6% /boot/efi
/dev/sda1        74G  4.1G   66G   6% /mnt
tmpfs           1.6G   12K  1.6G   1% /run/user/1001

@tmbrbr
Copy link
Contributor Author

tmbrbr commented Jan 27, 2025

Mozilla states around 30Gb is required for a build: https://firefox-source-docs.mozilla.org/setup/linux_build.html.

@tmbrbr
Copy link
Contributor Author

tmbrbr commented Jan 27, 2025

The default GitHub runners have a lot of stuff installed to be able to build just about everything (Docker images, Android SDKs, Node.js, Java, ...).

See for example this ticket: actions/runner-images#10386

There are Actions plugins available to free up space: https://github.com/marketplace/actions/free-disk-space-ubuntu

@tmbrbr
Copy link
Contributor Author

tmbrbr commented Jan 27, 2025

All checks have passed! 🎉

@tmbrbr
Copy link
Contributor Author

tmbrbr commented Feb 5, 2025

At the moment there is an issue that bash cannot find /tmp. After some research it seems it is related to the fact that the bash shell shipping with MSYS does not respect the TEMP/TMP environment variables:

msys2/MSYS2-packages#334
https://sourceforge.net/p/msys2/mailman/message/34925671/

@tmbrbr
Copy link
Contributor Author

tmbrbr commented Feb 5, 2025

The underlying problem is that extracting mozilla build tools via 7z does not contain all the directories needed by the installer (including tmp).

@tmbrbr
Copy link
Contributor Author

tmbrbr commented Feb 5, 2025

Now the build is starting but we are into the actual build errors! The good news is that it looks like a windows build is in principle possible via github actions! 🎉

The error message is:

 8:16.29 error[E0282]: type annotations needed for `Box<_>`
 8:16.29   --> D:\a\project-foxhound\project-foxhound\third_party\rust\time\src\format_description\parse\mod.rs:83:9
 8:16.29    |
 8:16.29 83 |     let items = format_items
 8:16.29    |         ^^^^^
 8:16.29 ...
 8:16.29 86 |     Ok(items.into())
 8:16.29    |              ---- type must be known at this point
 8:16.29    |
 8:16.29    = note: this is an inference error on crate `time` caused by an API change in Rust 1.80.0; update `time` to version `>=0.3.35` by calling `cargo update`
 8:17.37 For more information about this error, try `rustc --explain E0282`.

The bootstrap installs Rust 1.84 by default, according to https://firefox-source-docs.mozilla.org/writing-rust-code/update-policy.html we need Rust 1.77.2.

We need to do something similar to the build script: https://github.com/sap/project-foxhound/blob/main/build.sh#L146

@tmbrbr
Copy link
Contributor Author

tmbrbr commented Feb 6, 2025

All checks have passed!! 🎉

@tmbrbr
Copy link
Contributor Author

tmbrbr commented Feb 6, 2025

I am impressed with how stable the GitHub runner builds are by now. I remember a few years ago we kept running into memory problems and the jobs kept getting killed!

@tmbrbr tmbrbr marked this pull request as ready for review February 6, 2025 12:01
@tmbrbr tmbrbr requested a review from leeN February 6, 2025 12:01
Copy link
Collaborator

@leeN leeN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@leeN leeN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tmbrbr tmbrbr merged commit 7af586a into SAP:main Feb 6, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build.sh Issues with the provided build tooling build Issues related to building Foxhound github Anything related to github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants