Re: How to expand environment variable in compilation command?

Ilja Honkonen <[email protected]>
Newsgroups gmane.comp.file-systems.zero-install.devel
Message-ID <[email protected]>
> <for-each> needs to go inside <runner> or <command>. e.g.
> <runner interface='http://repo.roscidus.com/e/e-core'>
>    <arg>-cpa</arg>
>    <arg>$SWT_JAR</arg>
>    <for-each item-from="EXTRA_E_OPTIONS" separator=" ">
>      <arg>${item}</arg>
>    </for-each>
> </runner>

It doesn't seem to do anything inside a compile command:

<?xml version="1.0" ?>
<interface
   xmlns = 'http://zero-install.sourceforge.net/2004/injector/interface'
   xmlns:compile = 
'http://zero-install.sourceforge.net/2006/namespaces/0compile'
 >
   <name>test</name>
   <summary>test</summary>
   <implementation id = '.' local-path = '.' version = '0.2' arch = '*-src'>
     <command name = 'compile' shell-command = 'c++ $SRCDIR/test.cpp -o 
$DISTDIR/test'>
       <for-each item-from = 'CPPFLAGS'><arg>-I ${item}</arg></for-each>
       <compile:implementation arch = '*-*'>
         <command name = 'test' path = 'test'></command>
         <command name = 'run' path = 'test'></command>
       </compile:implementation>
     </command>
     <requires interface = '../boost/boost.xml'>
       <environment name = 'CPPFLAGS' insert = 'include' mode = 
'append'></environment>
     </requires>
   </implementation>
</interface>


0compile autocompile test.xml
WARNING:root:Error setting locale (eg. Invalid locale)
================== /Users/iljah/0inst-test/test/test.xml ===================

Selecting versions for test...
Selection done.

Plan:

- test: Compile 0.2 (.)
   - boost: Use existing binary 1.59.0 (Darwin-x86_64)

No dependencies need compiling... compile test itself...
WARNING:root:Error setting locale (eg. Invalid locale)
TMPDIR=/var/folders/ff/m6cylxhd2csdz9fh62g3djtm0000gq/T/0compile-lUsS8x
WARNING:root:Error setting locale (eg. Invalid locale)
Note: source /Users/iljah/0inst-test/test/test.xml is a local feed
BUILDDIR=/private/var/folders/ff/m6cylxhd2csdz9fh62g3djtm0000gq/T/0compile-h82wkZ/build
DISTDIR=/private/var/folders/ff/m6cylxhd2csdz9fh62g3djtm0000gq/T/0compile-h82wkZ/test-any-any
SRCDIR=/Users/iljah/0inst-test/test
BINARYFEED=/private/var/folders/ff/m6cylxhd2csdz9fh62g3djtm0000gq/T/0compile-h82wkZ/test-any-any/0install/feed.xml
cd 
/private/var/folders/ff/m6cylxhd2csdz9fh62g3djtm0000gq/T/0compile-h82wkZ/build
CPPFLAGS=/Users/iljah/.local/share/0install.net/site-packages/file/Users__iljah__0inst-test__boost__boost.xml/1.59.0-x86_64/include
Executing: c++ $SRCDIR/test.cpp -o $DISTDIR/test []
/Users/iljah/0inst-test/test/test.cpp:1:10: fatal error: 
'boost/array.hpp' file not found
#include "boost/array.hpp"
          ^
1 error generated.
Command '['/bin/sh', '-c', u'c++ $SRCDIR/test.cpp -o $DISTDIR/test 
"$@"', '-']': Build failed with exit code 1
Command failed with exit status 1

Build failed: leaving build directory 
/var/folders/ff/m6cylxhd2csdz9fh62g3djtm0000gq/T/0compile-h82wkZ for 
inspection...

Command 
'['/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python', 
'/Users/iljah/.cache/0install.net/implementations/sha256new_JVBP6RCR3JVWBOBYLB7HOYFDV2FXGMUPDW4GCMZY7U2KHVUFFWYA/0compile', 
'build']' returned non-zero exit status 1


------------------------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.