Skip to content

Commit 96a3985

Browse files
committed
Another attempt to fix windows workflow
1 parent 9dbf6a5 commit 96a3985

3 files changed

Lines changed: 13 additions & 6 deletions

File tree

src/Makevars.in

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ all: $(SHLIB) rust_clean
1111

1212
$(SHLIB): $(STATLIB)
1313

14+
# SHORT_BASE is set dynamically by tools/config.R
15+
SHORT_BASE = @SHORT_BASE@
1416
# CARGO_HOME is set dynamically by tools/config.R
1517
# On Unix, this uses the current directory (no path length issues)
1618
CARGOTMP = @CARGO_HOME@
17-
VENDOR_DIR = $(CURDIR)/vendor
19+
VENDOR_DIR = $(SHORT_BASE)/vendor
1820

1921

2022
# RUSTFLAGS appends --print=native-static-libs to ensure that
@@ -27,7 +29,7 @@ VENDOR_DIR = $(CURDIR)/vendor
2729
$(STATLIB):
2830

2931
if [ -f ./rust/vendor.tar.xz ]; then \
30-
tar xf rust/vendor.tar.xz && \
32+
tar xf rust/vendor.tar.xz -C $(SHORT_BASE) && \
3133
mkdir -p $(CARGOTMP) && \
3234
cp rust/vendor-config.toml $(CARGOTMP)/config.toml; \
3335
fi

src/Makevars.win.in

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ all: $(SHLIB) rust_clean
1313

1414
$(SHLIB): $(STATLIB)
1515

16+
# SHORT_BASE is set dynamically by tools/config.R
17+
SHORT_BASE = @SHORT_BASE@
1618
# CARGO_HOME is set dynamically by tools/config.R
1719
# On Windows, this uses the same short base path as TARGET_DIR
1820
# so that relative paths in aws-lc-sys CMake builds resolve correctly
1921
CARGOTMP = @CARGO_HOME@
20-
# Vendor dir is relative to CARGO_HOME's config.toml location
21-
VENDOR_DIR = $(CARGOTMP)/vendor
22+
# Vendor dir is relative to SHORT_BASE
23+
VENDOR_DIR = $(SHORT_BASE)/vendor
2224

2325
$(STATLIB):
2426
# Clean any previous build artifacts to avoid conflicts
@@ -28,7 +30,7 @@ $(STATLIB):
2830

2931
if [ -f ./rust/vendor.tar.xz ]; then \
3032
mkdir -p $(CARGOTMP) && \
31-
tar xf rust/vendor.tar.xz -C $(CARGOTMP) && \
33+
tar xf rust/vendor.tar.xz -C $(SHORT_BASE) && \
3234
cp rust/vendor-config.toml $(CARGOTMP)/config.toml; \
3335
fi
3436

tools/config.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,12 @@ if (is_windows) {
3636
}
3737

3838
# Normalize to forward slashes for Make compatibility
39+
.short_base <- short_base
3940
.target_dir <- paste0(short_base, "/target")
4041
.cargo_home <- paste0(short_base, "/.cargo")
4142
message("Using short build path: ", short_base)
4243
} else {
44+
.short_base <- "$(CURDIR)"
4345
.target_dir <- "./rust/target"
4446
.cargo_home <- "$(CURDIR)/.cargo"
4547
}
@@ -143,7 +145,8 @@ new_txt <- gsub("@CRAN_FLAGS@", .cran_flags, mv_txt) |>
143145
gsub("@TARGET@", .target, x = _) |>
144146
gsub("@PANIC_EXPORTS@", .panic_exports, x = _) |>
145147
gsub("@TARGET_DIR@", .target_dir, x = _) |>
146-
gsub("@CARGO_HOME@", .cargo_home, x = _)
148+
gsub("@CARGO_HOME@", .cargo_home, x = _) |>
149+
gsub("@SHORT_BASE@", .short_base, x = _)
147150

148151
message("Writing `", mv_ofp, "`.")
149152
con <- file(mv_ofp, open = "wb")

0 commit comments

Comments
 (0)