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

Protecting from import leak by fetching package one directory deeper #502

Closed
p0nce opened this issue Feb 2, 2015 · 2 comments
Closed

Protecting from import leak by fetching package one directory deeper #502

p0nce opened this issue Feb 2, 2015 · 2 comments

Comments

@p0nce
Copy link
Contributor

p0nce commented Feb 2, 2015

There were complaints in the NG that DUB does'nt support libraries whose source files are at the top-level directory.

Reference: http://forum.dlang.org/post/[email protected]

- When cloning repositories, dub does not preserve the 
repository's directory name (so e.g. fruit will be cloned to 
~/.dub/fruit-1.0.0/).

Somebody has created a Dub package for my library (excluding 
certain packages, due to point 1a above), and the other day 
someone complained that it doesn't work with Dscanner, because of 
the above issue - the module path "ae.dir.module" does not 
correspond to the filesystem path "ae-1.0.1/dir/module.d".

I think this is mostly solvable by fetching dependencies one directory deeper :

Reference: http://forum.dlang.org/post/[email protected]

Currently, using ae checkouted in an ae/ directory means having 
an "import leak" meaning that you have to import a path outside 
the checkouted repositery. That's somehow unhygienic like, er, a 
global namespace. But yeah DUB could isolate checkouts one 
directory deeper (ae-1.0.0/ae/) to make this a non-problem, this 
would support libraries like ae/ and make DScanner work.

What do you think?

@p0nce
Copy link
Contributor Author

p0nce commented Oct 6, 2015

This prevent to use the ae library from DUB.
ae is a very useful library with the best command-line parser, best image library in the ecosystem, a HTTP server that supports DFeed, etc...

@s-ludwig
Copy link
Member

I think this is a viable workaround. The only thing that should ideally be made sure is that old directory hierarchies get upgraded to the new scheme when the new DUB version is first used.

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

No branches or pull requests

2 participants