Skip to content

Commit 2df56f1

Browse files
committed
Remove more pre-PL/Java-1.6 remnants from docs
The build system introduced in 1.6 fixed the "Windows might get -Dpljava.libjvmdefault wrong" issue. Also, by no longer trying to capture compiler/linker messages and classify them, it has fixed the "Not all [ERROR]s are errors" issue. In 1.6, both the pljava and pljava-api jars must be present in $SHAREDIR/pljava at runtime. So a package maintainer may choose to include the API jar additionally in a -devel package that places it where users' development tools will expect, but may not omit it from the base package that installs it where the runtime needs it.
1 parent 081c93c commit 2df56f1

File tree

3 files changed

+19
-59
lines changed

3 files changed

+19
-59
lines changed

src/site/markdown/build/build.md

+8-24
Original file line numberDiff line numberDiff line change
@@ -222,30 +222,6 @@ build issues that are commonly asked about.*
222222

223223
[btwp]: https://github.com/tada/pljava/wiki/Build-tips
224224

225-
#### Not all `[ERROR]`s are errors
226-
227-
In the part of the build that compiles the native code, you may see lines of
228-
output starting with `[ERROR]`, but the build completes and shows success for
229-
all subprojects.
230-
231-
Maven is capturing output from the C compiler and adding a tag at the front of
232-
each line. If the line from the C compiler contains the string `warning:` then
233-
Maven adds a `[WARNING]` tag at the front of the line; otherwise it adds
234-
`[ERROR]`. That is how Maven can turn a multiple-line warning, like
235-
236-
```
237-
type/String.c: In function 'String_createJavaString':
238-
type/String.c:132:43: warning: conversion to 'jlong' from 'Size' may change
239-
the sign of the result [-Wsign-conversion]
240-
bytebuf = JNI_newDirectByteBuffer(utf8, srcLen);
241-
^
242-
```
243-
244-
(where only the second line contains `warning:`) into what looks like one
245-
`[WARNING]` and several `[ERROR]`s.
246-
247-
If the compiler reports any actual errors, the build will fail.
248-
249225
#### Capture the output of `mvn -X`
250226

251227
The `-X` option will add a lot of information on the details of Maven's
@@ -259,3 +235,11 @@ On the first run, Maven will produce a lot of output while downloading all
259235
of the dependencies needed to complete the build. It is better, if the build
260236
fails, to simply run Maven again and capture the output of that run, which
261237
will not include all of the downloading activity.
238+
239+
As an alternative, the flood of messages reflecting successful dependency
240+
downloads in a first run can be suppressed by adding this option on the `mvn`
241+
command line:
242+
243+
```
244+
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
245+
```

src/site/markdown/build/buildmsvc.md

+1-22
Original file line numberDiff line numberDiff line change
@@ -211,26 +211,5 @@ dependency when [building your own projects that _use_ PL/Java][jproj].
211211

212212
### Troubleshooting the build
213213

214-
If something fails, two tricks may be helpful. The C compilation may produce
215-
a lot of nuisance warnings, because the Maven plugin driving it enables many
216-
types of warning that would be impractical to fix. With many warnings it may
217-
be difficult to pick out messages that matter.
218-
219-
If the link step of the build reports that the symbol `rint` is undefined you
220-
are probably using an older version of Visual Studio (2010) with a newer version
221-
of Postgresql (9.4). This symbol is defined in Visual Studio 2013 and later and
222-
the Postgresql 9.4 headers lack the appropriate conditional options for the
223-
older compilers. You will need to use a newer version of Visual Studio.
224-
225-
On a machine with many cores, messages from several compilation threads may be
226-
intermingled in the output so that related messages are hard to identify.
227-
The option `-Dnar.cores=1` will force the messages into a sequential order
228-
(and has little effect on the speed of a PL/Java build).
229-
230-
The `-X` option will add a lot of information on the details of Maven's
231-
build activities.
232-
233-
mvn -X -Dnar.cores=1 clean install
234-
235-
There is a more comprehensive "troubleshooting the build" section
214+
There is an extensive "troubleshooting the build" section
236215
on the [main build page][mbp].

src/site/markdown/build/package.md

+10-13
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,6 @@ When building a package, you are
2525
encouraged to set the default `pljava.libjvm_location` to the library of a
2626
JRE version that is expected to be present on your platform.
2727

28-
**Note:** when building on Windows, the `-Dpljava.libjvmdefault` option is
29-
likely to produce a failed build or the wrong stored value for the library
30-
path. A fix for this option on Windows is unlikely (see [issue 190][bug190]);
31-
if preparing a package for Windows, it will be simplest to use a patch that
32-
changes the definition of `PLJAVA_LIBJVMDEFAULT` in
33-
`pljava-so/src/main/c/Backend.c`.
34-
3528
[locatejvm]: ../install/locatejvm.html
3629
[bug190]: https://github.com/tada/pljava/issues/190
3730

@@ -139,7 +132,7 @@ the package.
139132

140133
`-Dpljava.libjvmdefault=`_path/to/jvm-shared-object_
141134
: As suggested earlier, please use this option to build a useful default
142-
into PL/Java for the `pljava.libjvm_location` PostgreSQL variable, users
135+
into PL/Java for the `pljava.libjvm_location` PostgreSQL variable, so users
143136
of your package will not need to set that variable before
144137
`CREATE EXTENSION pljava` works.
145138

@@ -189,8 +182,11 @@ those needed to support `ALTER EXTENSION UPGRADE`.
189182

190183
It also contains the `pljava-api` jar, needed for developing Java code to use
191184
in a database with PL/Java, and the `pljava-examples` jar. As discussed above,
192-
these may be omitted from a base package and supplied separately, if packaging
193-
guidelines require.
185+
the examples jar may be omitted from a base package and supplied separately,
186+
if packaging guidelines require, and the API jar may be included also in a
187+
`-devel` package that installs it in a standard Java-library location. (However,
188+
the API jar cannot be omitted from the base package; it is needed at runtime, in
189+
the `SHAREDIR/pljava` location where the extension expects it.)
194190

195191
The self-extracting jar consults `pg_config` at the time of extraction to
196192
determine where the files should be installed.
@@ -226,9 +222,10 @@ will have on the target system.
226222

227223
In addition to the files named in the self-extractor's output, additional
228224
files could be included in the package (if guidelines require the README
229-
or COPYRIGHT, for example). As discussed above, the `pljava-api` jar could
230-
be filtered from the list if it will be delivered in a separate `-devel`
231-
package, and the same could be done for `pljava-examples`.
225+
or COPYRIGHT, for example). As discussed above, the `pljava-examples` jar could
226+
be filtered from the list if it will be delivered in a separate
227+
package, and the `pljava-api` jar could be additionally delivered in a separate
228+
`-devel` package (but must not be excluded from the base package).
232229

233230
[install]: ../install/install.html
234231

0 commit comments

Comments
 (0)