SHA256
2
1
forked from pool/deno
Avindra Goolcharan 2024-07-10 23:36:38 +00:00 committed by Git OBS Bridge
commit a295f685b2
14 changed files with 4459 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

15
_constraints Normal file
View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Trying constraint per:
https://lists.opensuse.org/archives/list/factory@lists.opensuse.org/thread/G4HX77LQANTQTZMARIU4XQI4JT3RCEQ7/#G3N7PCAUIIVPO63V5QYKY6QMZK4TEP2Q
-->
<constraints>
<hardware>
<disk>
<size unit="G">18</size>
</disk>
<physicalmemory>
<size unit="G">21</size>
</physicalmemory>
</hardware>
</constraints>

146
_service Normal file
View File

@ -0,0 +1,146 @@
<!--
# vim: set syntax=xml
-->
<services>
<!--
Build Deno and rusty_v8 as completely from
scratch as we can. We pull in all the sources
through git.
TODO: migrate to obs_scm as soon as "exclude"
works there.
-->
<service name="tar_scm" mode="manual">
<param name="scm">git</param>
<param name="url">https://github.com/denoland/deno</param>
<param name="revision">v1.45.0</param>
<param name="version">1.45.0</param>
<!-- remove large docs -->
<param name="exclude">docs</param>
<param name="exclude">Releases.md</param>
<param name="exclude">CODE*.md</param>
<param name="exclude">*/README.md</param>
<param name="exclude">**/*/*.md</param>
<!-- remove things not required for build -->
<param name="exclude">.editorconfig</param>
<param name="exclude">.github</param>
<param name="exclude">.gitattributes</param>
<param name="exclude">tools</param>
<param name="exclude">third_party</param>
<param name="exclude">cli/tests</param>
<param name="exclude">test_util/wpt</param>
<param name="exclude">std/wasi/testdata</param>
<param name="exclude">core/examples</param>
<param name="exclude">runtime/examples</param>
</service>
<service name="tar_scm" mode="manual">
<param name="scm">git</param>
<param name="url">https://github.com/denoland/rusty_v8</param>
<param name="revision">v0.97.0</param>
<param name="version">0.97.0</param>
<param name="exclude">.github</param>
<!--
mirror pruning of build tree expressed in Cargo.toml
except for LICENSE +README, which we ship
-->
<param name="exclude">*.settings</param>
<param name="exclude">*.txt</param>
<param name="exclude">AUTHORS</param>
<param name="exclude">build/android</param>
<param name="exclude">build/chromeos</param>
<param name="exclude">build/fuchsia</param>
<!-- todo: send upstream: deno doesnt run on 32-bit
<param name="exclude">v8/src/compiler/backend/ia32</param>
<param name="exclude">v8/src/codegen/ia32</param>
<param name="exclude">v8/src/builtins/ia32</param>
<param name="exclude">v8/src/execution/ia32</param>
<param name="exclude">v8/src/diagnostics/ia32</param>
<param name="exclude">v8/src/wasm/baseline/ia32</param>
<param name="exclude">v8/src/regexp/ia32</param>
-->
<!-- additional platforms that can be dropped todo: send relevant upstream
<param name="exclude">build/apple</param>
<param name="exclude">build/ios</param>
<param name="exclude">build/mac</param>
<param name="exclude">build/win</param>
<param name="exclude">build/toolchain/win</param>
<param name="exclude">build/toolchain/mac</param>
<param name="exclude">build/toolchain/apple</param>
<param name="exclude">build/toolchain/aix</param>
<param name="exclude">build/toolchain/android</param>
<param name="exclude">build/toolchain/fuchsia</param>
-->
<!-- todo: send this batch upstream:
<param name="exclude">build/config/android</param>
<param name="exclude">build/config/ios</param>
<param name="exclude">build/config/mac</param>
<param name="exclude">build/config/win</param>
<param name="exclude">build/config/fuchsia</param>
<param name="exclude">build/config/chromeos</param>
<param name="exclude">build/config/chromecast</param>
<param name="exclude">build/config/aix</param>
<param name="exclude">build/config/apple</param>
-->
<param name="exclude">buildtools/checkdeps</param>
<param name="exclude">buildtools/clang_format</param>
<param name="exclude">buildtools/third_party/libc++/trunk/benchmarks</param>
<param name="exclude">buildtools/third_party/libc++/trunk/docs</param>
<param name="exclude">buildtools/third_party/libc++/trunk/lib</param>
<param name="exclude">buildtools/third_party/libc++/trunk/test</param>
<param name="exclude">buildtools/third_party/libc++/trunk/utils</param>
<param name="exclude">buildtools/third_party/libc++/trunk/www</param>
<param name="exclude">buildtools/third_party/libc++abi/trunk/test</param>
<param name="exclude">v8/ChangeLog</param>
<param name="exclude">v8/benchmarks/</param>
<param name="exclude">v8/docs/</param>
<param name="exclude">v8/samples</param>
<!-- tests are bloated but there isnt a clear way to skip
<param name="exclude">v8/test/cctest</param>
<param name="exclude">v8/test/mjsunit</param>
<param name="exclude">v8/test/webkit</param>
<param name="exclude">v8/test/unittests</param>
<param name="exclude">v8/test/inspector</param>
<param name="exclude">v8/test/debugger</param>
<param name="exclude">v8/test/js-perf-test</param>
<param name="exclude">v8/test/intl</param>
<param name="exclude">v8/test/message</param>
-->
<param name="exclude">v8/tools/*.js</param>
<param name="exclude">v8/tools/*.mjs</param>
<param name="exclude">v8/tools/*.html</param>
<param name="exclude">v8/tools/turbolizer</param>
<!--
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
When trimming the build.... remember that the following files
are required to build and cannot be the subject of any
exclusion rules:
v8/test (most things)
v8/test/torque/test-torque.tq
v8/tools/gen-postmortem-metadata.py
v8/tools/js2c.py
v8/tools/run.py
v8/tools/snapshot/asm_to_inline_asm.py
v8/tools/testrunner/utils/dump_build_config.py
-->
</service>
<service name="tar" mode="manual"/>
<service name="recompress" mode="manual">
<param name="file">*.tar</param>
<param name="compression">xz</param>
</service>
<service name="cargo_audit" mode="manual">
<param name="srcdir">deno</param>
</service>
</services>

5
cargo_config Normal file
View File

@ -0,0 +1,5 @@
[source.crates-io]
replace-with = "vendored-sources"
[source.vendored-sources]
directory = "vendor"

3
deno-1.44.4.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6ab2aacd0fe42b4ff6d177a75638c620df963109492613896c0895932e8941ec
size 102007712

3
deno-1.45.0.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ceaff4e42f323923ae76cf1c6336394d564e112fefa99415e75233776acd0231
size 105075132

18
deno-disable-lto.patch Normal file
View File

@ -0,0 +1,18 @@
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -146,7 +146,6 @@ winapi = "=0.3.9"
[profile.release]
codegen-units = 1
incremental = true
-lto = true
opt-level = 'z' # Optimize for size
# Build release with debug symbols: cargo build --profile=release-with-debug
@@ -158,7 +157,6 @@ debug = true
[profile.bench]
codegen-units = 1
incremental = true
-lto = true
opt-level = 'z' # Optimize for size
# Key generation is too slow on `debug`

319
deno-rm-upgrade.patch Normal file
View File

@ -0,0 +1,319 @@
diff --git a/cli/tools/run/mod.rs.1 b/cli/tools/run/mod.rs
index 4805ea7..57bb752 100644
--- a/cli/tools/run/mod.rs.1
+++ b/cli/tools/run/mod.rs
@@ -51,14 +51,6 @@ To grant permissions, set them before the script argument. For example:
);
}
- // Run a background task that checks for available upgrades or output
- // if an earlier run of this background task found a new version of Deno.
- #[cfg(feature = "upgrade")]
- super::upgrade::check_for_upgrades(
- http_client.clone(),
- deno_dir.upgrade_check_file_path(),
- );
-
let main_module = cli_options.resolve_main_module()?;
maybe_npm_install(&factory).await?;
diff --git a/cli/main.rs.1 b/cli/main.rs
index 031ab07..4f3b05c 100644
--- a/cli/main.rs.1
+++ b/cli/main.rs
@@ -204,15 +204,6 @@ async fn run_subcommand(flags: Flags) -> Result<i32, AnyError> {
let types = tsc::get_types_declaration_file_text();
display::write_to_stdout_ignore_sigpipe(types.as_bytes())
}),
- #[cfg(feature = "upgrade")]
- DenoSubcommand::Upgrade(upgrade_flags) => spawn_subcommand(async {
- tools::upgrade::upgrade(flags, upgrade_flags).await
- }),
- #[cfg(not(feature = "upgrade"))]
- DenoSubcommand::Upgrade(_) => exit_with_message(
- "This deno was built without the \"upgrade\" feature. Please upgrade using the installation method originally used to install Deno.",
- 1,
- ),
DenoSubcommand::Vendor(vendor_flags) => spawn_subcommand(async {
tools::vendor::vendor(flags, vendor_flags).await
}),
diff --git a/cli/args/flags.rs.1 b/cli/args/flags.rs
index 48cfb92..eb31bf6 100644
--- a/cli/args/flags.rs.1
+++ b/cli/args/flags.rs
@@ -377,15 +377,6 @@ pub struct TestFlags {
pub junit_path: Option<String>,
}
-#[derive(Clone, Debug, Eq, PartialEq)]
-pub struct UpgradeFlags {
- pub dry_run: bool,
- pub force: bool,
- pub canary: bool,
- pub version: Option<String>,
- pub output: Option<String>,
-}
-
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct VendorFlags {
pub specifiers: Vec<String>,
@@ -428,7 +419,6 @@ pub enum DenoSubcommand {
Task(TaskFlags),
Test(TestFlags),
Types,
- Upgrade(UpgradeFlags),
Vendor(VendorFlags),
Publish(PublishFlags),
}
@@ -1097,9 +1087,6 @@ static ENV_VARIABLES_HELP: &str = color_print::cstr!(
<g>DENO_NO_PROMPT</> Set to disable permission prompts on access
(alternative to passing --no-prompt on invocation)
- <g>DENO_NO_UPDATE_CHECK</> Set to disable checking if a newer Deno version is
- available
-
<g>DENO_TLS_CA_STORE</> Comma-separated list of order dependent certificate
stores. Possible values: "system", "mozilla".
Defaults to "mozilla".
@@ -1209,7 +1196,6 @@ pub fn flags_from_vec(args: Vec<OsString>) -> clap::error::Result<Flags> {
"test" => test_parse(&mut flags, &mut m),
"types" => types_parse(&mut flags, &mut m),
"uninstall" => uninstall_parse(&mut flags, &mut m),
- "upgrade" => upgrade_parse(&mut flags, &mut m),
"vendor" => vendor_parse(&mut flags, &mut m),
"publish" => publish_parse(&mut flags, &mut m),
_ => unreachable!(),
@@ -1379,7 +1365,6 @@ fn clap_root() -> Command {
.subcommand(task_subcommand())
.subcommand(test_subcommand())
.subcommand(types_subcommand())
- .subcommand(upgrade_subcommand())
.subcommand(vendor_subcommand())
})
.long_about(DENO_HELP)
@@ -2776,60 +2761,6 @@ The declaration file could be saved and used for typing information.",
)
}
-fn upgrade_subcommand() -> Command {
- Command::new("upgrade")
- .about("Upgrade deno executable to given version")
- .long_about(
- "Upgrade deno executable to the given version.
-Defaults to latest.
-
-The version is downloaded from
-https://github.com/denoland/deno/releases
-and is used to replace the current executable.
-
-If you want to not replace the current Deno executable but instead download an
-update to a different location, use the --output flag
-
- deno upgrade --output $HOME/my_deno",
- )
- .hide(cfg!(not(feature = "upgrade")))
- .defer(|cmd| {
- cmd
- .arg(
- Arg::new("version")
- .long("version")
- .help("The version to upgrade to"),
- )
- .arg(
- Arg::new("output")
- .long("output")
- .help("The path to output the updated version to")
- .value_parser(value_parser!(String))
- .value_hint(ValueHint::FilePath),
- )
- .arg(
- Arg::new("dry-run")
- .long("dry-run")
- .help("Perform all checks without replacing old exe")
- .action(ArgAction::SetTrue),
- )
- .arg(
- Arg::new("force")
- .long("force")
- .short('f')
- .help("Replace current exe even if not out-of-date")
- .action(ArgAction::SetTrue),
- )
- .arg(
- Arg::new("canary")
- .long("canary")
- .help("Upgrade to canary builds")
- .action(ArgAction::SetTrue),
- )
- .arg(ca_file_arg())
- })
-}
-
// TODO(bartlomieju): this subcommand is now deprecated, remove it in Deno 2.
fn vendor_subcommand() -> Command {
Command::new("vendor")
@@ -4488,23 +4419,6 @@ fn types_parse(flags: &mut Flags, _matches: &mut ArgMatches) {
flags.subcommand = DenoSubcommand::Types;
}
-fn upgrade_parse(flags: &mut Flags, matches: &mut ArgMatches) {
- ca_file_arg_parse(flags, matches);
-
- let dry_run = matches.get_flag("dry-run");
- let force = matches.get_flag("force");
- let canary = matches.get_flag("canary");
- let version = matches.remove_one::<String>("version");
- let output = matches.remove_one::<String>("output");
- flags.subcommand = DenoSubcommand::Upgrade(UpgradeFlags {
- dry_run,
- force,
- canary,
- version,
- output,
- });
-}
-
fn vendor_parse(flags: &mut Flags, matches: &mut ArgMatches) {
ca_file_arg_parse(flags, matches);
config_args_parse(flags, matches);
@@ -4974,43 +4888,6 @@ mod tests {
assert_eq!(flags2, flags);
}
- #[test]
- fn upgrade() {
- let r = flags_from_vec(svec!["deno", "upgrade", "--dry-run", "--force"]);
- let flags = r.unwrap();
- assert_eq!(
- flags,
- Flags {
- subcommand: DenoSubcommand::Upgrade(UpgradeFlags {
- force: true,
- dry_run: true,
- canary: false,
- version: None,
- output: None,
- }),
- ..Flags::default()
- }
- );
- }
-
- #[test]
- fn upgrade_with_output_flag() {
- let r = flags_from_vec(svec!["deno", "upgrade", "--output", "example.txt"]);
- assert_eq!(
- r.unwrap(),
- Flags {
- subcommand: DenoSubcommand::Upgrade(UpgradeFlags {
- force: false,
- dry_run: false,
- canary: false,
- version: None,
- output: Some(String::from("example.txt")),
- }),
- ..Flags::default()
- }
- );
- }
-
#[test]
fn version() {
let r = flags_from_vec(svec!["deno", "--version"]);
@@ -8832,25 +8709,6 @@ mod tests {
);
}
- #[test]
- fn upgrade_with_ca_file() {
- let r = flags_from_vec(svec!["deno", "upgrade", "--cert", "example.crt"]);
- assert_eq!(
- r.unwrap(),
- Flags {
- subcommand: DenoSubcommand::Upgrade(UpgradeFlags {
- force: false,
- dry_run: false,
- canary: false,
- version: None,
- output: None,
- }),
- ca_data: Some(CaData::File("example.crt".to_owned())),
- ..Flags::default()
- }
- );
- }
-
#[test]
fn cache_with_cafile() {
let r = flags_from_vec(svec![
diff --git a/cli/tools/mod.rs.1 b/cli/tools/mod.rs
index 4593092..3247915 100644
--- a/cli/tools/mod.rs.1
+++ b/cli/tools/mod.rs
@@ -17,5 +17,4 @@ pub mod repl;
pub mod run;
pub mod task;
pub mod test;
-pub mod upgrade;
pub mod vendor;
diff --git a/cli/standalone/binary.rs.1 b/cli/standalone/binary.rs
index 628922b..f8bb1e2 100644
--- a/cli/standalone/binary.rs.1
+++ b/cli/standalone/binary.rs
@@ -499,13 +499,7 @@ impl<'a> DenoCompileBinaryWriter<'a> {
let archive_data = std::fs::read(binary_path)?;
let temp_dir = tempfile::TempDir::new()?;
- let base_binary_path = unpack_into_dir(
- "denort",
- &binary_name,
- archive_data,
- target.contains("windows"),
- &temp_dir,
- )?;
+ let base_binary_path = "/tmp";
let base_binary = std::fs::read(base_binary_path)?;
drop(temp_dir); // delete the temp dir
Ok(base_binary)
diff --git a/cli/lsp/language_server.rs.1 b/cli/lsp/language_server.rs
index 573fb1e..158c136 100644
--- a/cli/lsp/language_server.rs.1
+++ b/cli/lsp/language_server.rs
@@ -99,8 +99,6 @@ use crate::lsp::tsc::file_text_changes_to_workspace_edit;
use crate::lsp::urls::LspUrlKind;
use crate::tools::fmt::format_file;
use crate::tools::fmt::format_parsed_source;
-use crate::tools::upgrade::check_for_upgrades_for_lsp;
-use crate::tools::upgrade::upgrade_check_enabled;
use crate::util::fs::remove_dir_all_if_exists;
use crate::util::path::is_importable_ext;
use crate::util::path::to_percent_decoded_str;
@@ -2982,28 +2980,6 @@ impl tower_lsp::LanguageServer for LanguageServer {
}
}
- if upgrade_check_enabled() {
- // spawn to avoid lsp send/sync requirement, but also just
- // to ensure this initialized method returns quickly
- spawn(async move {
- match check_for_upgrades_for_lsp(http_client).await {
- Ok(version_info) => {
- client.send_did_upgrade_check_notification(
- lsp_custom::DidUpgradeCheckNotificationParams {
- upgrade_available: version_info.map(|info| {
- lsp_custom::UpgradeAvailable {
- latest_version: info.latest_version,
- is_canary: info.is_canary,
- }
- }),
- },
- );
- }
- Err(err) => lsp_warn!("Failed to check for upgrades: {err}"),
- }
- });
- }
-
lsp_log!("Server ready.");
}

21
deno-v8-arm.patch Normal file
View File

@ -0,0 +1,21 @@
--- ./vendor/v8/build.rs.orig 2024-06-27 14:26:40.281226961 +0200
+++ ./vendor/v8/build.rs 2024-06-27 14:28:10.388618455 +0200
@@ -200,16 +200,12 @@ fn build_v8(is_asan: bool) {
// cross-compilation setup
if target_arch == "aarch64" {
gn_args.push(r#"target_cpu="arm64""#.to_string());
- gn_args.push("use_sysroot=true".to_string());
- maybe_install_sysroot("arm64");
- maybe_install_sysroot("amd64");
+ gn_args.push("use_sysroot=false".to_string());
}
if target_arch == "arm" {
gn_args.push(r#"target_cpu="arm""#.to_string());
gn_args.push(r#"v8_target_cpu="arm""#.to_string());
- gn_args.push("use_sysroot=true".to_string());
- maybe_install_sysroot("i386");
- maybe_install_sysroot("arm");
+ gn_args.push("use_sysroot=false".to_string());
}
let target_triple = env::var("TARGET").unwrap();

3741
deno.changes Normal file

File diff suppressed because it is too large Load Diff

98
deno.spec Normal file
View File

@ -0,0 +1,98 @@
#
# spec file for package deno
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2020-2024 Avindra Goolcharan <avindra@opensuse.org>
# Copyright (c) 2018-2024 the Deno authors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: deno
Version: 1.45.0
Release: 0
Summary: A secure JavaScript and TypeScript runtime
License: MIT
Group: Productivity/Other
URL: https://github.com/denoland/deno
Source0: %{name}-%{version}.tar.xz
Source1: vendor.tar.xz
Source2: cargo_config
Source99: revendor_source.sh
Patch1: deno-rm-upgrade.patch
Patch2: deno-v8-arm.patch
BuildRequires: cargo-packaging
# gcc-c++ needed to build SPIRV-Cross
BuildRequires: clang
# needed by `libz-ng-sys` after 1.36.1
# see: https://build.opensuse.org/package/show/devel:languages:javascript/deno#comment-1808174
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: gn
BuildRequires: lld
BuildRequires: llvm
BuildRequires: ninja
BuildRequires: pkgconfig
BuildRequires: python3-base
BuildRequires: rust >= 1.68.0
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(gmodule-2.0)
BuildRequires: pkgconfig(gobject-2.0)
BuildRequires: pkgconfig(gthread-2.0)
BuildRequires: pkgconfig(protobuf)
# deno does not build on 32-bit archs
ExclusiveArch: x86_64 aarch64 ppc64 ppc64le s390x
# PATCH-FIX-OPENSUSE - Disable LTO (to reduce req memory)
%ifarch %{arm} aarch64
Patch10: deno-disable-lto.patch
%endif
%description
A JavaScript and TypeScript platform built on V8
Deno has standard library and has features such as
a linter, a language server protocol, a code formatter and
a unit test runner.
Remote code is fetched and cached on first execution, and only
updated with the --reload flag.
%prep
%autosetup -a1 -p1
# Drop lock file due to revendor_source.sh breaking check
rm Cargo.lock
# drop checksum for ICU 72 -> 73
echo '{"files":{},"package":""}' > vendor/deno_core/.cargo-checksum.json
cp %{SOURCE2} .cargo/config
%build
export V8_FROM_SOURCE=1
export CLANG_BASE_PATH=%{_prefix}
# https://www.chromium.org/developers/gn-build-configuration
export GN_ARGS="enable_nacl = false blink_symbol_level = 0 v8_symbol_level = 0"
# enable binary stripping
export RUSTFLAGS="%{__global_rustflags} -Clink-arg=-s"
%{cargo_build}
%install
# place deno cli manually (cannot cargo install)
mkdir -p %{buildroot}%{_bindir}
cp target/release/deno %{buildroot}%{_bindir}
%files
%license LICENSE.md
%doc README.md
%{_bindir}/%{name}
%changelog

63
revendor_source.sh Normal file
View File

@ -0,0 +1,63 @@
#!/bin/sh
set -euo pipefail
# packaging helper to merge rusty_v8 in place,
# from source (i.e., avoid using the published crate).
#
# output is a single, merged vendor tarball
wd="$(mktemp -d /tmp/revendor.XXXXX)"
# take what we need into the build
cp rusty_v8*xz $wd
cp vendor*xz $wd
cd $wd
echo -n "Extracting vendor..."
tar xf vendor*xz
echo "done"
echo -n "Extracting rusty_v8 (v8)..."
tar xf rusty*xz \
--exclude="Cargo.toml" \
--exclude="Cargo.lock"
echo " done"
# take vendored Cargo toml and lock which
# can still be used
cp vendor/v8/{Cargo.*,.cargo*} .
# get rid of everything else
rm -fr vendor/v8
# drop version prefix
target=$(find . -name "*_v8-*" -type d)
mv $target v8
# insert proper files
mv Cargo.* .cargo* v8
echo "Check final rusty_v8 root:"
ls -la v8
mv v8 vendor
# disregard rusty_v8 checks as we inject it directly from source
echo '{"files":{},"package":""}' > vendor/v8/.cargo-checksum.json
# extra: workaround winapi bloat
# by ejecting it from the build
#
# https://github.com/rust-lang/cargo/issues/7058
echo -n "Pruning winapi bloat... "
rm -fr vendor/winapi*gnu*/lib/*.a
echo "done"
# remake tarball
echo -n "Compressing archive... "
tar -cf - vendor/ | xz -9 -c - > vendor-merged.tar.xz
echo "done"
ls -lh "$wd/vendor-merged.tar.xz"
cd -
cp "$wd/vendor-merged.tar.xz" ./vendor.tar.xz

3
vendor.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:eae4781e9f78ee31884eb31f6114974482d175a74b318824491e00e385adf780
size 105619904