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

Copy and package dev/beta channel png images #366

Closed
wants to merge 3 commits into from
Closed

Conversation

mbacchi
Copy link
Contributor

@mbacchi mbacchi commented Aug 28, 2018

When building dev/beta channel on Linux, the release
png images were being packaged even though the
alternate color images should have been present in
the package. This corrects that behavior.

Fixes brave/brave-browser#712

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.
  • Request a security/privacy review as needed.
  • Add appropriate QA labels (QA/Needed or QA/No-QA-Needed) to include the closed issue in milestone

Test Plan:

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

When building dev/beta channel on Linux, the release
png images were being packaged even though the
alternate color images should have been present in
the package. This corrects that behavior.

Fixes brave/brave-browser#712
@mbacchi mbacchi self-assigned this Aug 28, 2018
+ sources += [
+ "$branding_dir/product_logo_128_beta.png",
+ "$branding_dir/product_logo_128_dev.png",
+ "$branding_dir/product_logo_128_development.png",
Copy link
Member

Choose a reason for hiding this comment

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

how about handing nightly image also?

Copy link
Member

Choose a reason for hiding this comment

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

I think we can avoid this patching and creating same copy target to our gn(ex, brave/BUILD.gn) and adding it proper deps list like create_dist target.

if [ "$CHANNEL" = "beta" ]; then
icon_regex=".*product_logo_[0-9]\+_beta\."
- elif [ "$CHANNEL" = "unstable" ]; then
+ elif [ "$CHANNEL" = "unstable" -o "$CHANNEL" = "dev" ]; then
Copy link
Member

Choose a reason for hiding this comment

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

ditto

@mbacchi
Copy link
Contributor Author

mbacchi commented Aug 29, 2018

Thank you @simonhong for the recommendations, I've implemented the copy theme_files in our brave/BUILD.gn as you requested. But I'm having a hard time implementing the steps that are run in the installer.include shell script in our brave/BUILD.gn file due to dependencies. If I try a construct like the below in brave/BUILD.gn, I get errors about Unresolved Dependencies:

copy("staging_linux_app_icons") {
  deps = [
    ":theme_files",
    "//chrome/installer/linux:linux_package"
  ]
  if (brave_channel == "beta") {
    sources = [
      "$root_out_dir/installer/theme/product_logo_128_beta.png"
    ]
  }
  if (brave_channel == "dev") {
    sources = [
      "$root_out_dir/installer/theme/product_logo_128_dev.png"
    ]
  }
  if (brave_channel == "nightly") {
    sources = [
      "$root_out_dir/installer/theme/product_logo_128_nightly.png"
    ]
  }
  outputs = [
    "$root_out_dir/rpm-staging-dev/opt/brave.com/brave-dev/"
  ]
}
ubuntu@ip-172-31-32-9:/var/lib/jenkins/workspace/brave-browser-build-linux/src$ ../vendor/depot_tools/gn desc out/Release //brave:staging_linux_app_icons
ERROR Unresolved dependencies.
//brave:staging_linux_app_icons(//build/toolchain/linux:clang_x64)
  needs //chrome/installer/linux:linux_package(//build/toolchain/linux:clang_x64)

I think this is due to the fact that the outputs directory (//build/toolchain/linux:clang_x64) is only created in the installer.include shell script and then it is packaged up into the rpm/deb packages effectively atomically because it runs the build.sh script which does all of these steps at once. I'm not sure what to depend on in my staging_linux_app_icons step.

If you have suggestions please let me know. For now I'm just adding the step that does the copy theme_files work to this PR.

In order to reduce unnecessary patching use
a copy target in BUILD.gn.
branding_dir = "//chrome/app/theme/$branding_path_component"
copy("theme_files") {
visibility = [ ":*" ]
if (!is_chrome_branded) {
Copy link
Member

@simonhong simonhong Aug 29, 2018

Choose a reason for hiding this comment

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

This can be removed because this target is always used when !is_chrome_branded.

@mbacchi
Copy link
Contributor Author

mbacchi commented Aug 29, 2018

In order to keep the commit history clean, I'm going to close this and open a new PR using the branch issue712-try2.

@mbacchi mbacchi closed this Aug 29, 2018
@mbacchi mbacchi deleted the issue712 branch August 29, 2018 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Linux shows wrong version installed and wrong browser icon
2 participants