CloudSlang / cloud-slang

CloudSlang Language, CLI and Builder
http://cloudslang.io
Apache License 2.0
235 stars 82 forks source link

Using relative path throws <duplicate executable found> error #1003

Open andras-krajnik opened 7 years ago

andras-krajnik commented 7 years ago

As mentioned in the title, relative path doesn't seem to work. Using full path everything is ok.

Steps to reproduce:

  1. Place the Tutorials folder inside cslang-cli folder so it will be on the same level as bin
  2. I used the sample code from the tutorial. So I had the following: 2.1 Base -> print.sl 2.2 Hiring -> check_availability, create_user_email, generate_user_email, new_hire
  3. Run command with full path: 3.1 run --f C:/CL/1.0.7/cslang-cli/Tutorials/hiring/new_hire.sl --cp C:/CL/1.0.7/cslang-cli/Tutorials --i first_name=john,last_name=doe

Actual result after step 3 : finished with SUCCESS

  1. Run command with relative path: 4.1 run --f ../Tutorials/hiring/new_hire.sl --cp ../Tutorials --i first_name=john,last_name=doe

Actual result after step 4 : you receive the below error message

Exception is : java.lang.RuntimeException: Duplicate executable found: 'tutorials.hiring.new_hire'

Note: tested with v1.0.6 & v1.0.7

Deklin commented 6 years ago

Is there any workaround for this? I'm on a Mac and trying to run the print_text.sl and seeing this error.

_________ .__                   .____________.__
\_   ___ \|  |   ____  __ __  __| _/   _____/|  | _____    ____    ____
/    \  \/|  |  /  _ \|  |  \/ __ |\_____  \ |  | \__  \  /    \  / ___\
\     \___|  |_(  <_> )  |  / /_/ |/        \|  |__/ __ \|   |  \/ /_/  >
 \______  /____/\____/|____/\____ /_______  /|____(____  /___|  /\___  /
        \/                       \/       \/           \/     \//_____/
1.0.10
Welcome to CloudSlang. For assistance type help.
cslang>run --f ../content/io/cloudslang/base/print/print_text.sl --i text=Hi
Command failed java.lang.RuntimeException: Failed compilation for file : print_text.sl ,Exception is : java.lang.RuntimeException: Duplicate executable found: 'io.cloudslang.base.print.print_text'
Deklin commented 6 years ago

@chronical ?

tethryus commented 6 years ago

@Deklin Hi, you could try making it work with supplying --cp ../content/io/cloudslang when running the command.

lautou commented 6 years ago

@Deklin As workaround try to use absolute path instead of relative: image @tethryus Supplying --cp argument with folder path doesn't work.