-
Notifications
You must be signed in to change notification settings - Fork 821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow build-from-source on GNU/Linux without maven repositories #546
Conversation
This is needed for GNU/Linux systems at the moment where waffle-jna.jar is not usually available in a native package (built-from-source on GNU/Linux).
This commit is aimed to ease the building of pgjdbc from source on GNU/Linux hosts "offline"; without having some of the dependencies installed (otherwise strictly required) and without some features built-in. There are two new properties, waffleEnabled and osgiEnabled, both are set to 'true' by default and are used to turn on/off corresponding maven profiles. By specifying '-DwaffleEnabled=false' during maven build we can build pgjdbc.jar without Windows SSPI authentication support. By specifying '-DosgiEnabled=false' respectively, you can build pgjdbc.jar without OSGi Enterprise support.
Current coverage is
|
Any thoughts about this? @vlsi |
@pkajaba , thank you. The change looks OK in general, however:
I'm sorry my schedule is tight, so I cannot merge the change right away. |
No problem, take your time. We fix these comments :) I meant with that I at the beginning of name of the class to indicate some kind of interface. |
@pkajaba , adding an item to What I am much less aware is the way to CI-test via |
@vlsi , do we need to test xmvn directly, or is it enough to tetst 'mvn' command with It should not be a big issue anyway, by enabling the options 'mvn' should produce the same Also, we can think about using Copr as CI (discussed before) - but I'm not sure copr |
That is what I mean. |
I've checked the possibilities -- and as far as I understand, we can't simply trigger the build by webhook, this option is not implemented in Copr that way to be compatible with pgjdbc conventions (there are Mock SCM and Tito options, but both are not suitable for pgjdbc). And both would have complicated checking for build results to "block PR" in case of failure. So the option to me is to (a) generate SRPM on ubuntu and (b) make it available somewhere and then (c) submit a build into Copr (that might be implemented by raw HTTP request) but not completely trivial. The (a) point I can't say how trivial is as I dont know how easy it is generate SRPM on ubuntu, and the (c) is there because we probably can't simply install copr client on ubuntu. Is it worth the troubles now ^^? To me, the more suitable option would be to implement new build-option into Copr (something which takes (a) spec file and (b) links to tarballs, I can work on such patch against Copr). This would require that we are able to obtain both tarballs -- pgjdbc-parent-poms and pgjdbc from PRs. Once this would be deployed, we could add the CI here into |
Of course, we can build the jars with 'mvn -PwaffleEnabled=false' directly, and check that build/test |
…es to respect conventions
…ort for until Java 7
Does https://developer.fedoraproject.org/deployment/copr/copr-cli.html work for triggering a copr build? |
Yes. But you need to have SRPM first and have the copr cli available. |
That's unfortunate. Ok, let's stick with |
I've added travis job with disabled osgi/waffle, but I'm afraid that the dependencies are |
Ah, thanks for the pgjdbc/pgjdbc-parent-poms#4 merge! Ok, I've fixed the travis.yml Is there something we could help with now (before we hack Copr to be able to serve |
I'm afraid it does not. |
The v1.0.6 has Waffle/OSGi dependencies optional.
This is unfortunate because users who want to build without OSGIi and without Waffle need to specify yet another compilation flag. But there is no way to do this automatically when user specifies '-DwaffleEnabled', the reason is that excludePackageNames accepts one string (colon or comma separated list of package names), and we can not edit the excludePackageNames tag twice (firstly for waffleEnabled and then for osgiEnabled properties) -- the last excludePackageNames wins.
You were right - when pgjdbc-parent-poms started handling the new options, maven build |
Ping :) |
return (ISSPIClient) c.getDeclaredConstructor(cArg).newInstance(pgStream, spnServiceClass, enableNegotiate, logger); | ||
} catch (Exception e) { | ||
// This catched quite a lot exceptions, but until Java 7 there is no ReflectiveOperationException | ||
throw new UnsupportedOperationException("You are using jar from Linux distribution or class SPPIClient cannot be loaded"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was not good. Original exception was not included into the new one, so user would have no way to debug the failure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vlsi, right - thanks for the fix!
Thanks for the merge, perfect! I can't wait for the next release :). |
@praiskup , does your packaging work as expected? Do "package consumers" confirm the package works for them? |
@vlsi, I'll give it a concrete try -- but as long as the travis build with disabled features |
@vlsi, what way I can generate the release tarball you provide during releases? 'mvn package' |
"In theory there is no difference between theory and practice, in practice there is...". You mean "dist.tar.gz" file? |
On Tuesday 10 of May 2016 01:40:17 Vladimir Sitnikov wrote:
:) I bet I should be more concrete. Well, what is scary about the Otherwise -- if the file hierarchy within tarball changes a bit,
This command helped, thanks! |
Any idea what should be better there? |
@vlsi wrote: Any idea what should be better there? Ideally (not saying we must have it) there should be one tarball pattern There shouldn't be any pre-compiled stuff (usually also documentation I'm not sure how to fix this; even the '*-dist.tar.gz' tarball is not @vlsi wrote: Frankly speaking, I've no idea who uses that dist artifact. All GNU/Linux package maintainers, I believe. |
@vlsi, I'm trying to have a look at the CI part of this topic. The problem is that in Copr, So, on the Ubuntu machine, would that be possible to run containerized Fedora? This is
Would that be problem to execute docker image based on Fedora? The other option is that we can provide long-term runnning virtual machine |
Travis supports docker: https://docs.travis-ci.com/user/docker/, so running against Fedora container should be possible. |
See this link for more info: pgjdbc/pgjdbc#546 Version: 9.4.1208-8
FTR, continuing in #578 |
No description provided.