-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fixes to build scripts for initial release #167
Conversation
if isnothing(m) | ||
throw(ArgumentError("Could not parse host triplet from $(basename(artifact_path))")) | ||
end | ||
for platform in REQUIRED_PLATFORMS |
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.
By using a list of required platforms we can ensure that if we failed to upload all of the artifacts that the bind_artifacts.jl
script will fail as it will attempt to download a file that doesn't exist
platform_str = "$platform_triplet-julia_version+$julia_version" | ||
platform = parse(BinaryPlatforms.Platform, platform_str) | ||
@info "Dowloading artifact $artifact_url" | ||
artifact_path = joinpath(TARBALL_DIR, artifact_name) |
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.
Previously we downloaded files to a temporary directory instead of the TARBALL_DIR
. This will override any locally generated files but that seems fine.
const REQUIRED_JULIA_VERSIONS = (v"1.8", v"1.9") | ||
const REQUIRED_PLATFORMS = let | ||
base_platforms = parse.(Platform, REQUIRED_BASE_TRIPLETS) | ||
base_tags = [(; julia_version=string(v)) for v in REQUIRED_JULIA_VERSIONS] | ||
[Platform(arch(p), platform_name(p); tags...) | ||
for p in base_platforms, tags in base_tags][:] | ||
end |
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.
Didn't spend much time refactoring this. If we can make the artifacts non-Julia specific this becomes much cleaner
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.
LGTM - it's not worth prettifying anyway
build/common.jl
Outdated
function set_url_scheme(url, scheme) | ||
m = match(LibGit2.URL_REGEX, url) | ||
if m === nothing | ||
throw(ArgumentError("URL is not a valid SCP or HTTP(S) URL: $(url)")) | ||
end | ||
return LibGit2.git_url(; scheme="https", username=something(m[:user], ""), | ||
host=something(m[:host], ""), port=something(m[:port], ""), | ||
path=something(m[:path], "")) | ||
end |
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.
@glennmoy I can understand your reason for copying the regex from LibGit2 as it's not exported by the library. However, now that I'm using git_url
as well it seemed better to use the function and regex from the library that tests them.
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.
So my understandig is this converts, e.g. git@github.com:beacon-biosignals/ray.jl
to https://github.com:beacon-biosignals/ray.jl
?
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.
Yes, it converts SCP-like URLs to HTTPS URLs. Specifically:
julia> set_url_scheme("git@github.com:beacon-biosignals/Ray.jl", "https")
"https://git@github.com/beacon-biosignals/Ray.jl"
We'll want to drop the user as we don't want that in our artifact URLs
@glennmoy feel free to make changes, approve, and merge this when you get in. Once that's done we can make the |
Yeah I wasn't sure about having to include |
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.
I'll give this a run through to make sure it works before merging
const REQUIRED_JULIA_VERSIONS = (v"1.8", v"1.9") | ||
const REQUIRED_PLATFORMS = let | ||
base_platforms = parse.(Platform, REQUIRED_BASE_TRIPLETS) | ||
base_tags = [(; julia_version=string(v)) for v in REQUIRED_JULIA_VERSIONS] | ||
[Platform(arch(p), platform_name(p); tags...) | ||
for p in base_platforms, tags in base_tags][:] | ||
end |
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.
LGTM - it's not worth prettifying anyway
build/common.jl
Outdated
function set_url_scheme(url, scheme) | ||
m = match(LibGit2.URL_REGEX, url) | ||
if m === nothing | ||
throw(ArgumentError("URL is not a valid SCP or HTTP(S) URL: $(url)")) | ||
end | ||
return LibGit2.git_url(; scheme="https", username=something(m[:user], ""), | ||
host=something(m[:host], ""), port=something(m[:port], ""), | ||
path=something(m[:path], "")) | ||
end |
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.
So my understandig is this converts, e.g. git@github.com:beacon-biosignals/ray.jl
to https://github.com:beacon-biosignals/ray.jl
?
build/upload_tarballs.jl
Outdated
@@ -92,15 +64,9 @@ if abspath(PROGRAM_FILE) == @__FILE__ | |||
# check that contents are tarballs with correct filename | |||
all(t -> !isnothing(match(TARBALL_REGEX, t)), readdir(TARBALL_DIR)) |
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.
first time I wrote this I wanted to see if there was a file
command (similar to the bash command) that would assert the file type rather than check against a regex. I went looking in Base.Filesystem
module but didn't see anything. Only calling it out in case you knew of one off hand - not suggesting we have to change it now.
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.
I think the usual way of handling this would be just to look at the extension. The other way is probably to use FileIO.jl and use the detection function which would detect the file type from magic bytes in the header: https://juliaio.github.io/FileIO.jl/stable/registry/#Registry-table
Assuming this works we'll merge it, I'll regenerate the Artifacts and then we can make a tag! |
Codecov Report
@@ Coverage Diff @@
## main #167 +/- ##
=======================================
Coverage 93.90% 93.90%
=======================================
Files 12 12
Lines 558 558
=======================================
Hits 524 524
Misses 34 34
Flags with carried forward coverage won't be shown. Click here to find out more. 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@omus the build worked - I just have a few suggestions incoming |
In attempting to do our initial release I encountered a few issues with things being out of date.
As I worked through these issues I noticed that the artifacts we are uploading have very specific triplets. Normally, the triplets from BinaryBuilder are based upon
BinaryBuilder.supported_platforms()
which uses quite generic triplets and mainly focuses on OS and architecture. Having an overly specific triplet is an issue in that it can result in us generating more artifacts than we have to. I've reduced the triplet down to what should be the current minimum. Ideally, we wouldn't use the Julia version in our triplet but appears that ourWORKSPACE.bazel
setup is pulling in Julia specific headers which is resulting in shared libraries which are incompatible with other Julia version (I think it's because our library is fully statically compiled).Anyway, these should be the final changes needed to be merged so we can cut our initial release.