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

zarvox
Copy link
Contributor

@zarvox 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.

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
Copy link
Member

r? @brson

Seems like a neat trick to me!

@brson
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
@zarvox zarvox deleted the remove-file-dependency branch June 23, 2016 22:33
AJ-Ianozi pushed a commit to AJ-Ianozi/getada-download that referenced this pull request Oct 12, 2023
rustup-init: remove dependency on `file` command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants