IBM / xmlservice

XML-based interface for accessing IBM i resources
https://xmlservice.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
35 stars 18 forks source link

Add exports file for XMLSTOREDP #27

Closed kadler closed 5 years ago

kadler commented 5 years ago

XMLSTOREDP currently exports a ton of functions, most of which should be exported from the main XMLSERVICE service program (#26) instead. Basically just the iPlug* entries should be exported from XMLSTOREDP for use by the stored procedures (https://github.com/IBM/xmlservice/blob/master/src/xmlstoredp.sql.in).

Justin-E-Taylor commented 5 years ago

Are the iPLUGR* exports the ones in question? Those functions don’t exist in XMLSERVICE, so do they need to be moved?

kadler commented 5 years ago

All the functions referenced by https://github.com/IBM/xmlservice/blob/master/src/xmlstoredp.sql.in need to be exported by XMLSTOREDP service program, but nothing else should be. Currently it just exports everything, which leaks a lot of internals.

Justin-E-Taylor commented 5 years ago

OK, I see now. The unwanted exports are coming from the copybooks. So we need binding source to only export the needed functions. I don't see that the project currently has any binding source.

  1. I assume the file needs to go in the src directory?
  2. What's the standard for the binding source signature?
  3. I believe the CRTSRVPGM in Makefile.in would need to be changed. I'm a little fuzzy on what the SRCSTMF value needs to be.
kadler commented 5 years ago

yeah, should go on src. As far as the signature goes, I'm up for suggestions. CRTSRVPGM doesn't allow export source from an IFS file, so the Makefile will need changes to create a source physical file and copy it in to it.

Justin-E-Taylor commented 5 years ago

For signatures, here we just use the *SRVPGM name and a date or version number. We don't distribute software, so we've never really put a lot of thought in to it.

I've committed the binding source (https://github.com/Justin-E-Taylor/xmlservice/blob/master/src/xmlstoredp.bnd) but haven't submitted a PR yet. I haven't got the local build working yet, and I want to do that first.

As an aside, what's with the .rpglesql extensions, shouldn't they be .sqlrpgle? RDi recognizes .sqlrpgle but not .rpglesql.

kadler commented 5 years ago

what's with the .rpglesql extensions, shouldn't they be .sqlrpgle?

You'd need to ask @rangercairns on that. :man_shrugging:

That's bugged me too. Feel free to change it (make sure to updated Makefile.in rules).

Justin-E-Taylor commented 5 years ago

I'm probably too much of a newb to rocking the boat too much regarding file extensions.

I compiled the *SRVPGM locally and submitted the PR. The PR shows action required, but that will have to wait until next week.

Justin-E-Taylor commented 5 years ago

The "action required" is resolved. I haven't looked at the makefile yet. I wanted to get the binding source up ASAP for feedback on the signature.

kadler commented 5 years ago

After thinking about it afterwards, we should just use *GEN for the signature, since nobody should be actually linking to this service program. (Db2 doesn't care about signatures as it loads everything dynamically at runtime).

Justin-E-Taylor commented 5 years ago

I had just a few minutes last week and I tried to run the makefile as-is. It failed but I didn't have time to dig into it. I got back to it today, looked more closely but still can't determine the problem.

Here's what I get:

-bash-4.3$ ./configure --lib JUSTIN
-bash-4.3$ make
make: Cannot find a rule to create target JUSTIN.lib from dependencies.
Stop.
-bash-4.3$

I have only the most basic familiarity with Makefiles, but it looks it looks like it should create the library. It does not.

Any suggestions?

kadler commented 5 years ago

I think you need to install GNU make: yum install make-gnu (make sure to run hash -r afterwards if you've already run make in that session).

Justin-E-Taylor commented 5 years ago

Bingo! I keep forgetting IBMi is "batteries not included". Thanks

jimoibm commented 5 years ago

@Justin-E-Taylor I just found 'RUNASCII' was missing from the exportsrc. Looks like some procedures are supposed to be called outside xmlservice in plugrun.xml.

kadler commented 5 years ago

@jimoibm I opened #37 for that problem.