Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into Localization
Browse files Browse the repository at this point in the history
  • Loading branch information
vmapetr committed Apr 1, 2024
2 parents 6e91d4f + ce65205 commit 37cce2b
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .azure-pipelines/build-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
- template: /.azure-pipelines/build-job.yml@self
parameters:
jobName: ${{ parameters.jobName }}_alternate
displayName: ${{ parameters.displayName }} (without Node 6)
displayName: ${{ parameters.displayName }} (without Node 6, Node 10)
pool: ${{ parameters.pool }}
container: ${{ parameters.container }}
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
Expand Down
6 changes: 6 additions & 0 deletions src/Agent.Sdk/Knob/AgentKnobs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ public class AgentKnobs
new EnvironmentKnobSource("USE_LATEST_GIT_VERSION"),
new BuiltInDefaultKnobSource("false"));

public static readonly Knob AgentTerminalEncoding = new Knob(
nameof(AgentTerminalEncoding),
"If the correct encoding name is specified, the encoding from the environment will be used instead of default UTF-8",
new EnvironmentKnobSource("AGENT_TERMINAL_ENCODING"),
new BuiltInDefaultKnobSource(string.Empty));

public static readonly Knob TfVCUseSecureParameterPassing = new Knob(
nameof(TfVCUseSecureParameterPassing),
"If true, don't pass auth token in TFVC parameters",
Expand Down
21 changes: 21 additions & 0 deletions src/Microsoft.VisualStudio.Services.Agent/Terminal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

using System;
using System.Collections.Generic;
using System.Text;
using Agent.Sdk.Knob;
using Agent.Sdk.Util;

namespace Microsoft.VisualStudio.Services.Agent
Expand Down Expand Up @@ -37,6 +39,25 @@ public override void Initialize(IHostContext hostContext)
{
base.Initialize(hostContext);
Console.CancelKeyPress += Console_CancelKeyPress;

var terminalEncoding = Encoding.UTF8;
var endEncodingName = AgentKnobs.AgentTerminalEncoding.GetValue(hostContext).AsString();

try
{
if (!string.IsNullOrEmpty(endEncodingName))
{
terminalEncoding = Encoding.GetEncoding(endEncodingName);
}
}
catch (Exception ex)
{
Trace.Error($@"Encoding ""{endEncodingName}"" not found:");
Trace.Error(ex);
}

Console.OutputEncoding = terminalEncoding;
Console.InputEncoding = terminalEncoding;
}

private void Console_CancelKeyPress(object sender, ConsoleCancelEventArgs e)
Expand Down
16 changes: 12 additions & 4 deletions src/Misc/externals.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ LAYOUT_DIR=$3
L1_MODE=$4

INCLUDE_NODE6=${INCLUDE_NODE6:-true}
INCLUDE_NODE10=${INCLUDE_NODE10:-true}

CONTAINER_URL=https://vstsagenttools.blob.core.windows.net/tools

Expand Down Expand Up @@ -174,8 +175,10 @@ if [[ "$PACKAGERUNTIME" == "win-x"* ]]; then
acquireExternalTool "${NODE_URL}/v${NODE_VERSION}/${PACKAGERUNTIME}/node.exe" node/bin
acquireExternalTool "${NODE_URL}/v${NODE_VERSION}/${PACKAGERUNTIME}/node.lib" node/bin
fi
acquireExternalTool "${NODE_URL}/v${NODE10_VERSION}/${PACKAGERUNTIME}/node.exe" node10/bin
acquireExternalTool "${NODE_URL}/v${NODE10_VERSION}/${PACKAGERUNTIME}/node.lib" node10/bin
if [[ "$INCLUDE_NODE10" == "true" ]]; then
acquireExternalTool "${NODE_URL}/v${NODE10_VERSION}/${PACKAGERUNTIME}/node.exe" node10/bin
acquireExternalTool "${NODE_URL}/v${NODE10_VERSION}/${PACKAGERUNTIME}/node.lib" node10/bin
fi
acquireExternalTool "${NODE_URL}/v${NODE16_VERSION}/${PACKAGERUNTIME}/node.exe" node16/bin
acquireExternalTool "${NODE_URL}/v${NODE16_VERSION}/${PACKAGERUNTIME}/node.lib" node16/bin
acquireExternalTool "${NODE_URL}/v${NODE20_VERSION}/${PACKAGERUNTIME}/node.exe" node20_1/bin
Expand All @@ -190,7 +193,10 @@ else
if [[ "$INCLUDE_NODE6" == "true" ]]; then
acquireExternalTool "${NODE_URL}/v${NODE_VERSION}/node-v${NODE_VERSION}-${ARCH}.tar.gz" node fix_nested_dir
fi
acquireExternalTool "${NODE_URL}/v${NODE10_VERSION}/node-v${NODE10_VERSION}-${ARCH}.tar.gz" node10 fix_nested_dir

if [[ "$INCLUDE_NODE10" == "true" ]]; then
acquireExternalTool "${NODE_URL}/v${NODE10_VERSION}/node-v${NODE10_VERSION}-${ARCH}.tar.gz" node10 fix_nested_dir
fi

ARCH="darwin-arm64"
acquireExternalTool "${NODE_URL}/v${NODE16_VERSION}/node-v${NODE16_VERSION}-${ARCH}.tar.gz" node16 fix_nested_dir
Expand All @@ -208,7 +214,9 @@ else
if [[ "$INCLUDE_NODE6" == "true" ]]; then
acquireExternalTool "${NODE_URL}/v${NODE_VERSION}/node-v${NODE_VERSION}-${ARCH}.tar.gz" node fix_nested_dir
fi
acquireExternalTool "${NODE_URL}/v${NODE10_VERSION}/node-v${NODE10_VERSION}-${ARCH}.tar.gz" node10 fix_nested_dir
if [[ "$INCLUDE_NODE10" == "true" ]]; then
acquireExternalTool "${NODE_URL}/v${NODE10_VERSION}/node-v${NODE10_VERSION}-${ARCH}.tar.gz" node10 fix_nested_dir
fi
acquireExternalTool "${NODE_URL}/v${NODE16_VERSION}/node-v${NODE16_VERSION}-${ARCH}.tar.gz" node16 fix_nested_dir
acquireExternalTool "${NODE_URL}/v${NODE20_VERSION}/node-v${NODE20_VERSION}-${ARCH}.tar.gz" node20_1 fix_nested_dir
fi
Expand Down
1 change: 1 addition & 0 deletions src/dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ DOTNET_WARNING_PREFIX="##vso[task.logissue type=warning]"
PACKAGE_TYPE=${PACKAGE_TYPE:-agent} # agent or pipelines-agent
if [[ "$PACKAGE_TYPE" == "pipelines-agent" ]]; then
export INCLUDE_NODE6="false"
export INCLUDE_NODE10="false"
fi

pushd "$SCRIPT_DIR"
Expand Down

0 comments on commit 37cce2b

Please sign in to comment.