-
Notifications
You must be signed in to change notification settings - Fork 249
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
ci_: upgrade go to 1.22 #6258
base: develop
Are you sure you want to change the base?
ci_: upgrade go to 1.22 #6258
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
{ | ||
stdenv, | ||
lib, | ||
fetchgit, | ||
fetchurl, | ||
buildGo122Module, | ||
zlib, | ||
makeWrapper, | ||
xcodeenv, | ||
androidenv, | ||
xcodeWrapperArgs ? { }, | ||
xcodeWrapper ? xcodeenv.composeXcodeWrapper xcodeWrapperArgs, | ||
withAndroidPkgs ? true, | ||
androidPkgs ? ( | ||
androidenv.composeAndroidPackages { | ||
includeNDK = true; | ||
} | ||
), | ||
}: | ||
buildGo122Module { | ||
pname = "gomobile"; | ||
version = "0-unstable-2024-12-13"; | ||
|
||
src = fetchgit { | ||
name = "gomobile"; | ||
url = "https://go.googlesource.com/mobile"; | ||
rev = "a87c1cf6cf463f0d4476cfe0fcf67c2953d76e7c"; | ||
hash = "sha256-7j4rdmCZMC8tn4vAsC9x/mMNkom/+Tl7uAY+5gkSvfY="; | ||
}; | ||
|
||
vendorHash = "sha256-6ycxEDEE0/i6Lxo0gb8wq3U2U7Q49AJj+PdzSl57wwI="; | ||
|
||
CGO_ENABLED = "1"; | ||
|
||
subPackages = [ | ||
"bind" | ||
"cmd/gobind" | ||
"cmd/gomobile" | ||
]; | ||
|
||
# Fails with: go: cannot find GOROOT directory | ||
doCheck = false; | ||
|
||
nativeBuildInputs = [ makeWrapper ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcodeWrapper ]; | ||
|
||
# Prevent a non-deterministic temporary directory from polluting the resulting object files | ||
postPatch = '' | ||
substituteInPlace cmd/gomobile/env.go --replace-quiet \ | ||
'tmpdir, err = ioutil.TempDir("", "gomobile-work-")' \ | ||
'tmpdir = filepath.Join(os.Getenv("NIX_BUILD_TOP"), "gomobile-work")' | ||
substituteInPlace cmd/gomobile/init.go --replace-quiet \ | ||
'tmpdir, err = ioutil.TempDir(gomobilepath, "work-")' \ | ||
'tmpdir = filepath.Join(os.Getenv("NIX_BUILD_TOP"), "work")' | ||
|
||
# To fix unable to import bind: no Go package in golang.org/x/mobile/bind | ||
substituteInPlace cmd/gomobile/init.go --replace \ | ||
'golang.org/x/mobile/cmd/gobind@latest' \ | ||
'golang.org/x/mobile/cmd/gobind' | ||
''; | ||
|
||
# Necessary for GOPATH when using gomobile. | ||
postInstall = '' | ||
mkdir -p $out/src/golang.org/x | ||
ln -s $src $out/src/golang.org/x/mobile | ||
''; | ||
|
||
postFixup = '' | ||
for prog in gomobile gobind; do | ||
wrapProgram $out/bin/$prog \ | ||
--suffix GOPATH : $out \ | ||
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ zlib ]}" \ | ||
${lib.optionalString withAndroidPkgs '' | ||
--prefix PATH : "${androidPkgs.androidsdk}/bin" \ | ||
--set-default ANDROID_HOME "${androidPkgs.androidsdk}/libexec/android-sdk" | ||
''} | ||
done | ||
''; | ||
|
||
meta = { | ||
description = "Tool for building and running mobile apps written in Go"; | ||
homepage = "https://pkg.go.dev/golang.org/x/mobile/cmd/gomobile"; | ||
license = with lib.licenses; [ bsd3 ]; | ||
maintainers = with lib.maintainers; [ jakubgs ]; | ||
}; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ let | |
|
||
/* Lock requires Xcode verison. */ | ||
xcodeWrapper = callPackage ./pkgs/xcodeenv/compose-xcodewrapper.nix { } { | ||
versions = ["14.3" "15.1" "15.2" "15.3" "15.4"]; | ||
versions = [ ]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have kept it empty to accept whatever version of Xcode exists on CI hosts. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, if there's no known versions of Xcode that break |
||
}; | ||
|
||
/* Gomobile also needs the Xcode wrapper. */ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment, why it is needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, is it just a copy from certain commit (add which one) or some lines were edited (add comments, which ones and why)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I will update comments.
Here i was updating to a newer version of
gomobile
and using latest derivation from master of nixpkgs.