Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Allow source files and summaries to come from anywhere #612

Closed
nex3 opened this issue Jul 28, 2016 · 7 comments
Closed

Allow source files and summaries to come from anywhere #612

nex3 opened this issue Jul 28, 2016 · 7 comments

Comments

@nex3
Copy link

nex3 commented Jul 28, 2016

Currently, all source files and module summaries must be within the build root and module root, respectively. This seems like an unnecessary limitation, and it's contrary to how other Dart implementations work.

This is blocking dart-lang/test#414. The test runner needs to synthesize an entrypoint in a temp directory, which isn't in the default build or module root. We can't even use the filesystem root, because on Windows the temp directory may be on a different drive than the Dart sources.

@jmesserly
Copy link
Contributor

@vsmenon - would you mind taking this one? I think you're likely most familiar with the "build root" "module root" options.

@nex3 - if this is blocking, does marking it P1 sound right to you?

@nex3
Copy link
Author

nex3 commented Jul 28, 2016

@nex3 - if this is blocking, does marking it P1 sound right to you?

I'd appreciate it, yeah!

@vsmenon
Copy link
Contributor

vsmenon commented Jul 29, 2016

@nex3 The build root and module root affect the generated code - the library names and module names in the generated code.

But those could point elsewhere. E.g.,

 dart ~/git/ddc/bin/dartdevc.dart compile --library-root /Users/vsm/tmp/ -o hello.js /Users/vsm/tmp/hello.dart

Is that sufficient or are you compiling multiple Dart sources from different directories in the same compile command?

If the latter, we could allow these to be a list of paths instead. E.g., something like:

dart ~/git/ddc/bin/dartdevc.dart compile --library-root /Users/vsm/working:/Users/vsm/tmp/ -o hello.js /Users/vsm/tmp/hello.dart /Users/vsm/working/world.dart

@nex3
Copy link
Author

nex3 commented Jul 29, 2016

Is that sufficient or are you compiling multiple Dart sources from different directories in the same compile command?

I am, yeah—and in general it seems like this is a thing we should support.

If the latter, we could allow these to be a list of paths instead. E.g., something like:

dart ~/git/ddc/bin/dartdevc.dart compile --library-root /Users/vsm/working:/Users/vsm/tmp/ -o hello.js > /Users/vsm/tmp/hello.dart /Users/vsm/working/world.dart

This would work (although colon-separated reads weird to me; I'd prefer comma-separated or just being able to pass multiple --library-root flags).

How would this work if multiple sources had the same paths relative to their respective roots?

@vsmenon
Copy link
Contributor

vsmenon commented Jul 29, 2016

This would work (although colon-separated reads weird to me; I'd prefer comma-separated or just being able to pass multiple --library-root flags).

Yeah, using comma's elsewhere already.

How would this work if multiple sources had the same paths relative to their respective roots?

It could take the first match it finds (in the listed order a la PATH). Or the tightest match I suppose.

@nex3
Copy link
Author

nex3 commented Aug 4, 2016

In #619, I wrote up a description of what my preferred replacement for --module-root and --library-root would be. I think if that lands it would obviate the need for this, but it's not the only way to solve this.

@vsmenon
Copy link
Contributor

vsmenon commented Sep 6, 2016

This issue was moved to dart-lang/sdk#27264

@vsmenon vsmenon closed this as completed Sep 6, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

3 participants