Code Monkey home page Code Monkey logo

nqp-configure's Introduction

NAME

nqp-configure

DESCRIPTION

Provide support modules for NQP and Rakudo Configure.pl scripts.

Modules Provided

  • NQP::Config
  • NQP::Macros

SEE ALSO

LICENSE

You can use and distribute this module under the terms of the The Artistic License 2.0. See the LICENSE file included in this distribution for complete details.

nqp-configure's People

Contributors

patrickbkr avatar patzim avatar pmurias avatar prince213 avatar sumanstats avatar tyil avatar usev6 avatar vrurg avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nqp-configure's Issues

Cannot determine the brand of your nmake utility

I'm seeing the error below for about 50% of my appveyor builds. Appears to be incomplete stdout... can this potentially be fixed or is this just appveyor being weird?

+++ Compiling blib\CORE.d.setting.moarvm
The following step can take a long time, please be patient.
Stage start      :   0.000
Stage parse      :   0.552
Stage syntaxcheck:   0.001
Stage ast        :   0.001
Stage optimize   :   0.042
Stage mast       :   0.079
Stage mbc        :   0.003
+++ Generating gen\moar\BOOTSTRAP\v6e.nqp
+++ Compiling blib\Perl6\BOOTSTRAP\v6e.moarvm
+++ Compiling blib\CORE.e.setting.moarvm
===SORRY!===
  Cannot determine the brand of your nmake utility.
  It is reporting itself as:
  
  Microsoft (R) Program Mai at C:/projects/rakudo/3rdparty/nqp-configure/lib/NQP/Config.pm line 192.
 at C:/projects/rakudo/3rdparty/nqp-configure/lib/NQP/Config.pm line 34.
	NQP::Config::__ANON__("===SORRY!===\x{a}  Cannot determine the brand of your nmake utili"...) called at C:/projects/rakudo/3rdparty/nqp-configure/lib/NQP/Config.pm line 192
	NQP::Config::sorry(NQP::Config::Rakudo=HASH(0x1643e8), "Cannot determine the brand of your nmake utility.\x{a}It is repor"...) called at C:/projects/rakudo/3rdparty/nqp-configure/lib/NQP/Config.pm line 537
	NQP::Config::configure_commands(NQP::Config::Rakudo=HASH(0x1643e8)) called at C:\projects\rakudo\Configure.pl line 91
NMAKE : fatal error U1077: 'C:\strawberry\perl\bin\perl.exe' : return code '0xff'
Stop.
Command exited with code 2

The path functions assume Unix paths will work

In nfp it assumes that splitpath and splitdir will work with Unix paths. This is not guaranteed.
It happens to work only because File::Spec::Win32 inherits from File::Spec::Unix, and they are close enough.
(A small change to File::Spec::Win32 may break the existing code.)

sub nfp {
    my ( $vol, $dirs, $file ) = File::Spec->splitpath(shift); # <--
    return File::Spec->catpath( $vol,
        File::Spec->catdir( File::Spec->splitdir($dirs) ), $file ); # <--
}

It should really use File::Spec::Unix->split[path|dir].

sub nfp {
    my ( $vol, $dirs, $file ) = File::Spec::Unix->splitpath(shift);
    #                           ^--------- Unix ----------^
    #      v---- whatever ---v
    return File::Spec->catpath( $vol,
        File::Spec->catdir( File::Spec::Unix->splitdir($dirs) ), $file );
    #   ^--- whatever ---^  ^--------- Unix ---------^
}

Think of the above code as path.decode('Unix').encode($current-system).
The existing code would then be path.decode($current-system).encode($current-system), which is not correct.

File::Spec::Unix should be used anywhere it is assumed to be a Unix path, and File::Spec everywhere else.

With the above changes, it should work on any system we care to support in the future.
(The existing code will not work properly on MacOS Classic, and may not work on VMS.)


Also there is no reason to load File::Spec::Win32 because it will be loaded automatically if it needs to be.

Configure.pl failed to detect nmake

Sample output on a Simplified Chinese Windows 10 machine:

X:\Build\nqp-2020.05>chcp
活动代码页: 936

X:\Build\nqp-2020.05>perl ./Configure.pl --prefix X:/Prefix --relocatable --make-install --backends=moar --with-moar=X:/Prefix/bin/moar.exe
fatal: not in a git directory
fatal: not in a git directory
===SORRY!===
  Cannot determine the brand of your nmake utility.
  It is reporting itself as:

  Microsoft (R) 程序维护实用工具 14.25.28614.0 版
  版权所有 (C) Microsoft Corporation。  保留所有权利。

  用法:     NMAKE @commandfile
        NMAKE [选项] [/f makefile] [/x stderrfile] [macrodefs] [targets]

  选项:

  /A 生成所有已计算的目标
  /B 如果时间戳相等则生成
  /C 取消输出消息
  /D 显示生成消息
  /E 覆盖 env-var 宏
  /ERRORREPORT:{NONE|PROMPT|QUEUE|SEND} 向 Microsoft 报告错误
  /G 显示 !include 文件名
  /HELP 显示简短的用法消息
  /I 忽略命令中的退出代码
  /K 遇到错误时继续生成不相关的目标
  /N 显示命令但不执行
  /NOLOGO 取消显示版权信息
  /P 显示 NMAKE 信息
  /Q 检查时间戳但不生成
  /R 忽略预定义的规则/宏
  /S 取消显示已执行的命令
  /T 更改时间戳但不生成
  /U 转储内联文件
  /Y 禁用批处理模式
 at X:/Build/nqp-2020.05/3rdparty/nqp-configure/lib/NQP/Config.pm line 192.
 at X:/Build/nqp-2020.05/3rdparty/nqp-configure/lib/NQP/Config.pm line 34.
        NQP::Config::__ANON__("===SORRY!===\x{a}  Cannot determine the brand of your nmake utili"...) called at X:/Build/nqp-2020.05/3rdparty/nqp-configure/lib/NQP/Config.pm line 192
        NQP::Config::sorry(NQP::Config::NQP=HASH(0x2915634), "Cannot determine the brand of your nmake utility.\x{a}It is repor"...) called at X:/Build/nqp-2020.05/3rdparty/nqp-configure/lib/NQP/Config.pm line 537
        NQP::Config::configure_commands(NQP::Config::NQP=HASH(0x2915634)) called at ./Configure.pl line 79

NQP version: 2020.05

To reproduce, install a language pack (e.g. Chinese Simplified), change the code page of your console (936 for Chinese Simplified) and build NQP.

Should we simplify NQP::Config creation?

I think it would make sense to get rid of the tie and runtime NQP::Config::* subclass loading.
Any reasons why we want to keep that instead of using NQP::Config::Rakudo->new(...)?

LTA error message with invalid backend

$ perl Configure.pl --backends=nope
===ATTENTION===
  No --prefix supplied, building and installing to /Volumes/BUKKIT/Users/coke/sandbox/nqp/install
Unknown backend: 'nope'; Known backends: moar, jvm, js
 at /Volumes/BUKKIT/Users/coke/sandbox/nqp/3rdparty/nqp-configure/lib/NQP/Config.pm line 34.
	NQP::Config::__ANON__("Unknown backend: 'nope'; Known backends: moar, jvm, js\x{a}") called at /Volumes/BUKKIT/Users/coke/sandbox/nqp/tools/lib/NQP/Config/NQP.pm line 21
	NQP::Config::NQP::configure_backends(NQP::Config::NQP=HASH(0x7ffcd0020738)) called at Configure.pl line 82

Do we need the stack trace?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.