-
Notifications
You must be signed in to change notification settings - Fork 381
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
Validate README.md supported targets with CI #686
Comments
Attempts to recreate the table present in README.md, with an initial script to generate the table information for a given target. Related to cross-rs#686.
I've created a very rudimentary attempt at this in target_info (only partially working on Android, and works for a few tested musl targets) to auto-generate a table similar to the one in README to compare and validate the information. This might also simplify the validation of the versions in #591. The use of the script is quite simple (and a wrapper with many targets would be provided to extract info for all targets): $ export TARGET=aarch64-unknown-linux-musl
$ docker run -e TARGET ghcr.io/cross-rs/"$TARGET":main bash -c "`cat extract_target_info.sh`"
| `aarch64-unknown-linux-musl` | 1.2.0 | 9.2.0 | ✓ | 5.1.0 | How this works is it queries the version information from GCC (or Clang), detects if Qemu is present and if so, gets the Qemu version. and determines if the command provided by This is then formatted to the desired output. This definitely should be possible for most targets, and we can do it after the image has been completed by using information provided by the toolchain. |
Awesome! Something I just realised, we should/could label the images with the different version |
That might be easier. I can get the libc versions for everything except FreeBSD pretty easily, and FreeBSD isn't hard, but the libc reported in the README is the base release (which is quite different than the symbol libc version). For example, for the current base release of 12.3, we would get So for this and Android, I'm not sure what the correct output should be. For FreeBSD, is the correct libc version |
Attempts to recreate the table present in README.md, which can extract the target information for a single target or for all targets. Should currently support the following targets: - Android - glibc - musl - MinGW - FreeBSD - NetBSD - newlib Closes cross-rs#686.
Attempts to recreate the table present in README.md, which can extract the target information for a single target or for all targets. Should currently support the following targets: - Android - glibc - musl - MinGW - FreeBSD - NetBSD - newlib Closes cross-rs#686.
Attempts to recreate the table present in README.md, which can extract the target information for a single target or for all targets. Should currently support the following targets: - Android - glibc - musl - MinGW - FreeBSD - NetBSD - newlib Closes cross-rs#686.
Attempts to recreate the table present in README.md, which can extract the target information for a single target or for all targets. Should currently support the following targets: - Android - glibc - musl - MinGW - FreeBSD - NetBSD - newlib Closes cross-rs#686.
Attempts to recreate the table present in README.md, which can extract the target information for a single target or for all targets. Should currently support the following targets: - Android - glibc - musl - MinGW - FreeBSD - NetBSD - newlib Closes cross-rs#686.
Attempts to recreate the table present in README.md, which can extract the target information for a single target or for all targets. Should currently support the following targets: - Android - glibc - musl - MinGW - FreeBSD - NetBSD - newlib Closes cross-rs#686.
Attempts to recreate the table present in README.md, which can extract the target information for a single target or for all targets. Should currently support the following targets: - Android - glibc - musl - MinGW - FreeBSD - NetBSD - newlib Closes cross-rs#686.
Attempts to recreate the table present in README.md, which can extract the target information for a single target or for all targets. Should currently support the following targets: - Android - glibc - musl - MinGW - FreeBSD - NetBSD - newlib Closes cross-rs#686.
Attempts to recreate the table present in README.md, which can extract the target information for a single target or for all targets. Should currently support the following targets: - Android - glibc - musl - MinGW - FreeBSD - NetBSD - newlib Closes cross-rs#686.
Attempts to recreate the table present in README.md, which can extract the target information for a single target or for all targets. Should currently support the following targets: - Android - glibc - musl - MinGW - FreeBSD - NetBSD - newlib Closes cross-rs#686.
753: Add scripts to validate target info. r=Emilgardis a=Alexhuszagh Attempts to recreate the table present in README.md, which can extract the target information for a single target or for all targets. Should currently support the following targets: - Android - glibc - musl - MinGW - FreeBSD - NetBSD - newlib Closes #686. This produces the following table: | Target | libc | GCC | C++ | QEMU | |:-:|:-:|:-:|:-:|:-:| | `aarch64-linux-android` | 9.0.8 | 9.0.8 | ✓ | 5.1.0 | | `aarch64-unknown-linux-gnu` | 2.23 | 5.4.0 | ✓ | 5.1.0 | | `aarch64-unknown-linux-musl` | 1.2.0 | 9.2.0 | ✓ | 5.1.0 | | `arm-linux-androideabi` | 9.0.8 | 9.0.8 | ✓ | 5.1.0 | | `arm-unknown-linux-gnueabi` | 2.23 | 5.4.0 | ✓ | 5.1.0 | | `arm-unknown-linux-gnueabihf` | 2.17 | 8.3.0 | ✓ | 5.1.0 | | `arm-unknown-linux-musleabi` | 1.2.0 | 9.2.0 | ✓ | 5.1.0 | | `arm-unknown-linux-musleabihf` | 1.2.0 | 9.2.0 | ✓ | 5.1.0 | | `armv5te-unknown-linux-gnueabi` | 2.27 | 7.5.0 | ✓ | 5.1.0 | | `armv5te-unknown-linux-musleabi` | 1.2.0 | 9.2.0 | ✓ | 5.1.0 | | `armv7-linux-androideabi` | 9.0.8 | 9.0.8 | ✓ | 5.1.0 | | `armv7-unknown-linux-gnueabihf` | 2.23 | 5.4.0 | ✓ | 5.1.0 | | `armv7-unknown-linux-musleabihf` | 1.2.0 | 9.2.0 | ✓ | 5.1.0 | | `i586-unknown-linux-gnu` | 2.23 | 5.4.0 | ✓ | N/A | | `i586-unknown-linux-musl` | 1.2.0 | 9.2.0 | ✓ | N/A | | `i686-linux-android` | 9.0.8 | 9.0.8 | ✓ | 5.1.0 | | `i686-pc-windows-gnu` | N/A | 7.5 | ✓ | N/A | | `i686-unknown-freebsd` | 1.5 | 6.4.0 | ✓ | N/A | | `i686-unknown-linux-gnu` | 2.23 | 5.4.0 | ✓ | 5.1.0 | | `i686-unknown-linux-musl` | 1.2.0 | 9.2.0 | ✓ | N/A | | `mips-unknown-linux-gnu` | 2.23 | 5.4.0 | ✓ | 5.1.0 | | `mips-unknown-linux-musl` | 1.2.0 | 9.2.0 | ✓ | 5.1.0 | | `mips64-unknown-linux-gnuabi64` | 2.23 | 5.4.0 | ✓ | 5.1.0 | | `mips64el-unknown-linux-gnuabi64` | 2.23 | 5.4.0 | ✓ | 5.1.0 | | `mipsel-unknown-linux-gnu` | 2.23 | 5.4.0 | ✓ | 5.1.0 | | `mipsel-unknown-linux-musl` | 1.2.0 | 9.2.0 | ✓ | 5.1.0 | | `powerpc-unknown-linux-gnu` | 2.23 | 5.4.0 | ✓ | 5.1.0 | | `powerpc64-unknown-linux-gnu` | 2.23 | 5.4.0 | ✓ | 5.1.0 | | `powerpc64le-unknown-linux-gnu` | 2.23 | 5.4.0 | ✓ | N/A | | `riscv64gc-unknown-linux-gnu` | 2.27 | 7.5.0 | ✓ | 5.1.0 | | `s390x-unknown-linux-gnu` | 2.23 | 5.4.0 | ✓ | 5.1.0 | | `sparc64-unknown-linux-gnu` | 2.23 | 5.4.0 | ✓ | 5.1.0 | | `thumbv6m-none-eabi` | 2.2.0 | 4.9.3 | | N/A | | `thumbv7em-none-eabi` | 2.2.0 | 4.9.3 | | N/A | | `thumbv7em-none-eabihf` | 2.2.0 | 4.9.3 | | N/A | | `thumbv7m-none-eabi` | 2.2.0 | 4.9.3 | | N/A | | `x86_64-linux-android` | 9.0.8 | 9.0.8 | ✓ | 5.1.0 | | `x86_64-pc-windows-gnu` | N/A | 7.3 | ✓ | N/A | | `x86_64-unknown-freebsd` | 1.5 | 6.4.0 | ✓ | N/A | | `x86_64-unknown-linux-gnu` | 2.17 | 4.8.5 | ✓ | 4.2.1 | | `x86_64-unknown-linux-musl` | 1.2.0 | 9.2.0 | ✓ | N/A | | `x86_64-unknown-netbsd` | 9.2.0 | 9.4.0 | ✓ | N/A | There's a few mild differences here, but I think they're correct: - FreeBSD uses the [symbol versioning](https://wiki.freebsd.org/SymbolVersioning) for libc. - Android libc uses the LLVM version, and the compiler version isn't the native GCC toolchain either. A few notes on how this works: - C++ support is checked by there being a C++ executable, and it can compile a simple program (see below): - Compiler version is detected by the output of GCC or Clang by a regular expression. - Qemu version is detected by the presence of a Qemu binary and extracted via a regular expression. - libc verson is quite intricate, but interesting: - If Android, the libc version is just the compiler version (Clang == LLVM). - If musl, we execute the binary and extract the version via a regular expression. - If glibc, we use the versioned filenames to get the version (`libc-2.17.so`). - If newlib, we use `dpkg` to get the package version which has the newlib version. - For FreeBSD, we wrote the FreeBSD version to file, and then match that to the libc version. - For NetBSD, we can read the version from the `libc.so` symbols, grepped for `NetBSD`. - For Windows, intentional passthrough. **C++ Program** This may fail in the case we cannot compile a C program to begin with (AKA, newlib, which we have missing startfiles, etc.). This really doesn't matter right now, since none of these bare-metal targets support C++, although in the future we may want to add `-nostartfiles` during compilation. ```cpp #include <iostream> int main() { std::cout << "Testing this" << std::endl; } ``` Co-authored-by: Alex Huszagh <[email protected]>
Attempts to recreate the table present in README.md, which can extract the target information for a single target or for all targets. Should currently support the following targets: - Android - glibc - musl - MinGW - FreeBSD - NetBSD - newlib Closes cross-rs#686.
Attempts to recreate the table present in README.md, which can extract the target information for a single target or for all targets. Should currently support the following targets: - Android - glibc - musl - MinGW - FreeBSD - NetBSD - newlib Closes cross-rs#686.
We should investigate if it would be possible to validate that the supported target table is correct
https://github.com/cross-rs/cross#supported-targets
The text was updated successfully, but these errors were encountered: