You've already forked code_examples_server
mirror of
https://github.com/AdaCore/code_examples_server.git
synced 2026-02-12 12:45:18 -08:00
Do not run if there is no main
Allows using the 'Run' button on packages, to have the compiler validate them.
This commit is contained in:
@@ -135,7 +135,7 @@ def safe_run(workdir, mode):
|
||||
p = subprocess.Popen(cl, cwd=workdir,
|
||||
stdout=subprocess.PIPE, shell=False)
|
||||
while True:
|
||||
line = p.stdout.readline()
|
||||
line = p.stdout.readline().replace(workdir, '.')
|
||||
if line != '':
|
||||
print line
|
||||
sys.stdout.flush()
|
||||
@@ -163,11 +163,12 @@ def safe_run(workdir, mode):
|
||||
# - as user 'unprivileged' that has no write access
|
||||
# - under a timeout
|
||||
# - with our ld preloader to prevent forks
|
||||
line = ['sudo', '-u', 'unprivileged', 'timeout', '10s',
|
||||
'bash', '-c',
|
||||
'LD_PRELOAD=/preloader.so {}'.format(
|
||||
os.path.join(workdir, main.split('.')[0]))]
|
||||
c(line)
|
||||
if main:
|
||||
line = ['sudo', '-u', 'unprivileged', 'timeout', '10s',
|
||||
'bash', '-c',
|
||||
'LD_PRELOAD=/preloader.so {}'.format(
|
||||
os.path.join(workdir, main.split('.')[0]))]
|
||||
c(line)
|
||||
|
||||
elif mode == "prove":
|
||||
doctor_main_gpr(workdir, spark_mode=True)
|
||||
|
||||
Reference in New Issue
Block a user