use build tags to embed appropriate bundles

This commit is contained in:
vyzo 2022-04-19 15:20:40 +03:00
parent 995caaaace
commit 7e1c55cdf9
6 changed files with 109 additions and 2 deletions

View File

@ -58,10 +58,26 @@ fetch_bundle() {
popd
}
touch_bundles() {
ver=$1
if [ ! -e $ver ]; then
mkdir $ver
fi
for net in mainnet caterpillarnet butterflynet calibrationnet devnet testing; do
touch $ver/builtin-actors-$net.car
done
}
if [ -n "$actors7_release" ]; then
fetch v7 "$actors7_release"
else
touch_bundles v7
fi
if [ -n "$actors8_release" ]; then
fetch v8 "$actors8_release"
else
touch_bundles v8
fi

View File

@ -0,0 +1,22 @@
//go:build debug || 2k || testground
// +build debug 2k testground
package build
import (
_ "embed"
)
//go:embed builtin-actors/v8/builtin-actors-devnet.car
var actorsv8 []byte
func BuiltinActorsV8Bundle() []byte {
return actorsv8
}
//go:embed builtin-actors/v7/builtin-actors-devnet.car
var actorsv7 []byte
func BuiltinActorsV7Bundle() []byte {
return actorsv7
}

View File

@ -0,0 +1,22 @@
//go:build butterflynet
// +build butterflynet
package build
import (
_ "embed"
)
//go:embed builtin-actors/v8/builtin-actors-butterflynet.car
var actorsv8 []byte
func BuiltinActorsV8Bundle() []byte {
return actorsv8
}
//go:embed builtin-actors/v7/builtin-actors-butterflynet.car
var actorsv7 []byte
func BuiltinActorsV7Bundle() []byte {
return actorsv7
}

View File

@ -1,17 +1,20 @@
//go:build calibnet
// +build calibnet
package build
import (
_ "embed"
)
//go:embed builtin-actors/builtin-actors-v8.car
//go:embed builtin-actors/v8/builtin-actors-calibrationnet.car
var actorsv8 []byte
func BuiltinActorsV8Bundle() []byte {
return actorsv8
}
//go:embed builtin-actors/builtin-actors-v7.car
//go:embed builtin-actors/v7/builtin-actors-calibrationnet.car
var actorsv7 []byte
func BuiltinActorsV7Bundle() []byte {

View File

@ -0,0 +1,22 @@
//go:build interopnet
// +build interopnet
package build
import (
_ "embed"
)
//go:embed builtin-actors/v8/builtin-actors-caterpillarnet.car
var actorsv8 []byte
func BuiltinActorsV8Bundle() []byte {
return actorsv8
}
//go:embed builtin-actors/v7/builtin-actors-caterpillarnet.car
var actorsv7 []byte
func BuiltinActorsV7Bundle() []byte {
return actorsv7
}

View File

@ -0,0 +1,22 @@
//go:build !debug && !2k && !testground && !calibnet && !nerpanet && !butterflynet && !interopnet
// +build !debug,!2k,!testground,!calibnet,!nerpanet,!butterflynet,!interopnet
package build
import (
_ "embed"
)
//go:embed builtin-actors/v8/builtin-actors-mainnet.car
var actorsv8 []byte
func BuiltinActorsV8Bundle() []byte {
return actorsv8
}
//go:embed builtin-actors/v7/builtin-actors-mainnet.car
var actorsv7 []byte
func BuiltinActorsV7Bundle() []byte {
return actorsv7
}