1. euc build directory and output filename poll

The euc program will compile a Euphoria program to an executable via a C compiler you have available on your system. During this process a lot of C source is generated as well as compiled object files. Thus, to prevent cluttering your working directory, euc offers a command line option -builddir. In this directory is where euc will generate all of it's files necessary for C translation and compilation of your program.

So:

C:\my_program> euc -builddir build myprogram.ex 

will create a directory build and generate a lot of temp stuff there. If everything is a success, the temp stuff is removed. It will leave behind the result which in this case is build\myprogram.exe

euc offers another command line option -o which specifies the name of the output program filename.

So:

C:\my_program> euc -builddir build -o my_program main.ex 

Instead of deriving the executable name from main.ex and creating main.exe euc will use what you specified via -o which is my_program. It does add the executable extension if necessary.

There is a debate between a few dev members on IRC about where the resulting executable should be placed. Should the -o be relative to the -builddir and my_program.exe be placed in C:\my_program\build\my_program.exe or should the -o be relative to the location where euc is run and my_program.exe be placed in C:\my_program\my_program.exe ?

It's all a matter of should -o be relative to -builddir or to where euc is running from.

We want the result of least surprise. If you issued:

C:\my_program> euc -builddir build -o my_program my_program.ex 

Where would you expect to find my_program.exe:

  1. C:\my_program\build\my_program.exe
  2. C:\my_program\my_program.exe

Thanks for your input.

Jeremy

new topic     » topic index » view message » categorize

2. Re: euc build directory and output filename poll

jeremy said...

We want the result of least surprise. If you issued:

C:\my_program> euc -builddir build -o my_program my_program.ex 

Where would you expect to find my_program.exe:

  1. C:\my_program\build\my_program.exe
  2. C:\my_program\my_program.exe

My first reaction is to say the executable would be placed in the builddir location.

How would this work ...

C:\my_program> euc -builddir build -o c:\some\other\path\my_name my_program.ex 

new topic     » goto parent     » topic index » view message » categorize

3. Re: euc build directory and output filename poll

DerekParnell said...

My first reaction is to say the executable would be placed in the builddir location.

How would this work ...

C:\my_program> euc -builddir build -o c:\some\other\path\my_name my_program.ex 

That would expose a bug that needs to be fixed. It would attempt to write build\C:\some\other\path\my_name. In a similar fashion -build build -o .\program would write build\.\program.

Jeremy

new topic     » goto parent     » topic index » view message » categorize

4. Re: euc build directory and output filename poll

DerekParnell said...
jeremy said...

We want the result of least surprise. If you issued:

C:\my_program> euc -builddir build -o my_program my_program.ex 

Where would you expect to find my_program.exe:

  1. C:\my_program\build\my_program.exe
  2. C:\my_program\my_program.exe

My first reaction is to say the executable would be placed in the builddir location.

Same here. But if, and only if, -o was followed by the name of the program alone.

DerekParnell said...

How would this work ...

C:\my_program> euc -builddir build -o c:\some\other\path\my_name my_program.ex 

If an absoute path is given to -o, then I feel it should be used directly, regardless of whether or not it's relative to the builddir.

If a relative path is given to -o, I can live with it being relative to the builddir - BUT with one exception.

I'd expect -o ./myprog to be in the current dir, not in builddir/./myprog Likewise, -o ../myprog should be in the parent dir of the current dir.

new topic     » goto parent     » topic index » view message » categorize

5. Re: euc build directory and output filename poll

jimcbrown said...

If an absoute path is given to -o, then I feel it should be used directly, regardless of whether or not it's relative to the builddir.

If a relative path is given to -o, I can live with it being relative to the builddir - BUT with one exception.

I'd expect -o ./myprog to be in the current dir, not in builddir/./myprog Likewise, -o ../myprog should be in the parent dir of the current dir.

So if an absolute or if the output starts with a . then relative to the current directory, otherwise relative to the build dir is what I understand you'd want Jim, right?

Jeremy

new topic     » goto parent     » topic index » view message » categorize

6. Re: euc build directory and output filename poll

jeremy said...

So if an absolute or if the output starts with a . then relative to the current directory, otherwise relative to the build dir is what I understand you'd want Jim, right?

Jeremy

Well, an absolute is not really relative to anything, but yes that's what I'd expect.

I can live with -o always being relative to the current directory though. That wouldn't really be unexpected behavior to me.

new topic     » goto parent     » topic index » view message » categorize

7. Re: euc build directory and output filename poll

Hi

builddir - where all the build stuff goes, ok.

I would expect the program to output the built program relative to the current dir, not the buildir, unless I specified a path to the output program. So

C:\my_program> euc -builddir build my_program.ex
my_program.exe in c:\my_program

C:\my_program> euc -builddir build -o great_program my_program.ex
great_program.exe in c:\my_program

C:\my_program> euc -builddir build -o c:\goodies\great_program my_program.ex
great_program in c:\goodies

Similarly with linux, current directory first, full path second (with errors issued for permission violations)

Frankly, I think builddir should only be used as the temp directory, and not a default final destination

Chris

new topic     » goto parent     » topic index » view message » categorize

8. Re: euc build directory and output filename poll

ChrisB said...

Hi

builddir - where all the build stuff goes, ok.

I would expect the program to output the built program relative to the current dir, not the buildir, unless I specified a path to the output program. So

Chris,

Good ideas. It has been implemented as you suggested. It's now in SVN that way.

Jeremy

new topic     » goto parent     » topic index » view message » categorize

9. Re: euc build directory and output filename poll

Another option is to replace -buildir with say -ctemp.

If it helps any, there should be no pressing need to make -buildir stop working, just add the new alternative and change all the docs.

Pete

new topic     » goto parent     » topic index » view message » categorize

10. Re: euc build directory and output filename poll

petelomax said...

Another option is to replace -buildir with say -ctemp.

If it helps any, there should be no pressing need to make -buildir stop working, just add the new alternative and change all the docs.

That makes sense if you are doing a direct build:

C:\my_program> euc hello.ex 
... 
C:\my_program> hello.exe 
Hello, World! 

However euc will also build the old emake.bat file or generate partial makefiles for inclusion into your own Makefile or a full Makefile that can be used by itself.

All of that information is not temporary.

Maybe in the end what we need is an -output-dir and a -temp-dir option. -temp-dir being usable for direct builds and -output-dir being usable for generation of build files/sources that are meant to be used later on by the developer?

Jeremy

new topic     » goto parent     » topic index » view message » categorize

11. Re: euc build directory and output filename poll

My two cent,

What I would like to see:
The completed .exe file go to the folder the original .exw file is in.

All my uneeded .c files endup in my BIN folder. So I would like to see -e = (erase all .c files created).

Don Cole

new topic     » goto parent     » topic index » view message » categorize

12. Re: euc build directory and output filename poll

dcole said...

What I would like to see: The completed .exe file go to the folder the original .exw file is in.

All my uneeded .c files endup in my BIN folder. So I would like to see -e = (erase all .c files created).

The way it works after this discussion and several on IRC is this:

euc myprg.ex 

creates a temporary working directory, builds there and when done removes the temp dir and your executable is in the CWD.

euc -build-dir build myprg.ex 

this assigns a build directory. When you do that, you are assuming responsibility for it. euc cleans up files it creates, but it will not do anything with the build directory. This command also leaves the executable in CWD

euc -build-dir build -o build\myprg.exe myprg.ex 

builds in build and puts your executable in build.

Jeremy

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu