Giter Club home page Giter Club logo

Comments (7)

qwerty12 avatar qwerty12 commented on May 22, 2024 2

Hi,

Thanks for this, and for the recent switch to an autotools-based system. I managed to build the Firefox variant of this (curl-impersonate-ff.exe and libcurl-impersonate-ff-4.dll) on 64-bit Windows 11 with MSYS 2. The way I did it has some problems, though:

  • not at all suited for automation somewhat true currently

  • for the life of me, I could not build NSS statically, so this relies on a bunch of DLLs in the same folder

    • NSS being ancient doesn't help; I bet BoringSSL is more amenable to this.
  • relies on MSYS-provided libraries, and NSS to be built with its packaging

I wonder if it would be easier to build everything with MSVC/VS. I might try at some point, but I doubt I'll be successful. In any case, I hope this helps someone while waiting for something better to come along.

I've updated the instructions and placed them here: https://github.com/qwerty12/subliminal/wiki/Building-curl-impersonate-Firefox-for-Windows-x64

from curl-impersonate.

lwthiker avatar lwthiker commented on May 22, 2024 2

@avently There is no progress unfortunately, my windows knowledge is extremely lacking and this seems like quite some work in order to make it part of the regular build process. It is still in the project's priorities though. Any external help in this regard would be highly appreciated as well.

from curl-impersonate.

lwthiker avatar lwthiker commented on May 22, 2024 1

Regarding statically linking with NSS, I found this reference in Mozilla's application-services code. It shows the needed static libraries and their order according to os and arch. I'll try this as well for the macOS version (to support M1 processors).

from curl-impersonate.

yuzd avatar yuzd commented on May 22, 2024

nice future

from curl-impersonate.

lwthiker avatar lwthiker commented on May 22, 2024

@qwerty12 Thank you for the thorough work and documentation.
What parts are not suited for automation? If it's changing the patches, then of course we can upload patches that will fit both Linux and Windows (maybe by checking the host OS)

from curl-impersonate.

qwerty12 avatar qwerty12 commented on May 22, 2024

I appear to have been exaggerating. By automation, I tend to mean in the CI/GitHub Actions sense, but I guess that could also mean someone running a script after preparing the MSYS environment. My steps as I've written them aren't really automation friendly but, as you say, there's nothing stopping the existing patches etc. from being integrated with your work and adapting anything else.

Only one pressing issue comes to mind:

  • in MSYS2, the initial upgrade requires you to close MSYS2 and start it again

    • this might not always be the case with a newer shipped base from the MSYS2 team

    • MSYS2 might not even be needed in the CI sense: the MinGW toolchains can be found in some Linux distros. I believe the curl-for-win project does that. Though cross-compiling NSS doesn't sound fun...

  • Not really an issue, but something to be aware of: nsinstall.exe needs to be present in a folder in $PATH, or the NSPR & NSS build scripts fail. Mozilla provide a binary here but because it has "install.exe" in the filename and lacks a manifest telling Windows it's UAC-aware, Windows thinks it's an installer and asks for elevation interactively

    • the MSYS2 team work around that by putting a manifest next to the binary

    • export __COMPAT_LAYER=RunAsInvoker also works

From what I can see, for building NSPR in MSYS2, all of the patches are needed.

For NSS, I think nss-build.patch is the most important one. I don't know if every change in there is needed, but I do know L54 and L91 are required changes. L43 too, so it can find MSYS2's libraries. Not sure if the other modifications (patched nss-config and pkg-config definition) are absolutely needed for cURL's build process to find NSS, though I had them applied as part of using MSYS2's PKGBUILDs to install NSS and NSPR.

EDIT: I can't get NSS to build with MSVC, even when using the MozillaBuild environment. At this point, I'm just going to suck it up and stick with dynamically-linked cURL built in MSYS 2. Right, after seeing Has the time come to drop NSS?, I'm definitely going to cut my losses and stick with what I have currently.

from curl-impersonate.

avently avatar avently commented on May 22, 2024

@lwthiker is there a progress regarding building firefox version for windows?

If you're unable to build nss there is a "solution". We can just use prebuilt libraries downloaded using this method: https://github.com/mozilla/application-services/blob/main/libs/build-nss-desktop.sh#L71

from curl-impersonate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.