Skip to content

Commit 02e9341

Browse files
authored
Merge pull request #638 from tiziodcaio/main
Build linked runtime by default
2 parents f522eba + 3b948bf commit 02e9341

File tree

9 files changed

+13
-15
lines changed

9 files changed

+13
-15
lines changed

.github/workflows/native.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ jobs:
455455
path: signed/paf/*.paf.exe
456456
compression-level: 0
457457

458-
# == BUILD PROVENANCE
458+
# == Build Provenance
459459

460460
- name: Attest artifacts
461461
if: startsWith(github.ref, 'refs/tags/v')

native/Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ lto = true
2323
portable = ["dep:phf"]
2424
static = ["reqwest/native-tls-vendored", "bzip2/static", "xz2/static"]
2525
immutable-runtime = []
26-
linked-runtime = ["dep:blake3"]
2726

2827
[dependencies]
2928
ab_glyph = "0.2.29"
@@ -77,9 +76,9 @@ features = [
7776
[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd"))'.dependencies]
7877
glob = "0.3.2"
7978
phf = { version = "0.11.2", features = ["macros"] }
80-
blake3 = { version = "1.5.5", optional = true }
8179

8280
[target.'cfg(target_os = "linux")'.dependencies]
81+
blake3 = "1.5.5"
8382
bzip2 = "0.5.0"
8483
xz2 = "0.1.7"
8584
tar = "0.4.43"

native/src/components/runtime.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ impl Runtime {
240240
const COPY_ERROR: &str = "Failed to copy the runtime";
241241
const CLEANUP_ERROR: &str = "Failed to clean up the runtime";
242242

243-
#[cfg(feature = "linked-runtime")]
243+
#[cfg(platform_linux)]
244244
{
245245
use crate::storage::Storage;
246246

@@ -352,7 +352,7 @@ impl Runtime {
352352
Ok(())
353353
}
354354

355-
#[cfg(feature = "linked-runtime")]
355+
#[cfg(platform_linux)]
356356
pub fn link(&self) -> Result<()> {
357357
use std::fs::{copy, create_dir_all};
358358
use std::os::unix::fs::symlink;

native/src/connector/process.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ impl Process for SetConfig {
8484
impl Process for InstallRuntime {
8585
fn process(&self, _connection: &Connection) -> Result<ConnectorResponse> {
8686
let command = RuntimeInstallCommand {
87-
#[cfg(feature = "linked-runtime")]
87+
#[cfg(platform_linux)]
8888
link: self.link,
8989
};
9090
command.run()?;

native/src/connector/request.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,14 @@ pub struct SetConfig(pub Config);
153153
///
154154
/// [`ConnectorResponse::RuntimeInstalled`] - No data.
155155
///
156-
157-
#[cfg(feature = "linked-runtime")]
156+
#[cfg(platform_linux)]
158157
#[derive(Deserialize, Debug, Eq, PartialEq, Clone)]
159158
pub struct InstallRuntime {
160159
/// Experimental: Use a linked runtime instead of downloading from Mozilla.
161160
pub link: bool,
162161
}
163162

164-
#[cfg(not(feature = "linked-runtime"))]
163+
#[cfg(not(platform_linux))]
165164
#[derive(Debug, Eq, PartialEq, Clone)]
166165
pub struct InstallRuntime;
167166

@@ -612,7 +611,7 @@ impl Into<crate::console::app::HTTPClientConfig> for HTTPClientConfig {
612611

613612
deserialize_unit_struct!(GetSystemVersions);
614613
deserialize_unit_struct!(GetConfig);
615-
#[cfg(not(feature = "linked-runtime"))]
614+
#[cfg(not(platform_linux))]
616615
deserialize_unit_struct!(InstallRuntime);
617616
deserialize_unit_struct!(UninstallRuntime);
618617
deserialize_unit_struct!(GetSiteList);

native/src/console/app.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ pub enum RuntimeCommand {
277277
#[derive(Parser, Debug, Eq, PartialEq, Clone)]
278278
pub struct RuntimeInstallCommand {
279279
/// Experimental: Use a linked runtime instead of downloading from Mozilla
280-
#[cfg(feature = "linked-runtime")]
280+
#[cfg(target_os = "linux")]
281281
#[clap(long)]
282282
pub link: bool,
283283
}

native/src/console/runtime.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ impl Run for RuntimeInstallCommand {
2626
let dirs = ProjectDirs::new()?;
2727
let runtime = Runtime::new(&dirs)?;
2828

29-
#[cfg(feature = "linked-runtime")]
29+
#[cfg(platform_linux)]
3030
if self.link {
3131
runtime.link().context("Failed to link runtime")?
3232
} else {
3333
runtime.install().context("Failed to install runtime")?;
3434
}
3535

36-
#[cfg(not(feature = "linked-runtime"))]
36+
#[cfg(not(platform_linux))]
3737
runtime.install().context("Failed to install runtime")?;
3838

3939
let runtime = Runtime::new(&dirs)?;

native/src/console/site.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl Run for SiteLaunchCommand {
4646
bail!("Runtime not installed");
4747
}
4848

49-
#[cfg(feature = "linked-runtime")]
49+
#[cfg(platform_linux)]
5050
{
5151
use std::fs::File;
5252
use std::io::Read;

native/src/storage.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub struct Config {
4949
/// May be overwritten with a system environment variable.
5050
pub runtime_use_portals: bool,
5151

52-
#[cfg(feature = "linked-runtime")]
52+
#[cfg(platform_linux)]
5353
/// Experimental: Using the system runtime to save some disk space.
5454
/// This might not work on your system.
5555
pub use_linked_runtime: bool,

0 commit comments

Comments
 (0)