refactor(tvix/nix-compat): support non-unicode Derivations
Derivations can have non-unicode strings in their env values, so the ATerm representations are not necessarily String anymore, but Vec<u8>. Change-Id: Ic23839471eb7f68d9c3c30667c878830946b6607 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8990 Tested-by: BuildkiteCI Reviewed-by: raitobezarius <tvl@lahfa.xyz> Autosubmit: flokli <flokli@flokli.de>
This commit is contained in:
parent
9521df708f
commit
79531c3dab
14 changed files with 425 additions and 123 deletions
|
|
@ -283,7 +283,7 @@ mod derivation_builtins {
|
|||
// Most of these are also added to the builder's environment in "raw" form.
|
||||
if drv
|
||||
.environment
|
||||
.insert(name.as_str().to_string(), val_str)
|
||||
.insert(name.as_str().to_string(), val_str.into())
|
||||
.is_some()
|
||||
{
|
||||
return Err(Error::DuplicateEnvVar(name.as_str().to_string()).into());
|
||||
|
|
@ -312,7 +312,7 @@ mod derivation_builtins {
|
|||
} else {
|
||||
let mut refscan = state.reference_scanner();
|
||||
drv.arguments.iter().for_each(|s| refscan.scan_str(s));
|
||||
drv.environment.values().for_each(|s| refscan.scan_str(s));
|
||||
drv.environment.values().for_each(|s| refscan.scan_bytes(s));
|
||||
refscan.scan_str(&drv.builder);
|
||||
refscan.finalise()
|
||||
}
|
||||
|
|
@ -324,7 +324,7 @@ mod derivation_builtins {
|
|||
for output in drv.outputs.keys() {
|
||||
if drv
|
||||
.environment
|
||||
.insert(output.to_string(), String::new())
|
||||
.insert(output.to_string(), String::new().into())
|
||||
.is_some()
|
||||
{
|
||||
emit_warning_kind(&co, WarningKind::ShadowedOutput(output.to_string())).await;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue