How to build ICU4C 70.1 on HP UX platform? - unique-ptr

I want to build ICU4C code for HP UX platform .
ICU4C repo -> https://github.com/unicode-org/icu/tree/release-70-1.
HP-UX version that i am using -
HP-UX B.11.31 U ia64 ,
aCC compiler version that i am using -
HP C/aC++ B3910B A.06.29
I tried +std=c++11 and -AA option with aCC like ->
aCC -DU_ATTRIBUTE_DEPRECATED= -D_REENTRANT -D_THREAD_SAFE -DU_HAVE_ELF_H=1 -DU_HAVE_STRTOD_L=0 -I../common +std=c++11 -w +O2 +Ofltacc +check=stack -AA +DD64 -mt -AA -Wc,-ansi_for_scope,on +W740 +W749 +W823 +W4232 -DVXPSP_CCFLAGS -c +Z -o stubdata.o stubdata.cpp
But when i am building stubdata.cpp file from icu stubdata project its giving me error related to unique_ptr as -
"../common/unicode/localpointer.h", line 238: error #2283: qualified name is not allowed explicit LocalPointer(std::unique_ptr<T> &&p)
"../common/unicode/localpointer.h", line 238: error #2018: expected a ")"
explicit LocalPointer(std::unique_ptr<T> &&p)
^
"../common/unicode/localpointer.h", line 239: error #2028: expression must
have a constant value
: LocalPointerBase<T>(p.release()) {}
^
"../common/unicode/localpointer.h", line 238: error #2771: "explicit" is not
allowed
explicit LocalPointer(std::unique_ptr<T> &&p)
^
"../common/unicode/localpointer.h", line 239: error #2065: expected a ";"
: LocalPointerBase<T>(p.release()) {}
^
"../common/unicode/localpointer.h", line 413: error #2283: qualified name is
not allowed
explicit LocalArray(std::unique_ptr<T[]> &&p)
^
"../common/unicode/localpointer.h", line 413: error #2018: expected a ")"
explicit LocalArray(std::unique_ptr<T[]> &&p)
^
"../common/unicode/localpointer.h", line 414: error #2028: expression must
have a constant value
: LocalPointerBase<T>(p.release()) {}
^
"../common/unicode/localpointer.h", line 413: error #2771: "explicit" is not
allowed
explicit LocalArray(std::unique_ptr<T[]> &&p)
^
"../common/unicode/localpointer.h", line 414: error #2065: expected a ";"
: LocalPointerBase<T>(p.release()) {}
^
"../common/unicode/udata.h", line 434: error #2283: qualified name is not
allowed
U_DEFINE_LOCAL_OPEN_POINTER(LocalUDataMemoryPointer, UDataMemory, udata_close);
^
"../common/unicode/udata.h", line 434: error #2018: expected a ")"
U_DEFINE_LOCAL_OPEN_POINTER(LocalUDataMemoryPointer, UDataMemory, udata_close);
^
"../common/unicode/udata.h", line 434: error #2040: expected an identifier
U_DEFINE_LOCAL_OPEN_POINTER(LocalUDataMemoryPointer, UDataMemory, udata_close);
^
"../common/unicode/udata.h", line 434: error #2079: expected a type specifier
U_DEFINE_LOCAL_OPEN_POINTER(LocalUDataMemoryPointer, UDataMemory, udata_close);
^
"../common/unicode/udata.h", line 434: error #2771: "explicit" is not allowed
U_DEFINE_LOCAL_OPEN_POINTER(LocalUDataMemoryPointer, UDataMemory, udata_close);
^
"../common/unicode/udata.h", line 434: error #2065: expected a ";"
U_DEFINE_LOCAL_OPEN_POINTER(LocalUDataMemoryPointer, UDataMemory, udata_close);
^
16 errors detected in the compilation of "stubdata.cpp".
It seems like aCC compiler don't have support for this C++ 11 feature unique_ptr .
Also i tried to run a sample standalone program having unique_ptr , but its not able to compile . Whereas other c++11 features like nullptr / range based for loop etc are compiled with aCC compiler on HP .
Any suggestions?

Related

Preg_match(): missing closing parenthesis

