-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
The pwsh task breaks with multi-repo checkout #12328
Comments
@jtpetty @stephenmichaelf @jpricket FYI. Not sure who wants to take a crack at this one. |
@mitchdenny - This is quite possibly fixed in the latest agent, 2.164.8. Can you try that agent version? We are in the process of rolling this version out to all customers so you may not have gotten it automatically yet. |
Sorry the Agent for this job: Let me know if you don't have access, since we are in the MS tenant I can give you access. |
@mitchdenny - Ok, for multi-repo checkouts, I think that it is expected that you have to explicitly I am curious why setting the working directory to either one of the repos you are populating or to the work directory itself does not fix the problem for both Windows and Ubuntu. Can you set the work directory and rerun the Ubuntu pipeline with debug enabled and send me a link? |
Here is the repro on Ubuntu where even if I have a workingDirectory defined it still bombs out: FWIW, I don't think I should have to specify a working directory. There should always be some reasonable default. In the case of multi-checkout I would expect that to be Pipeline.Workspace/Agent.BuildDirectory. I thought that was the direction things where heading fro a consistency perspective anyway. |
THe snippet for the above build failure is: - stage: AgentProblemRepro
dependsOn: ${{parameters.DependsOn}}
jobs:
- job: PwshOnUbuntu
steps:
- checkout: azure-sdk-build-tools
path: azure-sdk-build-tools
- pwsh: |
Write-Host Hello world
workingDirectory: $(Agent.BuildDirectory) |
I will try to repro this today and take a look. |
@mitchdenny I can't seem to repro the either error with the latest agent. Perhaps there's something missing for the repro. Can you share more of your yaml? I tried to mimic what you show in the snippet but I don't know what the other stages are doing. |
@mitchdenny Actually, I was able to repo it after a few more builds. I am not sure what changed. Perhaps, it started happening after I stopped changing things and it started re-using the same build folders. In any case, I think I have a repro now and will try to find a fix. |
There are actually two issues. The first occurs with multi-repo where pwsh needs to have the workingDirectory set otherwise it blows up (this occurs on Windows). But there is another issue that happens on Ubuntu where it just blows up even if you do set the working directory. I suspect that they are related (the way using the named checkouts impacts variables etc). |
@mitchdenny - I think I have found the problem and I have a fix. It needs some additional testing, but should get in this week. I will work with @jtpetty to get the fix rolled out as soon as possible. For others viewing this thread... |
FYI the PR can be found here microsoft/azure-pipelines-agent#2815 |
Thanks for looking into the issue and getting a resolution. So given this will I need |
@mitchdenny No, setting working directory was just a workaround for windows. The PR should fix the problem without any changes needed. |
The fix is in agent release 2.165.1 - https://github.com/microsoft/azure-pipelines-agent/releases/tag/v2.165.1 |
Question, Bug, or Feature?
Type: Bug
Enter Task Name: PowerShell
Environment
Issue Description
When using the pwsh task on with the multi-repo checkout feature I experience the following issues:
For #1, the issue can be worked around by setting the workingDirectory. I haven't found a workaround for #2 yet.
The text was updated successfully, but these errors were encountered: