Skip to content

Please update "host": descripion in index.json specification #1168

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

Closed
ArminJo opened this issue Feb 4, 2021 · 2 comments
Closed

Please update "host": descripion in index.json specification #1168

ArminJo opened this issue Feb 4, 2021 · 2 comments
Assignees
Labels
topic: documentation Related to documentation for the project

Comments

@ArminJo
Copy link

ArminJo commented Feb 4, 2021

Hello,
in the current specification I see:

    Linux 64-bit (x86_64-linux-gnu),
    Linux 32-bit (i686-linux-gnu),
    Windows (i686-mingw32),
    Mac (i386-apple-darwin11)

In the Arduino package_index.json there are also aarch64-linux-gnu + arm-linux-gnueabihf.
And what confuses me, is that there are new entries x86_64-pc-linux-gnu / i686-pc-linux-gnu.
What is the difference to x86_64-linux-gnu / i686-linux-gnu?

Thanks
Armin

@per1234
Copy link
Contributor

per1234 commented Feb 4, 2021

Hi @ArminJo. The list you see in the Package Index Specification is only some examples, not a comprehensive list of all supported values. I agree that the supported values being undocumented is not so great.

You can see the full list here:

var (
regexpLinuxArm = regexp.MustCompile("arm.*-linux-gnueabihf")
regexpLinuxArm64 = regexp.MustCompile("(aarch64|arm64)-linux-gnu")
regexpLinux64 = regexp.MustCompile("x86_64-.*linux-gnu")
regexpLinux32 = regexp.MustCompile("i[3456]86-.*linux-gnu")
regexpWindows32 = regexp.MustCompile("i[3456]86-.*(mingw32|cygwin)")
regexpWindows64 = regexp.MustCompile("(amd64|x86_64)-.*(mingw32|cygwin)")
regexpMac64 = regexp.MustCompile("x86_64-apple-darwin.*")
regexpMac32 = regexp.MustCompile("i[3456]86-apple-darwin.*")
regexpMacArm64 = regexp.MustCompile("arm64-apple-darwin.*")
regexpFreeBSDArm = regexp.MustCompile("arm.*-freebsd[0-9]*")
regexpFreeBSD32 = regexp.MustCompile("i?[3456]86-freebsd[0-9]*")
regexpFreeBSD64 = regexp.MustCompile("amd64-freebsd[0-9]*")
)
func (f *Flavor) isExactMatchWith(osName, osArch string) bool {
if f.OS == "all" {
return true
}
switch osName + "," + osArch {
case "linux,arm", "linux,armbe":
return regexpLinuxArm.MatchString(f.OS)
case "linux,arm64":
return regexpLinuxArm64.MatchString(f.OS)
case "linux,amd64":
return regexpLinux64.MatchString(f.OS)
case "linux,386":
return regexpLinux32.MatchString(f.OS)
case "windows,386":
return regexpWindows32.MatchString(f.OS)
case "windows,amd64":
return regexpWindows64.MatchString(f.OS)
case "darwin,arm64":
return regexpMacArm64.MatchString(f.OS)
case "darwin,amd64":
return regexpMac64.MatchString(f.OS)
case "darwin,386":
return regexpMac32.MatchString(f.OS)
case "freebsd,arm":
return regexpFreeBSDArm.MatchString(f.OS)
case "freebsd,386":
return regexpFreeBSD32.MatchString(f.OS)
case "freebsd,amd64":
return regexpFreeBSD64.MatchString(f.OS)
}
return false
}

there are also aarch64-linux-gnu + arm-linux-gnueabihf

aarch64-linux-gnu is 64 bit Linux on ARM architecture host.
arm-linux-gnueabihf is 32 bit Linux on ARM architecture host.

What is the difference to x86_64-linux-gnu / i686-linux-gnu?

You can see that in the code above the regular expressions provide a good deal of flexibility in the host values.

This sort of variation certainly has caused me some confusion, since I tend to try to reverse engineer the platform system by studying the existing platforms, rather than diving into the actual code. This would lead me to assume there was some significance between these different host values, but as far as Boards Manager is concerned they are identical.

@per1234 per1234 added the topic: documentation Related to documentation for the project label Feb 4, 2021
@ArminJo
Copy link
Author

ArminJo commented Feb 4, 2021

T H A N K S 🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: documentation Related to documentation for the project
Projects
None yet
Development

No branches or pull requests

4 participants