Skip to content

Commit 9b762f9

Browse files
authored
Use MozTools 4.0 and vendored autoconf (#392)
* MozTools 4.0 * fix paths for msys2 * use vendored autoconf * better error * moztools4.0 in ci * fixup * switch to servo-build-deps
1 parent 080dc75 commit 9b762f9

File tree

3 files changed

+13
-25
lines changed

3 files changed

+13
-25
lines changed

.github/workflows/rust.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
steps:
2929
- uses: actions/checkout@v3
3030
- name: Install deps
31-
run: brew install python autoconf@2.13 llvm yasm
31+
run: brew install python llvm yasm
3232
- name: Run sccache-cache
3333
uses: mozilla-actions/sccache-action@v0.0.3
3434
with:
@@ -53,7 +53,7 @@ jobs:
5353
- uses: dtolnay/rust-toolchain@stable
5454
- name: Install deps
5555
run: |
56-
sudo apt install autoconf2.13 llvm -y
56+
sudo apt install llvm -y
5757
- name: Run sccache-cache
5858
uses: mozilla-actions/sccache-action@v0.0.3
5959
with:
@@ -74,7 +74,7 @@ jobs:
7474
LINKER: "lld-link.exe"
7575
CC: "clang-cl"
7676
CXX: "clang-cl"
77-
MOZTOOLS_PATH: "${{ github.workspace }}\\target\\dependencies\\moztools-3.2"
77+
MOZTOOLS_PATH: "${{ github.workspace }}\\target\\dependencies\\moztools-4.0"
7878
steps:
7979
- uses: actions/checkout@v3
8080
- uses: dtolnay/rust-toolchain@stable
@@ -86,7 +86,7 @@ jobs:
8686
components: rust-src
8787
- name: Install deps
8888
run: |
89-
curl -SL "https://github.com/servo/servo-build-deps/releases/download/msvc-deps/moztools-3.2.zip" --create-dirs -o target/dependencies/moztools.zip
89+
curl -SL "https://github.com/servo/servo-build-deps/releases/download/msvc-deps/moztools-4.0.zip" --create-dirs -o target/dependencies/moztools.zip
9090
cd target/dependencies && unzip -qo moztools.zip -d .
9191
- name: Run sccache-cache
9292
uses: mozilla-actions/sccache-action@v0.0.3

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@ are in the [rust-mozjs directory][r-m].
1313

1414
## Linux
1515

16-
Install Clang (at least version 3.9) and autoconf v 2.13, for example on a
17-
Debian-based Linux:
16+
Install Clang and `build-essential`, for example on a Debian-based Linux:
1817

1918
```sh
20-
sudo apt-get install clang-6.0 autoconf2.13
19+
sudo apt-get install clang build-essential
2120
```
2221

2322
If you have more than one version of Clang installed, you can set the `LIBCLANG_PATH`
@@ -29,8 +28,8 @@ export LIBCLANG_PATH=/usr/lib/clang/4.0/lib
2928

3029
## Windows
3130

32-
1. Install [MozillaBuild 3.4](https://ftp.mozilla.org/pub/mozilla/libraries/win32/MozillaBuildSetup-3.4.exe)
33-
or download and unzip [MozTools 3.2](https://github.com/servo/servo-build-deps/releases/download/msvc-deps/moztools-3.2.zip)
31+
1. Install [MozillaBuild 4.0](https://ftp.mozilla.org/pub/mozilla/libraries/win32/MozillaBuildSetup-4.0.2.exe)
32+
or download and unzip [MozTools 4.0](https://github.com/servo/servo-build-deps/releases/download/msvc-deps/moztools-4.0.zip)
3433

3534
2. Download and install Clang for Windows (64 bit) from <https://releases.llvm.org/download.html>.
3635

@@ -58,7 +57,7 @@ export LIBCLANG_PATH=/usr/lib/clang/4.0/lib
5857
or if you unzipped MozTools in 1.:
5958

6059
```shell
61-
set MOZTOOLS_PATH=C:\path\to\moztools-3.2
60+
set MOZTOOLS_PATH=C:\path\to\moztools-4.0
6261
```
6362

6463
## Run Cargo

mozjs/build.rs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const EXTRA_FILES: &'static [&'static str] = &[
3636
];
3737

3838
/// Which version of moztools we expect
39-
const MOZTOOLS_VERSION: &str = "3.2";
39+
const MOZTOOLS_VERSION: &str = "4.0";
4040

4141
fn main() {
4242
// https://github.com/servo/mozjs/issues/113
@@ -175,26 +175,15 @@ fn build_jsapi(build_dir: &Path) {
175175
);
176176
};
177177
let mut paths = Vec::new();
178-
paths.push(moztools.join("msys").join("bin"));
178+
paths.push(moztools.join("msys2").join("usr").join("bin"));
179179
paths.push(moztools.join("bin"));
180180
paths.extend(env::split_paths(&env::var_os("PATH").unwrap()));
181181
env::set_var("PATH", &env::join_paths(paths).unwrap());
182182

183-
if env::var_os("AUTOCONF").is_none() {
184-
env::set_var(
185-
"AUTOCONF",
186-
moztools
187-
.join("msys")
188-
.join("local")
189-
.join("bin")
190-
.join("autoconf-2.13"),
191-
);
192-
}
193-
194183
make = OsStr::new("mozmake").to_os_string();
195184
}
196185

197-
let mut cmd = Command::new(make);
186+
let mut cmd = Command::new(make.clone());
198187

199188
let encoding_c_mem_include_dir = env::var("DEP_ENCODING_C_MEM_INCLUDE_DIR").unwrap();
200189
let mut cppflags = OsString::from("-I");
@@ -222,7 +211,7 @@ fn build_jsapi(build_dir: &Path) {
222211
.env("SRC_DIR", &cargo_manifest_dir.join("mozjs"))
223212
.env("NO_RUST_PANIC_HOOK", "1")
224213
.status()
225-
.expect("Failed to run `make`");
214+
.expect(&format!("Failed to run `{:?}`", make));
226215
assert!(result.success());
227216

228217
println!(

0 commit comments

Comments
 (0)