[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #22830 [Core Tor/Tor]: Problems with building with --enable-rust with RUST_DEPENDENCIES



#22830: Problems with building with --enable-rust with RUST_DEPENDENCIES
-----------------------------+--------------------------
 Reporter:  isis             |          Owner:
     Type:  defect           |         Status:  new
 Priority:  High             |      Milestone:
Component:  Core Tor/Tor     |        Version:
 Severity:  Normal           |     Resolution:
 Keywords:  rust, tor-build  |  Actual Points:
Parent ID:                   |         Points:  1
 Reviewer:                   |        Sponsor:  SponsorZ
-----------------------------+--------------------------
Description changed by isis:

Old description:

> From #22816, Chelsea and I realised that there are some problems when
> trying to build the Rust code currently in tor in "offline mode" with
> `RUST_DEPENDENCIES` specifying a directory where the dependencies should
> live. (I.e. building with
> `RUST_DEPENDENCIES='path_to_dependencies_directory' ./configure --enable-
> rust` as noted on
> [https://trac.torproject.org/projects/tor/wiki/RustInTor the wiki page]
> on building with Rust.)
>
> So one problem was that I had a relative path for `RUST_DEPENDENCIES`
> (now noted on the wiki that it must be the full path).
>
> There are other problems though. Cargo expects a lot of structure to be
> there (basically everything that would normally be in `~/.cargo` needs to
> be in the directory we're giving it as our `HOME` or `CARGO_HOME`). While
> we ''could'' write some scripts or something to basically reimplement a
> bunch of cargo functionality to set all that up, it's kind of non-trivial
> and it seems like a potential maintainability hazard. Another, even worse
> way (IMHO) around this would be to say, "if you use `RUST_DEPENDENCIES`
> then the entire build doesn't use cargo, but instead calls rustc with the
> flags that cargo would have." (This seems even less maintainable, because
> then we have two distinct ways to compile the Rust code.)
>
> Instead, I think a solution which is potentially better than either of
> those would be to say something like: "If you want to use
> `RUST_DEPENDENCIES`, you have to run the following first, which will use
> cargo to get the dependencies, and then you can re-use the directory it
> produces offline by specifying it in `RUST_DEPENDENCIES."
>
> {{{
> mkdir path_to_dependencies_directory
> cd src/rust
> rm .cargo/config
> CARGO_HOME="/whatever/full/path_to_dependencies_directory/.cargo" cargo
> update
> }}}
>
> After this initial set up of the directories which cargo is expecting the
> normal offline build should be conducted, and instead of passing `HOME`
> to cargo, we should pass `CARGO_HOME` as is used above.

New description:

 From #22816, Chelsea and I realised that there are some problems when
 trying to build the Rust code currently in tor in "offline mode" with
 `RUST_DEPENDENCIES` specifying a directory where the dependencies should
 live. (I.e. building with
 `RUST_DEPENDENCIES='path_to_dependencies_directory' ./configure --enable-
 rust` as noted on [https://trac.torproject.org/projects/tor/wiki/RustInTor
 the wiki page] on building with Rust.)

 So one problem was that I had a relative path for `RUST_DEPENDENCIES` (now
 noted on the wiki that it must be the full path).

 There are other problems though. Cargo expects a lot of structure to be
 there (basically everything that would normally be in `~/.cargo` needs to
 be in the directory we're giving it as our `HOME` or `CARGO_HOME`). While
 we ''could'' write some scripts or something to basically reimplement a
 bunch of cargo functionality to set all that up, it's kind of non-trivial
 and it seems like a potential maintainability hazard. Another, even worse
 way (IMHO) around this would be to say, "if you use `RUST_DEPENDENCIES`
 then the entire build doesn't use cargo, but instead calls rustc with the
 flags that cargo would have." (This seems even less maintainable, because
 then we have two distinct ways to compile the Rust code.)

 Instead, I think a solution which is potentially better than either of
 those would be to say something like: "If you want to use
 `RUST_DEPENDENCIES`, you have to run the following first, which will use
 cargo to get the dependencies, and then you can re-use the directory it
 produces offline by specifying it in `RUST_DEPENDENCIES."

 {{{
 mkdir path_to_dependencies_directory
 cd src/rust
 rm .cargo/config
 CARGO_HOME="/whatever/full/path_to_dependencies_directory/.cargo" cargo
 update
 CARGO_HOME="/whatever/full/path_to_dependencies_directory/.cargo" cargo
 fetch
 }}}

 After this initial set up of the directories which cargo is expecting the
 normal offline build should be conducted, and instead of passing `HOME` to
 cargo, we should pass `CARGO_HOME` as is used above.

--

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/22830#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs