Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make build process consistent with non-build dependencies (#253)
* Return to spawning in a new process -- this is so its easier to set the libs available to the dependency. There is probably a nice way to do this with a temp $*REPO to avoid spawning a new process. * No longer install build dependencies differently than other dependencies -- this allows --dry --serial etc to continue being useful. Essentially we want each set of dependencies to have an isolated environment, but installing build dependencies prior to anything else means its much more difficult to get reproducibility between run.
- Loading branch information
Showing
7 changed files
with
40 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use Zef; | ||
|
||
class Zef::Service::Shell::DistributionBuilder does Builder does Messenger { | ||
method build-matcher($dist) { ($dist.meta-version // 0) == 1 } | ||
method needs-build($dist) { self.build-matcher($dist) and $dist.builder } | ||
|
||
method probe { True } | ||
|
||
method build($dist, :@includes) { | ||
die "path does not exist: {$dist.path}" unless $dist.path.IO.e; | ||
|
||
my $cmd = "(require ::('Distribution::Builder::$dist.builder()')).new(meta => $dist.meta.perl()).build('$dist.path()') ?? exit(0) !! exit(1)"; | ||
my @exec = |($*EXECUTABLE, '-I.', |@includes.grep(*.defined).map({ "-I{$_}" }), '-e', "$cmd"); | ||
|
||
$.stdout.emit("Command: {@exec.join(' ')}"); | ||
|
||
my $ENV := %*ENV; | ||
my $passed; | ||
react { | ||
my $proc = zrun-async(@exec); | ||
whenever $proc.stdout.lines { $.stdout.emit($_) } | ||
whenever $proc.stderr.lines { $.stderr.emit($_) } | ||
whenever $proc.start(:$ENV, :cwd($dist.path)) { $passed = $_.so } | ||
} | ||
return $passed; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters