2015-11-19 17:20:12 -06:00
|
|
|
# Copyright 2015-2016 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
# file at the top-level directory of this distribution and at
|
|
|
|
# http://rust-lang.org/COPYRIGHT.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
# option. This file may not be copied, modified, or distributed
|
|
|
|
# except according to those terms.
|
|
|
|
|
|
|
|
import argparse
|
|
|
|
import contextlib
|
2016-04-13 21:10:42 -05:00
|
|
|
import hashlib
|
2015-11-19 17:20:12 -06:00
|
|
|
import os
|
|
|
|
import shutil
|
|
|
|
import subprocess
|
|
|
|
import sys
|
|
|
|
import tarfile
|
2016-04-30 01:09:53 -05:00
|
|
|
import tempfile
|
|
|
|
|
2015-11-19 17:20:12 -06:00
|
|
|
|
|
|
|
def get(url, path, verbose=False):
|
2016-04-13 21:10:42 -05:00
|
|
|
sha_url = url + ".sha256"
|
2016-05-08 02:54:50 -05:00
|
|
|
with tempfile.NamedTemporaryFile(delete=False) as temp_file:
|
|
|
|
temp_path = temp_file.name
|
|
|
|
with tempfile.NamedTemporaryFile(suffix=".sha256", delete=False) as sha_file:
|
|
|
|
sha_path = sha_file.name
|
|
|
|
|
|
|
|
try:
|
|
|
|
download(sha_path, sha_url, verbose)
|
|
|
|
download(temp_path, url, verbose)
|
|
|
|
verify(temp_path, sha_path, verbose)
|
2016-06-01 11:24:41 -05:00
|
|
|
print("moving {} to {}".format(temp_path, path))
|
2016-05-08 02:54:50 -05:00
|
|
|
shutil.move(temp_path, path)
|
|
|
|
finally:
|
2016-05-08 03:00:36 -05:00
|
|
|
delete_if_present(sha_path)
|
|
|
|
delete_if_present(temp_path)
|
|
|
|
|
|
|
|
|
|
|
|
def delete_if_present(path):
|
|
|
|
if os.path.isfile(path):
|
|
|
|
print("removing " + path)
|
|
|
|
os.unlink(path)
|
2016-04-30 01:09:53 -05:00
|
|
|
|
|
|
|
|
2016-04-30 01:43:01 -05:00
|
|
|
def download(path, url, verbose):
|
2016-06-01 11:24:41 -05:00
|
|
|
print("downloading {} to {}".format(url, path))
|
2016-04-30 01:43:01 -05:00
|
|
|
# see http://serverfault.com/questions/301128/how-to-download
|
|
|
|
if sys.platform == 'win32':
|
|
|
|
run(["PowerShell.exe", "/nologo", "-Command",
|
|
|
|
"(New-Object System.Net.WebClient)"
|
|
|
|
".DownloadFile('{}', '{}')".format(url, path)],
|
|
|
|
verbose=verbose)
|
|
|
|
else:
|
|
|
|
run(["curl", "-o", path, url], verbose=verbose)
|
2016-04-30 01:09:53 -05:00
|
|
|
|
|
|
|
|
2016-05-08 02:54:50 -05:00
|
|
|
def verify(path, sha_path, verbose):
|
|
|
|
print("verifying " + path)
|
|
|
|
with open(path, "rb") as f:
|
2016-04-13 21:10:42 -05:00
|
|
|
found = hashlib.sha256(f.read()).hexdigest()
|
|
|
|
with open(sha_path, "r") as f:
|
|
|
|
expected, _ = f.readline().split()
|
|
|
|
if found != expected:
|
|
|
|
err = ("invalid checksum:\n"
|
|
|
|
" found: {}\n"
|
|
|
|
" expected: {}".format(found, expected))
|
|
|
|
if verbose:
|
|
|
|
raise RuntimeError(err)
|
|
|
|
sys.exit(err)
|
2015-11-19 17:20:12 -06:00
|
|
|
|
2016-04-30 01:09:53 -05:00
|
|
|
|
2015-11-19 17:20:12 -06:00
|
|
|
def unpack(tarball, dst, verbose=False, match=None):
|
|
|
|
print("extracting " + tarball)
|
|
|
|
fname = os.path.basename(tarball).replace(".tar.gz", "")
|
|
|
|
with contextlib.closing(tarfile.open(tarball)) as tar:
|
|
|
|
for p in tar.getnames():
|
|
|
|
if "/" not in p:
|
|
|
|
continue
|
|
|
|
name = p.replace(fname + "/", "", 1)
|
|
|
|
if match is not None and not name.startswith(match):
|
|
|
|
continue
|
|
|
|
name = name[len(match) + 1:]
|
|
|
|
|
|
|
|
fp = os.path.join(dst, name)
|
|
|
|
if verbose:
|
|
|
|
print(" extracting " + p)
|
|
|
|
tar.extract(p, dst)
|
|
|
|
tp = os.path.join(dst, p)
|
|
|
|
if os.path.isdir(tp) and os.path.exists(fp):
|
|
|
|
continue
|
|
|
|
shutil.move(tp, fp)
|
|
|
|
shutil.rmtree(os.path.join(dst, fname))
|
|
|
|
|
|
|
|
def run(args, verbose=False):
|
|
|
|
if verbose:
|
|
|
|
print("running: " + ' '.join(args))
|
|
|
|
sys.stdout.flush()
|
|
|
|
# Use Popen here instead of call() as it apparently allows powershell on
|
|
|
|
# Windows to not lock up waiting for input presumably.
|
|
|
|
ret = subprocess.Popen(args)
|
|
|
|
code = ret.wait()
|
|
|
|
if code != 0:
|
2016-04-13 21:10:25 -05:00
|
|
|
err = "failed to run: " + ' '.join(args)
|
|
|
|
if verbose:
|
|
|
|
raise RuntimeError(err)
|
|
|
|
sys.exit(err)
|
2015-11-19 17:20:12 -06:00
|
|
|
|
2016-04-13 13:18:35 -05:00
|
|
|
def stage0_data(rust_root):
|
|
|
|
nightlies = os.path.join(rust_root, "src/stage0.txt")
|
2016-04-21 16:07:51 -05:00
|
|
|
data = {}
|
2016-04-13 13:18:35 -05:00
|
|
|
with open(nightlies, 'r') as nightlies:
|
2016-04-21 16:07:51 -05:00
|
|
|
for line in nightlies:
|
|
|
|
line = line.rstrip() # Strip newline character, '\n'
|
2016-04-13 13:18:35 -05:00
|
|
|
if line.startswith("#") or line == '':
|
|
|
|
continue
|
|
|
|
a, b = line.split(": ", 1)
|
|
|
|
data[a] = b
|
2016-04-21 16:07:51 -05:00
|
|
|
return data
|
2016-04-13 13:18:35 -05:00
|
|
|
|
2015-11-19 17:20:12 -06:00
|
|
|
class RustBuild:
|
2016-04-13 13:18:35 -05:00
|
|
|
def download_stage0(self):
|
2015-11-19 17:20:12 -06:00
|
|
|
cache_dst = os.path.join(self.build_dir, "cache")
|
2016-04-13 13:18:35 -05:00
|
|
|
rustc_cache = os.path.join(cache_dst, self.stage0_rustc_date())
|
|
|
|
cargo_cache = os.path.join(cache_dst, self.stage0_cargo_date())
|
2015-11-19 17:20:12 -06:00
|
|
|
if not os.path.exists(rustc_cache):
|
|
|
|
os.makedirs(rustc_cache)
|
|
|
|
if not os.path.exists(cargo_cache):
|
|
|
|
os.makedirs(cargo_cache)
|
|
|
|
|
|
|
|
if self.rustc().startswith(self.bin_root()) and \
|
|
|
|
(not os.path.exists(self.rustc()) or self.rustc_out_of_date()):
|
2016-03-01 14:02:11 -06:00
|
|
|
if os.path.exists(self.bin_root()):
|
|
|
|
shutil.rmtree(self.bin_root())
|
2016-04-13 13:18:35 -05:00
|
|
|
channel = self.stage0_rustc_channel()
|
2016-06-01 11:24:41 -05:00
|
|
|
filename = "rust-std-{}-{}.tar.gz".format(channel, self.build)
|
2016-04-13 13:18:35 -05:00
|
|
|
url = "https://static.rust-lang.org/dist/" + self.stage0_rustc_date()
|
2015-11-19 17:20:12 -06:00
|
|
|
tarball = os.path.join(rustc_cache, filename)
|
|
|
|
if not os.path.exists(tarball):
|
2016-06-01 11:24:41 -05:00
|
|
|
get("{}/{}".format(url, filename), tarball, verbose=self.verbose)
|
2015-11-19 17:20:12 -06:00
|
|
|
unpack(tarball, self.bin_root(),
|
|
|
|
match="rust-std-" + self.build,
|
|
|
|
verbose=self.verbose)
|
|
|
|
|
2016-06-01 11:24:41 -05:00
|
|
|
filename = "rustc-{}-{}.tar.gz".format(channel, self.build)
|
2016-04-13 13:18:35 -05:00
|
|
|
url = "https://static.rust-lang.org/dist/" + self.stage0_rustc_date()
|
2015-11-19 17:20:12 -06:00
|
|
|
tarball = os.path.join(rustc_cache, filename)
|
|
|
|
if not os.path.exists(tarball):
|
2016-06-01 11:24:41 -05:00
|
|
|
get("{}/{}".format(url, filename), tarball, verbose=self.verbose)
|
2015-11-19 17:20:12 -06:00
|
|
|
unpack(tarball, self.bin_root(), match="rustc", verbose=self.verbose)
|
|
|
|
with open(self.rustc_stamp(), 'w') as f:
|
2016-04-13 13:18:35 -05:00
|
|
|
f.write(self.stage0_rustc_date())
|
2015-11-19 17:20:12 -06:00
|
|
|
|
|
|
|
if self.cargo().startswith(self.bin_root()) and \
|
|
|
|
(not os.path.exists(self.cargo()) or self.cargo_out_of_date()):
|
2016-04-13 13:18:35 -05:00
|
|
|
channel = self.stage0_cargo_channel()
|
2016-06-01 11:24:41 -05:00
|
|
|
filename = "cargo-{}-{}.tar.gz".format(channel, self.build)
|
2016-04-13 13:18:35 -05:00
|
|
|
url = "https://static.rust-lang.org/cargo-dist/" + self.stage0_cargo_date()
|
2015-11-19 17:20:12 -06:00
|
|
|
tarball = os.path.join(cargo_cache, filename)
|
|
|
|
if not os.path.exists(tarball):
|
2016-06-01 11:24:41 -05:00
|
|
|
get("{}/{}".format(url, filename), tarball, verbose=self.verbose)
|
2015-11-19 17:20:12 -06:00
|
|
|
unpack(tarball, self.bin_root(), match="cargo", verbose=self.verbose)
|
|
|
|
with open(self.cargo_stamp(), 'w') as f:
|
2016-04-13 13:18:35 -05:00
|
|
|
f.write(self.stage0_cargo_date())
|
2015-11-19 17:20:12 -06:00
|
|
|
|
2016-04-13 13:18:35 -05:00
|
|
|
def stage0_cargo_date(self):
|
2015-11-19 17:20:12 -06:00
|
|
|
return self._cargo_date
|
|
|
|
|
2016-04-13 13:18:35 -05:00
|
|
|
def stage0_cargo_channel(self):
|
|
|
|
return self._cargo_channel
|
|
|
|
|
|
|
|
def stage0_rustc_date(self):
|
2015-11-19 17:20:12 -06:00
|
|
|
return self._rustc_date
|
|
|
|
|
2016-04-13 13:18:35 -05:00
|
|
|
def stage0_rustc_channel(self):
|
|
|
|
return self._rustc_channel
|
|
|
|
|
2015-11-19 17:20:12 -06:00
|
|
|
def rustc_stamp(self):
|
|
|
|
return os.path.join(self.bin_root(), '.rustc-stamp')
|
|
|
|
|
|
|
|
def cargo_stamp(self):
|
|
|
|
return os.path.join(self.bin_root(), '.cargo-stamp')
|
|
|
|
|
|
|
|
def rustc_out_of_date(self):
|
2016-05-31 15:24:28 -05:00
|
|
|
if not os.path.exists(self.rustc_stamp()) or self.clean:
|
2015-11-19 17:20:12 -06:00
|
|
|
return True
|
|
|
|
with open(self.rustc_stamp(), 'r') as f:
|
2016-04-13 13:18:35 -05:00
|
|
|
return self.stage0_rustc_date() != f.read()
|
2015-11-19 17:20:12 -06:00
|
|
|
|
|
|
|
def cargo_out_of_date(self):
|
2016-05-31 15:24:28 -05:00
|
|
|
if not os.path.exists(self.cargo_stamp()) or self.clean:
|
2015-11-19 17:20:12 -06:00
|
|
|
return True
|
|
|
|
with open(self.cargo_stamp(), 'r') as f:
|
2016-04-13 13:18:35 -05:00
|
|
|
return self.stage0_cargo_date() != f.read()
|
2015-11-19 17:20:12 -06:00
|
|
|
|
|
|
|
def bin_root(self):
|
|
|
|
return os.path.join(self.build_dir, self.build, "stage0")
|
|
|
|
|
|
|
|
def get_toml(self, key):
|
|
|
|
for line in self.config_toml.splitlines():
|
|
|
|
if line.startswith(key + ' ='):
|
|
|
|
return self.get_string(line)
|
|
|
|
return None
|
|
|
|
|
2015-11-19 18:55:21 -06:00
|
|
|
def get_mk(self, key):
|
|
|
|
for line in iter(self.config_mk.splitlines()):
|
|
|
|
if line.startswith(key):
|
|
|
|
return line[line.find(':=') + 2:].strip()
|
|
|
|
return None
|
|
|
|
|
2015-11-19 17:20:12 -06:00
|
|
|
def cargo(self):
|
|
|
|
config = self.get_toml('cargo')
|
|
|
|
if config:
|
|
|
|
return config
|
|
|
|
return os.path.join(self.bin_root(), "bin/cargo" + self.exe_suffix())
|
|
|
|
|
|
|
|
def rustc(self):
|
|
|
|
config = self.get_toml('rustc')
|
|
|
|
if config:
|
|
|
|
return config
|
2015-11-19 18:55:21 -06:00
|
|
|
config = self.get_mk('CFG_LOCAL_RUST')
|
|
|
|
if config:
|
|
|
|
return config + '/bin/rustc' + self.exe_suffix()
|
2015-11-19 17:20:12 -06:00
|
|
|
return os.path.join(self.bin_root(), "bin/rustc" + self.exe_suffix())
|
|
|
|
|
|
|
|
def get_string(self, line):
|
|
|
|
start = line.find('"')
|
|
|
|
end = start + 1 + line[start+1:].find('"')
|
|
|
|
return line[start+1:end]
|
|
|
|
|
|
|
|
def exe_suffix(self):
|
|
|
|
if sys.platform == 'win32':
|
|
|
|
return '.exe'
|
|
|
|
else:
|
|
|
|
return ''
|
|
|
|
|
|
|
|
def build_bootstrap(self):
|
2016-05-31 15:24:28 -05:00
|
|
|
build_dir = os.path.join(self.build_dir, "bootstrap")
|
|
|
|
if self.clean and os.path.exists(build_dir):
|
|
|
|
shutil.rmtree(build_dir)
|
2015-11-19 17:20:12 -06:00
|
|
|
env = os.environ.copy()
|
2016-05-31 15:24:28 -05:00
|
|
|
env["CARGO_TARGET_DIR"] = build_dir
|
2015-11-19 17:20:12 -06:00
|
|
|
env["RUSTC"] = self.rustc()
|
|
|
|
env["LD_LIBRARY_PATH"] = os.path.join(self.bin_root(), "lib")
|
|
|
|
env["DYLD_LIBRARY_PATH"] = os.path.join(self.bin_root(), "lib")
|
|
|
|
env["PATH"] = os.path.join(self.bin_root(), "bin") + \
|
|
|
|
os.pathsep + env["PATH"]
|
|
|
|
self.run([self.cargo(), "build", "--manifest-path",
|
|
|
|
os.path.join(self.rust_root, "src/bootstrap/Cargo.toml")],
|
|
|
|
env)
|
|
|
|
|
|
|
|
def run(self, args, env):
|
2016-04-21 16:07:51 -05:00
|
|
|
proc = subprocess.Popen(args, env=env)
|
2015-11-19 17:20:12 -06:00
|
|
|
ret = proc.wait()
|
|
|
|
if ret != 0:
|
|
|
|
sys.exit(ret)
|
|
|
|
|
|
|
|
def build_triple(self):
|
|
|
|
config = self.get_toml('build')
|
2015-11-19 18:55:21 -06:00
|
|
|
if config:
|
|
|
|
return config
|
|
|
|
config = self.get_mk('CFG_BUILD')
|
2015-11-19 17:20:12 -06:00
|
|
|
if config:
|
|
|
|
return config
|
|
|
|
try:
|
|
|
|
ostype = subprocess.check_output(['uname', '-s']).strip()
|
|
|
|
cputype = subprocess.check_output(['uname', '-m']).strip()
|
2016-04-21 16:07:51 -05:00
|
|
|
except subprocess.CalledProcessError:
|
2015-11-19 17:20:12 -06:00
|
|
|
if sys.platform == 'win32':
|
|
|
|
return 'x86_64-pc-windows-msvc'
|
2016-04-21 16:07:51 -05:00
|
|
|
err = "uname not found"
|
|
|
|
if self.verbose:
|
|
|
|
raise Exception(err)
|
|
|
|
sys.exit(err)
|
2015-11-19 17:20:12 -06:00
|
|
|
|
|
|
|
# Darwin's `uname -s` lies and always returns i386. We have to use
|
|
|
|
# sysctl instead.
|
|
|
|
if ostype == 'Darwin' and cputype == 'i686':
|
|
|
|
sysctl = subprocess.check_output(['sysctl', 'hw.optional.x86_64'])
|
2016-04-21 16:07:51 -05:00
|
|
|
if ': 1' in sysctl:
|
2015-11-19 17:20:12 -06:00
|
|
|
cputype = 'x86_64'
|
|
|
|
|
|
|
|
# The goal here is to come up with the same triple as LLVM would,
|
|
|
|
# at least for the subset of platforms we're willing to target.
|
|
|
|
if ostype == 'Linux':
|
|
|
|
ostype = 'unknown-linux-gnu'
|
|
|
|
elif ostype == 'FreeBSD':
|
|
|
|
ostype = 'unknown-freebsd'
|
|
|
|
elif ostype == 'DragonFly':
|
|
|
|
ostype = 'unknown-dragonfly'
|
|
|
|
elif ostype == 'Bitrig':
|
|
|
|
ostype = 'unknown-bitrig'
|
|
|
|
elif ostype == 'OpenBSD':
|
|
|
|
ostype = 'unknown-openbsd'
|
|
|
|
elif ostype == 'NetBSD':
|
|
|
|
ostype = 'unknown-netbsd'
|
|
|
|
elif ostype == 'Darwin':
|
|
|
|
ostype = 'apple-darwin'
|
|
|
|
elif ostype.startswith('MINGW'):
|
|
|
|
# msys' `uname` does not print gcc configuration, but prints msys
|
|
|
|
# configuration. so we cannot believe `uname -m`:
|
|
|
|
# msys1 is always i686 and msys2 is always x86_64.
|
|
|
|
# instead, msys defines $MSYSTEM which is MINGW32 on i686 and
|
|
|
|
# MINGW64 on x86_64.
|
|
|
|
ostype = 'pc-windows-gnu'
|
|
|
|
cputype = 'i686'
|
|
|
|
if os.environ.get('MSYSTEM') == 'MINGW64':
|
|
|
|
cputype = 'x86_64'
|
|
|
|
elif ostype.startswith('MSYS'):
|
|
|
|
ostype = 'pc-windows-gnu'
|
|
|
|
elif ostype.startswith('CYGWIN_NT'):
|
|
|
|
cputype = 'i686'
|
|
|
|
if ostype.endswith('WOW64'):
|
|
|
|
cputype = 'x86_64'
|
|
|
|
ostype = 'pc-windows-gnu'
|
|
|
|
else:
|
2016-04-13 21:10:25 -05:00
|
|
|
err = "unknown OS type: " + ostype
|
|
|
|
if self.verbose:
|
|
|
|
raise ValueError(err)
|
|
|
|
sys.exit(err)
|
2015-11-19 17:20:12 -06:00
|
|
|
|
|
|
|
if cputype in {'i386', 'i486', 'i686', 'i786', 'x86'}:
|
|
|
|
cputype = 'i686'
|
|
|
|
elif cputype in {'xscale', 'arm'}:
|
|
|
|
cputype = 'arm'
|
|
|
|
elif cputype == 'armv7l':
|
|
|
|
cputype = 'arm'
|
|
|
|
ostype += 'eabihf'
|
|
|
|
elif cputype == 'aarch64':
|
|
|
|
cputype = 'aarch64'
|
|
|
|
elif cputype in {'powerpc', 'ppc', 'ppc64'}:
|
|
|
|
cputype = 'powerpc'
|
|
|
|
elif cputype in {'amd64', 'x86_64', 'x86-64', 'x64'}:
|
|
|
|
cputype = 'x86_64'
|
|
|
|
else:
|
2016-04-13 21:10:25 -05:00
|
|
|
err = "unknown cpu type: " + cputype
|
|
|
|
if self.verbose:
|
|
|
|
raise ValueError(err)
|
|
|
|
sys.exit(err)
|
2015-11-19 17:20:12 -06:00
|
|
|
|
2016-06-01 11:24:41 -05:00
|
|
|
return "{}-{}".format(cputype, ostype)
|
2015-11-19 17:20:12 -06:00
|
|
|
|
2016-04-13 13:18:35 -05:00
|
|
|
def main():
|
|
|
|
parser = argparse.ArgumentParser(description='Build rust')
|
|
|
|
parser.add_argument('--config')
|
2016-05-31 15:24:28 -05:00
|
|
|
parser.add_argument('--clean', action='store_true')
|
2016-04-13 13:18:35 -05:00
|
|
|
parser.add_argument('-v', '--verbose', action='store_true')
|
|
|
|
|
|
|
|
args = [a for a in sys.argv if a != '-h']
|
|
|
|
args, _ = parser.parse_known_args(args)
|
|
|
|
|
|
|
|
# Configure initial bootstrap
|
|
|
|
rb = RustBuild()
|
|
|
|
rb.config_toml = ''
|
|
|
|
rb.config_mk = ''
|
|
|
|
rb.rust_root = os.path.abspath(os.path.join(__file__, '../../..'))
|
|
|
|
rb.build_dir = os.path.join(os.getcwd(), "build")
|
|
|
|
rb.verbose = args.verbose
|
2016-05-31 15:24:28 -05:00
|
|
|
rb.clean = args.clean
|
2016-04-13 13:18:35 -05:00
|
|
|
|
|
|
|
try:
|
|
|
|
with open(args.config or 'config.toml') as config:
|
|
|
|
rb.config_toml = config.read()
|
|
|
|
except:
|
|
|
|
pass
|
|
|
|
try:
|
|
|
|
rb.config_mk = open('config.mk').read()
|
|
|
|
except:
|
|
|
|
pass
|
|
|
|
|
|
|
|
data = stage0_data(rb.rust_root)
|
|
|
|
rb._rustc_channel, rb._rustc_date = data['rustc'].split('-', 1)
|
|
|
|
rb._cargo_channel, rb._cargo_date = data['cargo'].split('-', 1)
|
|
|
|
|
|
|
|
# Fetch/build the bootstrap
|
|
|
|
rb.build = rb.build_triple()
|
|
|
|
rb.download_stage0()
|
|
|
|
sys.stdout.flush()
|
|
|
|
rb.build_bootstrap()
|
|
|
|
sys.stdout.flush()
|
|
|
|
|
|
|
|
# Run the bootstrap
|
|
|
|
args = [os.path.join(rb.build_dir, "bootstrap/debug/bootstrap")]
|
|
|
|
args.append('--src')
|
|
|
|
args.append(rb.rust_root)
|
|
|
|
args.append('--build')
|
|
|
|
args.append(rb.build)
|
|
|
|
args.extend(sys.argv[1:])
|
|
|
|
env = os.environ.copy()
|
|
|
|
env["BOOTSTRAP_PARENT_ID"] = str(os.getpid())
|
|
|
|
rb.run(args, env)
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|