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

build command ignores '--cache' #1556

Closed
0xEAB opened this issue Sep 7, 2018 · 3 comments
Closed

build command ignores '--cache' #1556

0xEAB opened this issue Sep 7, 2018 · 3 comments
Labels

Comments

@0xEAB
Copy link
Contributor

0xEAB commented Sep 7, 2018

System information

  • dub version: 1.11.0+13-gb837cee
  • OS Platform and distribution: GNU/Linux 4.18, Ubuntu 18.04
  • compiler version: doesn't matter

Bug Description

The build command (dub build) ignores the package cache option specified by --cache.

How to reproduce?

Double-check that the used package does not exist in the user cache, otherwise you'll get fooled by DUB (for simplicity, this examples uses the package _ that acutally exists):

dub --cache=local fetch _
dub --cache=local build _
Failed to find a package named '_'.

Expected Behavior

Build that package THAT IS ACTUALLY THERE from the SPECIFIED local cache.

@andre2007
Copy link
Contributor

I am not sure whether I understand it correctly.
I observed following behavior:
While --cache=local downloads the dependencies to the dub project folder, dub will ignore them.

There is an open pull request to solve the issue: #1568
The solution is to download these dependencies to ./.dub/packages and to make Dub aware of them.

@Panke
Copy link
Contributor

Panke commented Mar 8, 2020

I think I have the same problem:

$ dub --cache=local fetch optional
Fetching optional 1.0.0...
Please note that you need to use dub run <pkgname> or add it to dependencies of your package to actually use/run it. dub does not do actual installation of packages outside of its own ecosystem.
$ dub --cache=local build optional
Building package optional in $PWD/.dub/packages/optional-1.0.0/optional/
Fetching vibe-d 0.8.6 (getting selected version)...
Fetching bolts 1.3.1 (getting selected version)...
Fetching stdx-allocator 2.77.5 (getting selected version)...
Unknown dependency: bolts

@Panke
Copy link
Contributor

Panke commented Mar 9, 2020

Had another look at this issue: In the case above bolts, vibe-d and stdx-allocator are placed at $PWD/.dub/packages/optional-1.0.0/optional/.dub/packages where they are subsequently not found.

Panke added a commit to Panke/dub that referenced this issue Mar 11, 2020
Panke added a commit to Panke/dub that referenced this issue Mar 11, 2020
Building a package that was locally cached failed, because
the dependencies whould be fetched at the wrong destination.

For example if one tries to build the package 'optional':

$ dub --cache=local fetch optional
-> optional is now at ./.dub/package/optional
$ dub --cache=local build optional
-> fails because the dependency bolts was fetched to
./.dub/package/optional/.dub/package/bolts.

This is fixed by not overwriting the root path if dub builds
a package from the cache.
Panke added a commit to Panke/dub that referenced this issue Mar 14, 2020
Building a package that was locally cached failed, because
the dependencies whould be fetched at the wrong destination.

For example if one tries to build the package 'optional':

$ dub --cache=local fetch optional
-> optional is now at ./.dub/package/optional
$ dub --cache=local build optional
-> fails because the dependency bolts was fetched to
./.dub/package/optional/.dub/package/bolts.

This is fixed by not overwriting the root path if dub builds
a package from the cache.
Panke added a commit to Panke/dub that referenced this issue Mar 14, 2020
Building a package that was locally cached failed, because
the dependencies whould be fetched at the wrong destination.

For example if one tries to build the package 'optional':

$ dub --cache=local fetch optional
-> optional is now at ./.dub/package/optional
$ dub --cache=local build optional
-> fails because the dependency bolts was fetched to
./.dub/package/optional/.dub/package/bolts.

This is fixed by not overwriting the root path if dub builds
a package from the cache.
@Geod24 Geod24 closed this as completed in bcd9048 Mar 15, 2020
Panke added a commit to Panke/dub that referenced this issue Mar 20, 2020
Building a package that was locally cached failed, because
the dependencies whould be fetched at the wrong destination.

For example if one tries to build the package 'optional':

$ dub --cache=local fetch optional
-> optional is now at ./.dub/package/optional
$ dub --cache=local build optional
-> fails because the dependency bolts was fetched to
./.dub/package/optional/.dub/package/bolts.

This is fixed by not overwriting the root path if dub builds
a package from the cache.
gedaiu pushed a commit to gedaiu/dub that referenced this issue Apr 11, 2020
Building a package that was locally cached failed, because
the dependencies whould be fetched at the wrong destination.

For example if one tries to build the package 'optional':

$ dub --cache=local fetch optional
-> optional is now at ./.dub/package/optional
$ dub --cache=local build optional
-> fails because the dependency bolts was fetched to
./.dub/package/optional/.dub/package/bolts.

This is fixed by not overwriting the root path if dub builds
a package from the cache.
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