Re: Could bash do what make does?

2016-12-06 Thread Dave Finlay
There is an onus on you to use the appropriate mailing list. Bug-bash isn't
for make-ing your case, bug-bash is for the bugs.

Dave Finlay

On Dec 6, 2016 15:44, "Robert Durkacz"  wrote:

On 6 December 2016 at 00:19, Greg Wooledge  wrote:

>  what evidence?
> ​ [for shell scripting builds]
>
​
I suppose the evidence that you want is in the very same wikipedia article
about make, where it says precisely that shell scripts were used before
make came along.
However, please remember I am here asking a question. I am not promoting
any views about these matters which are secondary to the question. There is
no onus on me to prove anything. If you are interested in my views and I
doubt you are, you can email me privately. I will not indulge you in
further public exchanges no matter how provocative you try to be. "Put up
or shut up" indeed.


Re: Could bash do what make does?

2016-12-06 Thread Robert Durkacz
On 6 December 2016 at 00:19, Greg Wooledge  wrote:

>  what evidence?
> ​ [for shell scripting builds]
>
​
I suppose the evidence that you want is in the very same wikipedia article
about make, where it says precisely that shell scripts were used before
make came along.
However, please remember I am here asking a question. I am not promoting
any views about these matters which are secondary to the question. There is
no onus on me to prove anything. If you are interested in my views and I
doubt you are, you can email me privately. I will not indulge you in
further public exchanges no matter how provocative you try to be. "Put up
or shut up" indeed.


Re: Could bash do what make does?

2016-12-05 Thread Greg Wooledge
On Mon, Dec 05, 2016 at 11:37:11PM +1100, Robert Durkacz wrote:
> I am asking about shell scripting
> of software builds, something that is perfectly possible to do and once
> must have been the common way.

Based on what evidence?  Show me a shell script created to build a
software project without make or ant or any other build tool.  Just one.

You started out arguing that "bash could do what make does".  It can't,
of course, and people have told you this, but you do not listen.

So next you argued that since make is newer than bash, people must have
done builds in bash before make was invented.  I disproved this by
showing you the release dates of bash and make.

Then you argued that you really meant the Bourne shell, not bash, because
you have absolutely NO idea how different bash is from the original
Bourne shell.  And then YOU YOURSELF dug up a release date for the
Bourne shell, which was STILL LATER then the release date of make.

Now, having argued yourself into a hole, you claim that people "must have"
used shell scripting (in a shell that did not exist yet) before they
used make, because you simply refuse to accept reality.

So, show us your evidence.  Put up or shut up.



Re: Could bash do what make does?

2016-12-05 Thread Robert Durkacz
You have gone to some trouble with your answer Eduardo, and thanks for that
but really you are arguing against a proposition that I have not put and I
do not want other readers to be mislead. I am asking about shell scripting
of software builds, something that is perfectly possible to do and once
must have been the common way. I do not want to see make reimplemented
inside bash. Sure, that sounds silly. I think some other contributors have
understood my question even without the clarification that has been made. I
personally don't mind talking about the related but distinct things that
you have raised but I think it would be a wrong to do that in this forum.

On 4 December 2016 at 04:07, Eduardo Bustamante  wrote:

> "build market"? What are you talking about? make was created with the
> sole purpose of build automation. The shell was created to provide a
> "human interface" to computer operators. These are very specific and
> different purposes. Are you going to start asking next to re-implement
> vi inside bash? to re-implement a mail user agent? a C compiler? Where
> do you draw the line? Read:
> http://www.catb.org/jargon/html/C/creeping-featurism.html
>
> I doubt anyone is willing to go through the effort to re-implement all
> the features that make provides, just because one guy thinks "it's
> obsolete" -- it's not, by the way. make is very alive. Also, it is
> part of the POSIX international standard. so any operating system that
> claims to be compatible with UNIX must provide it, see [1] and [2] and
> [3].
>
> Also remember that nothing makes a stronger argument than patches. If
> you want to see this feature implemented, I suggest that you start
> looking into the features make provides, and send patches to add said
> functionality to bash.
>
> [1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html
> [2] https://www.gnu.org/software/make/
> [3] http://lists.gnu.org/archive/html/bug-make/
>


Re: Could bash do what make does?

2016-12-03 Thread John McKown
On Sat, Dec 3, 2016 at 11:07 AM, Eduardo Bustamante 
wrote:

> "build market"? What are you talking about? make was created with the
> sole purpose of build automation. The shell was created to provide a
> "human interface" to computer operators. These are very specific and
> different purposes. Are you going to start asking next to re-implement
> vi inside bash? to re-implement a mail user agent? a C compiler? Where
> do you draw the line? Read:
>

​ OP must be confusing BASH with EMACS.​



> http://www.catb.org/jargon/html/C/creeping-featurism.html
>
> I doubt anyone is willing to go through the effort to re-implement all
> the features that make provides, just because one guy thinks "it's
> obsolete" -- it's not, by the way. make is very alive. Also, it is
> part of the POSIX international standard. so any operating system that
> claims to be compatible with UNIX must provide it, see [1] and [2] and
> [3].
>
> Also remember that nothing makes a stronger argument than patches. If
> you want to see this feature implemented, I suggest that you start
> looking into the features make provides, and send patches to add said
> functionality to bash.
>
> [1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html
> [2] https://www.gnu.org/software/make/
> [3] http://lists.gnu.org/archive/html/bug-make/
>
>


-- 
Heisenberg may have been here.

Unicode: http://xkcd.com/1726/

Maranatha! <><
John McKown


Re: Could bash do what make does?

2016-12-03 Thread Eduardo Bustamante
"build market"? What are you talking about? make was created with the
sole purpose of build automation. The shell was created to provide a
"human interface" to computer operators. These are very specific and
different purposes. Are you going to start asking next to re-implement
vi inside bash? to re-implement a mail user agent? a C compiler? Where
do you draw the line? Read:
http://www.catb.org/jargon/html/C/creeping-featurism.html

I doubt anyone is willing to go through the effort to re-implement all
the features that make provides, just because one guy thinks "it's
obsolete" -- it's not, by the way. make is very alive. Also, it is
part of the POSIX international standard. so any operating system that
claims to be compatible with UNIX must provide it, see [1] and [2] and
[3].

Also remember that nothing makes a stronger argument than patches. If
you want to see this feature implemented, I suggest that you start
looking into the features make provides, and send patches to add said
functionality to bash.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html
[2] https://www.gnu.org/software/make/
[3] http://lists.gnu.org/archive/html/bug-make/



Re: Could bash do what make does?

2016-12-03 Thread Robert Durkacz
On Fri, Dec 02, 2016 Greg Wooledge wrote:
"For starters, make is *older* than bash, by over a decade.
"https://en.wikipedia.org/wiki/Make_%28software%29 says that make
originated at Bell Labs in April 1976.
"https://en.wikipedia.org/wiki/Bash_%28Unix_shell%29 says that the first
"beta version of bash was released by Brian Fox in June 1989."

But, quoting the second reference, bash is "a free software replacement for
the Bourne shell" and the Bourne shell dates to 1977.

Quoting the second reference, "before Make's introduction in 1976, the Unix
build system most commonly consisted of operating system dependent make and
install shell scripts accompanying their program's source."

So it is not that much different from what I said. People would have known
what the shell was good for when make appeared but they did not try to hold
on to the build market which they had at that time.


Re: Could bash do what make does?

2016-12-02 Thread Dave Finlay
Robert-

I wanted to craft a witty retort with a veneer of encouragement that might
push your towards trying your proposed endeavor.  I could not bring myself
to do it after realizing that you are quite serious.  I understand your
motivations.  Build systems are often complicated, opaque pieces of
software with many bespoke elements, like syntax, configuration, and macro
systems.  They often become that way because software projects of any large
size start to take on their own arbitrary conventions and requirements that
must be handled.  We just love to shoot ourselves in the foot.

I feel like these are self evident, but perhaps there is a grok gap I'm not
seeing. Bash is a shell, a language and an old friend. It is not a build
system. Narrowing and/or expanding a piece of software's scope to address
problems it isn't concerned with is almost always going to end in tears.
See the Unix Philosophy
:
do one thing and do it well.

I recommend you attempt this endeavor independently, as a learning
experience. Try writing a script and a function library that will allow you
to build the Bash project (or something simpler) without Make or Autotools.
You will come to understand why the world is as it is.  You will come to
truly comprehend the dark side of dealing with compilation caches, diverse
compiler output, job control, dependency management, packaging, and all the
other painful things.

After that exercise, take a look at some of approaches people have taken.
CMake, Maven, Gradle, and SCons are good projects to look at. Just take a
look at how much thought went into Maven's Dependency Version Requirement
Specification
.
There is no magic that will lead to the 'Perfect Build System'.  It takes
well thought out architecture, obsession with details, and a gobs of
effort.  Even with all that, it will never be perfect or universal.  There
is always a use case or edge case you didn't deal with.

I hope this response was of benefit to you.



Dave Finlay

On Fri, Dec 2, 2016 at 2:29 AM, Robert Durkacz 
wrote:

> I agree that is the first step to take, but I am supposing that, since
> build systems are a big business, some extensions to bash would be worth
> doing to take on that market. E.g. I think we would need a concept of lists
> of files so as to skip executing a command if all files in the list are
> older than some file that is required.
>
> On 29 November 2016 at 02:21, Dennis Williamson <
> dennistwilliam...@gmail.com> wrote:
>
>>
>>
>> On Sun, Nov 27, 2016 at 7:25 PM, Robert Durkacz > > wrote:
>>
>>> Has thought been given, over the years, to extending bash to do
>>> what make does, in the obvious way that I am about to describe?
>>>
>>> It would be a matter of having chosen build commands do nothing if their
>>> outputs are newer than their inputs. For example that is, cc file.c -o
>>> file.o should execute normally if file.c is the newer file but do nothing
>>> if file.o is newer.
>>>
>>> Then you would have a deterministic script to build a system that simply
>>> skipped steps determined to be unnecessary.
>>>
>>> It is possible to achieve this without changing bash but it seems like
>>> there would be leverage in having bash deliberately support this mode.
>>>
>>
>>
>> Use the newer-than test:
>>
>> source=file.c
>> object=file.o
>> [[ $source -nt $object ]] && cc "$source" -o "$object"
>>
>>
>> --
>> Visit serverfault.com to get your system administration questions
>> answered.
>>
>
>


Re: Could bash do what make does?

2016-12-02 Thread Greg Wooledge
On Fri, Dec 02, 2016 at 10:53:30PM +1100, Robert Durkacz wrote:
> really I am asking why should not program builds have been scripted with
> bash all along

For starters, make is *older* than bash, by over a decade.

https://en.wikipedia.org/wiki/Make_%28software%29 says that make
originated at Bell Labs in April 1976.

https://en.wikipedia.org/wiki/Bash_%28Unix_shell%29 says that the first
beta version of bash was released by Brian Fox in June 1989.



Re: Could bash do what make does?

2016-12-02 Thread Robert Durkacz
On 29/11/16 Charles Daffern replied to my question about bash and make as
if I was proposing that bash might beneficially reimplement make, but
really I am asking why should not program builds have been scripted with
bash all along and make never invented. So if Charles or someone else could
point out the fallacy in the following simplistic approach, I would be
grateful:
1. Script exhaustively the commands to build a unit of software.
2. Using facilities already in bash or, as appropriate, extensions, have
the commands bypass actual execution when all input files are older than
all output files.
It seems that this gives the same effects and benefits of make but in a
more straightforward way.


Re: Could bash do what make does?

2016-12-02 Thread Robert Durkacz
I agree that is the first step to take, but I am supposing that, since
build systems are a big business, some extensions to bash would be worth
doing to take on that market. E.g. I think we would need a concept of lists
of files so as to skip executing a command if all files in the list are
older than some file that is required.

On 29 November 2016 at 02:21, Dennis Williamson  wrote:

>
>
> On Sun, Nov 27, 2016 at 7:25 PM, Robert Durkacz 
> wrote:
>
>> Has thought been given, over the years, to extending bash to do
>> what make does, in the obvious way that I am about to describe?
>>
>> It would be a matter of having chosen build commands do nothing if their
>> outputs are newer than their inputs. For example that is, cc file.c -o
>> file.o should execute normally if file.c is the newer file but do nothing
>> if file.o is newer.
>>
>> Then you would have a deterministic script to build a system that simply
>> skipped steps determined to be unnecessary.
>>
>> It is possible to achieve this without changing bash but it seems like
>> there would be leverage in having bash deliberately support this mode.
>>
>
>
> Use the newer-than test:
>
> source=file.c
> object=file.o
> [[ $source -nt $object ]] && cc "$source" -o "$object"
>
>
> --
> Visit serverfault.com to get your system administration questions
> answered.
>


Re: Could bash do what make does?

2016-11-29 Thread Charles Daffern
On 29/11/16 05:41, Robert Durkacz wrote:
> make has survived all this time but it is not very well accepted today
> with a lot of competing build systems trying to do better. bash is
> very secure and moreover the Bourne shell was there first. make is
> falling out of favour as far as I can see even though it has had a
> very good run: Kernighan and Pike in their book on Unix said to use it
> in preference to the shell for builds. That is the background to my
> asking was it really necessary after all to do give up on the shell
> for doing builds?
It seems a little perverse to me to have huge features added to bash for
social reasons. make does its job well, and in the majority of cases it
either shells out to bash or can be made to do so.
The Bourne shell may have a legacy but I don't think that means that
people will immediately adopt bash's make-like features if they ever
happen. (Besides, bash is not the Bourne shell, and the other Bourne
shell derivatives probably won't follow suit.)

Regardless of that, make does a lot more than just check file times. It
checks whole dependency trees and builds common dependencies just once,
and it can schedule build tasks in parallel safely (providing the
makefile is well-written). It can have generic rules defined which
determine how to build a filetype in general, and will follow those
rules when they're needed to build a dependency of another target. It
has a lot of helpful features you can see in its man page, and I'd hate
to see people ditching make for a simplified imitation built into a
popular shell.

Even then, if the implementation isn't simplified, and feature parity
with make is achieved, the resulting build system would rely on a weird
kind of makefile which is incompatible with systems running older
versions of bash. You might as well have written a proper makefile
instead. (That's to say nothing of how awkward it would be to specify a
non-deterministic ordering of jobs and a proper dependency tree in
bash's syntax.)

In short:
- make does its job very well.
- bash's popularity doesn't mean people will automatically adopt new
features. (Ever seen a shell script using "coproc" in the wild?)
- Reimplementing it is no mean feat.
- If you reimplement it, you just have make all over again, so just use
make.

If someone wants to build their project using waf or something instead,
that's their own prerogative. That kind of person would probably
overlook a native bash build system too, because I feel like there are a
lot of Python (/Ruby/etc.) programmers with a visceral disdain for shell
scripting. It'll take a lot to change that.

But I'm not related to the Bash project in any meaningful way, so
there's a chance that the regulars won't think the same.



signature.asc
Description: OpenPGP digital signature


Re: Could bash do what make does?

2016-11-28 Thread Robert Durkacz
make has survived all this time but it is not very well accepted today with
a lot of competing build systems trying to do better. bash is very secure
and moreover the Bourne shell was there first. make is falling out of
favour as far as I can see even though it has had a very good run:
Kernighan and Pike in their book on Unix said to use it in preference to
the shell for builds. That is the background to my asking was it really
necessary after all to do give up on the shell for doing builds?

On 29 November 2016 at 01:02, Eduardo Bustamante  wrote:

> Why should bash do what make already does?
>


Re: Could bash do what make does?

2016-11-28 Thread Dennis Williamson
On Sun, Nov 27, 2016 at 7:25 PM, Robert Durkacz 
wrote:

> Has thought been given, over the years, to extending bash to do
> what make does, in the obvious way that I am about to describe?
>
> It would be a matter of having chosen build commands do nothing if their
> outputs are newer than their inputs. For example that is, cc file.c -o
> file.o should execute normally if file.c is the newer file but do nothing
> if file.o is newer.
>
> Then you would have a deterministic script to build a system that simply
> skipped steps determined to be unnecessary.
>
> It is possible to achieve this without changing bash but it seems like
> there would be leverage in having bash deliberately support this mode.
>


Use the newer-than test:

source=file.c
object=file.o
[[ $source -nt $object ]] && cc "$source" -o "$object"


-- 
Visit serverfault.com to get your system administration questions answered.


Re: Could bash do what make does?

2016-11-28 Thread Eduardo Bustamante
Why should bash do what make already does?