Closed xvrh closed 6 years ago
This is definitely now a big issue, now than dart 1.20 is out with no symlink by default. The workaround for now is to do pub get --packages-dir
first in the server project
Also having this problem. Any workarounds yet (apart from --packages-dir
)? Now that 1.20.1
is out, the default is to exclude the packages dir.
We're now at dart version 1.24.x
and I'm afraid that the --packages-dir
will be removed soon and we won't be able to upgrade because of this dependency. Is there any news regarding this issue or plans on how to fix it?
@mkustermann I guess that you would know?
I've got a workaround, if you enable the discovery document generation on your RPC server you can just download the JSON from your server. This doesn't lend well to continuous integration, but it gets the job done until they've got this worked out. Check the readme file, search for "ApiServer.enableDiscoveryApi()".
Thanks @sanmadjack. Unfortunately we really need it in our CI, so we can't go this route.
You can, just in your CI environment start the server (or start a subset of the server with the generator enabled), and then use curl (or platform equivalent) to fetch the json file, then continue processing as normal.
For info, I worked around this bug simply by forking the repo and remove the pub check:
https://github.com/xavierhainaux/rpc/commit/bcd774caa31cf6d91a6f2a54243d86a971935ca4
@xavierhainaux Is it a good enough change for a pull request?
@sanmadjack I don't know, it works for my usage. I guess there is some limitation or the check would not have been there.
It looks like this was already fixed, in https://github.com/dart-lang/rpc/commit/c658881841fe311ebb0629276cdec53b91a8c847.
I think we just need to push a new release. In the meantime, you should be able to add a dependency override to get the latest code from github (https://www.dartlang.org/tools/pub/dependencies#git-packages):
dependency_overrides:
rpc:
git: git://github.com/dart-lang/rpc.git
@mkustermann could you publish a new release, please?
Sorry for the delay, I've published a new version in 15cd18042804a014fdcbad5456c31038db9ca431. Does this fix the issues you're seeing?
When I run
pub get --no-packages-dir
and thenpub run rpc:generate discovery -i lib/server.dart
. I get this error:Please run 'pub get' in your API package before running the generator.
It seems there is a check for the
packages/
subfolders in the class ClientApiGenerator. If I manually remove the check in the code everything seems fine.