Ungoogled-chromium: release 62 build failed on Windows, about safe_browsing

Created on 13 Dec 2017  ·  14Comments  ·  Source: Eloston/ungoogled-chromium

ninja: Entering directory `out/ReleasePackage'
[1/5624] LIB obj/chrome/browser/safe_browsing/safe_browsing.lib
[2/5624] LINK(DLL) chrome.dll chrome.dll.lib
FAILED: chrome.dll chrome.dll.lib
C:/depot_tools/python276_bin/python.exe ../../build/toolchain/win/tool_wrapper.py link-wrapper environment.x86 False link.exe /nologo /IMPLIB:./chrome.dll.lib /DLL /OUT:./chrome.dll /PDB:./chrome.dll.pdb @./chrome.dll.rsp
LINK : fatal error LNK1181: Can't open input file “obj/chrome/browser/safe_browsing/safe_browsing.lib”
ninja: build stopped: subcommand failed.

bug

Most helpful comment

@Eloston no it's exactly my style =) yeah, was going to do exactly that

All 14 comments

so how to fix it for 62

No idea. If no one figures it out beforehand, I'll investigate after progress is made with version 63.

I has fixed it for windows. This is my patch:

0000-fix-safebrowsing.txt

@PonyPC can you please recap what you did? So I could try to reproduce it for macOS.

@PonyPC I, too, would like to know your method. Based on your patch, I only see removal of Safe Browsing code from various files.

  1. How did you figure out that the remaining references to various Safe Browsing code was causing the linker to include the non-existant Safe Browsing static library? Is this some behavior of build/toolchain/win/tool_wrapper.py or .ninja files?
  2. What did you use to find the references?

EDIT: I will include these changes in 63. Thanks for the help!

Well, you're right. I did missing add GN config to git and I'll upload the patch again include these, sorry for that.

0000-fix-safebrowsing.txt

How do I know?
There isn't a safe_browsing.lib in "obj\chrome\browser\safe_browsing", I checked "chrome\browser\safe_browsing\BUILD.gn" and found that there is no source file so that the compiler can not generate library. I tried add some sources which build without errors, and found that corrupt references, fix it. Then try to remove the static_library("safe_browsing"), the compiler figure out which contains safe_browsing.
How do I do?

  1. Firstly, remove "static_library("safe_browsing")" in "chrome\browser\safe_browsing\BUILD.gn"
  2. Build as normal you will get error about which GN config include these library.
  3. Remove those you got above.
  4. Build as normal you will get error about the references in header and source.
  5. Remove by context to not break whole function.
  6. Build passed.

@PonyPC can you upload your version somewhere?

I would like to test some recent version of ungoogled chromium. The last one is very old.

@PonyPC Ah, I see. GN was the missing link that made everything here "click" for me.

From what I understand, the static_library keyword in GN causes the linker to look for a corresponding static library file, hence your original error. So you removed the GN dependency, which removed the visibility of header and source files in chrome/*/safe_browsing. To fix it, you patched out those references (many of which are Windows-specific since the existing Safe Browsing patch removes the cross-platform references), which made the build work.

@tectiv3 you can remove the //chrome/browser/safe_browsing line that @PonyPC has done, and then try building. You will encounter errors about missing headers and such in chrome/*/safe_browsing/ and related paths; just patch them out in the same manner that is done in the existing patches. If trial-and-error isn't your style (or is too sloppy), you could use some code analysis tool to find includes of the path chrome/browser/safe_browsing or chrome/common/safe_browsing, and patch those files.

@ribatamu FYI, because @PonyPC seems to be using Depot Tools, there is a high probability that domain substitution or source cleaning were not used. As a result, Google binaries were involved in the build and could be included, and there may be an occasional leak from the browser (e.g. #302).

@Eloston no it's exactly my style =) yeah, was going to do exactly that

@ribatamu sorry, my binary version contains custom modifies.

Actually, I patched my version without domain substitution. But if patch them all, you can still use depot tools. You can fetch build params from ungoogle script and parsing them to ninja

Only the windows version I have environment to build, those platform I can't fix it.

yep, I was able to build successfully. Just needed to remove a couple of entries from various Build.gn files, there was no need in fixing sources.

I will prepare a patch tomorrow.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Zoraver picture Zoraver  ·  3Comments

Eloston picture Eloston  ·  4Comments

brianegan picture brianegan  ·  3Comments

playgithub picture playgithub  ·  3Comments

MilesFM picture MilesFM  ·  4Comments