Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code_transformer pkg: unable to handle when dart exe is a symlink #20376

Closed
sethladd opened this issue Aug 5, 2014 · 7 comments
Closed

code_transformer pkg: unable to handle when dart exe is a symlink #20376

sethladd opened this issue Aug 5, 2014 · 7 comments
Labels

Comments

@sethladd
Copy link
Contributor

@sethladd sethladd commented Aug 5, 2014

Consider this case:

/usr/local/bin/dart ==> /usr/local/Cellar/dart/1.5.3/bin/dart ==> /usr/local/Cellar/dart/1.5.3/libexec/bin/dart

This is what homebrew does.

The code in dartSdkDirectory assumed that which dart points to the physical location of dart.

@sethladd
Copy link
Contributor Author

@sethladd sethladd commented Aug 5, 2014

Looks like calling something like:

var file = new File(result.stdout.trim());
// check if file is a symlink
var realLocation = file.resolveSymbolicLinksSync();
    var sdkDir = path.dirname(path.dirname(reloadLocation));
    if (isSdkDir(sdkDir)) return sdkDir;

Or similar might do the trick?

@sethladd
Copy link
Contributor Author

@sethladd sethladd commented Aug 5, 2014

FWIW this affects the zengen package on pub, which uses code_transformers. At least, it affects: code_transformers + dart sdk installed by homebrew + mac.

@blois
Copy link
Contributor

@blois blois commented Aug 5, 2014

This code is a complete (and extremely unfortunate) hack around 16994.

Pub just recently added a pseudo-package '$sdk' which it sounds like we can use, though this will take a chunk of refactoring to change the resolver's use of dart sources from proxies of file-based sources to be asset-based sources. Though it may clean some stuff up by having everything be asset-based.

@sethladd
Copy link
Contributor Author

@sethladd sethladd commented Aug 6, 2014

Might also let it work cross-platform, too. Another benefit. :)

@sigmundch
Copy link
Member

@sigmundch sigmundch commented Dec 11, 2014

We added the workaround to resolve the symlink for now in code_transformers 0.2.3+2 (see
https://codereview.chromium.org//795433002)


Added Fixed label.

@sethladd
Copy link
Contributor Author

@sethladd sethladd commented Dec 11, 2014

Thanks very much!

@DartBot
Copy link

@DartBot DartBot commented Jun 5, 2015

This issue has been moved to dart-archive/code_transformers#20.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants