cloud-mta-build-tool icon indicating copy to clipboard operation
cloud-mta-build-tool copied to clipboard

MBT tool does not work properly under Cygwin

Open oboguev opened this issue 3 years ago • 0 comments

The build happens without error messages, but MTAR file is not created in a proper directory. Also directories mta_archives and .cloud-cap-samples-java_mta_build_tmp are not created at a proper location.

This had been verified by two developers on two different machines.

Last MBT messages are

[2022-06-18 01:55:40]  INFO running the "after-all" build...
[2022-06-18 01:55:41]  INFO generating the metadata...
[2022-06-18 01:55:41]  INFO generating the "C:\cygdrive\c\xxx\cloud-cap-samples-java\.cloud-cap-samples-java_mta_build_tmp\META-INF\mtad.yaml" file...
[2022-06-18 01:55:43]  INFO generating the MTA archive...
[2022-06-18 01:55:48]  INFO the MTA archive generated at: \cygdrive\c\xxx\cloud-cap-samples-java\mta_archives\bookshop-mt_1.0.0.mtar

Instead of creating C:\xxx\cloud-cap-samples-java\mta_archives\bookshop-mt_1.0.0.mtar MBT creates C:\cygdrive\c\xxx\cloud-cap-samples-java\mta_archives\bookshop-mt_1.0.0.mtar

Environment:

Windows 10. MBT is installed via npm.

mbt --version
Cloud MTA Build Tool version 1.2.18

make --version
GNU Make 4.3
Built for x86_64-pc-cygwin

bash --version
GNU bash, version 4.4.12(3)-release (x86_64-unknown-cygwin)

node --version
v16.15.0

npm -version
8.12.1

Steps to reproduce:

npm i -g @sap/cds-dk
npm install -g mbt
git clone https://github.com/SAP-samples/cloud-cap-samples-java
cd cloud-cap-samples-java
mv mta-single-tenant.yaml mta.yaml
mbt build

Alternatively, instead of "mbt build", the sequence of

mbt init
make --trace -f Makefile.mta p=cf mtar

also leads to the same result.

A possible contributing cause is that behind the scenes Cygwin make utility uses the cygdrive notation. E.g.

mbt module build -m=bookshop-mt-srv -p=cf -t="/cygdrive/c/xxx/cloud-cap-samples-java"
mbt module build -m=bookshop-mt-sidecar -p=cf -t="/cygdrive/c/xxx/cloud-cap-samples-java"
mbt module build -m=bookshop-mt-app -p=cf -t="/cygdrive/c/xxx/cloud-cap-samples-java"
mbt project build -p=post -t="/cygdrive/c/xxx/cloud-cap-samples-java"
mbt gen meta -p=cf -t="/cygdrive/c/xxx/cloud-cap-samples-java"
mbt gen mtar --mtar="*" --target_provided=false -t="/cygdrive/c/xxx/cloud-cap-samples-java"

As a workaround,

mbt init
make --trace -f Makefile.mta p=cf t=. mtar

appears to work, except it creates the MTAR file in the project directory, rather than under mta_archives.

oboguev avatar Jun 18 '22 09:06 oboguev