-
Notifications
You must be signed in to change notification settings - Fork 44
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
07 fixes + tests #147
07 fixes + tests #147
Changes from 5 commits
8ca9a05
22d89b2
fa9ff19
8f407ab
929e616
b296ffd
a6555c6
1865ec5
0e4b318
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
julia 0.6 | ||
julia 0.7-alpha | ||
Compat 0.42.0 | ||
URIParser 0.0.3 | ||
@unix HTTPClient 0.0.0 | ||
LibExpat 0.2.8 | ||
Libz | ||
CodecZlib 0.4 | ||
BinDeps 0.3 | ||
SHA |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
environment: | ||
matrix: | ||
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe" | ||
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe" | ||
|
||
## uncomment the following lines to allow failures on nightly julia | ||
## (tests will run but not make your overall status red) | ||
#matrix: | ||
# allow_failures: | ||
# - JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe" | ||
# - JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe" | ||
|
||
branches: | ||
only: | ||
- master | ||
- /release-.*/ | ||
|
||
notifications: | ||
- provider: Email | ||
on_build_success: false | ||
on_build_failure: false | ||
on_build_status_changed: false | ||
|
||
install: | ||
- ps: "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12" | ||
# If there's a newer build queued for the same PR, cancel this one | ||
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod ` | ||
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | ` | ||
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` | ||
throw "There are newer queued builds for this pull request, failing early." } | ||
# Download most recent Julia Windows binary | ||
- ps: (new-object net.webclient).DownloadFile( | ||
$env:JULIA_URL, | ||
"C:\projects\julia-binary.exe") | ||
# Run installer silently, output to C:\projects\julia | ||
- C:\projects\julia-binary.exe /S /D=C:\projects\julia | ||
|
||
build_script: | ||
# Need to convert from shallow to complete for Pkg.clone to work | ||
- IF EXIST .git\shallow (git fetch --unshallow) | ||
- C:\projects\julia\bin\julia -e "versioninfo(); | ||
Pkg.clone(pwd(), \"WinRPM\"); Pkg.build(\"WinRPM\")" | ||
|
||
test_script: | ||
- C:\projects\julia\bin\julia -e "Pkg.test(\"WinRPM\")" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ if isunix() | |
using HTTPClient.HTTPC | ||
end | ||
|
||
using Libz, LibExpat, URIParser | ||
using CodecZlib, LibExpat, URIParser | ||
|
||
import Base: show, getindex, wait_close, pipeline_error | ||
|
||
|
@@ -153,7 +153,7 @@ function update(ignorecache::Bool=false, allow_remote::Bool=true) | |
warn("received error $(data[2]) while downloading $source/$path") | ||
return nothing | ||
end | ||
body = gunzip ? Libz.decompress(convert(Vector{UInt8},data[1])) : data[1] | ||
body = gunzip ? transcode(GzipDecompressor, convert(Vector{UInt8}, data[1])) : data[1] | ||
open(path2, "w") do f | ||
write(f, body) | ||
end | ||
|
@@ -447,7 +447,13 @@ function do_install(packages::Packages) | |
end | ||
end | ||
|
||
const exe7z = iswindows() ? joinpath(BINDIR, "7z.exe") : "7z" | ||
const exe7z = if try; success(`7z`) catch; false end; | ||
"7z" | ||
elseif iswindows() | ||
joinpath(BINDIR, "7z.exe") | ||
else | ||
error("No 7z installed. Please install it for your machine") | ||
end | ||
|
||
function do_install(package::Package) | ||
name = names(package) | ||
|
@@ -459,25 +465,18 @@ function do_install(package::Package) | |
error("failed to download $name $(data[2]) from $source/$path.") | ||
end | ||
cache = getcachedir(source) | ||
path2 = joinpath(cache,escape(path)) | ||
path2 = joinpath(cache, escape(path)) | ||
open(path2, "w") do f | ||
write(f, data[1]) | ||
end | ||
info("Extracting: ", name) | ||
|
||
if VERSION < v"0.7.0-DEV.2181" | ||
cpio = splitext(path2)[1]*".cpio" | ||
else | ||
cpio = splitext(joinpath(cache, escape(basename(path))))[1] * ".cpio" | ||
end | ||
|
||
cpio = splitext(path2)[1]*".cpio" | ||
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. wrong way around, should use the newer code 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. but that was actually failing for me! 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. were you using a nightly binary of Julia, or something else? if your code was picking up whatever happened to be on the path, it could easily have been an older version with different behavior |
||
local err = nothing | ||
for cmd = [`$exe7z x -y $path2 -o$cache`, `$exe7z x -y $cpio -o$installdir`] | ||
for cmd = (`$exe7z x -y $path2 -o$cache`, `$exe7z x -y $cpio -o$installdir`) | ||
(out, pc) = open(cmd, "r") | ||
stdoutstr = read(out, String) | ||
if !success(pc) | ||
wait_close(out) | ||
println(stdoutstr) | ||
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. don't hide error output 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. Ah, good catch - thought that was one of my debugging println |
||
err = pc | ||
if isunix() | ||
cd(installdir) do | ||
|
@@ -486,7 +485,7 @@ function do_install(package::Package) | |
end | ||
end | ||
end | ||
isfile(cpio) && rm(cpio) | ||
(try; isfile(cpio); catch; false end;) && rm(cpio) | ||
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. when would this throw? 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. Good question, it did though... I think this is the whole 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. what error, and with what input path? 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.
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. when is 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 was just saying when |
||
err !== nothing && pipeline_error(err) | ||
break | ||
end | ||
|
@@ -519,7 +518,7 @@ end | |
|
||
include("winrpm_bindeps.jl") | ||
|
||
# deprecations | ||
# deprecations | ||
@deprecate help() "Please see the README.md file at https://github.com/JuliaPackaging/WinRPM.jl" | ||
|
||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
using WinRPM | ||
using Test | ||
WinRPM.install("gcc", yes = true) | ||
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. this has the same problem as #95 (comment) - it should clean up after itself instead of making a mess of the user's environment |
||
gcc = joinpath(WinRPM.installdir, "usr", string(Sys.ARCH, "-w64-mingw32"), "sys-root", "mingw", "bin", "gcc.exe") | ||
|
||
@test success(`$gcc --version`) |
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.
not a good idea to use any old random version that happens to be on the path, the behavior has been version-specific in ways that have broken this package