Patchwork D1846: rust: avoid redundant 'static lifetime

login
register
mail settings
Submitter phabricator
Date Jan. 11, 2018, 3:42 a.m.
Message ID <differential-rev-PHID-DREV-a2emvmrjvhfoukxmcha2-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/26674/
State Superseded
Headers show

Comments

phabricator - Jan. 11, 2018, 3:42 a.m.
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  'static is apparently automatic for const variables.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1846

AFFECTED FILES
  rust/hgcli/build.rs

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel
phabricator - Jan. 11, 2018, 1:08 p.m.
yuja added a comment.


  I think it's new feature. Which Rust version should we support?
  
  https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1170-2017-04-27

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1846

To: indygreg, #hg-reviewers
Cc: yuja, mercurial-devel
phabricator - Jan. 11, 2018, 6:14 p.m.
durin42 added a comment.


  In https://phab.mercurial-scm.org/D1846#31265, @yuja wrote:
  
  > I think it's new feature. Which Rust version should we support?
  >
  > https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1170-2017-04-27
  
  
  Hm, that's release notes from April of 2017, so about 9 months ago. To my understanding, as long as we're only using the stable channel, we should be fine for the binaries we're building being packageable even on slower-moving distros like Debian. Let's go with this for now, worst case we can re-add the annotation.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1846

To: indygreg, #hg-reviewers
Cc: durin42, yuja, mercurial-devel
phabricator - Jan. 11, 2018, 9:13 p.m.
glandium added a comment.


  >   To my understanding, as long as we're only using the stable channel, we should be fine for the binaries we're building being packageable even on slower-moving distros like Debian.
  
  Slow-moving distros like Debian don't update the rust compiler. Debian stable is stuck on rustc 1.14 until Debian buster (next year?).

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1846

To: indygreg, #hg-reviewers, durin42
Cc: glandium, durin42, yuja, mercurial-devel
phabricator - Jan. 11, 2018, 9:20 p.m.
durin42 added a comment.


  In https://phab.mercurial-scm.org/D1846#31298, @glandium wrote:
  
  > >   To my understanding, as long as we're only using the stable channel, we should be fine for the binaries we're building being packageable even on slower-moving distros like Debian.
  >
  > Slow-moving distros like Debian don't update the rust compiler. Debian stable is stuck on rustc 1.14 until Debian buster (next year?).
  
  
  My understanding (correct me if you know more) was that that's the distributed compiler, but it's okay to depend on backports or rustup to /build/ packages, since there aren't runtime deps on anything from rustc.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1846

To: indygreg, #hg-reviewers, durin42
Cc: glandium, durin42, yuja, mercurial-devel
phabricator - Jan. 11, 2018, 9:43 p.m.
glandium added a comment.


  > but it's okay to depend on backports or rustup to /build/ packages
  
  The only exception where it's okay is, essentially, Firefox. With a backport of the rust compiler landing in stable about once a year, and even then it won't replace the version in stable. See the gcc-mozilla package in Debian wheezy.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1846

To: indygreg, #hg-reviewers, durin42
Cc: glandium, durin42, yuja, mercurial-devel

Patch

diff --git a/rust/hgcli/build.rs b/rust/hgcli/build.rs
--- a/rust/hgcli/build.rs
+++ b/rust/hgcli/build.rs
@@ -84,7 +84,7 @@ 
     return dll.exists();
 }
 
-const REQUIRED_CONFIG_FLAGS: [&'static str; 2] = ["Py_USING_UNICODE", "WITH_THREAD"];
+const REQUIRED_CONFIG_FLAGS: [&str; 2] = ["Py_USING_UNICODE", "WITH_THREAD"];
 
 fn main() {
     let config = get_python_config();