[FeatureRequest] Allow building in non-HG repositories.

Bernhard Urban bernhard.urban at jku.at
Mon Mar 24 09:47:44 UTC 2014


Hi Stefan,

thanks, that's a good point!  However I think you should not try to read
the .hgtags file manually, unless you implement the semantics of it.  For
example, if you delete a tag, there'll be two entries in .hgtags (one for
creation and one for removal).  Also, what if there is no .hgtags file?

Therefore if `hg tags' fails, we should just not set USER_RELEASE_SUFFIX.
 I'll push a fix.


Thanks,
Bernhard



On Fri, Mar 21, 2014 at 5:21 PM, Stefan Marr <java at stefan-marr.de> wrote:

> Hi:
>
> For a while, I have the work-around below in my copy of the Graal
> repository to enable building in a git-based environment.
>
> Would it be possible to integrate something along those lines?
> I guess, currently it is also not possible to build graal without errors
> from a simple source tarball.
> For me, upstreaming this would make it easier to test against the latest
> version of Graal.
>
> Thanks
> Stefan
>
>
> diff --git a/mx/mx_graal.py b/mx/mx_graal.py
> index fb258fc..73cccfd 100644
> --- a/mx/mx_graal.py
> +++ b/mx/mx_graal.py
> @@ -647,7 +647,11 @@ def build(args, vm=None):
>              env.setdefault('ALT_BOOTDIR', mx.java().jdk)
>
>              # extract latest release tag for graal
> -            tags = [x.split(' ')[0] for x in
> subprocess.check_output(['hg', 'tags']).split('\n') if
> x.startswith("graal-")]
> +            try:
> +                tags = [x.split(' ')[0] for x in
> subprocess.check_output(['hg', 'tags']).split('\n') if
> x.startswith("graal-")]
> +            except (subprocess.CalledProcessError, OSError):
> +                with open('.hgtags') as f:
> +                    tags = [x.split(' ')[0] for x in f.readlines() if
> x.startswith("graal-")]
>              if tags:
>                  # extract the most recent tag
>                  tag = sorted(tags, key=lambda e: [int(x) for x in
> e[len("graal-"):].split('.')], reverse=True)[0]
>
>
>
> --
> Stefan Marr
> INRIA Lille - Nord Europe
> http://stefan-marr.de/research/
>
>
>
>


More information about the graal-dev mailing list