Skip to content

On porting PowerShell Core to FreeBSD #7207

Closed

Description

Hello,

I'm working on a project with Google Summer of Code and the FreeBSD organization to port PowerShell -- as well as the .NET SDK -- to the FreeBSD platform. So far, I've successfully compiled both native (libpsl-native) and managed parts of the PowerShell code on FreeBSD.

At first, three libpsl tests were failing: IsFileTest.RootIsFile, GetUserFromPid.Success and LocaleTest.Success. The last one was just a missing LANG env variable, so as soon as I set it, the test passed. But the first two ones required code changes, which I'm submitting as a PR with questions I had related to specific lines, but they are now ALL passing.

However, the resulting PowerShell build is misbehaving in some ways and I'd like some guidance as to what I should look for:

  • This is what I'm getting for the shell prompt: PS Alias:/>.
  • Running any cmdlet gets me a not recognized as the name of a cmdlet, function... error.
  • Typing anything in results in repeated characters. For example, if I type in Get-Help, this is what I get: PS Alias:/> GGeGetGet-Get-HGet-HeGet-HelGet-Help. Although, as I press Enter, the actual thing that gets read is Get-Help, and not the long string with repeated characters.

This is what my $PSVersionTable looks like:

Name                           Value
----                           -----
PSVersion                      6.1.0-preview.3
PSEdition                      Core
GitCommitId                    v6.1.0-preview.3-59-ge56a6c4bc9c42ba0d0a4c413f31d4508c7a65b75
OS                             FreeBSD 11.1-RELEASE FreeBSD 11.1-RELEASE #0 r321309: Fri Jul 21 02:08:28 UTC 2017   ...
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

cc David Naylor (@DragonSA) David Chisnall (@davidchisnall) Steve Lee (@SteveL-MSFT)

Activity

  1. iSazonov commented on Jun 29, 2018

    @iSazonov
    Collaborator

    PowerShell is entirely based on .Net Core so before you continue with porting PowerShel you should pass all tests in CoreCLR, CoreFX, CLI. After that I hope most problems (your questions above) will resolved automatically.

    •Running any cmdlet gets me a not recognized as the name of a cmdlet, function... error.

    Modules is not imported. There can be many reasons for this.

    •Typing anything in results in repeated characters

    Perhaps it is a console problem. Try TERM=xterm pwsh. You could read related issues

  2. added
    Issue-Question
    on Jun 29, 2018
  3. mateusrodrigues commented on Jul 13, 2018

    @mateusrodrigues
    Author

    So, these are the latest updates:

    • This is what I'm getting for the shell prompt: PS Alias:/>.
    • Running any cmdlet gets me a not recognized as the name of a cmdlet, function... error.

    These have been resolved. It was a problem in CoreFX's FileSystem native implementation that was failing in a certain function and the mount points were not being returned. PR has been submitted and merged into master.

    • Typing anything in results in repeated characters. For example, if I type in Get-Help, this is what I get: PS Alias:/> GGeGetGet-Get-HGet-HeGet-HelGet-Help. Although, as I press Enter, the actual thing that gets read is Get-Help, and not the long string with repeated characters.

    I'm still investigating what the cause of this is. Ilya (@iSazonov) the variable change you suggested didn't work. I'm trying to find out how PS interacts with the console and if there's any echoing involved.

  4. SteveL-MSFT commented on Jul 14, 2018

    @SteveL-MSFT
    Member

    Mateus Rodrigues de Morais (@mateusrodrigues) regarding the console echo problem is PSReadLine being used? if so, try removing it to isolate the problem

    remove-module psreadline

  5. mateusrodrigues commented on Jul 15, 2018

    @mateusrodrigues
    Author

    Steve Lee (@SteveL-MSFT) No, PSReadLine isn't being used.

  6. iSazonov commented on Jul 15, 2018

    @iSazonov
    Collaborator

    Do you test .Net console methods? Do they work ok on FreeBSD?

  7. mateusrodrigues commented on Jul 17, 2018

    @mateusrodrigues
    Author

    Ilya (@iSazonov) Yes, Read, ReadLine, ReadKey ... all work fine on FreeBSD.

  8. iSazonov commented on Jul 17, 2018

    @iSazonov
    Collaborator

    GGeGetGet-Get-HGet-HeGet-HelGet-Help

    Looks like problem with cursor possition evaluating or setting - I see +1 on every next step.

  9. iSazonov commented on Oct 21, 2018

    @iSazonov
    Collaborator

    Feel free to ask if you need a help.

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-AnsweredWG-Maintainers-Build

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions