[
https://issues.apache.org/jira/browse/DERBY-3986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Rick Hillegas updated DERBY-3986:
---------------------------------
Attachment: derby-3986-02-af-sanity-bin-toursdb-storeless-release.diff
Attaching derby-3986-02-af-sanity-bin-toursdb-storeless-release.diff. This
patch intends to put build artifacts in a directory tree separate from the
subversion-controlled source tree. This writeup addresses the following topics:
o Motivation
o High level description
o New tree for generated artifacts
o Remaining work
o State of testing
o How to apply the patch
o Patch details
------------------ MOTIVATION ----------------
Right now the Derby build drops artifacts into the subversion-controlled source
tree. This makes it awkward to run multiple builds using different
environments, since each new build clobbers the output of other builds. After
this patch is applied, it should be possible to build Derby in different
environments without clobbering the results of other builds. In particular, the
following use-cases should be supported:
o Building Derby in parallel using different rev levels of Java
o Building Derby on a hypervisor whose guest operating systems share a
read-only subversion client but compile into os-specific output directories.
------------------ HIGH LEVEL DESCRIPTION ----------------
This patch introduces two high level concepts:
1) A new artifact directory called "generated", which lives parallel to the
classes, jars, and javadoc directories already created by the build machinery.
This new directory is the root of a tree where the build puts generated java
files and other artifacts which do not fit tidily into the existing classes,
jars, or javadoc directories.
2) A new variable ${out.base} which you can customize in your ant.properties or
on the command line. ${out.base} is the base directory for all build artifacts.
It defaults to be ${basedir}. That means that if you do not customize
${out.base}, then most of your build artifacts (including classes, jars, and
javadoc) will continue to be dropped into the same locations where they are
dropped today. If you do customize ${out.base}, then all of the following
artifacts will be dropped into the ${out.base} directory:
changenumber.properties
classes
classes.pptesting
classes.storeless
generated
jars
javadoc
------------------ NEW TREE FOR GENERATED ARTIFACTS ----------------
After applying this patch and building Derby, you will see the following new
subtree:
generated
generated/bin
generated/bin/dblook
generated/bin/ij
generated/bin/NetworkServerControl
generated/bin/startNetworkServer
generated/bin/stopNetworkServer
generated/bin/sysinfo
generated/java
generated/java/org
generated/java/org/apache
generated/java/org/apache/derby
generated/java/org/apache/derby/iapi
generated/java/org/apache/derby/iapi/services
generated/java/org/apache/derby/iapi/services/cache
generated/java/org/apache/derby/iapi/services/cache/ClassSizeCatalog.java
generated/java/org/apache/derby/impl
generated/java/org/apache/derby/impl/sql
generated/java/org/apache/derby/impl/sql/compile
generated/java/org/apache/derby/impl/sql/compile/SQLParser.java
generated/java/org/apache/derby/impl/sql/compile/SQLParserConstants.java
generated/java/org/apache/derby/impl/sql/compile/SQLParserTokenManager.java
generated/java/org/apache/derby/impl/sql/compile/TokenMgrError.java
generated/java/org/apache/derby/impl/tools
generated/java/org/apache/derby/impl/tools/ij
generated/java/org/apache/derby/impl/tools/ij/CharStream.java
generated/java/org/apache/derby/impl/tools/ij/ij.java
generated/java/org/apache/derby/impl/tools/ij/ijConstants.java
generated/java/org/apache/derby/impl/tools/ij/ijTokenManager.java
generated/java/org/apache/derby/impl/tools/ij/mtGrammar.java
generated/java/org/apache/derby/impl/tools/ij/mtGrammarConstants.java
generated/java/org/apache/derby/impl/tools/ij/mtGrammarTokenManager.java
generated/java/org/apache/derby/impl/tools/ij/SimpleCharStream.java
generated/java/org/apache/derby/impl/tools/ij/Token.java
generated/java/org/apache/derby/impl/tools/ij/TokenMgrError.java
generated/java/org/apache/derby/loc
generated/java/org/apache/derby/loc/messages_en.properties
generated/java/org/apache/derby/shared
generated/java/org/apache/derby/shared/common
generated/java/org/apache/derby/shared/common/sanity
generated/java/org/apache/derby/shared/common/sanity/SanityState.java
generated/java/org/apache/derby/shared/common/sanity/state.properties
generated/toursdb
generated/toursdb/derby.log
generated/toursdb/toursdb
generated/toursdb/toursdb.jar
generated/toursdb/toursdb.out
generated/toursdb/toursdb/...
------------------ REMAINING WORK ----------------
More work may be needed to relocate the special artifacts created by the
release build targets. Those targets may not behave correctly if you customize
${out.base}.
------------------ STATE OF TESTING ----------------
I have tested building a subversion client on both a host operating system and
a guest operating system, with each os building into its own artifact tree.
I have also built a release on my host operating system using the default
${out.base}. The following artifacts (now built into the generated tree) appear
in the correct locations in the bin distributions:
- merged scripts in the bin directory
- toursdb database in demo/databases
I am running regression tests against the host os build to verify that
everything was generated correctly.
------------------ HOW TO APPLY THE PATCH ----------------
To apply this patch, do the following:
o First, "ant clean" your subversion client. This removes most of the generated
artifacts from your client (there are some stragglers like
changenumber.properties which will still hang around). Technically, this step
should not be necessary and if you omit this step, the build probably will
function correctly after you apply the patch. However, I have not tested the
case of applying this patch to a dirty client, so I advise you to "ant clean"
first.
o Then apply the patch as you would normally do.
------------------ PATCH DETAILS ----------------
Touches the following files:
------
M .
Updates the svn:ignore property so that the new generated directory does not
confuse "ant status".
------
M tools/ant/properties/dirs.properties
Adds the ${out.base} variable and makes it the root of the artifact directories.
------
M java/tools/org/apache/derby/impl/tools/build.xml
Builds the tools grammar into the generated tree.
------
M java/engine/org/apache/derby/impl/sql/build.xml
Builds the SQL grammar into the generated tree. Deletes the 3 artifacts which
are overridden by checked-in sources:
CharStream.java
ParseException.java
Token.java
As a follow-on effort, we may want to consider eliminating the checked-in
sources.
------
M java/demo/build.xml
M java/demo/toursdb/build.xml
Drops the toursdb database into the generated directory.
------
M java/engine/org/apache/derby/loc/build.xml
Drops the English messages into the generated directory.
------
M java/shared/build.xml
Drops the sanity state into the generated directory.
------
M tools/release/build.xml
Now looks into the generated tree for toursdb and the merged bin scripts.
------
M build.xml
Changes to the master build script to pull all of this together.
> Stop dropping build artifacts in the subversion-controlled source tree
> ----------------------------------------------------------------------
>
> Key: DERBY-3986
> URL: https://issues.apache.org/jira/browse/DERBY-3986
> Project: Derby
> Issue Type: Improvement
> Components: Build tools
> Affects Versions: 10.5.1.1
> Reporter: Rick Hillegas
> Attachments: derby-3986-01-aa-checkCompilerLevel.diff,
> derby-3986-02-af-sanity-bin-toursdb-storeless-release.diff
>
>
> The Derby build drops various artifacts in the source tree. Build artifacts
> should not muddy subversion controlled directories but should, instead, go
> into temporary directories created by the the build.
> The following is a (perhaps partial) list of artifacts currently dropped into
> subversion-controlled space:
> Sanity directives
> Generated grammars
> The English error messages
> Data type class sizes
> Toursdb
> Temporary class for verifying compiler level
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.