Is it possible to configure the directory where Cargo caches the crates it downloads? [duplicate]
This question already has an answer here:
How can the location of Cargo's configuration directory be overridden?
2 answers
In GitLab's CI, I can breakdown my build into stages and each stage can pass artifacts to the next configuration:
cache:
paths:
- target/
- Cargo.lock
However, if the cache directory is outside the project directory or the /cache
directory, it becomes hard to pass those artifacts along. I need to tell Cargo a good place to put (and look for) its cached crates.
In my case, I wish to use /cache/cargo/registry/...
rather than ~/.cargo/registry/...
. or /usr/local/cargo/registry/...
.
Bonus points for doing that via an environment variable.
caching rust rust-cargo
marked as duplicate by Shepmaster
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Jan 1 at 17:37
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
How can the location of Cargo's configuration directory be overridden?
2 answers
In GitLab's CI, I can breakdown my build into stages and each stage can pass artifacts to the next configuration:
cache:
paths:
- target/
- Cargo.lock
However, if the cache directory is outside the project directory or the /cache
directory, it becomes hard to pass those artifacts along. I need to tell Cargo a good place to put (and look for) its cached crates.
In my case, I wish to use /cache/cargo/registry/...
rather than ~/.cargo/registry/...
. or /usr/local/cargo/registry/...
.
Bonus points for doing that via an environment variable.
caching rust rust-cargo
marked as duplicate by Shepmaster
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Jan 1 at 17:37
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
How can the location of Cargo's configuration directory be overridden?
2 answers
In GitLab's CI, I can breakdown my build into stages and each stage can pass artifacts to the next configuration:
cache:
paths:
- target/
- Cargo.lock
However, if the cache directory is outside the project directory or the /cache
directory, it becomes hard to pass those artifacts along. I need to tell Cargo a good place to put (and look for) its cached crates.
In my case, I wish to use /cache/cargo/registry/...
rather than ~/.cargo/registry/...
. or /usr/local/cargo/registry/...
.
Bonus points for doing that via an environment variable.
caching rust rust-cargo
This question already has an answer here:
How can the location of Cargo's configuration directory be overridden?
2 answers
In GitLab's CI, I can breakdown my build into stages and each stage can pass artifacts to the next configuration:
cache:
paths:
- target/
- Cargo.lock
However, if the cache directory is outside the project directory or the /cache
directory, it becomes hard to pass those artifacts along. I need to tell Cargo a good place to put (and look for) its cached crates.
In my case, I wish to use /cache/cargo/registry/...
rather than ~/.cargo/registry/...
. or /usr/local/cargo/registry/...
.
Bonus points for doing that via an environment variable.
This question already has an answer here:
How can the location of Cargo's configuration directory be overridden?
2 answers
caching rust rust-cargo
caching rust rust-cargo
edited Jan 1 at 16:53
Shepmaster
157k14316459
157k14316459
asked Jan 1 at 15:21
Chen LevyChen Levy
8,756155677
8,756155677
marked as duplicate by Shepmaster
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Jan 1 at 17:37
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by Shepmaster
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Jan 1 at 17:37
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Found it:
variables:
CARGO_HOME: "/cache/cargo/"
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Found it:
variables:
CARGO_HOME: "/cache/cargo/"
add a comment |
Found it:
variables:
CARGO_HOME: "/cache/cargo/"
add a comment |
Found it:
variables:
CARGO_HOME: "/cache/cargo/"
Found it:
variables:
CARGO_HOME: "/cache/cargo/"
answered Jan 1 at 15:22
Chen LevyChen Levy
8,756155677
8,756155677
add a comment |
add a comment |