Skip to content

Commit

Permalink
Fix getting the scie platform architecture for armv7l (#260)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lauszus authored Dec 12, 2024
1 parent 60015e9 commit 0942975
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 30 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes

## 1.4.1

This release fixes the `scie.platform` and `scie.platform.arch` placeholders for armv7l.

## 1.4.0

This release adds support for Linux s390x.
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ members = [

[package]
name = "scie-jump"
version = "1.4.0"
version = "1.4.1"
description = "The self contained interpreted executable launcher."
authors = [
"John Sirois <[email protected]>",
Expand Down
30 changes: 19 additions & 11 deletions jump/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,22 @@ use crate::placeholders::{self, Item, Placeholder, ScieBindingEnv};
use crate::process::{EnvVar, Process};
use crate::{config, CurrentExe, EnvVars, Jump, Source};

#[cfg(all(
target_os = "linux",
target_arch = "arm",
target_pointer_width = "32",
target_endian = "little"
))]
pub const ARCH: &str = "armv7l";

#[cfg(not(all(
target_os = "linux",
target_arch = "arm",
target_pointer_width = "32",
target_endian = "little"
)))]
pub const ARCH: &str = env::consts::ARCH;

fn expanduser(path: &Path) -> Result<PathBuf, String> {
if !<[u8]>::from_path(path)
.ok_or_else(|| {
Expand Down Expand Up @@ -637,17 +653,9 @@ impl<'a> Context<'a> {
lift_manifest_required = true;
reified.push_str(path_to_str(&self.lift_manifest.path)?);
}
Item::Placeholder(Placeholder::SciePlatform) => reified.push_str(
format!(
"{os}-{arch}",
os = env::consts::OS,
arch = env::consts::ARCH
)
.as_str(),
),
Item::Placeholder(Placeholder::SciePlatformArch) => {
reified.push_str(env::consts::ARCH)
}
Item::Placeholder(Placeholder::SciePlatform) => reified
.push_str(format!("{os}-{arch}", os = env::consts::OS, arch = ARCH).as_str()),
Item::Placeholder(Placeholder::SciePlatformArch) => reified.push_str(ARCH),
Item::Placeholder(Placeholder::SciePlatformOs) => reified.push_str(env::consts::OS),
}
}
Expand Down
1 change: 1 addition & 0 deletions jump/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ use logging_timer::{time, timer};
pub use crate::archive::create_options;
use crate::config::Config;
pub use crate::config::Jump;
pub use crate::context::ARCH;
use crate::installer::Installer;
// Exposed for the package crate post-processing of the scie-jump binary.
pub use crate::jump::EOF_MAGIC;
Expand Down
18 changes: 1 addition & 17 deletions package/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::process::Command;

use byteorder::{LittleEndian, WriteBytesExt};
use clap::Parser;
use jump::EOF_MAGIC;
use jump::{ARCH, EOF_MAGIC};
use proc_exit::{Code, Exit, ExitResult};
use sha2::{Digest, Sha256};

Expand All @@ -21,22 +21,6 @@ const PATHSEP: &str = ";";
#[cfg(target_family = "unix")]
const PATHSEP: &str = ":";

#[cfg(all(
target_os = "linux",
target_arch = "arm",
target_pointer_width = "32",
target_endian = "little"
))]
const ARCH: &str = "armv7l";

#[cfg(not(all(
target_os = "linux",
target_arch = "arm",
target_pointer_width = "32",
target_endian = "little"
)))]
const ARCH: &str = env::consts::ARCH;

fn add_magic(path: &Path) -> ExitResult {
let mut binary = std::fs::OpenOptions::new()
.append(true)
Expand Down

0 comments on commit 0942975

Please sign in to comment.