<commit_before>def _go_command(ctx):
  output = ctx.attr.output
  if ctx.attr.os == "windows":
    output = output + ".exe"

  output_file = ctx.actions.declare_file(ctx.attr.os + "/" + ctx.attr.arch + "/" + ctx.attr.ver + "/" + output)
  pkg = ctx.attr.pkg

  ld_flags = "-s -w"
  if ctx.attr.ld:
    ld_flags = ld_flags + " " + ctx.attr.ld

  options = [
    "go",
    "build",
    "-o", output_file.path,
    "-compiler", "gc",
    "-gcflags", '"all=-trimpath=${GOPATH}/src"',
    "-asmflags", '"all=-trimpath=${GOPATH}/src"',
    "-ldflags", "'%s'" % ld_flags,
    "-tags", "'%s'" % ctx.attr.gotags,
    pkg,
  ]

  command = " ".join(options)

  envs = [
    "CGO_ENABLED=0",
    "GOOS="+ctx.attr.os,
    "GOARCH="+ctx.attr.arch,
    #"GOROOT_FINAL=/go",
    "GO111MODULE=on",
    "GOCACHE=${TMPDIR}/gocache"
  ]

  if ctx.attr.mips: # https://github.com/golang/go/issues/27260
    envs+=["GOMIPS="+ctx.attr.mips]
    envs+=["GOMIPS64="+ctx.attr.mips]
    envs+=["GOMIPSLE="+ctx.attr.mips]
    envs+=["GOMIPS64LE="+ctx.attr.mips]
  if ctx.attr.arm:
    envs+=["GOARM="+ctx.attr.arm]

  switchToPwd="cd ${SPWD} && "
<commit_msg>removes all file system paths from the compiled executable, to improve build reproducibility<commit_after>def _go_command(ctx):
  output = ctx.attr.output
  if ctx.attr.os == "windows":
    output = output + ".exe"

  output_file = ctx.actions.declare_file(ctx.attr.os + "/" + ctx.attr.arch + "/" + ctx.attr.ver + "/" + output)
  pkg = ctx.attr.pkg

  ld_flags = "-s -w"
  if ctx.attr.ld:
    ld_flags = ld_flags + " " + ctx.attr.ld

  options = [
    "go",
    "build",
    "-o", output_file.path,
    "-compiler", "gc",
    "-gcflags", '"all=-trimpath=${GOPATH}/src"',
    "-asmflags", '"all=-trimpath=${GOPATH}/src"',
    "-ldflags", "'%s'" % ld_flags,
    "-tags", "'%s'" % ctx.attr.gotags,
    "-trimpath",
    pkg,
  ]

  command = " ".join(options)

  envs = [
    "CGO_ENABLED=0",
    "GOOS="+ctx.attr.os,
    "GOARCH="+ctx.attr.arch,
    "GO111MODULE=on",
    "GOCACHE=${TMPDIR}/gocache"
  ]

  if ctx.attr.mips: # https://github.com/golang/go/issues/27260
    envs+=["GOMIPS="+ctx.attr.mips]
    envs+=["GOMIPS64="+ctx.attr.mips]
    envs+=["GOMIPSLE="+ctx.attr.mips]
    envs+=["GOMIPS64LE="+ctx.attr.mips]
  if ctx.attr.arm:
    envs+=["GOARM="+ctx.attr.arm]

  switchToPwd="cd ${SPWD} && "

{'fraction_non_alphanumeric': 0.22312633832976445, 'fraction_numerical': 0.01113490364025696, 'mean_word_length': 2.993162393162393, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '880793', 'n_tokens_mistral': 1004, 'n_tokens_neox': 974, 'n_words': 140}