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

Format Code #71

Merged
merged 1 commit into from
Feb 11, 2024
Merged

Format Code #71

merged 1 commit into from
Feb 11, 2024

Conversation

hsbasu
Copy link
Collaborator

@hsbasu hsbasu commented Feb 10, 2024

  • Using custom script to extract version from debian/changelog
  • Fix tab spacing in metadata file

@amit9838 amit9838 self-requested a review February 10, 2024 15:03
meson.build Outdated Show resolved Hide resolved
@amit9838 amit9838 self-requested a review February 10, 2024 15:20
Copy link
Owner

@amit9838 amit9838 left a comment

Choose a reason for hiding this comment

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

added comments

@hsbasu
Copy link
Collaborator Author

hsbasu commented Feb 10, 2024

I built both snap and flatpak locally on my system. And tested the app. Both of them are working.

@hsbasu
Copy link
Collaborator Author

hsbasu commented Feb 10, 2024

I think we should change the snap and flatpak workflow so that it always checks for any build errors on any branch and PR. This way before creating a PR we should be able to fix any build issue.

@amit9838
Copy link
Owner

I want to know that , lets say i'm building new version(1.0.3) and Im compiling the flatpak or snap , how can i Change the version to 1.0.3, or is it going to pick when it is released

@hsbasu
Copy link
Collaborator Author

hsbasu commented Feb 10, 2024

It will pick the version automatically. You just need to update these files:

data/io.github.amit9838.mousam.appdata.xml.in
debian/changelog

After you have updated the data/io.github.amit9838.mousam.appdata.xml.in with a new version, I'll update the debian/changelog using the command gbp dch --full -N <the new version in data/io.github.amit9838.mousam.appdata.xml.in> -D stable.

Edit: I think you might also need to use --since option as well with gbp dch. Anyway. If you ping me after updating the data/io.github.amit9838.mousam.appdata.xml.in, I'll do the rest for you.

@hsbasu
Copy link
Collaborator Author

hsbasu commented Feb 10, 2024

@amit9838 I would suggest using the Squash and merge option rather than using Merge Commits when merging a PR. You should be able to access these options by clicking the down arrow on the right of Merge Commits options.

@amit9838
Copy link
Owner

It will pick the version automatically. You just need to update these files:

data/io.github.amit9838.mousam.appdata.xml.in
debian/changelog

After you have updated the data/io.github.amit9838.mousam.appdata.xml.in with a new version, I'll update the debian/changelog using the command gbp dch --full -N <the new version in data/io.github.amit9838.mousam.appdata.xml.in> -D stable.

Edit: I think you might also need to use --since option as well with gbp dch. Anyway. If you ping me after updating the data/io.github.amit9838.mousam.appdata.xml.in, I'll do the rest for you.

I tested this thing, but it is not building the app in runner in debug mode, and I think it not fesible to always build the project and generate new package. And i think there is one more issue of dependency of project over the changelog file in the deb dir(it need to run a script first) to make any new release.
So what i would suggest it to either create a new file may be VERSION.txt in deb dir containing version which can be updated manually whenever a new release is made, or get it from meson file using some python script.
Example :

import re

def get_package_version(file_path):
    with open(file_path, 'r') as file:
        content = file.read()
        version_match = re.search(r"version:\s*'([\d.]+)'", content)
        if version_match:
            return version_match.group(1)
        else:
            return None

meson_file_path = 'meson.build'
version = get_package_version(meson_file_path)
if version:
    print(f"The package version is: {version}")
else:
    print("Package version not found in the meson.build file.")

@hsbasu
Copy link
Collaborator Author

hsbasu commented Feb 10, 2024

Which runner did you use and how?

@amit9838
Copy link
Owner

amit9838 commented Feb 10, 2024

I mean Builder
https://flathub.org/apps/org.gnome.Builder

@hsbasu
Copy link
Collaborator Author

hsbasu commented Feb 10, 2024

And i think there is one more issue of dependency of project over the changelog file in the deb dir(it need to run a script first) to make any new release.

Which script are you saying? Can you explain?

So what i would suggest it to either create a new file may be VERSION.txt in deb dir containing version which can be updated manually whenever a new release is made, or get it from meson file using some python script.

Debian packaging does not work that way. For debian packaging, you create the changelog file first. Before you build a .deb package.

