Skip to content

Commit

Permalink
Use system rustc if configured with --enable-local-rust
Browse files Browse the repository at this point in the history
This commit makes the configuration system autodetect a rustc that
is already installed and use that instead of downloading a snapshot.
  • Loading branch information
gioele committed Aug 7, 2014
1 parent 8a02304 commit ddeb3db
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions configure
Expand Up @@ -557,13 +557,21 @@ fi

if [ ! -z "$CFG_ENABLE_LOCAL_RUST" ]
then
if [ ! -f ${CFG_LOCAL_RUST_ROOT}/bin/rustc${BIN_SUF} ]
system_rustc=$(which rustc)
if [ -f ${CFG_LOCAL_RUST_ROOT}/bin/rustc${BIN_SUF} ]
then
err "no local rust to use"
: # everything already configured
elif [ -n "$system_rustc" ]
then
# we assume that rustc is in a /bin directory
CFG_LOCAL_RUST_ROOT=${system_rustc%/bin/rustc}
else
LRV=`${CFG_LOCAL_RUST_ROOT}/bin/rustc${BIN_SUF} --version`
step_msg "using rustc at: ${CFG_LOCAL_RUST_ROOT} with version: $LRV"
err "no local rust to use"
fi

LRV=`${CFG_LOCAL_RUST_ROOT}/bin/rustc${BIN_SUF} --version`
step_msg "using rustc at: ${CFG_LOCAL_RUST_ROOT} with version: $LRV"
putvar CFG_LOCAL_RUST_ROOT
fi

# Force freebsd to build with clang; gcc doesn't like us there
Expand Down

5 comments on commit ddeb3db

@bors
Copy link
Contributor

@bors bors commented on ddeb3db Aug 8, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from brson
at gioele@ddeb3db

@bors
Copy link
Contributor

@bors bors commented on ddeb3db Aug 8, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging gioele/rust/use-local-rust = ddeb3db into auto

@bors
Copy link
Contributor

@bors bors commented on ddeb3db Aug 8, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gioele/rust/use-local-rust = ddeb3db merged ok, testing candidate = 1272a83

@bors
Copy link
Contributor

@bors bors commented on ddeb3db Aug 8, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 1272a83

Please sign in to comment.