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

add: micro-nightly #1814

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

Conversation

davidusrex
Copy link

Closes #1598

Would it be possible to add a "tag" input to the gh_commit function in anda? What I'm trying to do is get the latest commit hash of the nightly tagged release instead of the latest commit hash of the main branch. That being said, it's probably not the end of the world if it can't be done.

I've had to compromise on how to handle versioning. The current maintainers of micro have taken the approach in the original developer's absence (the whole reason why I wanted to package this in the first place) to not bump the version number (current release version is 2.0.13, from Oct 2023) but instead to use its own convention for dev pre-release versions - appending "dev.(number of commits since last release version)" to the next release version number, i.e. the latest pre-release version is 2.0.14-dev.245

I've found out the hard way that this causes all sorts of problems with rpm, so what I've done is simply made %version = 2.0.14~dev. Also I have no idea where to even start with getting the commit count difference for update.rhai, seriously I spent like a week thinking about it lol

The downside to this is that the user won't know which commit their package is built against until they run the binary (the correct versioning scheme desired by micro is built into the binary). Please let me know if you would prefer appending the caret syntax to the rpm package version as well, i.e. 2.0.14~dev^20240731g2259fd1

I mentioned that the specfile failed to build in mock, would appreciate any and all help and advice on what I'm doing wrong.

Thanks so much!

@davidusrex
Copy link
Author

In hindsight I think I answered a lot of my own questions. I'll make the necessary changes to incorporate the caret syntax into the version and build the package against the latest commit of main instead.

@madonuko madonuko added the new This adds a new package label Aug 2, 2024
@madonuko
Copy link
Member

madonuko commented Aug 2, 2024

Well… personally I think if you are calling this a nightly package then tracking the HEAD commit makes sense…

Copy link
Member

@madonuko madonuko left a comment

Choose a reason for hiding this comment

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

Also, I think I'd put this in anda/devs instead; anda/apps are more for like graphical apps

Thank you so much by the way :3

Comment on lines +53 to +54
%generate_buildrequires
%go_generate_buildrequires
Copy link
Member

Choose a reason for hiding this comment

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

You probably don't need this

%global godocs README.md

Name: %{goname}-%{tag}
Version: 2.0.14~dev^%{commit_date}g%{shortcommit}
Copy link
Member

@madonuko madonuko Aug 2, 2024

Choose a reason for hiding this comment

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

I feel like 2.0.14 right now basically has no meaning whatsoever, might as well use %{commit_date}.%{shortcommit}?

%global golicenses LICENSE LICENSE-THIRD-PARTY
%global godocs README.md

Name: %{goname}-%{tag}
Copy link
Member

Choose a reason for hiding this comment

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

%{tag}?

go generate ./runtime

for cmd in cmd/* ; do
%gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd
Copy link
Member

Choose a reason for hiding this comment

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

This line causes mock to fail. Try this instead: (see langs/go/glow)

Suggested change
%gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd
go build -ldflags "-B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -s -w" -buildmode=pie -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd

Summary: A modern and intuitive terminal-based text editor
License: MIT AND Apache-2.0 AND MPL-2.0
URL: https://micro-editor.github.io
Source0: %{gosource}
Copy link
Member

Choose a reason for hiding this comment

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

Oh yeah, by the way, we are currently updating the Terra submission policies and guidelines, and you are encouraged to add yourself to Packager:

Suggested change
Source0: %{gosource}
Source0: %{gosource}
Packager: davidusrex <dlunn@outlook.com>

Comment on lines +1 to +6
if filters.contains("nightly") {
rpm.global("commit", gh_commit("zyedidia/micro"));
if rpm.changed() {
rpm.release();
}
}
Copy link
Member

Choose a reason for hiding this comment

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

(Again, we are still updating our documentation, so here you go:)

Suggested change
if filters.contains("nightly") {
rpm.global("commit", gh_commit("zyedidia/micro"));
if rpm.changed() {
rpm.release();
}
}
rpm.global("commit", gh_commit("zyedidia/micro"));
if rpm.changed() {
rpm.release();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new This adds a new package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Request] micro-nightly
2 participants