Opened 12 months ago

Last modified 5 weeks ago

#26376 needs_information enhancement

add cross compiling docs

Reported by: Hello71 Owned by: Hello71
Priority: Low Milestone: Tor: unspecified
Component: Core Tor/Tor Version: Tor: unspecified
Severity: Normal Keywords: postfreeze-ok, reviewer-was-teor-20190422
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

since apparently nobody on #tor-dev knows, I wrote a document.

https://cgit.alxu.ca/tor.git/commit/?h=building-tor-mingw-docs

setting catalyst as reviewer since they say they tried it and it works.

Child Tickets

TicketTypeStatusOwnerSummary
#13694enhancementassignedgkShip with native build instructions for windows

Change History (23)

comment:1 Changed 12 months ago by rl1987

comment:2 Changed 12 months ago by Hello71

Status: assignedneeds_review

Updated to add MXE instructions. It works fairly well after fixing #26464.

comment:3 Changed 12 months ago by catalyst

Status: needs_reviewneeds_revision

Thanks for the new documentation!

I'm not sure the core team has much experience with MXE or much interest in trying it out. Please delete the MXE section for now. Feel free to submit it under a separate ticket.

RUST_TARGET should be TOR_RUST_TARGET. We changed it to reduce chances of environment variable conflicts.

Please don't refer to yourself as "this author" in a shared-authorship document. Also I'm not sure we should be making such claims about the security properties of using the Jenkins build artifacts. I think it's a tradeoff, and maybe one that we shouldn't try to summarize here. Maybe it's enough to mention that the artifacts aren't signed and their integrity depends on the Jenkins infrastructure itself and the web CA infrastructure.

comment:4 Changed 11 months ago by Hello71

ahf said that MXE "sounds cool" and presumably would like to not maintain https://github.com/ahf/tor-win32/. additionally, the MXE option supports zstd and xz. therefore, I would like to keep those. if you or ahf could test those it would be great.

already fixed TOR_RUST_TARGET in an earlier revision.

changed jenkins wording to be more critical.

comment:5 Changed 11 months ago by asn

Status: needs_revisionneeds_review

comment:6 in reply to:  4 Changed 10 months ago by catalyst

Status: needs_reviewneeds_revision

Replying to Hello71:

ahf said that MXE "sounds cool" and presumably would like to not maintain https://github.com/ahf/tor-win32/. additionally, the MXE option supports zstd and xz. therefore, I would like to keep those. if you or ahf could test those it would be great.

already fixed TOR_RUST_TARGET in an earlier revision.

changed jenkins wording to be more critical.

Thanks. Please delete mentions of MXE for now. We can look at that in a separate ticket. Also, what do you mean by this:

Jenkins is not a part of the Tor infrastructure

comment:7 Changed 10 months ago by nickm

Milestone: Tor: 0.3.5.x-final

comment:8 Changed 9 months ago by nickm

Sponsor: Sponsor8-can

Noting some tickets in 0.3.5 milestone as 8-can. These include tickets that are bugfixes on bugs caused by earlier sponsor8 work.

comment:9 Changed 8 months ago by Hello71

Status: needs_revisionneeds_review

Made changes and auto-rebased on master. Still at https://cgit.alxu.ca/tor.git/commit/?h=building-tor-mingw-docs.

comment:10 Changed 8 months ago by asn

Reviewer: catalystteor

comment:11 Changed 8 months ago by teor

Status: needs_reviewneeds_revision

This documentation seems ok to me.

But I am not sure that the references to compiling on Windows are accurate:

Compiling tor *on* Windows using mingw is theoretically supported, but few
developers actually use this configuration, and it is not used to build Tor
Browser. Therefore, this guide will only cover cross-compilation.

We compile tor on Windows using MSYS2 on every pull request on 0.3.4 and later:
https://ci.appveyor.com/project/torproject/tor

MSYS2 contains cygwin as well as mingw. The library and compiler names suggest that our builds just use mingw. But I haven't checked if the builds or binaries depend on cygwin.

  1. Acquire libevent, openssl, and zlib cross-compiled for mingw. ...

MSYS2 has package repositories containing these libraries. There seem to be versions of the libraries that just depend on mingw.

