Thu Aug 18, 2022 10:55 am
Login Register Lost Password? Contact Us

Please Note: The HPCC Systems forums are moving to Stack Overflow. We invite you to post your questions on Stack Overflow utilizing the tag hpcc-ecl (https://stackoverflow.com/search?tab=newest&q=hpcc-ecl). This legacy forum will be active and monitored during our transition to Stack Overflow but will become read only beginning September 1, 2022.



Command Line automation with /usr/bin/ecl

Topics specific to the use of the ECL IDE

Fri Oct 25, 2013 9:26 am Change Time Zone

I am doing some command line automation under Linux. For this project we are using the standard file system folders for our code under windows and replicating the repository to a Linux box where we expect to run our automation.

After much gnashing-of-teeth things seem to be configured correctly to use "/usr/bin/ecl" to run the code and reference our filesystem-based code libraries ... except my work requires that I pass the "-legacy" flag to the compiler and I don't see how to do that for the ecl compiler. Any pointers?

Thanks in advance,

Brian
BrianB644
 
Posts: 16
Joined: Thu Sep 13, 2012 7:52 pm

Fri Oct 25, 2013 12:02 pm Change Time Zone

So ... I peeked through the code for "eclcmd" and it appears that most of the work to support a -legacy option is present ... but the output of "strings /usr/bin/ecl" doesn't have "-legacy" in it ... though the other supported options do seem appear.

The code did call "eclcc" as a pipe command though and appeared to rely on eclcc to be in the path ... so ... I made my own version of "eclcc" to call /usr/bin/eclcc with the -legacy option enabled and that "worked around" my problem.

What I have come to consider an idiom for something like this is as follows ... though I tend to think it is a bit too cute at the expense of readability:

#!/bin/bash
test $# -eq 0 && exec /usr/bin/ecl -legacy
exec /usr/bin/ecl -legacy "$*"

This worked around my problem ... though I'd be happy to have a way to do it from the command line.

Cheers,

Brian
BrianB644
 
Posts: 16
Joined: Thu Sep 13, 2012 7:52 pm

Fri Oct 25, 2013 12:35 pm Change Time Zone

Does ecl --legacy not work?

Also since this feature is being deprecated is there any reason why you need it (rather than updating the ecl files to use the new import semantics)?
gsmith
 
Posts: 291
Joined: Thu May 12, 2011 9:40 am

Fri Oct 25, 2013 3:27 pm Change Time Zone

I certainly tried it ... both with -legacy and --legacy ... in almost every conceivable portion of the command line I could. It certainly appears that it should be there based on the code to support it in the code base, but it isn't in the help message, it isn't in the documentation, and the string "legacy" isn't compiled into the executable ... at least not in the way that strings for most of the other arguments are present.

Concerning modifying the code ... the code is generated, I don't maintain it, and updating the generator isn't in scope for my current project.

Another nit ... /usr/bin/ecl doesn't always return a non-zero error code when "there is a failure". I previously used eclplus, and it seemed to return codes that made sense from an automation perspective. Unfortunately, I couldn't seem to get eclplus to respect the -I option so had to switch the framework to use the "ecl command" instead.

Cheers,

Brian B.
BrianB644
 
Posts: 16
Joined: Thu Sep 13, 2012 7:52 pm


Return to ECL IDE

Who is online

Users browsing this forum: No registered users and 1 guest

cron