Skip to content

Commit 2ba317d

Browse files
lhtgraydon
authored andcommitted
build: Temp hack to make transition to new snapshot
1 parent 03d1644 commit 2ba317d

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

mk/stage0.mk

+10-2
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,21 @@ $(HLIB0_H_$(CFG_HOST_TRIPLE))/$(CFG_RUNTIME): \
1313
$(HBIN0_H_$(CFG_HOST_TRIPLE))/rustc$(X)
1414
$(Q)touch $@
1515

16+
## FIXME temporary hack for snapshot transition
17+
CORELIB_DUMMY :=$(call CFG_LIB_NAME,core-dummy)
18+
STDLIB_DUMMY :=$(call CFG_LIB_NAME,std-dummy)
19+
1620
$(HLIB0_H_$(CFG_HOST_TRIPLE))/$(CFG_CORELIB): \
1721
$(HBIN0_H_$(CFG_HOST_TRIPLE))/rustc$(X)
1822
$(Q)touch $@
23+
$(foreach target,$(CFG_TARGET_TRIPLES),\
24+
$(shell touch $(CFG_HOST_TRIPLE)/stage0/lib/rustc/$(target)/lib/$(CORELIB_DUMMY)))
1925

2026
$(HLIB0_H_$(CFG_HOST_TRIPLE))/$(CFG_STDLIB): \
2127
$(HBIN0_H_$(CFG_HOST_TRIPLE))/rustc$(X)
2228
$(Q)touch $@
29+
$(foreach target,$(CFG_TARGET_TRIPLES),\
30+
$(shell touch $(CFG_HOST_TRIPLE)/stage0/lib/rustc/$(target)/lib/$(STDLIB_DUMMY)))
2331

2432
$(HLIB0_H_$(CFG_HOST_TRIPLE))/$(CFG_RUSTLLVM): \
2533
$(HBIN0_H_$(CFG_HOST_TRIPLE))/rustc$(X)
@@ -45,12 +53,12 @@ $$(HLIB0_H_$(1))/$$(CFG_RUNTIME): \
4553
$$(HLIB0_H_$(1))/$(CFG_CORELIB): \
4654
$$(TLIB$(2)_T_$(1)_H_$(3))/$$(CFG_CORELIB)
4755
@$$(call E, cp: $$@)
48-
$$(Q)cp $$< $$@
56+
$$(Q)cp $$(TLIB$(2)_T_$(1)_H_$(3))/$$(CORELIB_GLOB) $$@
4957

5058
$$(HLIB0_H_$(1))/$(CFG_STDLIB): \
5159
$$(TLIB$(2)_T_$(1)_H_$(3))/$$(CFG_STDLIB)
5260
@$$(call E, cp: $$@)
53-
$$(Q)cp $$< $$@
61+
$$(Q)cp $$(TLIB$(2)_T_$(1)_H_$(3))/$$(STDLIB_GLOB) $$@
5462

5563
$$(HLIB0_H_$(1))/$(CFG_RUSTLLVM): \
5664
$$(TLIB$(2)_T_$(1)_H_$(3))/$$(CFG_RUSTLLVM)

src/etc/get-snapshot.py

+18-1
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,30 @@
33
import os, tarfile, hashlib, re, shutil, sys
44
from snapshot import *
55

6+
old_snapshot_files = {
7+
"linux": ["bin/rustc",
8+
"lib/libcore.so",
9+
"lib/libruststd.so",
10+
"lib/librustrt.so",
11+
"lib/librustllvm.so"],
12+
"macos": ["bin/rustc",
13+
"lib/libcore.dylib",
14+
"lib/libruststd.dylib",
15+
"lib/librustrt.dylib",
16+
"lib/librustllvm.dylib"],
17+
"winnt": ["bin/rustc.exe",
18+
"lib/core.dll",
19+
"lib/ruststd.dll",
20+
"lib/rustrt.dll",
21+
"lib/rustllvm.dll"]
22+
}
623

724
def unpack_snapshot(triple, snap):
825
dl_path = os.path.join(download_dir_base, snap)
926
print("opening snapshot " + dl_path)
1027
tar = tarfile.open(dl_path)
1128
kernel = get_kernel(triple)
12-
for name in snapshot_files[kernel]:
29+
for name in old_snapshot_files[kernel]:
1330
p = "rust-stage0/" + name
1431
stagep = os.path.join(triple, "stage0")
1532
fp = os.path.join(stagep, name)

0 commit comments

Comments
 (0)