Skip to content

Semver2#625

Merged
oocube merged 6 commits into
masterfrom
semver2
May 14, 2026
Merged

Semver2#625
oocube merged 6 commits into
masterfrom
semver2

Conversation

@oocube
Copy link
Copy Markdown
Contributor

@oocube oocube commented May 13, 2026

This second semver PR activates the semantic version number in our builds. With that #616 is complete.

Comment thread installers/win32/create_nsis.sh Outdated
return 1
fi

if [ -z "${VER_NSIS}" ]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's generally best practice to use double brackets [[ ]]

VER_MAJ=$(echo "$VERSION" | cut -d. -f1)
VER_MIN=$(echo "$VERSION" | cut -d. -f2)
VER_REV=$(echo "$VERSION" | cut -d. -f3)
if [ "" == "$VER_REV" ]; then
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Single Brackets (Dangerous):
if [ $name == "Bob" ]
If $name is empty, Bash sees: if [ == "Bob" ], which is a syntax error.

Double Brackets (Safe):
if [[ $name == "Bob" ]]
Even if $name is empty, Bash handles it gracefully without requiring extra quotes.

I try to stick to double brackets everywhere for consistency.

Comment thread ShellScripts/common/get_version.sh Outdated
VER_FULL="$VER_MAJ.$VER_MIN.$VER_REV.$VER_GITREV-$VER_DATE-$VER_GITHASH"
BUILDTIME=$(date "+%Y.%m.%d %H:%M")

if [ -z "${SEMVER}" ] || [ -z "${PROJECTNAME}" ]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would use double brackets and you can just do "$SEMVER" and "$PROJECTNAME"

else
# Variables passed in. Make use of them.

VER_FULL="${SEMVER}"
Copy link
Copy Markdown
Contributor

@mcarans mcarans May 13, 2026

Choose a reason for hiding this comment

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

simplify to "$SEMVER"

@mcarans
Copy link
Copy Markdown
Contributor

mcarans commented May 13, 2026

I added some comments.

BTW, do you think it would be better for PRs to fork the Oolite repo, then make PRs from the fork keeping the Oolite repo clean with only master and version branches (and maybe a develop branch)?

@phkb
Copy link
Copy Markdown
Contributor

phkb commented May 13, 2026

Windows Test version fails to start with this error

The procedure entry point __emutls_v._ZSt11__once_call could not be located in the dynamic link library C:\Oolite-semver\oolite.app\gnustep-base-1_31.dll

Haven't tried the standard version.

@oocube
Copy link
Copy Markdown
Contributor Author

oocube commented May 13, 2026

I added some comments.

BTW, do you think it would be better for PRs to fork the Oolite repo, then make PRs from the fork keeping the Oolite repo clean with only master and version branches (and maybe a develop branch)?

Added the double brackets although I am more happy with a syntax error than some automagical fix.
And just like your best practice for double brackets the curly ones are my best practice. ;-)

Your idea of handing development elsewhere is interesting. I was close to suggesting you to use branches in the oolite repository, thus making your development more visible to others. But I am happy to see now we have prereleases available for download for all branches and pull requests. Which means I can make a change and everybody and download and test the behaviour even without having merged. And for guys like you who develop in private then come up with a pull request, the PR will also result in a prerelease so we can test the behaviour before having to merge.

@mcarans
Copy link
Copy Markdown
Contributor

mcarans commented May 13, 2026

Your idea of handing development elsewhere is interesting. I was close to suggesting you to use branches in the oolite repository, thus making your development more visible to others. But I am happy to see now we have prereleases available for download for all branches and pull requests. Which means I can make a change and everybody and download and test the behaviour even without having merged. And for guys like you who develop in private then come up with a pull request, the PR will also result in a prerelease so we can test the behaviour before having to merge.

@oocube Did you test a PR from a forked repo with gitversion? All new devs do not have write access to the oolite repo so cannot create branches in it. I only received write access when it was required to install readthedocs. I was developing for months without any write access so forking and PRs was the only option.

It is sensible for security reasons that people are not given immediate write access to the oolite repo when they start developing so we should expect that there will be PRs coming from forks like this old open one for example: #426

It should only be maintainers who have write access to the oolite repo. Not all devs also need to be maintainers.

As for visibility, as long as there is a PR then there is visibility to the work done in a fork provided the user doesn't delete their branch or fork (but it's worse with full access to the oolite repo, where a user could delete a shared branch or worse the whole repo!).

I think if we make branches for every small fix directly on the main Oolite repo it will be hard to find the major branches and also it will make cloning the repo slower and slower.

@phkb
Copy link
Copy Markdown
Contributor

phkb commented May 13, 2026

I'm still getting that error when I download the Windows Test installer and install locally. When I build from source from this PR, it works fine.

@phkb
Copy link
Copy Markdown
Contributor

phkb commented May 13, 2026

And the same error happens in the standard Windows installer.

@mcarans
Copy link
Copy Markdown
Contributor

mcarans commented May 13, 2026

Windows Test version fails to start with this error

The procedure entry point __emutls_v._ZSt11__once_call could not be located in the dynamic link library C:\Oolite-semver\oolite.app\gnustep-base-1_31.dll

Haven't tried the standard version.

Errors like this occur whenever MSYS2 rebuild packages. Fixing it requires creating a new release of the Windows dependencies in the GitHub UI here: https://github.com/OoliteProject/oolite_windeps_build/releases. I reran the broken Windows test builds and they passed. I've rerun the Build Oolite package for this PR: https://github.com/OoliteProject/oolite/actions/runs/25809626925 - please see if that works for you.

@oocube
Copy link
Copy Markdown
Contributor Author

oocube commented May 14, 2026

@oocube Did you test a PR from a forked repo with gitversion? All new devs do not have write access to the oolite repo so cannot create branches in it. I only received write access when it was required to install readthedocs. I was developing for months without any write access so forking and PRs was the only option.

I did not, as I expect impact only to happen after this PR gets merged.

It is sensible for security reasons that people are not given immediate write access to the oolite repo when they start developing so we should expect that there will be PRs coming from forks like this old open one for example: #426

I agree not everyone should have direct write access. Security issues? Let's discuss them as they also exist with PR access. I opened #631 for that.

I think if we make branches for every small fix directly on the main Oolite repo it will be hard to find the major branches and also it will make cloning the repo slower and slower.

Let's discuss this in a different thread. This is the PR that allows us to distinguish artifacts for every branch.

@oocube
Copy link
Copy Markdown
Contributor Author

oocube commented May 14, 2026

As I responded to the comments, the windows test problems got fixed and the discussion is drifting away from this PR's purpose I will now merge.

@oocube oocube merged commit 0622e28 into master May 14, 2026
44 of 47 checks passed
@oocube oocube deleted the semver2 branch May 14, 2026 07:34
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