Once this cross-compiling document is accurate, we should merge it.
Then we can open tickets for mingw-on-Windows and MXE builds.

comment:12 Changed 8 months ago by teor

It might also be worth mentioning that you can cross-compile tor for Windows on Windows 10 using Windows Subsystem for Linux, which is an emulated Linux environment.

comment:13 Changed 8 months ago by teor

I don't understand why we get cross-compiled libraries from Jenkins, when we can just get signed libraries from Debian. I also think that ahf's instructions are much easier to follow.

Is there a reason you rewrote/summarised them?

https://github.com/ahf/tor-win32/

comment:14 in reply to:  13 Changed 8 months ago by Hello71

Replying to teor:

This documentation seems ok to me.

But I am not sure that the references to compiling on Windows are accurate:

Compiling tor *on* Windows using mingw is theoretically supported, but few
developers actually use this configuration, and it is not used to build Tor
Browser. Therefore, this guide will only cover cross-compilation.

We compile tor on Windows using MSYS2 on every pull request on 0.3.4 and later:
https://ci.appveyor.com/project/torproject/tor

Didn't exist when I wrote this :)

MSYS2 contains cygwin as well as mingw. The library and compiler names suggest that our builds just use mingw. But I haven't checked if the builds or binaries depend on cygwin.

I'm virtually certain that they don't.

  1. Acquire libevent, openssl, and zlib cross-compiled for mingw. ...

MSYS2 has package repositories containing these libraries. There seem to be versions of the libraries that just depend on mingw.

Should be, I forgot about MSYS2. Also I'm not sure if their packages are usable for cross-compiling.

Once this cross-compiling document is accurate, we should merge it.
Then we can open tickets for mingw-on-Windows and MXE builds.

Sounds good.

Replying to teor:

It might also be worth mentioning that you can cross-compile tor for Windows on Windows 10 using Windows Subsystem for Linux, which is an emulated Linux environment.

I think that was a worse option when I wrote this, but sure.

Replying to teor:

I don't understand why we get cross-compiled libraries from Jenkins, when we can just get signed libraries from Debian.

For non-Debian users.

I also think that ahf's instructions are much easier to follow.

Is there a reason you rewrote/summarised them?

https://github.com/ahf/tor-win32/

I didn't know ahf had instructions.

comment:15 Changed 7 months ago by teor

Milestone: Tor: 0.3.5.x-finalTor: 0.3.6.x-final
Status: needs_revisionneeds_information

We discussed this documentation in the network team meeting.

We want to document the following use cases:

  • cross-compiling Tor (Tor Browser, Tor Devs using Wine)
  • compiling Tor using mingw (Appveyor, Tor Devs using Native Windows)

We want to spend some more time reviewing this document, and trying out the process, before deciding if we want to merge it as-is, or make some more changes.

comment:16 Changed 7 months ago by gk

What's the relationship of this ticket to #13694?

comment:17 Changed 7 months ago by teor

This ticket is about cross-compiling, #13694 is about native builds (using mingw).

comment:18 Changed 7 months ago by nickm

Milestone: Tor: 0.3.6.x-finalTor: 0.4.0.x-final

Tor 0.3.6.x has been renamed to 0.4.0.x.

comment:19 Changed 5 months ago by gaba

Sponsor: Sponsor8-can

comment:20 Changed 5 months ago by nickm

Keywords: postfreeze-ok added

Mark some tickets as postfreeze-ok, to indicate that I think they are okay to accept in 0.4.0 post-freeze. Does not indicate that they are all necessary to do postfreeze.

comment:21 Changed 4 months ago by dgoulet

Keywords: 040-can added
Priority: MediumLow

Bug triage of 0.4.0 tickets. These are now in the "CAN" section. Lower priority than "040-must".

comment:22 Changed 2 months ago by teor

Keywords: reviewer-was-teor-20190422 added
Reviewer: teor

If these tickets go back in to needs_review, and I am on leave, they will need another reviewer.

comment:23 Changed 5 weeks ago by nickm

Keywords: 040-can removed
Milestone: Tor: 0.4.0.x-finalTor: unspecified
Note: See TracTickets for help on using tickets.