we should try to minimize the number of macOS jobs that run, both to be a better netizen and pragmatically because they are limited to two at a time, so if you have a bunch they will not run in a good order.
for example, I think it is probably unnecessary to test three ways of compiling rust with both gcc and clang.
with a view to changing number five to offline, whenever that gets fixed. this will utilise all of the allowed parallel build slots (4/6 Linux, 2/6 macOS) and ensure the best immediate feedback. for better immediate feedback, we could also enable cargo cache (https://docs.travis-ci.com/user/caching/#Rust-Cargo-cache).
That gives us 15 builds rather than the previous 13, so CI should complete in a similar time. (I'm seeing 5 builders allocated at a time when building this branch.)
That gives us 15 builds rather than the previous 13, so CI should complete in a similar time. (I'm seeing 5 builders allocated at a time when building this branch.)
That gives us 15 builds rather than the previous 13, so CI should complete in a similar time.
overall, I like this. I'm not super convinced that we need all these miscellaneous builds, e.g. no hardening when we already have Rust without hardening, but I guess they could help diagnose some CI failures, and I think we're far from exceeding the total maximum jobs.
(I'm seeing 5 builders allocated at a time when building this branch.)
unfortunately, I can't find where I found this information, but I believe the maximum at the time that I wrote "4/6" and "2/6" was the lower of: 5 Linux jobs, 2 Mac jobs, 6 total jobs (at any given time). therefore, adding Mac jobs and decreasing Linux jobs is expected to lower the total time.
I like a lot of these changes. Simplifying stuff so we don't have to list every matrix row explicitly seems quite helpful. I think there are a few minor changes remaining.
I think $TRAVIS_BUILD_DIR/target isn't the right directory for caching Rust build output; it's probably more correct to use $TRAVIS_BUILD_DIR/src/rust/target, because that's where we point CARGO_TARGET_DIR in all our cargo invocations.
Also we should probably stop setting CARGO_HOME explicitly so more stuff ends up in $HOME/.cargo to cache. (see #26497 (moved); we could put the fix in that ticket, or maybe do it in this branch but make that ticket a child of this one)
I'm going to leave Travis to run overnight, and hopefully it's all successful in the morning. I expect 0.3.3 to take a little while, and then 0.3.4 and 0.3.5 should be trivial.
Thanks! I'm commenting only on master, because I haven't looked at the others yet.
This mostly looks good.
mkdir in before_install should create $TRAVIS_BUILD_DIR/src/rust/target, not $TRAVIS_BUILD_DIR/target.
Please explicitly delete the CARGO_HOME settings from src/rust/tor_rust/include.am and src/test/test_rust.sh instead of merging the changes from #26038 (moved). There are other changes in #26038 (moved) that I think we don't want, like:
deleting the registry setting in [source.crates-io] in src/rust/.cargo/config.in; I'm not sure whether this breaks anything, but I'd rather play it safe and leave it there until we know why we should delete it.
warning if CARGO_HOME is set; I'm not sure the added complexity is worth it, especially given that the checks are added in at least four places.
explicit setting of target-dir in [build] in src/rust/.cargo/config.in; this seems redundant with the explicit setting of CARGO_TARGET_DIR in various cargo invocations.
We could use target-dir in the cargo config instead of explicitly setting CARGO_TARGET_DIR for each cargo invocation, but in that case we should make a comment that it assumes that cargo is always invoked from a specific directory (which it should be after this change set).
(I think these comments should go in #26038 (moved), but I'm responding to them here because you made them here.)
Please explicitly delete the CARGO_HOME settings from src/rust/tor_rust/include.am and src/test/test_rust.sh instead of merging the changes from #26038 (moved). There are other changes in #26038 (moved) that I think we don't want, like:
deleting the registry setting in [source.crates-io] in src/rust/.cargo/config.in; I'm not sure whether this breaks anything, but I'd rather play it safe and leave it there until we know why we should delete it.
I believe cargo vendor used to print this line a long time ago, and now it has been the default for some time, so they stopped printing it. I could be remembering wrong though.
warning if CARGO_HOME is set; I'm not sure the added complexity is worth it, especially given that the checks are added in at least four places.
This is not correct. My patch only checks if CARGO_HOME is set once. It is supposed to check separately if CARGO_HOME is a relative path at use time, on the basis that the user may have changed their CARGO_HOME since they used configure. However, it does this wrong, since it should actually error instead of just warn, and also there is more than one place that CARGO_HOME is used. I think I do agree that checking for relative path can be done a single time in configure with AC_ARG_VAR though.
explicit setting of target-dir in [build] in src/rust/.cargo/config.in; this seems redundant with the explicit setting of CARGO_TARGET_DIR in various cargo invocations.
We could use target-dir in the cargo config instead of explicitly setting CARGO_TARGET_DIR for each cargo invocation, but in that case we should make a comment that it assumes that cargo is always invoked from a specific directory (which it should be after this change set).
This is also not correct, although it is my fault for writing a poor comment. Paths in cargo configuration are interpreted relative to the parent of the .cargo directory, so as long as the correct cargo config is read, the target will always be set to the same place. Therefore, "./target" is equivalent to writing "@abs_top_builddir@/src/rust/target". Whether it is read or not, however, is unrelated to CARGO_TARGET_DIR, but in fact the CARGO_HOME. I assume however that if you can set CARGO_HOME correctly then you can also set the current directory correctly.
Thanks! I'm commenting only on master, because I haven't looked at the others yet.
This mostly looks good.
mkdir in before_install should create $TRAVIS_BUILD_DIR/src/rust/target, not $TRAVIS_BUILD_DIR/target.
Done in my 0.3.2 and later branches.
Please explicitly delete the CARGO_HOME settings from src/rust/tor_rust/include.am and src/test/test_rust.sh instead of merging the changes from #26038 (moved). There are other changes in #26038 (moved) that I think we don't want...
Done in my 0.3.2 branch, and re-done in 0.3.3 because a file moved.
I added a missing asciidoc dependency to the macOS build and merged it forward.
New builds are under https://travis-ci.org/teor2345/tor/branches . I made some custom travis configs that run macOS asciidoc, their branches end in "-all". (We shouldn't merge the "-all" branches, because their travis configs run all the combinations.)
Here's the first branch where macOS asciidoc worked:
Overall this looks very good! I think this is a lot of work and will make things more maintainable in the future.
I would like to know if it ends up being significantly slower to default to using offline builds for most --enable-rust builds instead of cached online builds. I think the more places we use --enable-cargo-online-mode, the more places we can have trouble with a transient network failure.