A plugin is generating the following error:
Got error 'PHP message: PHP Warning: preg_match(): Compilation failed: missing closing parenthesis at offset 946 - DeferJS.php on line 78
The line of code that generates the error:
if ( preg_match( '#(' . $exclude_defer_js . ')#i', $tag['url'] ) ) {
Thanks for any help
$exclude_defer_js must contain special characters.
Use preg_quote:
if ( preg_match( '#' . preg_quote($exclude_defer_js, '#') . '#i', $tag['url'] ) ) {

Jmeter test in Jenkins fails with "errorlevel=255" error

I am trying to run jmeter test from windows command line using Jenkins and getting an error at build step. The error is:
" errorlevel=255 Press any key to continue . . . Build step 'Execute Windows batch command' marked build as failure"
The executable windows batch command is:
C:\Ankush\PerformanceTesting\apache-jmeter-3.3\apache-jmeter-
3.3\bin\jmeter.bat -Jjmeter.save.saveservice.output_format=csv -n -t
C:\Users\a.panday\git\performance-tests\dwp.jmx -l
C:\Ankush\PerformanceTesting\Results\Test.csv -j test_local.log ^
-JthinkTime=500 ^
-JthreadDelay=1000 ^
-Jdwpserver= abc.bac.com^
-Juserid= abc ^
-Jpassword= abc ^
-Jprotocol=https ^
-Jtc1RenewalsSelectionCriteriaEndDateFrom= ^
-Jtc1RenewalsSelectionCriteriaEndDateTo= ^
-JtimeOutInSecondsForPassiveRenewalsTC1Jobs= ^
-JdelayInMilisecondsBeforeCheckingOrdersInJbillingForTC1PR= ^
-Jrampup=2 ^
-Jloopcount=1 ^
-Jrenewalthread=0 ^
-Jtest_load_Account_screen=1 ^
-Jtest_load_List_of_contracts_sales_marketing_menu=1 ^
-Jtest_load_List_of_contracts_contract_switching_menu=1 ^
-Jtest_load_List_of_contracts_contract_switching_menu_filtered=1 ^
-Jtest_load_List_quotes_sales_marketing_menu=1 ^
-Jtest_load_List_quotes_sales_marketing_menu_filtered=1 ^
-Jtest_load_account_cockpit_billing_And_InvoiceDetails=1 ^
-Jtest_load_Contract_details_page=1 ^
-Jtest_load_Quote_details_page=1 ^
-Jtest_load_creation_and_saving_of_a_guidance_flow=1 ^
-Jtest_load_creation_of_a_quote_cqfa=1 ^
-Jtest_load_determine_quote_price=1 ^
-Jtest_load_creation_of_a_case=1 ^
-Jtest_load_creation_and_saving_of_a_guidance_flow_B2C=1 ^
-Jtest_load_market_transaction_screen=1 ^
-Jtest_load_market_transaction_task_screen=1 ^
-Jtest_load_market_transaction_filter_ean_screen=1 ^
-Jtest_load_market_transaction_filter_account_screen=1 ^
-Jtest_load_market_transaction_filter_status_screen=1 ^
-Jtest_load_market_transaction_task_filter_ean_screen=1 ^
-Jtest_load_market_transaction_task_filter_account_screen=1 ^
-Jtest_load_market_transaction_task_filter_status_screen=1 ^
-Jtest_load_market_transaction_task_restart=1 ^
-Jjmeter.save.saveservice.bytes=true ^
-Jjmeter.save.saveservice.label=true ^
-Jjmeter.save.saveservice.latency=true ^
-Jjmeter.save.saveservice.response_code=true ^
-Jjmeter.save.saveservice.response_message=true ^
-Jjmeter.save.saveservice.successful=true ^
-Jjmeter.save.saveservice.thread_counts=true ^
-Jjmeter.save.saveservice.thread_name=true ^
-Jjmeter.save.saveservice.time=true ^
-Jjmeter.save.saveservice.connect_time=true ^
-Jjmeter.save.saveservice.timestamp_format="yyyy/MM/dd HH:mm:ss"`
The above command is running fine in windows command line perfectly but giving the stated error while building in Jenkins.
Any help is appreciated.
If you notice you have spaces between = sign and property value
-Jdwpserver=SPACEabc.bac.com^
You such space which prevent JMeter execution in the following properties:
-Jdwpserver= abc.bac.com^
-Juserid= abc ^
-Jpassword= abc ^
-Jtc1RenewalsSelectionCriteriaEndDateFrom= ^
-Jtc1RenewalsSelectionCriteriaEndDateTo= ^
-JtimeOutInSecondsForPassiveRenewalsTC1Jobs= ^
-JdelayInMilisecondsBeforeCheckingOrdersInJbillingForTC1PR= ^
Just remove the spaces and it will work

Laravel 5.3.19 Illuminate\Support\Str::class error syntax error, unexpected ';'

I got error when i use Str from Alliases
Aliases Declaration:
'Str' => Illuminate\Support\Str::class,
Usages:
<p>{{ Str::limit($notice->description,100)}}</p>
Error Type:
FatalErrorException in aae7b22b68f86ae3874e1bac917a810813cbf059.php line 380: syntax error, unexpected ';'

PHP phar install on FreeBSD (phar.so not found)

Dedicated server -
FreeBSD 8.2 -
amd64 -
Apache/2.2.21 -
PHP/5.3.9
I am trying of install the dependency manager for php composer, but composer needs the extension "phar".
Try
curl -sS https://getcomposer.org/installer | php
Get
The phar extension is missing.
Install it or recompile php without --disable-phar
In php.ini and extensions.ini extension=phar.so not found. Add line, but file search phar.so has not brought results.
php -i and php -m show extension phar not installed
Try
cd /usr/ports/archivers/php53-phar && make install clean
Get
php53-phar: No such file or directory
I think command portsnap fetch update delete old /usr/ports/archivers/php53-phar directory
Try
cd /usr/ports/archivers/php5-phar && make install clean
Get meny errors like
Unknown modifier 't'
Unknown modifier 't'
"/usr/ports/Mk/bsd.php.mk", line 267: Malformed conditional (defined(_POSTMKINCLUDED) && ${USE_PHP:tl} != "yes") "/usr/ports/archivers/php5-phar/../../lang/php5/Makefile", line 208: if-less endif Unknown modifier 't'
Unknown modifier 't'
Unknown modifier 't'
Unknown modifier 't'
"/usr/ports/Mk/bsd.php.mk", line 267: Malformed conditional (defined(_POSTMKINCLUDED) && ${USE_PHP:tl} != "yes") Unknown modifier 't'
Unknown modifier 't'
Unknown modifier 't'
Unknown modifier 't'
Unknown modifier 't'
Unknown modifier 't'
"/usr/ports/Mk/bsd.sites.mk", line 1049: Malformed conditional (!empty(_PERL_CPAN_ID) && ${_PERL_CPAN_FLAG:tl} == "cpan") Unknown modifier 't'
Unknown modifier 't'
Unknown modifier 't'
"/usr/ports/Mk/bsd.port.mk", line 2948: warning: Missing closing parenthesis for defined() Unknown modifier 't'
"/usr/ports/Mk/bsd.port.mk", line 2948: Malformed conditional (((!defined(OPTIONS_DEFINE) && !defined(OPTIONS_SINGLE) && !defined(OPTIONS_MULTI)) && !defined(OPTIONS_GROUP) && !defined(OPTIONS_RADIO) || defined(CONFIG_DONE_${PKGBASE:tu}) || defined(PACKAGE_BUILDING) || defined(BATCH))) "/usr/ports/Mk/bsd.port.mk", line 2950: if-less endif Unknown modifier 't'
Unknown modifier 't'
Unknown modifier 't'
Unknown modifier 't'
Unknown modifier 't'
Unknown modifier 't'
Unknown modifier 't'
Unknown modifier 't'
Unknown modifier '-'
"/usr/ports/Mk/bsd.port.mk", line 4358: Need an operator Unknown modifier '-'
"/usr/ports/Mk/bsd.port.mk", line 4358: Need an operator Unknown modifier '-'
"/usr/ports/Mk/bsd.port.mk", line 4358: Need an operator Unknown modifier '-'
"/usr/ports/Mk/bsd.port.mk", line 4358: Need an operator Unknown modifier '-'
"/usr/ports/Mk/bsd.port.mk", line 4358: Need an operator Unknown modifier '-'
"/usr/ports/Mk/bsd.port.mk", line 4358: Need an operator Unknown modifier '-'
"/usr/ports/Mk/bsd.port.mk", line 4358: Need an operator Unknown modifier '-'
"/usr/ports/Mk/bsd.port.mk", line 4358: Need an operator Unknown modifier 't'
Unknown modifier 't'
"/usr/ports/Mk/bsd.port.mk", line 4903: warning: Missing closing parenthesis for target() "/usr/ports/Mk/bsd.port.mk", line 4903: warning: Missing closing parenthesis for target() Unknown modifier 't'
Unknown modifier 't'
Unknown modifier 't'
Unknown modifier 't'
Unknown modifier 't'
Unknown modifier 't'
Unknown modifier 't'
Unknown modifier 't'
Unknown modifier 't'
8 open conditionals:
at line 5785 (evaluated to true)
at line 5785 (evaluated to true)
at line 5785 (evaluated to true)
at line 5785 (evaluated to true)
at line 5785 (evaluated to true)
at line 5785 (evaluated to true)
at line 4903 (evaluated to true)
at line 4903 (evaluated to true) make: fatal errors encountered -- cannot continue
This version for PHP 5.4?
How do I install the phar extension on PHP 5.3.9?
PHP 5.3 isn't officially supported in FreeBSD ports anymore, as well as FreeBSD 8.x itself.
Your options are:
Obtain ports tree for FreeBSD 8.x. portsnap won't do, use svn to
checkout FreeBSD ports tree on right branch/revision.
Compile phar from source. As this is just extension, it shouldn't be
too hard.

power-shell script in chef keeps being recognized as ruby code

The initial problem I Was trying to solve was that chefDK version of ruby wasn't showing up because it was at the end of the PATH environmental variable, so I have created a block of code to check and then add if it doesn't find it.
powershell_script "add_chefdk_bin_to_shell" do
code '$oldPath=(Get-ItemProperty -Path \'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment\' -Name PATH).Path
$newPath= \'C:\opscode\chefdk\embedded\bin;\' + $oldPath
Set-ItemProperty -Path \'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment\' -Name PATH –Value $newPath
'
only_if { `powershell $a = $Env:Path; $a -match 'C:\\opscode\\chefdk\\embedded\\bin'` == "False" }
end
Except when berk shelf runs (to publish the chef cookbook to our chef server) it spits out this error:
**E, [2014-10-24T11:33:55.771484 #2916] ERROR -- : Cookbook file recipes/install.rb has a ruby syntax error:
E, [2014-10-24T11:33:55.771484 #2916] ERROR -- : c:/path/to/cookbook/root/recipes/install.rb:25: invalid multibyte char (US-ASCII)
E, [2014-10-24T11:33:55.771484 #2916] ERROR -- : c:/path/to/cookbook/root/recipes/install.rb:23: invalid multibyte char (US-ASCII)
E, [2014-10-24T11:33:55.771484 #2916] ERROR -- : c:/path/to/cookbook/root/recipes/install.rb:23: syntax error, unexpected $end, expecting keyword_end
E, [2014-10-24T11:33:55.771484 #2916] ERROR -- : ...ger\Environment\' -Name PATH –Value $newPath
E, [2014-10-24T11:33:55.771484 #2916] ERROR -- : ... ^
E, [2014-10-24T11:33:55.771484 #2916] ERROR -- : Ridley::Errors::CookbookSyntaxError: Invalid ruby files in cookbook: gg-web-opsboard (1.0.177).**
This is very-much beginning to frustrate me, I'm only doing this in the first place because chefDK isn't being used as the default ruby (which is screwing a bunch of other stuff up).
There is a secondary issue, if I look at the path, I can clearly see C:\opscode\chefdk\embedded\bin at the end, so why does:
powershell $a = $Env:Path; $a -match 'C:\\opscode\\chefdk\\embedded\\bin'
Register as false?
EDIT:
I tried what #acro444 said but I'm still getting errors:
E, [2014-10-24T12:36:15.642147 #1932] ERROR -- : Cookbook file recipes/install.rb has a ruby syntax error:
E, [2014-10-24T12:36:15.642147 #1932] ERROR -- : c:/path/to/cookbook/root/recipes/install.rb:24: Invalid escape character syntax
E, [2014-10-24T12:36:15.642147 #1932] ERROR -- : ...ry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Sess...
E, [2014-10-24T12:36:15.642147 #1932] ERROR -- : ... ^
E, [2014-10-24T12:36:15.642147 #1932] ERROR -- : c:/path/to/cookbook/root/recipes/recipes/install.rb:24: Invalid escape character syntax
E, [2014-10-24T12:36:15.642147 #1932] ERROR -- : ...HINE\System\CurrentControlSet\Control\Session Manager\Enviro...
E, [2014-10-24T12:36:15.642147 #1932] ERROR -- : ... ^
E, [2014-10-24T12:36:15.642147 #1932] ERROR -- : c:/path/to/cookbook/root/recipes/recipes/install.rb:26: Invalid escape character syntax
E, [2014-10-24T12:36:15.642147 #1932] ERROR -- : ...ry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Sess...
E, [2014-10-24T12:36:15.642147 #1932] ERROR -- : ... ^
E, [2014-10-24T12:36:15.642147 #1932] ERROR -- : c:/path/to/cookbook/root/recipes/install.rb:26: Invalid escape character syntax
E, [2014-10-24T12:36:15.642147 #1932] ERROR -- : ...HINE\System\CurrentControlSet\Control\Session Manager\Enviro...
E, [2014-10-24T12:36:15.642147 #1932] ERROR -- : ... ^
E, [2014-10-24T12:36:15.642147 #1932] ERROR -- : c:/path/to/cookbook/root/recipes/install.rb:26: invalid multibyte char (US-ASCII)
E, [2014-10-24T12:36:15.642147 #1932] ERROR -- : c:/path/to/cookbook/root/recipes/install.rb:23: syntax error, unexpected $end, expecting tSTRING_CONTENT or tSTRING_DBEG or tSTRING_DVAR or tSTRING_END
I did the quadruple backslash escapething you did on all the backslashes and that reduced the error to just :
syntax error, unexpected $end, expecting tSTRING_CONTENT or tSTRING_DBEG or tSTRING_DVAR or tSTRING_END
I removed all trailing white space but that didn't fix it, currently my herdoc looks like:
code <<-EOF
$oldPath=(Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\\\\System\\\\CurrentControlSet\\\\Control\\\\Session Manager\\\\Environment' -Name PATH).Path
$newPath='C:\\\\opscode\\\\chefdk\\\\embedded\\\\bin;' + $oldPath
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\\\\System\\\\CurrentControlSet\\\\Control\\\\Session Manager\\\\Environment' -Name PATH –Value $newPath
EOF
If you want, you can skip the guard block, and move some of the operation to ruby like this:
ruby_block "chefdk_path_check" do
block do
current_path = ENV['PATH'].split(';')
chefdk_path = 'C:\\opscode\\chefdk\\embedded\\bin'
current_path.delete_if { |path| path == chefdk_path }
new_path = current_path.unshift(chefdk_path)
`Powershell -Command Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Session Manager\\Environment' -Name PATH –Value '#{new_path}'`
end
end
This will check every time, remove any existing entry (if it is in the wrong position in the path), and add the desired entry to the beginning. No duplicates and a lot less escaping to worry about!
Try structuring the block as follows:
powershell_script "add_chefdk_bin_to_shell" do
code <<-EOF
$oldPath=(Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).Path
$newPath='C:\opscode\chefdk\embedded\bin;' + $oldPath
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH –Value $newPath
EOF
only_if { `powershell -command "$Env:Path -match 'C:\\\\opscode\\\\chefdk\\\\embedded\\\\bin'".strip }` == "False"
end
Your only_if guard has a couple of problems. Firstly, powershell itself requires the paths to be escaped - \\, therefore you need to double escape in the ruby command.
Secondly, the condition will never be met because the powershell command also includes the newline character on the end of the string, and you weren't matching for that. Hence add the strip to the end of the command. You can test that using irb:
irb> `powershell -command "$Env:Path -match 'C:\\\\opscode\\\\chefdk\\\\embedded\\\\bin'"`
=> "True\n"
You may even be able to swap out the guard as it's written altogether and use the built in interpreter:
guard_interpreter :powershell_script
not_if "$Env:Path -match 'C:\\\\opscode\\\\chefdk\\\\embedded\\\\bin'"
Have a good read of this link.

Resources