# CI using one month old version of rust nightly

**URL:** <https://travis-ci.community/t/ci-using-one-month-old-version-of-rust-nightly/4502>\
**Category:** Rust\
**Tags:** build-env\
**Created:** [August 2, 2019, 8:06am UTC](https://travis-ci.community/t/ci-using-one-month-old-version-of-rust-nightly/4502 "2019-08-02T08:06:19Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![95th](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/95th/32/2404_2.png) [@95th](https://travis-ci.community/u/95th)\
**Post date:** [August 2, 2019, 8:06am UTC](https://travis-ci.community/t/ci-using-one-month-old-version-of-rust-nightly/4502/1 "2019-08-02T08:06:19Z")

</div>

I want to use latest Rust Nightly to build my project.

Here is the config file:

> <https://github.com/95th/h2/blob/fut/.travis.yml>

But, it seems to be using one month old nightly:  
rustc 1.37.0-nightly (5f9c0448d 2019-06-25)

[https://travis-ci.org/hyperium/h2/builds/566657987?utm\_source=github\_status&utm\_medium=notification](https://travis-ci.org/hyperium/h2/builds/566657987?utm_source=github_status&utm_medium=notification)

How do I make it use the latest one?

---

<div class="post-metadata">

**Author:** ![95th](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/95th/32/2404_2.png) [@95th](https://travis-ci.community/u/95th)\
**Post date:** [August 2, 2019, 8:22am UTC](https://travis-ci.community/t/ci-using-one-month-old-version-of-rust-nightly/4502/2 "2019-08-02T08:22:00Z")

</div>

Also, I tried running the build from my fork and surprisingly it uses latest nightly there with same yml config.

[https://travis-ci.org/95th/h2/builds/566841946](https://travis-ci.org/95th/h2/builds/566841946)

So, why doesn’t it use latest in the PR build?

[https://travis-ci.org/hyperium/h2/builds/566657987?utm\_source=github\_status&utm\_medium=notification](https://travis-ci.org/hyperium/h2/builds/566657987?utm_source=github_status&utm_medium=notification)

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [August 2, 2019, 12:39pm UTC](https://travis-ci.community/t/ci-using-one-month-old-version-of-rust-nightly/4502/3 "2019-08-02T12:39:32Z")

</div>

This is either a variation or the resurfacing of [https://github.com/travis-ci/travis-ci/issues/8124](https://github.com/travis-ci/travis-ci/issues/8124), which was presumably fixed by [https://github.com/travis-ci/travis-build/pull/1161](https://github.com/travis-ci/travis-build/pull/1161).

There is [a short blurb](https://travis-ci.org/hyperium/h2/builds/566657987#L471) during the installation which might offer a solution:

```
To configure your current shell run source $HOME/.cargo/env

```

Could you add this line in your `before_script` to see if this is effective?

```auto
before_script:
  - source $TRAVIS_HOME/.cargo/env
  - rustc --version
  ⋮ # rest

```

---

<div class="post-metadata">

**Author:** ![95th](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/95th/32/2404_2.png) [@95th](https://travis-ci.community/u/95th)\
**Post date:** [August 3, 2019, 4:54pm UTC](https://travis-ci.community/t/ci-using-one-month-old-version-of-rust-nightly/4502/4 "2019-08-03T16:54:08Z")

</div>

Sorry, that didn’t work.  
[https://travis-ci.org/hyperium/h2/builds/567338420?utm\_source=github\_status&utm\_medium=notification](https://travis-ci.org/hyperium/h2/builds/567338420?utm_source=github_status&utm_medium=notification)

 ![image](https://us1.discourse-cdn.com/flex015/uploads/travis_ci/original/2X/9/99d627b1562539c061e804ccc1d554a020b229fd.png)  
It is still using old version.

Surprisingly, earlier today I changed my PR from Draft to “ready for review” and it then used correct nightly version. But now it has reverted back to old one.

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [August 3, 2019, 6:07pm UTC](https://travis-ci.community/t/ci-using-one-month-old-version-of-rust-nightly/4502/5 "2019-08-03T18:07:02Z")

</div>

I see the problem more clearly now. I think this is a problem with the Rust installer no longer updating nightlies.

In [https://travis-ci.org/hyperium/h2/jobs/546966455#L446](https://travis-ci.org/hyperium/h2/jobs/546966455#L446) and [https://travis-ci.org/hyperium/h2/jobs/551001348#L450](https://travis-ci.org/hyperium/h2/jobs/551001348#L450), you see that the installer recognizes the existing nightly installation, but still updates it.

However, the next one [https://travis-ci.org/hyperium/h2/jobs/551930277#L448](https://travis-ci.org/hyperium/h2/jobs/551930277#L448) no longer does.

This seems to be a problem with [rustup.rs](https://github.com/rust-lang/rustup.rs).

I’ve reported the problem at

> <https://github.com/rust-lang/rustup.rs/issues/1964>

---

<div class="post-metadata">

**Author:** ![95th](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/95th/32/2404_2.png) [@95th](https://travis-ci.community/u/95th)\
**Post date:** [August 5, 2019, 2:24pm UTC](https://travis-ci.community/t/ci-using-one-month-old-version-of-rust-nightly/4502/6 "2019-08-05T14:24:29Z")

</div>

Hi @BanzaiMan. The change suggested by @kinnison on the github issue - will you need to do that in travis or I have to do in my scripts ?

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [August 5, 2019, 2:31pm UTC](https://travis-ci.community/t/ci-using-one-month-old-version-of-rust-nightly/4502/7 "2019-08-05T14:31:44Z")

</div>

Once the behavior change (and that the previous behavior was wrong) is confirmed, I’ll put the change in. If you want to add it in the meantime, you are welcome to do so.

---

<div class="post-metadata">

**Author:** ![95th](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/95th/32/2404_2.png) [@95th](https://travis-ci.community/u/95th)\
**Post date:** [August 5, 2019, 2:57pm UTC](https://travis-ci.community/t/ci-using-one-month-old-version-of-rust-nightly/4502/8 "2019-08-05T14:57:17Z")

</div>

I have workaround for the meantime to run the build against my fork. (where it works - dont know why).

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [August 8, 2019, 9:08pm UTC](https://travis-ci.community/t/ci-using-one-month-old-version-of-rust-nightly/4502/9 "2019-08-08T21:08:34Z")

</div>

> <https://github.com/travis-ci/travis-build/pull/1758>

---

<div class="post-metadata">

**Author:** ![95th](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/95th/32/2404_2.png) [@95th](https://travis-ci.community/u/95th)\
**Post date:** [August 11, 2019, 10:08am UTC](https://travis-ci.community/t/ci-using-one-month-old-version-of-rust-nightly/4502/10 "2019-08-11T10:08:34Z")

</div>

The build now uses correct version. Many thanks @BanzaiMan for quick response and solution. 🙂
