Skip to content
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

Running pre- and post-commands #208

Open
zkarj735 opened this issue Mar 16, 2023 · 6 comments · Fixed by #227
Open

Running pre- and post-commands #208

zkarj735 opened this issue Mar 16, 2023 · 6 comments · Fixed by #227

Comments

@zkarj735
Copy link

With the recent debugger support integrated into VSCode, I am once again looking at how we might use bob for our regular work.

One of our current tools is a homegrown "compile processor" which provides facilities to, among others:

  • Handle CRTxxx parameter overrides — handled by bob
  • Run commands before compile
  • Run commands after compile

I set about figuring out how to do those pre- and post-commands and came up with this (spurious) example, which works.

DSPALT.CMD: DSPALT.CMDSRC
	system -i "crtdtaara qgpl/signal type(*char) len(10)"
	$(CMDSRC_TO_CMD_RECIPE)

The trouble with this is it means having to know, for any given object type, what the name of the recipe is.

Is there a better way to do this?

I think I can build out the other functions we have by building helper commands to use as above, so this is the key requirement.

@zkarj735
Copy link
Author

Another important aspect of this would be the ability to ensure pre- and post-commands and the compile happen in the same context. I found documentation regarding .ONESHELL but this appears not to be supported in the make tool.

I really need someone with more knowledge in this space to weigh in. Per the bob documentation...

Bob bridges the gap between the Linux/Unix environment with which Make is familiar and the QSYS file system in which most IBM i software lives.

It's not making enough of a bridge yet, in my view. I'm still fighting a combination of Code for IBM i, makefiles, and VSCode just to compile a simple utility reliably.

@zkarj735
Copy link
Author

I also considered whether I could adapt our compile processor to deal with IFS source files, but that's only half the story, as bob will intrinsically use the standard CRTxxx commands, meaning we would have even more trouble adapting it to use ours.

@edmundreinhardt
Copy link
Member

Bob, does not yet support that. I am looking at getting -e variables to influence the build and maybe somebody could contribute a PRE and POST command to the recipes.

But in the meantime your approach is not bad. I haven't tried it, but it looks like it should work.

@edmundreinhardt
Copy link
Member

This issue also needs the ability to have environment variables affect the build

@zkarj735
Copy link
Author

The example I gave above works but I later learned those commands are running in parallel, which PRE and POST commands should not, of course. I tried to use the ONESHELL directive but could not get it to work.

@edmundreinhardt
Copy link
Member

Code is there, but does not seem to be having an effect. Needs debugging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants