internal/rosa: IR-curable source override
All checks were successful
Test / Hakurei (push) Successful in 4m16s
Test / Hakurei (race detector) (push) Successful in 6m40s
Test / Create distribution (push) Successful in 1m4s
Test / Sandbox (push) Successful in 1m54s
Test / ShareFS (push) Successful in 2m36s
Test / Sandbox (race detector) (push) Successful in 2m41s
Test / Flake checks (push) Successful in 1m18s
All checks were successful
Test / Hakurei (push) Successful in 4m16s
Test / Hakurei (race detector) (push) Successful in 6m40s
Test / Create distribution (push) Successful in 1m4s
Test / Sandbox (push) Successful in 1m54s
Test / ShareFS (push) Successful in 2m36s
Test / Sandbox (race detector) (push) Successful in 2m41s
Test / Flake checks (push) Successful in 1m18s
This creates a tarball in-memory for overriding hakurei-source. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -64,11 +64,12 @@ func main() {
|
||||
return
|
||||
}
|
||||
|
||||
e, ok := r.(rosa.LoadError)
|
||||
if !ok {
|
||||
switch r.(type) {
|
||||
case rosa.LoadError, pkg.IRStringError:
|
||||
log.Fatal(r)
|
||||
default:
|
||||
panic(r)
|
||||
}
|
||||
log.Fatal(e)
|
||||
}()
|
||||
|
||||
ctx, stop := signal.NotifyContext(context.Background(),
|
||||
@@ -86,6 +87,7 @@ func main() {
|
||||
flagLTO bool
|
||||
flagPT bool
|
||||
|
||||
flagSourcePath string
|
||||
flagCrossOverride int
|
||||
|
||||
addr net.UnixAddr
|
||||
@@ -136,6 +138,12 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
if flagSourcePath != "" {
|
||||
if err := rosa.Native().SetSource(os.DirFS(flagSourcePath)); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}).Flag(
|
||||
&flagQuiet,
|
||||
@@ -196,6 +204,10 @@ func main() {
|
||||
&flagPT,
|
||||
"parse-time", command.BoolFlag(false),
|
||||
"Print duration of the initial azalea parse",
|
||||
).Flag(
|
||||
&flagSourcePath,
|
||||
"source", command.StringFlag(""),
|
||||
"Override hakurei source tree",
|
||||
)
|
||||
|
||||
c.NewCommand(
|
||||
|
||||
Reference in New Issue
Block a user