Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,14 @@ static ExperimentalFeature()
}
catch (Exception e) when (LogException(e)) { }

if (enabledFeatures.Length == 0 && !string.IsNullOrEmpty(PSVersionInfo.PSCurrentVersion.PreReleaseLabel))
{
// if no experimental features are configured in pwsh.config.json file
// and pwsh version is preview
// then we enable all experimental features by default.
enabledFeatures = engineFeatures.Select(static f => f.Name).ToArray();
Copy link
Member

@daxian-dbw daxian-dbw Feb 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work. Modules can declare experimental features which are not in engineFeatures.
It would need a more sophisticated change than this.

Copy link
Collaborator Author

@iSazonov iSazonov Feb 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For in-box modules they are in (could be in) engineFeatures.
For out-box modules it should be up to the authors of these modules to decide if they want to include experimental features by default.

Copy link
Member

@daxian-dbw daxian-dbw Feb 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For in-box modules they are in (could be in) engineFeatures.

They are not by design, to be equivalent to any other modules and go through the same discovery path.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not have them in engineFeatures?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because

  1. it's not necessary from the developer's perspective -- the module manifest already needs to have the experimental feature declared.
  2. it should be the same as any other module and exercise the same discovery code path.

We are not going to add a burden to the developer just for making the build easier, especially given that the build changes are already done.

}

EnabledExperimentalFeatureNames = ProcessEnabledFeatures(enabledFeatures);
}

Expand Down