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

Comments

Projects
None yet
4 participants
@sethladd
Member

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

This comment has been minimized.

Member

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

This comment has been minimized.

Member

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

This comment has been minimized.

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

This comment has been minimized.

Member

sethladd commented Aug 6, 2014

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

@sigmundch

This comment has been minimized.

Member

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

This comment has been minimized.

Member

sethladd commented Dec 11, 2014

Thanks very much!

@DartBot

This comment has been minimized.

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