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

Allow compiled binaries to get version #997

Merged
merged 3 commits into from
Jan 29, 2024
Merged

Allow compiled binaries to get version #997

merged 3 commits into from
Jan 29, 2024

Conversation

Hofer-Julian
Copy link
Contributor

We started using the function that Julia provides, but it doesn't seem to work with compiled binaries

Fixes #364

We started using the function that julia provides, but it doesn't seem to work with compiled binaries
Fixes #364
@deltamarnix
Copy link
Contributor

I did a test on the Main branch and I checked main_test.jl.

I changed the test to

@testitem "version" begin
    using IOCapture: capture

    (; value, output) = capture() do
        Ribasim.main(["--version"])
    end
    @test value == 0
    @test output != "nothing"
    @test VersionNumber(output) > v"0.0.0"
end

It works locally, but as described in the issue, the binary .exe returns "nothing".
The solution provided in this PR breaks this adjusted test in code mode, but will make the binary.exe return correct values.

I would suggest to make a bug report that shows these differences with an example: https://github.com/JuliaLang/julia/issues

@Hofer-Julian Hofer-Julian requested a review from visr January 29, 2024 11:56
@Hofer-Julian Hofer-Julian marked this pull request as ready for review January 29, 2024 11:57
Comment on lines 4 to 6
if !isnothing(version)
return version
else
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know how the Ribasim team is on this, but to have less nesting you could write it as: !isnothing(version) && return version

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fine by me

@Hofer-Julian Hofer-Julian merged commit 24e3a5b into main Jan 29, 2024
19 checks passed
@Hofer-Julian Hofer-Julian deleted the binary-version branch January 29, 2024 12:58
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.

Version cannot be acquired with compiled binaries
3 participants