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

Lingo Clean #63

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Lingo Clean #63

wants to merge 2 commits into from

Conversation

tanneberger
Copy link
Member

No description provided.

Copy link
Collaborator

@erlingrj erlingrj left a comment

Choose a reason for hiding this comment

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

I think this looks good, some questions only!

src/main.rs Outdated
@@ -87,6 +89,11 @@ fn do_clone_and_checkout(
Ok(git_rev)
}

fn do_remove_folder(path: &str) -> Result<(), RemoveFolderError> {
fs::remove_dir_all(path)
.map_err(|_| RemoveFolderError(format!("Could not delete folder: {}", path)))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this yield an error if the build folder is not present? Should probably not do that?

Copy link
Member Author

Choose a reason for hiding this comment

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

that is indeed a bug, fixed ist last commit

CommandSpec::Clean => {
let output_root = &config.apps[0].output_root;
if let Err(e) = remove_dir_all(&output_root.display().to_string()) {
error!("lingo was unable to delete build folder! {e}");
Copy link
Collaborator

Choose a reason for hiding this comment

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

More or less the same error message is produced by remove_dir_all

Copy link
Member Author

Choose a reason for hiding this comment

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

yes remove_dir_all produces and error and here we handle it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

But it seems like the error is: "lingo was unable to delete build folder! Could not delete folder: ..." which seems a little redundant

@@ -54,6 +55,12 @@ pub fn execute_command<'a>(
}
}
}
CommandSpec::Clean => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we also remove Lingo.toml here?

Copy link
Member Author

Choose a reason for hiding this comment

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

no

@tanneberger tanneberger requested a review from erlingrj January 2, 2025 23:05
Copy link

@edwardalee edwardalee left a comment

Choose a reason for hiding this comment

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

In my Makefile, make clean also removes Lingo.lock. If I don’t remove this file, then lingo build isn’t much use because it just checks out same previous version of the library repo that I’m trying to update. Is there a separate mechanism in Lingo for updating a library?

What if I want to update one library and not another? Removing Lingo.lock won’t do that.

Also, there are warning that should be dealt with.

@erlingrj
Copy link
Collaborator

erlingrj commented Jan 4, 2025

In my Makefile, make clean also removes Lingo.lock. If I don’t remove this file, then lingo build isn’t much use because it just checks out same previous version of the library repo that I’m trying to update. Is there a separate mechanism in Lingo for updating a library?

What if I want to update one library and not another? Removing Lingo.lock won’t do that.

We should probably stay inspired by cargo. To update dependcies we should do either lingo update or lingo update -p mqtt-c

Also, there are warning that should be dealt with.

Which warning? Is it #60 ?

@tanneberger
Copy link
Member Author

The purpose of the file Lingo.lock is to save and pin the selected packages.

If you remove the Lingo.lock file, Lingo has to re-evaluate the entire dependency tree by cloning everything and finding out the correct versions and sources (git, tarball, ...) to use.

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.

3 participants