logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Building & Member Downloads View previous topic :: View next topic
Reply to topic   Topic: lineends.pl : Out of Memory [Solved]
Author
Carel



Joined: 13 Mar 2016
Posts: 3
Location: South Africa

PostPosted: Sun 13 Mar '16 13:11    Post subject: lineends.pl : Out of Memory [Solved] Reply with quote

Perhaps this is a Nubian issue but google has no knowledge of my queries...

When I extract the Apache HTTPD 2.4, APR, APR-util and APR-iconv (1.5) files into their prescribed locations and perform the command

Code:

perl srclib\apr\build\lineends.pl


I get an error or rather a message stating "Out of Memory". The machine I'm on behaves sluggish as my ram consumption maxes out and the final Apache.sln won't upgrade correctly nor compile as not all of the files are suitably converted.

Specifically perl uses up to 3 GIG of RAM before bourking. Considering the Apache install instructions recommend 200MB of compilation/Install space this seems excessive.

I'm using a Win 10 (AMD64) machine with MSVC2015 Community Edition and experience this with ActiveState's 64 and 32 bit version of Perl, Strawberries 64 bit version of Perl and Cygwin's . My Perl version is 5.22.1 in all cases. When I started this Active States Perl 4.X.Y was in play and also bourked. I believe I had the same problem six months ago when I last tried compiling HttpD 2.2. Perhaps I should switch to a newer /older version of Perl but if the 4.X.Y version bourked I don't see that it will help.

Has anyone else had trouble with this ? Is there perhaps a work around ?

If you're suffering from the same problem but have access to python the following script might be of assistance. Save it as eol.py in your apache source root folder e.g. if your source was extracted to C:\Apache\Src then save this as C:\Apache\Src\eol.py. One may then invoke it as follows :

Code:

python eol.py -r


It requires the docopt package

Code:

pip install docopt


Code:

#!/usr/bin/python
"""
Quickly convert the end of line characters in the files in a directory from
some unkown format to the local machine format.

Usage:
 eol.py [options] [PATH...]
 
Options:
 -h --help                  Show this screen
 -r --recurse               Control whether or not the subfolders are traversed
 -v --version               Shows the version number

Examples:
 eol.py -r %CD%
"""

import pathlib
import fnmatch
import pprint
import mimetypes

def _eol_(path) :
  mime = mimetypes.guess_type(str(path)) # not the best at type guessing
  if mime[0] == 'text/plain' :
    print("{0:52} {1:24} {2:8} ".format(str(path.parent), path.stem, path.suffix))
    with path.open(mode="r") as file :
      data = file.read()
    with path.open(mode="w", newline="\r\n") as file :
      file.write(data)

def eol(path, recurse=True, glob = [], filter=[], exclude= [], extentions = ['*.*']) :
 if   path.is_file() :
  print('OptOut')
  _eol_(path)
 else :
  for item in path.glob(glob) if glob else path.iterdir() :
   if any([fnmatch.fnmatch(str(item), pattern) for pattern in exclude]) :
    continue
   if recurse and item.is_dir() :
    print('folder : {}'.format(str(item)))
    eol(item, recurse=recurse, filter=filter, exclude=exclude)
   if item.is_file() :
    _eol_(item)

if __name__ == '__main__':
  from pprint import pprint
  import sys, os
  from docopt import docopt
  args = sys.argv[1:]
  print(args)
  args = args + ['-r']
  print(args)
  args = docopt(__doc__, args, version='EOL 0.0')
  if not args['PATH'] :
    args['PATH'].append(os.getcwd()) # pathlib.Path().cwd()
  print(args) 
  display = lambda path : "{0:24} {1:16} {2:8} ".format(str(path.parent), path.stem, path.suffix if path.is_file() else "Folder")
  [eol(pathlib.Path(path), recurse = args['--recurse'], glob = args['--glob']) for path in args['PATH']]


It does the same thing as lineends.pl


Last edited by Carel on Tue 15 Mar '16 22:47; edited 1 time in total
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Tue 15 Mar '16 19:21    Post subject: Reply with quote

You need at least perl 5.? to build apache.

I use 5.8 and 5.10 with both it works fine.
Back to top
Carel



Joined: 13 Mar 2016
Posts: 3
Location: South Africa

PostPosted: Tue 15 Mar '16 22:45    Post subject: Thanks Reply with quote

Thanks.

I'll downgrade to 5.8 if I can get it on Active State/Strawberry. I was fiddling further and found it seems to work alright if I don't have the APR stuff in Apache/srclib folder. Which is odd/interesting. In the interim I've had some success with the Python script. So I'll mark this as solved till I can confirm success with Perl 8/10

As a side note : I got Apache 2.2 to build from the win sources but Apache 2.4 seems really hard to compile from the sources made available by Apache. Is there perhaps a more in depth guide/explanation on building with MSVC 2015 then what the Apache pages offer ? Can one cross compile from linux/cygwin targeting windows ? I'll start posting here when I'm really stuck still trying to get my feet wet for now and see what google offers.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Wed 16 Mar '16 10:45    Post subject: Reply with quote

The sources are the same.

the build steps are

command line
cd C:\build\2.4.x
srclib\apr\build\lineends.pl
srclib\apr\build\cvtdsp.pl -2005


cd srclib\zlib
nmake -f win32/Makefile.msc LOC="-DASMV -DASMINF -I." OBJA="inffas32.obj match686.obj"
MT -manifest zlib1.dll.manifest -outputresource:zlib1.dll;2

cd ..\..\srclib\openssl
perl Configure VC-WIN32 --prefix=/Apache24 --openssldir=/Apache24/conf disable-idea
ms\do_nasm
nmake /f ms\ntdll.mak


Open Apache.dsw with VS8/VS9/VS11 and answer "Yes to All" to the "convert projects" question
Select relase win32

Now build InstallBin
Back to top


Reply to topic   Topic: lineends.pl : Out of Memory [Solved] View previous topic :: View next topic
Post new topic   Forum Index -> Building & Member Downloads