KEMBAR78
Embed the version information into the Windows executable by sschuberth · Pull Request #1689 · git-lfs/git-lfs · GitHub
Skip to content

Conversation

sschuberth
Copy link
Member

I'm currently looking into reducing the number of places where the version is defined, so that less places need to be touched when bumping the version for a new release, like e.g. in 4e5ba41.

But I have a few questions in this regard. To start with, where are the values for the variables in this line of the RPM spec defined? Do these come from a few lines above? I'm asking because these definitions differ in the case from the variable use.

@ttaylorr
Copy link
Contributor

I'm currently looking into reducing the number of places where the version is defined, so that less places need to be touched when bumping the version for a new release, like e.g. in 4e5ba41.

I'm on board with this 👍 . I think the reason that they are defined in more than one place has to do with preventing circular dependencies, though I'm neither happy with the existence of this problem or its (current) solution.

To start with, where are the values for the variables in this line of the RPM spec defined?

I'm not sure, but @andyneff might have a better idea 👍

@sschuberth sschuberth changed the title Reduce the number of version defines [WIP] Reduce the number of version defines Nov 19, 2016
@sschuberth
Copy link
Member Author

While looking more into this, I realized we should probably also add proper version information to the Windows executable (and an icon, while at it). My final goal would be to create the official Windows distribution on CI to be fully reproducible, and not on some "blessed" developer's machine.

@sschuberth sschuberth changed the title [WIP] Reduce the number of version defines Embed the version information into the Windows executable Nov 21, 2016
@sschuberth
Copy link
Member Author

Ok, so I changed the topic of this PR a bit ... in fact it's now not less places where some sort of version number is defined. But at least there now is a canonical place where to bump the version information for the Windows build: In the new resources.rc file.

lfs/lfs.go Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

I think I'd rather have the version stay here than in config, since it makes more sense to say lfs.Version than config.Version and have to look at your import paths to realize that the config package comes from github.com/git-lfs/git-lfs.

Copy link
Member Author

Choose a reason for hiding this comment

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

I can do that. It also solves the issue of Version being a var in config/version.go. IMO it should be a const like it is 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.

Turns out that when I import github.com/git-lfs/git-lfs/lfs in config/version.go in order to use lfs.Version I get import cycle not allowed :-( Any suggestion how to solve that?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, that's because the github.com/git-lfs/git-lfs/lfs package already has a dependency pointing towards github.com/git-lfs/git-lfs/config, introducing another dependency the other way around would be a circular dependency issue. Let's just leave it in the config package for now, even though it's kind of unfortunate.

Untangling that stuff would be more time than I think it's worth at this stage.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed.

Copy link
Contributor

Choose a reason for hiding this comment

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

FWIW I think it should eventually in ./git-lfs.go or something:

import gitlfs "github.com/git-lfs/git-lfs"
import "fmt"

func main() {
  fmt.Println(gitlfs.Version)
}

Oh god, I just realized git-lfs is not a valid go package. What have we donnnnnne.

As far as this PR is concerned, config.Version is just fiiiine 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

BTW, I was wondering why the version still is 1.5.0 in master. Don't you merge back the release branches to master?

Copy link
Contributor

Choose a reason for hiding this comment

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

Nope, release-1.5 is basically its own thing. Bug fixes will have to be backported to it. The master branch is diverging a lot already, with the scanner refactoring PRs.

I suppose we should change it to 2.0.0-dev or something though.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a part of the LFS version, or a version for the .rc format?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's part of the LFS version. I'm not super happy about the syntax either, but that's how it is :-/

Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need to do anything with git-lfs-x64.exe too?

Copy link
Member Author

Choose a reason for hiding this comment

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

Nope, I arbitrarily chose the x86 version. As both executables have the version information embedded it does not matter which one Inno Setup is looking at here. But I should make that clearer by adding a comment.

@sschuberth
Copy link
Member Author

I made a few minor updates, but I still wonder about how to conveniently update the version numbers across all places we now have. Should I add a shell script that runs sed or something?

@technoweenie
Copy link
Contributor

We basically just look at previous releases to see what needs to change. I don't think a script is necessary for this PR, but would be welcome.

@sschuberth
Copy link
Member Author

I don't think a script is necessary for this PR, but would be welcome.

I've rebased the PR and added such a script.

There is no reason for it to be variable.
…table

This fixes the display of the application icon in Windows' uninstall
dialog and allows Inno Setup to use the version information from the
executable.

Note that AppVeyor has windres.exe in all these locations:

C:\cygwin\bin\windres.exe
C:\cygwin64\bin\windres.exe
C:\MinGW\bin\windres.exe
C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin\windres.exe
C:\msys64\mingw32\bin\windres.exe
C:\msys64\mingw64\bin\windres.exe
C:\msys64\usr\bin\windres.exe
C:\Qt\Tools\mingw482_32\bin\windres.exe
C:\Qt\Tools\mingw491_32\bin\windres.exe
C:\Qt\Tools\mingw492_32\bin\windres.exe
C:\Qt\Tools\mingw530_32\bin\windres.exe
C:\Ruby193\DevKit\mingw\bin\windres.exe
C:\Ruby23\DevKit\mingw\bin\windres.exe
C:\Ruby23-x64\DevKit\mingw\bin\windres.exe

But only the Ruby versions work without giving an "preprocessing failed"
error.
@sschuberth
Copy link
Member Author

Looks like this is again waiting forever for CircleCI to return its result. Is this a known issue?

@ttaylorr
Copy link
Contributor

ttaylorr commented Dec 8, 2016

Looks like this is again waiting forever for CircleCI to return its result. Is this a known issue?

We had some issues last week where we'd exceeded our allotted build time for the month, but that issue has since been resolved. I'm not seeing any other weird changes to the circle.yml file in your tree, so perhaps you could try updating your branch (again) and hope that that kicks of a build?

@sschuberth
Copy link
Member Author

so perhaps you could try updating your branch (again) and hope that that kicks of a build?

Well, I did that just a few minutes ago, but I certainly can try again ...

@sschuberth
Copy link
Member Author

I don't see my PR being built at https://circleci.com/gh/git-lfs/git-lfs, so maybe we're indeed out of build time again?

@ttaylorr
Copy link
Contributor

ttaylorr commented Dec 8, 2016

maybe we're indeed out of build time again?

Hm, doesn't seem like it: the last PR I just pushed is building now. Going to loop in @technoweenie since he owns the Circle account.

This is done in a separate commit to check whether this makes trigger
Circle CI properly.
@sschuberth
Copy link
Member Author

Circle CI still is "Waiting for status to be reported", @technoweenie could you please advise?

@technoweenie
Copy link
Contributor

@sschuberth Our Circle trial expired, but we updated the billing recently. Can you update the branch with the latest from master, to kick the jobs off again? I'd do it, but you posted this on your fork.

@sschuberth
Copy link
Member Author

@technoweenie How recently did you update the billing? My last change to this PR is from 6 hours ago, but still Circle CI did not seem to kick off.

@technoweenie
Copy link
Contributor

Hmm... We're at 18% of our allotted build minutes. No errors from Circle CI. SHRUG. Just going to merge it, it's not like this PR adds anything remotely risky from mac builds.

@technoweenie technoweenie merged commit 2b60619 into git-lfs:master Dec 9, 2016
@sschuberth
Copy link
Member Author

Thanks!

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