<commit_before>package buildlib

import (
	"fmt"
	"path/filepath"

	"github.com/skia-dev/glog"
	"go.skia.org/infra/go/buildskia"
	"go.skia.org/infra/go/exec"
)

// BuildLib, given a directory that Skia is checked out into, builds libskia.a
// and fiddle_main.o.
func BuildLib(checkout, depotTools string) error {
	glog.Info("Starting GNGen")
	if err := buildskia.GNGen(checkout, depotTools, "Release", []string{"is_debug=false", "extra_cflags=\"-g0\""}); err != nil {
		return fmt.Errorf("Failed GN gen: %s", err)
	}

	glog.Info("Building fiddle")
	if msg, err := buildskia.GNNinjaBuild(checkout, depotTools, "Release", "fiddle", true); err != nil {
		return fmt.Errorf("Failed ninja build of fiddle: %q %s", msg, err)
	}

	glog.Info("Running the default fiddle")
	runFiddleCmd := &exec.Command{
		Name:      filepath.Join(checkout, "skia", "out", "Release", "fiddle"),
		Dir:       filepath.Join(checkout, "skia"),
		LogStderr: true,
		LogStdout: true,
	}

	if err := exec.Run(runFiddleCmd); err != nil {
		return fmt.Errorf("Failed to run the default fiddle: %s", err)
	}

	return nil
}<commit_msg>fiddle: Change GN args.<commit_after>package buildlib

import (
	"fmt"
	"path/filepath"

	"github.com/skia-dev/glog"
	"go.skia.org/infra/go/buildskia"
	"go.skia.org/infra/go/exec"
)

// BuildLib, given a directory that Skia is checked out into, builds libskia.a
// and fiddle_main.o.
func BuildLib(checkout, depotTools string) error {
	glog.Info("Starting GNGen")
	if err := buildskia.GNGen(checkout, depotTools, "Release", []string{"is_official_build=true"}); err != nil {
		return fmt.Errorf("Failed GN gen: %s", err)
	}

	glog.Info("Building fiddle")
	if msg, err := buildskia.GNNinjaBuild(checkout, depotTools, "Release", "fiddle", true); err != nil {
		return fmt.Errorf("Failed ninja build of fiddle: %q %s", msg, err)
	}

	glog.Info("Running the default fiddle")
	runFiddleCmd := &exec.Command{
		Name:      filepath.Join(checkout, "skia", "out", "Release", "fiddle"),
		Dir:       filepath.Join(checkout, "skia"),
		LogStderr: true,
		LogStdout: true,
	}

	if err := exec.Run(runFiddleCmd); err != nil {
		return fmt.Errorf("Failed to run the default fiddle: %s", err)
	}

	return nil
}
{'fraction_non_alphanumeric': 0.1608933454876937, 'fraction_numerical': 0.00045578851412944393, 'mean_word_length': 4.314769975786925, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5369361', 'n_tokens_mistral': 863, 'n_tokens_neox': 804, 'n_words': 204}