lix-pm / lix.client

A dependable package manager for your Haxe projects
The Unlicense
119 stars 24 forks source link

`lix dev` vs relative paths #125

Open Gama11 opened 4 years ago

Gama11 commented 4 years ago

The behavior of lix dev with relative paths seems a bit strange / potentially buggy.

Scenario: https://github.com/vshaxe/haxe-test-adapter has a main project / lix scope in the root, and then a few subprojects in samples/. It also contains a Haxelib that I've tried installing with lix dev test-adapter test-adapter.

However, if you then cd to one of the subprojects and try to build it, you'll get errors since it tries to resolve the relative -cp against the current working directory, rather than the root directory that contains the scope. So for CI I've had to resort to this hack:

https://github.com/vshaxe/haxe-test-adapter/blob/88f71015792cab78696a3ff8c0fed7b26269d892/.github/workflows/main.yml#L28

Not sure if this is an issue with lix dev or if I'm doing something I shouldn't. Should lix dev maybe automatically convert all relative paths to absolute ones?

Gama11 commented 4 years ago

On second thought, supporting relative paths in lix dev is a nice feature since it allows you to commit the dependency HXML. So it would be preferable if the path was resolved against the correct directory.

Gama11 commented 4 years ago

Hm, are you sure this works now? I get the following hxml for npx lix dev test-adapter test-adapter with lix 15.9.0:

-lib json2object
-cp test-adapter
-D test-adapter=1.2.8
${SCOPE_DIR}/test-adapter/extraParams.hxml
--macro Sys.println("haxe_libraries/test-adapter.hxml:3: [Warning] Using dev version of library test-adapter")

Which again leads to classpath test-adapter is not a directory or cannot be read from on CI.

I guess it would have to be -cp ${SCOPE_DIR}/test-adapter, like ${SCOPE_DIR}/test-adapter/extraParams.hxml?

back2dos commented 4 years ago

Will check tomorrow ;)