Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aot macro compilation - magic script #1789

Closed
wants to merge 18 commits into from
Closed

Conversation

wawel37
Copy link
Member

@wawel37 wawel37 commented Nov 28, 2024

No description provided.

@wawel37 wawel37 requested a review from mkaput November 28, 2024 14:10
@wawel37 wawel37 requested a review from a team as a code owner November 28, 2024 14:10
scarb/src/ops/package.rs Outdated Show resolved Hide resolved
scarb/src/ops/package.rs Outdated Show resolved Hide resolved
scarb/src/ops/package.rs Show resolved Hide resolved
scarb/src/ops/package.rs Outdated Show resolved Hide resolved
scarb/src/ops/package.rs Outdated Show resolved Hide resolved
@wawel37 wawel37 force-pushed the aot-macros/magic-script branch from 5f885c1 to cd18cbd Compare November 29, 2024 15:54
@wawel37 wawel37 force-pushed the aot-macros/magic-script branch from cd18cbd to 4a68d19 Compare November 29, 2024 15:54
@wawel37 wawel37 requested review from mkaput and DelevoXDG November 29, 2024 15:55
scarb/src/ops/package.rs Outdated Show resolved Hide resolved
scarb/tests/package.rs Outdated Show resolved Hide resolved
scarb/tests/package.rs Outdated Show resolved Hide resolved
scarb/tests/package.rs Outdated Show resolved Hide resolved
@wawel37 wawel37 requested review from DelevoXDG and mkaput December 5, 2024 16:14
@@ -75,6 +75,7 @@ pub struct ManifestMetadata {
pub license_file: Option<Utf8PathBuf>,
pub readme: Option<Utf8PathBuf>,
pub repository: Option<String>,
pub include: Option<Vec<String>>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this field should be a separate PR

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just thought that adding this single field isn't that much of a big change to make it as a separate PR, but I see your point, should i convert this to stacked PR?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so

@wawel37 wawel37 force-pushed the aot-macros/magic-script branch from 1f6c2e7 to fb66fcf Compare December 6, 2024 10:50
@wawel37 wawel37 requested a review from mkaput December 6, 2024 10:56
@wawel37 wawel37 force-pushed the aot-macros/magic-script branch from 896a6e3 to 81dcccc Compare December 6, 2024 13:13
scarb/src/lib.rs Show resolved Hide resolved
copy_items_to_target_dir(includes, target_dir_path)?;
}

execute_script(script_definition, &[], ws, target_dir_path, None)?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we executing the script in target/package?

It seems to me it should be either executed in the root dir, or if we want avoid modifying any unnecessary files there, in target/package/<name>-<version>?

b.name("foo")
.version("1.0.0")
.manifest_package_extra(formatdoc! {r#"
include = ["Cargo.lock", "Cargo.toml", "src"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure it's supposed to work that way 🤔

These files are included in the tarball by default, shouldn't we use all the files that are included in the tarball by default when running a package script?

let script_code = indoc! { r#"cargo build --release && mkdir -p ../scarb/cairo-plugin && cp target/release/libfoo.so ../scarb/cairo-plugin"#};

#[cfg(windows)]
let script_code = indoc! { r#"cargo build --release && mkdir -p ../scarb/cairo-plugin && cp target/release/libfoo.dll ../scarb/cairo-plugin"#};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the users are not supposed to use relatives paths like ../scarb/cairo-plugin or ../scarb/cairo-plugin, and binaries should not be copied somewhere outside of the cwd tree.

The binaries imo should either:

  1. Be required to be placed in target/scarb/cairo-plugin/
  2. Be automatically located regardless of their path and then placed in the correct directory

@maciektr
Copy link
Contributor

Replacing with #1836

@maciektr maciektr closed this Dec 10, 2024
@maciektr maciektr mentioned this pull request Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants