VeryGoodOpenSource / dart_frog

A fast, minimalistic backend framework for Dart 🎯
https://dartfrog.vgv.dev
MIT License
1.87k stars 150 forks source link

fix: ./pubspec_overrides.yaml generated with \ on windows breaks docker build. #1116

Open djkingCanada opened 1 year ago

djkingCanada commented 1 year ago

I'm on windows (.net legacy projects, sigh) and have a shared module between my server and client using the path option. The build tool generates a ./pubspec_overrides.yaml using '\' in the path.

'\' is the platform separator so I suspect this is coming from code that is trying to be platform independent. The problem is this breaks the docker build as a path with \ is not a valid Linux path.

I'm thinking this could be an issue on mac with ':' being the system separator (I haven't tested this). Maybe we need a way to specify the target separator for the process?

I'm willing to help with this if someone could give me a place to start looking.

alestiago commented 1 year ago

Hi @djkingCanada! Thanks for submitting an issue.

I would like to reproduce the issue. Can you provide an enumerated list of steps to reproduce this issue?


I'm willing to help with this if someone could give me a place to start looking.

As a guess, this is probably related to the bundling process, you might want to take a look at the dart_frog_prod brick, see: https://github.com/VeryGoodOpenSource/dart_frog/blob/b990068738ad2517c3178aa68f10ae12223f70a2/bricks/dart_frog_prod_server/hooks/pre_gen.dart#L88

djkingCanada commented 10 months ago

@alestiago: All I did was run the build on a windows machine, that produces a docker file with \ used in the file paths and then when you try to use that docker file to build a Linux image things break.

salim-lachdhaf commented 8 months ago

I have the same issue.

to reproduce the issue:

 shared:
       path: ../server/packages/shared

you will notice that we have `\` not `/`.

- Deploy : to Cloud Run  you will get this error:
`Because server depends on shared from path which doesn't exist (could not find package shared at ".dart_frog_path_dependencies\shared"), version solving failed.`