-
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 all 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,22 @@ function do_install(packages::Packages) | |
end | ||
end | ||
|
||
const exe7z = iswindows() ? joinpath(BINDIR, "7z.exe") : "7z" | ||
const exe7z = if Sys.iswindows() | ||
_exe7z = joinpath(Sys.BINDIR, "7z.exe") | ||
if isfile(_exe7z) | ||
_exe7z | ||
else # if it's not located in win-extras lets get it catched by the second isfile check | ||
joinpath(Sys.BINDIR, "..", "..", "dist-extras", "7z.exe") | ||
end | ||
else | ||
joinpath(Sys.BINDIR, "7z") | ||
end | ||
|
||
if !isfile(exe7z) && success(`7z -h`) | ||
warn("We're using 7z installed on your system. It might be out of date and cause problems. This usually happens when you're on windows with Julia compiled from source, and you didn't execute: `make win-extras` to get 7zip") | ||
elseif !isfile(exe7z) | ||
error("No 7z installed. Please install it for your machine. If you're on windows and compiled Julia from source, you need to also execute `make win-extras` to get 7zip") | ||
end # else we're fine! | ||
|
||
function do_install(package::Package) | ||
name = names(package) | ||
|
@@ -459,25 +474,19 @@ 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(joinpath(cache, escape(basename(path))))[1] * ".cpio" | ||
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 |
||
println(stderr, stdoutstr) | ||
err = pc | ||
if isunix() | ||
cd(installdir) do | ||
|
@@ -519,7 +528,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,9 @@ | ||
using WinRPM | ||
using Test | ||
|
||
if haskey(ENV, "CI") && haskey(ENV, "WINRPM_DO_THE_TEST") && ENV["WINRPM_DO_THE_TEST"] == "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 env var would need to be set in the appveyor config for this to do anything 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. that should be set in the yaml where it's visible and can be modified by people who don't have access to that settings page - generally the UI should be avoided, the yaml takes precedence for anything set both places |
||
WinRPM.install("gcc", yes = true) | ||
gcc = joinpath(WinRPM.installdir, "usr", string(Sys.ARCH, "-w64-mingw32"), "sys-root", "mingw", "bin", "gcc.exe") | ||
|
||
@test success(`$gcc --version`) | ||
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.
If the problem is that you're trying to test packages in source builds on windows, it would be better to fix this in your personal build process rather than copy-paste these fallbacks everywhere.
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 do the stuff for cross compiling and creating an installer!?
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.
Or
make install
and copy files around. Otherwise the environment you're testing in and the environment that practically every Windows user will be working in will have discrepancies.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.
Hm, I still don't see the exe in the right folder:
Not sure whats up with
julia-abab96668c
, but even that bin dir doesn't contain a 7z exe.I'm not going to start copying random files around :D if make win-extras copies it into this folder, this is good enough for me as long as the normal case is covered first. If you have more patience to fix these fiddly issues, i would very much appreciate if you could just push to this PR.
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.
Why not? That's what building the installer has always done. Guess it happens as part of
make binary-dist
then. You can locally approximate it. This could be cleaned up in the Julia makefiles, but really isn't that hard to deal with locally - it shouldn't be propagating out into every package that needs to extract files.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.
please remove this line