Datasets:

Modalities:
Text
Formats:
json
Size:
< 1K
Tags:
code
DOI:
Libraries:
Datasets
pandas
License:
dtcxzyw commited on
Commit
56da365
·
1 Parent(s): 305a048
Files changed (2) hide show
  1. scripts/lab_env.py +5 -1
  2. scripts/llvm_helper.py +2 -2
scripts/lab_env.py CHANGED
@@ -46,6 +46,7 @@ class Environment:
46
  *,
47
  max_build_jobs=None,
48
  max_test_jobs=None,
 
49
  ):
50
  with open(os.path.join(llvm_helper.dataset_dir, f"{issue_id}.json")) as f:
51
  self.data = json.load(f)
@@ -73,6 +74,7 @@ class Environment:
73
  self.max_test_jobs = max_build_jobs
74
  else:
75
  self.max_test_jobs = max_test_jobs
 
76
  self.start_time = time.time()
77
 
78
  def use_knowledge(self, url: str, date: Union[str, datetime.datetime]):
@@ -96,7 +98,9 @@ class Environment:
96
  with TimeCompensationGuard(self):
97
  self.build_count += 1
98
  self.verify_head()
99
- res, log = llvm_helper.build(self.max_build_jobs)
 
 
100
  if not res:
101
  self.build_failure_count += 1
102
  return res, log
 
46
  *,
47
  max_build_jobs=None,
48
  max_test_jobs=None,
49
+ additional_cmake_args=[],
50
  ):
51
  with open(os.path.join(llvm_helper.dataset_dir, f"{issue_id}.json")) as f:
52
  self.data = json.load(f)
 
74
  self.max_test_jobs = max_build_jobs
75
  else:
76
  self.max_test_jobs = max_test_jobs
77
+ self.additional_cmake_args = additional_cmake_args
78
  self.start_time = time.time()
79
 
80
  def use_knowledge(self, url: str, date: Union[str, datetime.datetime]):
 
98
  with TimeCompensationGuard(self):
99
  self.build_count += 1
100
  self.verify_head()
101
+ res, log = llvm_helper.build(
102
+ self.max_build_jobs, self.additional_cmake_args
103
+ )
104
  if not res:
105
  self.build_failure_count += 1
106
  return res, log
scripts/llvm_helper.py CHANGED
@@ -104,7 +104,7 @@ def decode_output(output):
104
  return output.decode()
105
 
106
 
107
- def build(max_build_jobs: int):
108
  os.makedirs(llvm_build_dir, exist_ok=True)
109
  log = ""
110
  try:
@@ -126,7 +126,7 @@ def build(max_build_jobs: int):
126
  "-DLLVM_TARGETS_TO_BUILD='X86;RISCV;AArch64;SystemZ;Hexagon;PowerPC;'",
127
  "-DLLVM_PARALLEL_LINK_JOBS=4",
128
  "-DLLVM_INCLUDE_EXAMPLES=OFF",
129
- ],
130
  stderr=subprocess.STDOUT,
131
  cwd=llvm_build_dir,
132
  ).decode()
 
104
  return output.decode()
105
 
106
 
107
+ def build(max_build_jobs: int, additional_cmake_args = []):
108
  os.makedirs(llvm_build_dir, exist_ok=True)
109
  log = ""
110
  try:
 
126
  "-DLLVM_TARGETS_TO_BUILD='X86;RISCV;AArch64;SystemZ;Hexagon;PowerPC;'",
127
  "-DLLVM_PARALLEL_LINK_JOBS=4",
128
  "-DLLVM_INCLUDE_EXAMPLES=OFF",
129
+ ] + additional_cmake_args,
130
  stderr=subprocess.STDOUT,
131
  cwd=llvm_build_dir,
132
  ).decode()