Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround for rust 1.27.0 not compiling on macOS 10.10 #126

Closed
STA-WSYNC opened this issue Jun 27, 2018 · 9 comments
Closed

Workaround for rust 1.27.0 not compiling on macOS 10.10 #126

STA-WSYNC opened this issue Jun 27, 2018 · 9 comments
Labels

Comments

@STA-WSYNC
Copy link

xsv 0.13.0 depends on Rust and requires the latest version (1.27.0 as of now). I've found that on my machine Rust fails to compile, probably because I'm running 10.10 Yosemite because my mac is ancient

rust-lang/rust#51838

Luckily there is a workaround for this.

In the general case where you want to install package X, package X depends on the latest version of package Y and for some reason (poverty, laziness) you can't use the latest version of package Y on your machine. Just do a /usr/local/Cellar/Y and sym link the last known good version to the latest version. This was inspired by https://stackoverflow.com/questions/19664535/how-can-i-prevent-homebrew-from-upgrading-vtk-dependency-for-pcl/19665408#19665408

In this specific case

cd /usr/local/Cellar/rust
ln -s 1.24.1 1.27.0

This tricks homebrew into thinking it already has 1.27.0 and thus won't download it, fail to compile and end up all fubar.

@BurntSushi
Copy link
Owner

xsv 0.13.0 compiles on Rust 1.20.0 just fine. This is checked in CI. Could you please say why you believe xsv requires Rust 1.27?

@STA-WSYNC
Copy link
Author

If you use Homebrew it tries to update because rust depends on the latest version. I actually tried to pin rust to 1.24.1. Homebrew failed to install because 'Error: You must brew unpin rust as installing xsv requires the latest version of pinned dependencies'

E.g.

$ brew info rust
rust: stable 1.27.0, HEAD
Safe, concurrent, practical language
https://www.rust-lang.org/
Conflicts with:
cargo-completion (because both install shell completion for cargo)
/usr/local/Cellar/rust/1.22.1 (6,211 files, 339.9MB)
Built from source on 2017-12-18 at 20:45:13
/usr/local/Cellar/rust/1.24.1 (6,033 files, 404.6MB) *
Built from source on 2018-03-05 at 19:59:53

So I did

brew switch rust 1.24.1
brew pin rust
brew install xsv

Fails with

Error: You must brew unpin rust as installing xsv requires the latest version of pinned dependencies

Looking at this

https://github.com/Homebrew/homebrew-core/blob/master/Formula/xsv.rb

I see

depends_on "rust" => :build

I don't know enough about Homebrew to know if it is possible to say that "xsv requires Rust 1.20.0 or later" or if it has to be "xsv requires the latest version of Rust"

At the moment it seems like Homebrew thinks it needs the latest version.

Thanks for confirming it only needs 1.20.0 or later BTW, I can now stop worrying if the ln hack I did had messed things up in a subtle way.

Xsv is a great idea BTW - CSV may be primitive but because it's a lowest common denominator format lots of UK government data sources use it and they generate multi GB files. Xsv means you can process those in a reasonable amount of time.

@BurntSushi
Copy link
Owner

All righty, thanks for the explanation. Looks like there's nothing to be done here on my end.

I'm not sure who's to blame for your Rust compilation issues though. My guess is that Homebrew probably isn't in the business of supporting every possible Rust version though.

@STA-WSYNC
Copy link
Author

Would it be possible to add support back in for Yosemite

E.g.

https://github.com/Homebrew/homebrew-core/blob/master/Formula/xsv.rb

  bottle do
    sha256 "9837a63d7a48c82a723294a24e66e64920c0b0ead2bc92c408e502d76cd482c7" => :high_sierra
    sha256 "c909a6c8c825a231d0148fd3776d764bf6c0a67663f2944e6b66ae492b206387" => :sierra
    sha256 "34848a92e9e392a942e31cb8af2c725e80742c27ecd6f0579a7242015b50259a" => :el_capitan
  end

So that means there are bottles (precompiled binaries?) for el_capitan ( 10.11 ), sierra (10.12) and high_sierra ( 10.13 ).

So on those ones you don't need to compile rust, you just get the precompiled version.

Another option would be to make it not require an upgrade to Rust if you have 1.20 or later.

Then again I'm guessing that I'm going to hit the same problem with 10.10 on a load of homebrew packages. Maybe I should just bite the bullet and upgrade to 10.11 at least.

@BurntSushi
Copy link
Owner

BurntSushi commented Jun 27, 2018

I don't use a Mac, and I don't really know much about them. So what support there is, I've cobbled together. I have the capacity to test it on my mac mini, and I upgrade that whenever possible. Anything else is really beyond my capacity to support, and asking me to provide support for ancient versions is too asymmetrical for my taste.

If you just want a precompiled binary, then they are available here: https://github.com/BurntSushi/xsv/releases --- Those are built via whatever version of macOS runs on Travis. If they work for you great!

https://github.com/Homebrew/homebrew-core/blob/master/Formula/xsv.rb

This is the xsv repo, not the Homebrew repo. I don't maintain the Homebrew formulas, although I have updated them on occasion. If you're looking to get support for older versions of macOS, then I think you need to go talk to the Homebrew folks, not me.

@STA-WSYNC
Copy link
Author

No worries, I'm upgrading to 10.12 Sierra now.

@STA-WSYNC
Copy link
Author

Right, did the OS upgrade and now I can use the bottled version of Rust which obviously installs fine

$ brew upgrade rust
==> Upgrading 1 outdated package, with result:
rust 1.24.1 -> 1.27.0
==> Upgrading rust 
==> Downloading https://homebrew.bintray.com/bottles/rust-1.27.0.sierra.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/9d/9d91681309cce40845d8c20d97ed2fa9ab0f4ecc7d015c33907abab7d5fa8643?__gda__=exp=1530124
######################################################################## 100.0%
==> Pouring rust-1.27.0.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/rust/1.27.0: 42,749 files, 763.6MB

@BurntSushi
Copy link
Owner

Glad you figured it out! :)

@STA-WSYNC
Copy link
Author

Well I figure I might as well document it so people can Google for it if they hit the same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants