dart_frog icon indicating copy to clipboard operation
dart_frog copied to clipboard

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

Open djkingCanada opened this issue 1 year ago • 3 comments

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.

djkingCanada avatar Oct 18 '23 15:10 djkingCanada

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

alestiago avatar Oct 23 '23 11:10 alestiago

@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.

djkingCanada avatar Jan 02 '24 20:01 djkingCanada

I have the same issue.

to reproduce the issue:

  • use a local lib like this :
 shared:
       path: ../server/packages/shared
  • build : dart_frog build (on Windows) => this will generate pubspec_overrides.yaml file in the build directory. that contains :
dependency_overrides:
  shared:
    path: .dart_frog_path_dependencies\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.

salim-lachdhaf avatar Feb 25 '24 12:02 salim-lachdhaf