@hsbasu
Copy link
Collaborator Author

hsbasu commented Feb 10, 2024

I mean Builder https://flathub.org/apps/org.gnome.Builder

Give me some time. Leave the PR as it is. I'll test it with gnome-builder. Have you tried following flatpak packaging tutorials here?

There they say that to build a flatpak you just need to run

flatpak-builder build-dir io.github.amit9838.mousam.json # build step
flatpak-builder --user --install --force-clean build-dir io.github.amit9838.mousam.json # testing step
flatpak run io.github.amit9838.mousam

If these two steps does not show any issue, then everything's alright.

@hsbasu
Copy link
Collaborator Author

hsbasu commented Feb 10, 2024

I mean Builder https://flathub.org/apps/org.gnome.Builder

@amit9838 Can you paste the error that you are getting on gnome-builder?

In my case its showing this:

The state dir (/home/himadri/Projects/project-mamolinux/Side_projects/my-repos/packages/apps/mousam/.flatpak-builder) is not on the same filesystem as the target dir (/home/himadri/.var/app/org.gnome.Builder/cache/gnome-builder/projects/mousam/flatpak/staging)

because source and target directory are on two different partitions.

@amit9838
Copy link
Owner

amit9838 commented Feb 10, 2024

Have you tried building using play button given in the menubar (center)

@amit9838
Copy link
Owner

And i think there is one more issue of dependency of project over the changelog file in the deb dir(it need to run a script first) to make any new release.

Which script are you saying? Can you explain?

So what i would suggest it to either create a new file may be VERSION.txt in deb dir containing version which can be updated manually whenever a new release is made, or get it from meson file using some python script.

Debian packaging does not work that way. For debian packaging, you create the changelog file first. Before you build a .deb package.

I mean this command,
gbp dch --full -N <the new version in data/io.github.amit9838.mousam.appdata.xml.in> -D stable

So, you can create the changelog file, without modefing the meson.build file right?

@hsbasu
Copy link
Collaborator Author

hsbasu commented Feb 10, 2024

And i think there is one more issue of dependency of project over the changelog file in the deb dir(it need to run a script first) to make any new release.

Which script are you saying? Can you explain?

So what i would suggest it to either create a new file may be VERSION.txt in deb dir containing version which can be updated manually whenever a new release is made, or get it from meson file using some python script.

Debian packaging does not work that way. For debian packaging, you create the changelog file first. Before you build a .deb package.

I mean this command, gbp dch --full -N <the new version in data/io.github.amit9838.mousam.appdata.xml.in> -D stable

So, you can create the changelog file, without modefing the meson.build file right?

Yes. Of course. I changed it to dynamic version so that the meson.build need not be modified every time we do a version update.

@hsbasu
Copy link
Collaborator Author

hsbasu commented Feb 10, 2024

Have you tried building using play button given in the menubar (center)

Yes. I clicked on that to build. Actually, gnome-builder is just an IDE like VS Code. It's not necessary to build flatpak or snaps. And IDE, you can use anything, be it gnome-builder or Code or Atom.

@amit9838
Copy link
Owner

Ok, so deb build entirly depends on changelog file. So lets remove dynamic versioning from. For now we can change it manually on new release. W'll fix it later.

@hsbasu
Copy link
Collaborator Author

hsbasu commented Feb 11, 2024

Ok, so deb build entirly depends on changelog file. So lets remove dynamic versioning from. For now we can change it manually on new release. W'll fix it later.

Not entirely. But it's part of it. It's more complex than that.

@hsbasu
Copy link
Collaborator Author

hsbasu commented Feb 11, 2024

I'll remove the versioning part from this PR.

@hsbasu
Copy link
Collaborator Author

hsbasu commented Feb 11, 2024

@amit9838 I updated this commit and now it only fixes the tab spacing in the metadata file.

@amit9838 amit9838 changed the title Fix dynamic versioning in meson Format Code Feb 11, 2024
@amit9838 amit9838 self-requested a review February 11, 2024 13:19
Copy link
Owner

@amit9838 amit9838 left a comment

Choose a reason for hiding this comment

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

Thnaks, LGTM

@amit9838 amit9838 merged commit 6659db2 into amit9838:master Feb 11, 2024
3 checks passed
@hsbasu hsbasu deleted the fix-versioning branch February 11, 2024 13:28
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.

2 participants