Building of native image fails if `ant `clobber` has been called
sophie-kaleba opened this issue · 3 comments
Linux-only (I assume)
A call to ant native
after an ant clobber
makes the build fail with the following error:
native:
[exec] Error: Invalid Path entry /home/sopi/Documents/Experiments/SOMns/libs/truffle/substratevm/mxbuild/linux-amd64/SVM_HOSTED_NATIVE/linux-amd64
[exec] Caused by: java.nio.file.NoSuchFileException: /home/sopi/Documents/Experiments/SOMns/libs/truffle/substratevm/mxbuild/linux-amd64/SVM_HOSTED_NATIVE/linux-amd64
[exec]
BUILD FAILED
/home/sopi/Documents/Experiments/SOMns/build.xml:544: exec returned: 1
The directory SVM_HOSTED_NATIVE
is indeed missing. It is usually generated by a call to mx build
in the substratevm directory.
it comes from a change made on the dev
branch (the clobber
command actually cleans the truffle build, along with this directory) - I assume a call to mx build
for the substratevm is missing somewhere, that or clobber
is being overzealous.
Hm, perhaps we miss a target that does that for svm.
Perhaps based on the one for truffle-libs
: https://github.com/smarr/SOMns/blob/dev/build.xml#L158
Actually, this line in the truffle-libs
target <arg value="--no-native" unless:true="${build.native}" />
seems to prevent the build of the substratevm (see https://github.com/smarr/SOMns/blob/dev/build.xml#L164). Though I don't know why a first call to ant native
does not raise the same issue.
Setting the value of build.native to true fixes the issue (ant -Dbuild.native=true native
). But setting this value directly from the native target seems to be a pain because of the dependencies - I'll add a new target soon