[
https://issues.apache.org/jira/browse/HADOOP-13583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15478531#comment-15478531
]
Robert Kanter commented on HADOOP-13583:
----------------------------------------
Looks good overall. I was actually partway through working on something like
this before I saw you already did it :)
A few minor things:
# Missing space after "classes." in help text:
{code}
-a ANNOTATIONS, --annotation ANNOTATIONS
Fully-qualified Java annotation. Java ACC will only
check compatibility of annotated classes.Can be
specified multiple times.
{code}
# Maybe add a few useful/common example usages to the BUILDING.txt file? e.g.
"Use these arguments to check HDFS compatibility between Hadoop 2.7 and 2.8".
Otherwise, there's a lot of initial guesswork to figure out what you actually
want for {{-i}}, {{-e}}, and {{-a}}.
# {{JAVA_ACC_GIT_URL}} isn't used anywhere. This currently points to the git
repo but we're actually downloading a tarball of the 1.8 release elsewhere.
# I ran into some problems getting it to run because I didn't have some of the
target directories it needed ({{./target/}} and {{./dev-support/target/}}. It
was also missing a directory level when trying to run
{{japi-compliance-checker.pl}}. I made a few changes to fix all this:
{noformat}
diff --git a/dev-support/bin/checkcompatibility.py
b/dev-support/bin/checkcompatibility.py
old mode 100644
new mode 100755
index 7725297..e441f34
--- a/dev-support/bin/checkcompatibility.py
+++ b/dev-support/bin/checkcompatibility.py
@@ -132,6 +132,8 @@ def checkout_java_acc(force):
return
logging.info("Forcing re-download.")
shutil.rmtree(acc_dir)
+ else:
+ os.makedirs(acc_dir)
logging.info("Downloading Java ACC...")
url = "https://github.com/lvc/japi-compliance-checker/archive/1.8.tar.gz"
@@ -169,7 +171,7 @@ def run_java_acc(src_name, src_jars, dst_name, dst_jars,
annotations):
"\n\t".join(src_jars),
"\n\t".join(dst_jars))
- java_acc_path = os.path.join(get_java_acc_dir(),
"japi-compliance-checker.pl")
+ java_acc_path = os.path.join(get_java_acc_dir(),
"japi-compliance-checker-1.8", "japi-compliance-checker.pl")
src_xml_path = os.path.join(get_scratch_dir(), "src.xml")
dst_xml_path = os.path.join(get_scratch_dir(), "dst.xml")
@@ -292,9 +294,6 @@ def main():
for a in annotations:
logging.info("\t%s", a)
- # Download deps.
- checkout_java_acc(args.force_download)
-
# Set up the build.
scratch_dir = get_scratch_dir()
src_dir = os.path.join(scratch_dir, "src")
@@ -308,6 +307,9 @@ def main():
checkout_java_tree(get_git_hash(src_rev), src_dir)
checkout_java_tree(get_git_hash(dst_rev), dst_dir)
+ # Download deps.
+ checkout_java_acc(args.force_download)
+
# Run the build in each.
if args.skip_build:
logging.info("Skipping the build")
{noformat}
> Incorporate checkcompatibility script which runs Java API Compliance Checker
> ----------------------------------------------------------------------------
>
> Key: HADOOP-13583
> URL: https://issues.apache.org/jira/browse/HADOOP-13583
> Project: Hadoop Common
> Issue Type: Improvement
> Components: scripts
> Affects Versions: 2.6.4
> Reporter: Andrew Wang
> Assignee: Andrew Wang
> Attachments: HADOOP-13583.001.patch
>
>
> Based on discussion at YETUS-445, this code can't go there, but it's still
> very useful for release managers. A similar variant of this script has been
> used for a while by Apache HBase and Apache Kudu, and IMO JACC output is
> easier to understand than JDiff.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]