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

rustup-init: remove dependency on `file` command #543

Merged
merged 1 commit into from Jun 23, 2016

Conversation

Projects
None yet
3 participants
@zarvox
Copy link
Contributor

zarvox commented Jun 23, 2016

Some distros don't install file(1) by default. For the purposes of userspace
architecture detection, rather than screenscrape file(1), we can check the ELF
header directly with only tools that are included in the default coreutils.

Note that printf is a builtin in some shells (like /bin/dash on Debian), and
may be less featureful than the one from coreutils, but that the syntax here
should work on all such shells.

Tested against bash, dash, and busybox sh.

rustup-init: remove dependency on `file` command
Some distros don't install file(1) by default.  For the purposes of userspace
architecture detection, rather than screenscrape file(1), we can check the ELF
header directly with only tools that are included in the default coreutils.

Note that printf is a builtin in some shells (like /bin/dash on Debian), and
may be less featureful than the one from coreutils, but that the syntax here
should work on all such shells.

Tested against bash, dash, and busybox sh.
@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Jun 23, 2016

r? @brson

Seems like a neat trick to me!

@brson

This comment has been minimized.

Copy link
Contributor

brson commented Jun 23, 2016

@zarvox you ninja!

@brson brson closed this Jun 23, 2016

@brson brson reopened this Jun 23, 2016

@brson brson merged commit ddb0d1b into rust-lang:master Jun 23, 2016

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@zarvox zarvox deleted the zarvox:remove-file-dependency branch Jun 23, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.