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

stdenv: Add isPc helper to replace (isi686 || isx86_64) #7846

Closed
wants to merge 2 commits into from

Conversation

dezgeg
Copy link
Contributor

@dezgeg dezgeg commented May 14, 2015

It's a relatively common operation to compare the current platform to PC platforms, i.e. x86 compatible platforms.

Bikeshedding: maybe there's a better name than isPc?

@codyopel
Copy link
Member

x86 would be more accurate then pc

@wmertens
Copy link
Contributor

isIA? isIntelArch?

On Fri, May 15, 2015, 7:36 AM Cody Opel notifications@github.com wrote:

x86 would be more accurate then pc


Reply to this email directly or view it on GitHub
#7846 (comment).

@edolstra
Copy link
Member

isX86 is probably the most accurate. isIntelArch isn't since there are other Intel architectures (Itanium, i960, ...).

@vcunat
Copy link
Member

vcunat commented May 15, 2015

@edolstra: Why "isX86" and not "isx86" when we have "isx86_64"?

@edolstra
Copy link
Member

camelCase dictates starting a non-initial word with a capital letter. So isx86_64 is wrong.

@vcunat
Copy link
Member

vcunat commented May 15, 2015

So, the situation is to choose any two from: consistency, camelCase rule, and backward compatibility?

@wmertens
Copy link
Contributor

No we can also fix all the isx86_64 occurrences, and we can add aliases as
well :)

On Fri, May 15, 2015 at 10:58 AM Vladimír Čunát notifications@github.com
wrote:

So, the situation is to choose any two from: consistency, camelCase rule,
and backward compatibility?


Reply to this email directly or view it on GitHub
#7846 (comment).

@wmertens
Copy link
Contributor

other options for that one are isX8664 (6 capitalized is 6) or isX86-64 or
is-x86_64 (nix forging new ground with - in names)

On Fri, May 15, 2015 at 12:55 PM Wout Mertens wout.mertens@gmail.com
wrote:

No we can also fix all the isx86_64 occurrences, and we can add aliases as
well :)

On Fri, May 15, 2015 at 10:58 AM Vladimír Čunát notifications@github.com
wrote:

So, the situation is to choose any two from: consistency, camelCase rule,
and backward compatibility?


Reply to this email directly or view it on GitHub
#7846 (comment).

@vcunat
Copy link
Member

vcunat commented May 15, 2015

Yes, dash is probably more common, so isX86-64 and isX86, and perhaps also isI686 to fix camelCase? If we're doing big renames, we should choose carefully. We might also keep the old names as deprecated aliases for some time to keep compatibility. @edolstra, others?

@edolstra
Copy link
Member

Please no dashes in variable names!

@vcunat
Copy link
Member

vcunat commented May 15, 2015

I'm just curious, why should only package attributes use dashes?

@copumpkin
Copy link
Member

The shed should be purple!!!

@codyopel
Copy link
Member

An idea I had for simplify things would be use something like:

isX86    # All x86 variations
isX86_32 # x86 32bit (i{3,4,5,6,7}86)
isX86_64 # x86 64bit (amd64)
isARM    # All ARM variations
isARM_32 # ARM 32bit (armv{5,6,7,8,+})
isARM_64 # ARM 64bit (armv{8,+})
...
isMIPS
isMIPS_32
isMIPS_64
isPPC
isPPC_32
isPPC_64
isSPARC
isSPARC_32
isSPARC_64

This would use a generic base identifier (X86) and then add on _32 & _64 for specifying Bits. x86_32 would be less politically correct than using i686, but might help to avoid confusion. Obviously some of these listed are not necessary since Nix doesn't support some of the listed arch's or variations there of.

@vcunat
Copy link
Member

vcunat commented May 16, 2015

IMO the name i686 implies that the HW shouldn't be too old and e.g. support MMX and some other features.

For a long time I meant to ask why we have various functions for platform categorization in lib/systems.nix and then in stdenv we just redefine the same groups without using the previous implementation. Perhaps I misunderstand the purpose of systems.nix.

It's a relatively common operation to compare the current platform to
x86 platforms of both bitness.
@dezgeg
Copy link
Contributor Author

dezgeg commented May 18, 2015

Changed to isX86.

@dezgeg dezgeg closed this Jun 24, 2015
@dezgeg dezgeg deleted the pr-ispc branch June 24, 2015 02:08
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

6 participants