Skip to content
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

Persistent builds don't seem to work #140

Closed
lzybkr opened this issue Feb 13, 2019 · 4 comments
Closed

Persistent builds don't seem to work #140

lzybkr opened this issue Feb 13, 2019 · 4 comments

Comments

@lzybkr
Copy link

lzybkr commented Feb 13, 2019

It looks like XTask is invoked before the task is run, so Elapsed is never set when read here.

Repro:

param($stuff)

task A {
    Write-Host "task A"
}

task B A,{
    $script:stuff = "Does this persist?"
    Write-Host "task B"
    if (!(Test-Path aa.txt)) {
         exec { cmd /c exit 1 }
    }
}

task C B,{
    Write-Host "task C: $stuff"
}

task . C
Build-Checkpoint tmp.clixml -Build @{File = '.\a.build.ps1' }
"" > aa.txt
Build-Checkpoint tmp.clixml -resume

Expected - it shouldn't run task A the second time.

@nightroman
Copy link
Owner

Hi @lzybkr

Weird... I thought it was fine to invoke XTask before tasks (and there was a reason to invoke before). In this case it should be invoked before B after A, so that and A's Elapsed should be set and A should be saved as done. I'll take a closer look indeed.

@nightroman
Copy link
Owner

In this case it should be invoked before B after A...

Ah, it's wrong. Due to the dependencies, XTask for B is invoked before A. It's a bug. Thank you for catching and reporting it.

@nightroman
Copy link
Owner

nightroman commented Feb 14, 2019

Here is the story of invoking XTask before tasks -- #22
The first idea of fixing the original problem was correct.
The second (shortcut) was not.

@nightroman
Copy link
Owner

Fixed in 5.4.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants