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 support for AIX #241

Closed
jokurz opened this issue May 20, 2019 · 13 comments · Fixed by #311
Closed

Add support for AIX #241

jokurz opened this issue May 20, 2019 · 13 comments · Fixed by #311
Assignees
Milestone

Comments

@jokurz
Copy link

jokurz commented May 20, 2019

Add support for AIX. Currently disto returns the following for a AIX 7.2:

{
    "codename": "",
    "id": "aix",
    "like": "",
    "version": "2",
    "version_parts": {
        "build_number": "",
        "major": "2",
        "minor": ""
    }
}

Source could be cmd oslevel:

$ oslevel
7.2.0.0

7 --> major
2 --> minor

@nir0s
Copy link
Collaborator

nir0s commented May 20, 2019

Can you share the release file?

@jokurz
Copy link
Author

jokurz commented May 21, 2019

As far as I know there is no release file on AIX.

@nir0s
Copy link
Collaborator

nir0s commented May 21, 2019

There must be something.. lsb.. something.. otherwise how would distro know that it's aix?

@jokurz
Copy link
Author

jokurz commented May 21, 2019

It seems that this information was gathered from uname -rs:

$ uname -rs
AIX 2

@HorlogeSkynet
Copy link
Member

Hey @jokurz, would it be possible to read these version components from a file instead of calling oslevel ? Thanks 🙇

@jokurz
Copy link
Author

jokurz commented Sep 27, 2021

@HorlogeSkynet - I am not aware of such a file. I would fully understand if you will not support AIX as the platform might not be the first choice for python development.

@HorlogeSkynet
Copy link
Member

@jokurz thanks for your fast feedback ! We'll do our best to support (and maintain) what distro should.
I was asking about a specific "release" file, as sourcing such would be faster than calling another external program. Do you know a substitute for Linux strace command that you could run against oslevel to see what it does ? Bye 👋

@nir0s
Copy link
Collaborator

nir0s commented Sep 27, 2021

@HorlogeSkynet, while I agree that a file would be nicer, I think that we can simply try to execute oslevel as a last resort (assuming nothing else is found, e.g. release file, uname, etc..).

If that's the case, it won't cost anything, as oslevel will indeed only run when no other option is available (supposedly, only on AIX, AFAIK).

WDYT?

@HorlogeSkynet
Copy link
Member

@nir0s Unless I'm missing something here, I don't think it would be that easy as uname -rs output is definitely working (see #241 (comment)) 🙄

@nir0s
Copy link
Collaborator

nir0s commented Sep 28, 2021

Hehe, I'm the one missing something. I didn't read the previous comments.

@HorlogeSkynet
Copy link
Member

HorlogeSkynet commented Sep 30, 2021

@nir0s @jokurz So it looks like we could be doing something like that in version method (naive pseudo-code here, implementation must be tougher and tests written of course) :

    def version(self, pretty: bool = False, best: bool = False) -> str:
        versions = [
            # current existing candidates list...
        ]
        if sys.platform.startswith('aix'):
            versions.insert(0, check_output("oslevel"))

@jokurz Homework chores if you don't mind :

  • verify that somehow we cannot retrieve oslevel output another way ;
  • check whether passing a specific flag to oslevel would be relevant in our case, according to AIX's terminology (manual).

Thanks, bye 👋

@nir0s
Copy link
Collaborator

nir0s commented Sep 30, 2021

@HorlogeSkynet, sounds good. However, while I don't know AIX, it doesn't make sense to me that there isn't a file with that info. Does AIX have a magical way of storing this info that we can't read?

HorlogeSkynet pushed a commit that referenced this issue Oct 3, 2021
HorlogeSkynet pushed a commit that referenced this issue Oct 3, 2021
HorlogeSkynet pushed a commit that referenced this issue Oct 3, 2021
HorlogeSkynet pushed a commit that referenced this issue Oct 4, 2021
@HorlogeSkynet HorlogeSkynet linked a pull request Oct 4, 2021 that will close this issue
@HorlogeSkynet
Copy link
Member

Closing here, please see #311.
An official review is expected from you @nir0s, but I'd be interested from yours too @jokurz. Bye 👋

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.

3 participants