Skip to content

installpsh-amazonlinux.sh not detecting amazon linux #9285

Closed

Description

@DarwinJS

Windows PowerShell

I can't figure out what commit did this, but the OS detection routine in installpsh-amazonlinux.sh has been dramatically simplified from what is still in install-powershell.sh.

It is now missing the amazon linux detection routines.

The original design allowed for the underlying installers to be called directly - but they still need the full linux detection routine in order validate they are being run on the correct OS.

My container builds that install PowerShell are now failing:

https://gitlab.com/DarwinJS/amazon-linux-2-container-with-powershell/-/jobs/189478956
https://gitlab.com/DarwinJS/amazon-linux-2-ec2-build-container-with-powershell/-/jobs/189478955

For the time being I'm going to switch my build to a known working branch in my own fork of this repo.

Is there a reason this does not show up in automated testing?

I don't personally have the time to fix this.

/cc Travis Plunk (@TravisEz13)

Activity

  1. added
    Issue-Question
    on Apr 3, 2019
  2. TravisEz13 commented on Apr 3, 2019

    @TravisEz13
    Member

    Yup... I am waiting on feedback on two issues in the docker repo before I can add tests for amazon linux.

    PowerShell/PowerShell-Docker#200

    On this issue, I think we can move these changes in to the sub-image proposed by 200, assuming we go with that solution.
    PowerShell/PowerShell-Docker#178

  3. TravisEz13 commented on Apr 7, 2019

    @TravisEz13
    Member

    I have a PR adding CI for this and the script is working fine. At least calling it through install-powershell.sh
    #9314

  4. DarwinJS commented on Apr 7, 2019

    @DarwinJS
    ContributorAuthor

    As I mentioned, the original intent was that if you knew your distro, you wouldn't need two scripts to get the job done.

    It looks like the sub-installers are now dot sourced into the overall script - which means the distro detection is passing through.

    But then this big block of now non-working (for Amazon Linux) distro detection in the sub-install script is unnecessary if the sub-install is going to always assume it is called from the overall: https://github.com/PowerShell/PowerShell/blob/master/tools/installpsh-amazonlinux.sh#L53-L83

    I liked it the original way because for those of us who are automating a known distro we don't need two internet downloads - or any actually. And then these sub-installs can self-validate that you are running them on the proper platform.

  5. TravisEz13 commented on Apr 7, 2019

    @TravisEz13
    Member

    This is the only change not by you, although you reviewed the change:
    #9071

    I'm adding a CI job for your scenario to my PR.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-QuestionResolution-Answered

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions