Maybe change the way to install packages?
It turns out that I was talking to myself.I guess I'm crazy.
Packages install to a global repository of packages.
Each version separately.
Let the virtual machine will load the correct version.
Am 10.09.2012 22:35 schrieb "Bob Nystrom" <rnys...@google.com>:
> Please keep a couple of things in mind:
>
Wow, the now following four points could easily be transformed into some dev-list netiquette! (or did they come from such?).
> 1. We don't usually work weekends, [...]
Am 10.09.2012 22:35 schrieb "Bob Nystrom" <rnys...@google.com>:
> Please keep a couple of things in mind:
>Wow, the now following four points could easily be transformed into some dev-list netiquette! (or did they come from such?).
--
//mypackage2=// I am already on machime. Look me at 'app repo' and 'user repo'.// if I am a 'web app' then look me at 'http://awesome.com/my_cool_app1/packages'// Well, I would venture to the new version?==dependencies.config.yaml==VM transform this into follwing urls.For remote:For local request used search paths.[APPLICTION_ROOT]/pub-cache/packages[USERPROFIFE]/pub-cache/packagesLimitation of the remote repository is a no support for version constraint.mypackage1.host=http://dart.google.org/cdn/packagesmypackage1.version=>=2.0.0 <=3.0.0 // Error: version constraint not allowed for remote repository.
--
> VM to deal with routes.
> VM can deal without routes.
The VM only deals with URI resolving. Libraries are imported using an URI -- which can look like http://..., file:// etc. Depends only on the set of protocols that the VM supports. So far so good.
1. If the string doesn't look like an URI but like a path on a file system, it will be resolved against local file system.
2. If the scheme is package:, it is resolved like an URI to the entrypoint script with the entrypoint script name removed and '/packages/${whatTheImportUriContained}' appended. Not sure if I explain it clearly, but the point here is that the VM (and all other Dart implementations, because they all share the same algorithm) should contain _the absolute minimum_ support for packages.
LT
P.S.: I think that the reason people don't understand you (at least this is how I feel) isn't your English, but the fact that you are basically dumping your brain on the list. No structure, no clear goal, no nothing. This used to be a nice artistic technique (about a hundred years ago), but it doesn't work here.
--
You are right.>> Wrt to imports-files: it requires one additional (tiny) step: loading the imports file into the VM.>> While this is trivial to implement, it is putting something into the VM that shouldn't be there.>> The advantage of these .imports files would need to be huge to get this accepted.Cons:1. Another extra file
Pros:1. VM's may work without it. Pub create univocal and flat symlinks to packages and not create "imports" files.2. No version conflicts.
3. No sources conficts.4. Path segments (and even full paths) to dependencies may be any allowable. Not only simplest flat.5. In the future, you can expand the syntax of "imports" if that needs.6. import "redirect:/home/floitsch/.dart-packages/lib1/lib1.dart". You can add this feature in the "imports" is very simple.
================================>>1) you don't like the fact that pub creates symlinks.Yes and no.Eventually eliminate errors.But "simplest flat path" symlinks - this irritates me.It is so naive.Use versions and not to use it at full capacity.Create problems themselves.If I want and need Visual C++ 2008 runtime why I cant use it if it already installed?Packages like runtime libraries.
=================================>> 2) you would like package caches to be unified into repositories.>> That is, instead of having a repository on pub.dartlang.org, and just a cache on the local harddrive, you would like the local harddrive to function as repository too (without any changes).Unfication not needs.The main thing there was the use of different versions."Imports" solve this problem.=================================>> When the VM loads a package it first reads the .imports file, which provides the necessary information to find the package in the local package-repository.Not only the local path.But by default, of course, the path is relative.But you can specify the VM that the path is absolute.
--
Different versions and sources do not interfere with each other.All used simultaneously.Each library uses its version dependencies from different sources without conflict.
So I went through this whole thread again (almost regretting of having revived it ;)I am still not completely sure what you want to solve but here is my guess:1) you don't like the fact that pub creates symlinks.2) you would like package caches to be unified into repositories. That is, instead of having a repository on pub.dartlang.org, and just a cache on the local harddrive, you would like the local harddrive to function as repository too (without any changes).I'm definitely less sure about (2).The way you want to solve this, is by having a mapping on the side that tells the VM where to find its packages. You call this mappings file import-file ("${script_name}.imports"). When the VM loads a package it first reads the .imports file, which provides the necessary information to find the package in the local package-repository. For example if the local package-repository contained lib1 with versions 1.0.0 and 1.5.0 the mappings file would contain the correct version-number, (say 1.5.0) so that the VM could open ${packages_root}/lib1/[1.5.0]/lib1.dart.Please correct me, if I got this wrong again.==Interestingly when we started discussing pub, we had a similar setup. Instead of having a .imports file we allowed redirecting imports. Something like (from memory):import "redirect:../../../foo.dart"We would still have our packages directory, but instead of having symlinks in there we would have a separate directory for each imported package, and have one lib.dart file in there that would redirect to the actual location. For example:We would have a package-cache (for instance in ~/.dart-packages) with:lib1/...lib2/...an application app1 would then have:app1/main.dartpackages/lib1/lib1.dartpackages/lib2/lib2.dartlib1.dart would contain just one line:import "redirect:/home/floitsch/.dart-packages/lib1/lib1.dart"
While this is not exactly the same as having a .imports file it is pretty close (unless I'm missing something).To be honest, I don't know why we switched to symlinks instead, but it simplifies the dart-vm (since it doesn't need to deal with redirecting libraries anymore). So I'm happy :)
>> 1. 'a' creates an instance of a class defined in 'c' 1.0.0. It passes it up to 'myapp'.>> 2. 'myapp' passes that to 'b'.>> 3. 'b' passes it down to its version (2.0.0) of 'c'.Firstly it is not a typical situation.
Then that means that it is not the reason for the refusal.
Second this is not directly related to the package management system, and this is offtopic.
Refer BY UNIQUE_ALIASES.