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

Add list of supported platforms #1371

Closed
Arcterus opened this issue May 4, 2019 · 5 comments · Fixed by #5172
Closed

Add list of supported platforms #1371

Arcterus opened this issue May 4, 2019 · 5 comments · Fixed by #5172

Comments

@Arcterus
Copy link
Collaborator

Arcterus commented May 4, 2019

It might be beneficial to add a list of platforms we know we support. At the moment, those are Linux, macOS, Windows, FreeBSD, and Redox (we should be getting a PR updating support at some point). I believe Android should work too, but there might be some target_os = "linux" that should actually be any(target_os = "linux", target_os = "android"). Many of the target_os = "macos" should also probably be any(target_os = "macos", target_os = "ios").

@nomius10
Copy link
Contributor

nomius10 commented Mar 19, 2021

Could this be done in an automatic manner? I'm thinking of a method in which the number of tests that pass are counted for each (platform, architecture, binary) combination, then a big table is populated with color-coded percentages. The formula would be something like (tests_that_pass) / (tests_that_fail + tests_that_don't_compile + tests_excluded_by_conditional_compilation)

It wouldn't paint the whole picture, but on the upside it'd be very easy to maintain / keep up to date.

@nomius10
Copy link
Contributor

This is how I'd envision the table. It's a Gdocs document with some random values.

If needed, it could be exported to html, peppered with some CSS (for the color-coding and vertical text), and placed in a .md file within the repo. Although AFAIK google docs has APIs through which one can manipulate the data, and thus could be integrated in the CI pipeline to automatically update the statistics.

I'm making the assumption here that all the tests which cover functionality that is known to work for a limited set of platforms should be rewritten such that they intentionally fail on non-supported platforms. Something like:

#[test]
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
fn test_cp_one_file_system() {
    [...]
}

#[test]
#[cfg(windows)]
fn test_cp_one_file_system() {
    // this platform is supported, but the test is not implemented due to logistics
}

#[test]
#[cfg(not(any(target_os = "linux", target_os = "freebsd", windows)))]
fn test_cp_one_file_system() {
    assert!(false,"not supported");
}

Or alternatively, a parser could be written that statically counts how many tests are platform-specific, and how many are not. That way it wouldn't be necessary to write the explicit failing test for unsupported platforms.

@stale
Copy link

stale bot commented Mar 20, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Mar 20, 2022
@tertsdiepraam
Copy link
Member

The current situation is that we have a table at https://github.com/uutils/coreutils/blob/main/README.target.md. The table has a disclaimer of not being up to date, because it's not automated. It can be generated but that takes a lot of resources. Additionally, the docs show some information via icons:
image

I'd like to propose that we adopt a tier system like Rust 1, but a bit different to fit our project:

  • Tier 1: Platforms that we build and test in CI: Linux, Mac, Windows & FreeBSD at the architectures that we test.
  • Tier 2: Platforms that we don't test, but should work. For example, we don't test all BSD's but expect most of them to work if FreeBSD works and we'll accept fixes.

For Tier 1, we can add an automatically generated page to the docs in the same way that we add the icons: by just reading the cargo features.

For Tier 2, we document what should work on the same page. I.e. expect the same features on OpenBSD as FreeBSD.

The advantages are:

  • It's fully automated.
  • It's simple to generate and we have most of the machinery for it already.
  • It's clear what platforms we support.
  • It moves the info to the docs instead of a file that is probably not looked at a lot.
  • The table will be a bit easier to read because it will be smaller.

cc @sylvestre @cakebaker

Footnotes

  1. See https://doc.rust-lang.org/nightly/rustc/platform-support.html

@sylvestre
Copy link
Contributor

sounds great, let's do it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants